From 9d8be8e7580ef577def96c852288a5a95eab4ea3 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期二, 11 七月 2023 19:22:53 +0800
Subject: [PATCH] 代码整合,前端代码打包

---
 Source/UBCS-WEB/src/mixins/codeApply.js |   27 +++++++++++++++++++--------
 1 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/Source/UBCS-WEB/src/mixins/codeApply.js b/Source/UBCS-WEB/src/mixins/codeApply.js
index 2dac60e..ffe002e 100644
--- a/Source/UBCS-WEB/src/mixins/codeApply.js
+++ b/Source/UBCS-WEB/src/mixins/codeApply.js
@@ -3,6 +3,7 @@
   data() {
     return {
       secVOList: [],
+      localSecVOList: [],
       showCodeApply: false,
       selfColumnType: {
         codefixedsec: "combox",
@@ -41,12 +42,14 @@
     }
   },
   created() {
-    this.getCodeRule()
+    if (this.type === 'batchImportApply') {
+      this.getCodeRule()
+    }
   },
   methods: {
     // 鑾峰彇鐮佸�肩敵璇锋暟鎹�
     getCodeRule() {
-      getCodeRule({ codeClassifyOid: this.codeClassifyOid }).then((res) => {
+      getCodeRule({ codeClassifyOid: this.localCodeClassifyOid || this.codeClassifyOid }).then((res) => {
         if (res.data && res.data.code === 200) {
           const typeList = [
             "codefixedsec",
@@ -55,14 +58,19 @@
             "coderefersec",
           ];
           this.secVOList = res.data.data.secVOList || []
-          let localSecVOList = (res.data.data.secVOList || []).filter((item) =>
+          this.localSecVOList = (res.data.data.secVOList || []).filter((item) =>
             typeList.includes(item.secType)
           );
-          if (localSecVOList.length > 0) {
+          if (this.localSecVOList.length > 0) {
             this.showCodeApply = true
             this.$nextTick(() => {
-              this.$refs.CodeApply.templateRender(localSecVOList);
+              if (this.batchApplyCodeTableData) {
+                this.batchApplyCodeTableData[this.codeRuleOid]["localSecVOList"] = this.localSecVOList
+              }
+              this.$refs.CodeApply.templateRender(this.localSecVOList);
             });
+          } else {
+            this.showCodeApply = false
           }
 
         }
@@ -70,6 +78,9 @@
     },
     getCodeApplyFormData(codeApplyForm) {
       this.codeApplyForm = codeApplyForm;
+      if (this.batchApplyCodeTableData) {
+        this.batchApplyCodeTableData[this.codeRuleOid]["codeApply"] = codeApplyForm
+      }
     },
     getType(item) {
       console.log(item.secType, 'item.secType');
@@ -122,7 +133,7 @@
           },
         };
       } else if (item.secType == "coderefersec") {
-        params = JSON.parse(item.referConfig);
+        params = JSON.parse(item.referValueInfo);
       }
       return params;
     },
@@ -166,14 +177,14 @@
     // 鍙傜収缁勪欢鏁版嵁鍙樻洿
     referConfigDataUpdate(data) {
       const { field } = data;
-      this.secVOList = this.secVOList.map((item) => {
+      this.localSecVOList = this.localSecVOList.map((item) => {
         if (item.parentClassifySecOid === field) {
           this.$refs.CodeApply.form[item.oid] = undefined;
           this.$refs.CodeApply.form[item.name] = undefined;
         }
         return item;
       });
-      this.$refs.CodeApply.templateRender(this.secVOList);
+      this.$refs.CodeApply.templateRender(this.localSecVOList);
     },
   }
 }
\ No newline at end of file

--
Gitblit v1.9.3