Explorar o código

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

xieyong hai 1 mes
pai
achega
e8ee9f4033
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  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
-        const filterList = this.List.map((item) => {
+        let filterList = this.List.map((item) => {
           return {
             ...item,
             product: Array.isArray(item.product)
@@ -1009,7 +1009,7 @@
           return Array.isArray(item.product) && item.product.length > 0;
         });
 
-        if(!filterList.length) return;
+        if(!filterList.length) filterList = this.List;
         let newList = [];
 
         for (let item of filterList) {