|
@@ -1100,13 +1100,18 @@ const search = (keyword: string) => {
|
|
|
})
|
|
|
.then((res: any) => {
|
|
|
if (Array.isArray(res.data) && res.data.length) {
|
|
|
- qcList.value = qcList.value.concat(
|
|
|
- res.data.map((i: any) => {
|
|
|
+ qcList.value = res.data
|
|
|
+ .map((i: any) => {
|
|
|
return {
|
|
|
...i,
|
|
|
isSearch: true,
|
|
|
}
|
|
|
- }),
|
|
|
+ })
|
|
|
+ .concat(qcList.value)
|
|
|
+ // 给qcList去重
|
|
|
+ qcList.value = qcList.value.filter(
|
|
|
+ (item, index, self) =>
|
|
|
+ index === self.findIndex((t) => t.id === item.id),
|
|
|
)
|
|
|
} else {
|
|
|
// qcList.value = []
|