Преглед на файлове

fix: 过滤异常数据返回

lixuan преди 2 месеца
родител
ревизия
433be1fe05
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      src/views/production-safety/risk-identification-and-control/labor-products-purchase-apply-manage/list.vue

+ 2 - 1
src/views/production-safety/risk-identification-and-control/labor-products-purchase-apply-manage/list.vue

@@ -170,7 +170,8 @@
         total?: number
       });
       if (resWithExtra) {
-        tableData.value = (resWithExtra?.records ?? resWithExtra?.list ?? []) as PpePurchaseApply[];
+        const rawList = (resWithExtra?.records ?? resWithExtra?.list ?? []) as (PpePurchaseApply | null)[];
+        tableData.value = rawList.filter((item): item is PpePurchaseApply => item !== null);
         pagination.total = resWithExtra?.totalRow ?? resWithExtra?.total ?? 0;
       }
     } catch (e) {