Explorar o código

fix: 过滤异常数据返回

lixuan hai 2 meses
pai
achega
433be1fe05

+ 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) {