Просмотр исходного кода

fix(feeding): 修复数据过滤逻辑,确保在无过滤结果时返回原始列表

xieyong 1 месяц назад
Родитель
Сommit
e8ee9f4033
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      src/views/produce/components/feeding/index.vue

+ 2 - 2
src/views/produce/components/feeding/index.vue

@@ -998,7 +998,7 @@
         }
         }
 
 
         // 不修改 this.List,新建一个 filterList,内部 product 只保留 confirm === 1
         // 不修改 this.List,新建一个 filterList,内部 product 只保留 confirm === 1
-        const filterList = this.List.map((item) => {
+        let filterList = this.List.map((item) => {
           return {
           return {
             ...item,
             ...item,
             product: Array.isArray(item.product)
             product: Array.isArray(item.product)
@@ -1009,7 +1009,7 @@
           return Array.isArray(item.product) && item.product.length > 0;
           return Array.isArray(item.product) && item.product.length > 0;
         });
         });
 
 
-        if(!filterList.length) return;
+        if(!filterList.length) filterList = this.List;
         let newList = [];
         let newList = [];
 
 
         for (let item of filterList) {
         for (let item of filterList) {