فهرست منبع

根据接口变动修改回显逻辑,解决报错问题

lph 1 سال پیش
والد
کامیت
8c0193c2e6
1فایلهای تغییر یافته به همراه10 افزوده شده و 3 حذف شده
  1. 10 3
      zkqy-ui/src/views/tablelist/commonTable/listInfo.vue

+ 10 - 3
zkqy-ui/src/views/tablelist/commonTable/listInfo.vue

@@ -956,7 +956,11 @@ export default {
       this.FormNameList = [];
       let { mainForm, subFormList } = data;
       this.formList = [];
-      let showValue = mainForm.showValue[0].resultMap;
+      let showValue = null;
+      if (mainForm.showValue) {
+        showValue = mainForm.showValue[0]?.resultMap;
+      }
+
       if (showValue) {
         for (const key of Object.keys(showValue)) {
           showValue[toUnderline(key)] = showValue[key];
@@ -973,11 +977,14 @@ export default {
         formItem: mainForm.mainFormItem,
         relateFormItem: null,
         formType: mainForm.showTemplate.spare == "2" ? "batch" : "normal",
-        defaultValue: mainForm.showValue[0].resultMap,
+        defaultValue: mainForm.showValue ? mainForm.showValue[0].resultMap : {},
       });
       if (subFormList && subFormList.length > 0) {
         subFormList.forEach((item) => {
-          let showValue = item.showValue[0];
+          let showValue = null;
+          if (item.showValue) {
+            showValue = item.showValue[0];
+          }
           let defaultValue = {};
           if (showValue) {
             if (item.showTemplate.spare == "2") {