From c2ee2b74bd587fdad8e9e276beb3c792f56f5b6c Mon Sep 17 00:00:00 2001
From: lihang <lihang@vci-tech.com>
Date: 星期三, 05 七月 2023 16:33:55 +0800
Subject: [PATCH] 业务类型和元数据相关的修正

---
 Source/UBCS-WEB/src/views/modeling/originalAdd.vue |   78 +++++++++++++++++++++++++-------------
 1 files changed, 51 insertions(+), 27 deletions(-)

diff --git a/Source/UBCS-WEB/src/views/modeling/originalAdd.vue b/Source/UBCS-WEB/src/views/modeling/originalAdd.vue
index c6e0c48..f73ccfa 100644
--- a/Source/UBCS-WEB/src/views/modeling/originalAdd.vue
+++ b/Source/UBCS-WEB/src/views/modeling/originalAdd.vue
@@ -37,7 +37,6 @@
                 <el-form-item label="鎻忚堪" label-width="100px">
                     <el-input v-model="attribute.description" type="text"></el-input>
                 </el-form-item>
-
                 <el-tabs v-model="activeName" @tab-click="handleClick" stretch="true">
                     <el-tab-pane label="鍙傜収" name="referTab">
                         <el-form-item label="鍙傜収绫诲瀷" label-width="100px">
@@ -61,14 +60,16 @@
                             </el-input>
                         </el-form-item>
                         <el-form-item label="鏋氫妇椤�" label-width="100px">
-
+                            <el-tag v-for="eItem in dictEnums" :key="eItem.itemName" type="info">
+                              {{eItem.itemName}}
+                            </el-tag>
                         </el-form-item>
                     </el-tab-pane>
                 </el-tabs>
             </el-form>
             <div slot="footer" class="dialog-footer">
                 <el-button type="primary" @click="submitAttribute">纭畾</el-button>
-                <el-button @click="cancleSubmit">鍙栨秷</el-button>
+                <el-button @click="cancelSubmit">鍙栨秷</el-button>
             </div>
             <!-- 閫夋嫨鍙傜収鏃剁殑寮圭獥 -->
             <el-dialog title="鍙傜収鍒楄〃" :visible.sync="btmRefer.show" append-to-body @close="closeReferDialog" width="80%"
@@ -104,7 +105,7 @@
                 </el-container>
                 <div slot="footer" class="dialog-footer">
                     <el-button type="primary" @click="confirmBtm" size="small">纭畾</el-button>
-                    <el-button @click="cancleBtm" size="small">鍙栨秷</el-button>
+                    <el-button @click="cancelBtm" size="small">鍙栨秷</el-button>
                 </div>
             </el-dialog>
             <!-- 閫夋嫨鏋氫妇鏃剁殑寮圭獥 -->
@@ -119,7 +120,7 @@
                 </avue-crud>
                 <div slot="footer" class="dialog-footer">
                     <el-button type="primary" @click="confirmEnum" size="small">纭畾</el-button>
-                    <el-button @click="cancleEnum" size="small">鍙栨秷</el-button>
+                    <el-button @click="cancelEnum" size="small">鍙栨秷</el-button>
                 </div>
             </el-dialog>
         </el-dialog>
@@ -223,7 +224,7 @@
                     addBtn: false,
                     refreshBtn: false,
                     columnBtn: false,
-                    selection: true,
+                    // selection: true,
                     menu: false,
                     border: true,
                     reserveSelection: true,
@@ -267,7 +268,12 @@
                         value: 'oid',
                     }
                 }
-            }
+            },
+            dictEnums: [],
+            enumEditFlag: false,
+            enumInitFlag: false,
+            referInitFlag: false,
+            referEditFlag: false,
         }
     },
     created() {
@@ -286,9 +292,23 @@
             };
             this.referToFlag = true;
             this.$refs.form.resetFields();
+            this.dictEnums = [];
         },
         submitAttribute() {
             const that = this;
+            if (that.referInitFlag && that.referEditFlag){
+                this.$delete(this.attribute,'dictCode');
+                this.$delete(this.attribute,'dictKey');
+                this.$delete(this.attribute,'dictValue');
+                this.$delete(this.attribute,'usingDict');
+            }
+            if (that.enumInitFlag && that.enumEditFlag){
+                this.$delete(this.attribute,'referTypeCode');
+                this.$delete(this.attribute,'referTypeKey');
+                this.$delete(this.attribute,'referTypeValue');
+                this.$delete(this.attribute,'referToId');
+                this.$delete(this.attribute,'referToName');
+            }
             this.$refs.form.validate(function (pass, field) {
                 if (pass) {
                     add(that.attribute).then(res => {
@@ -302,21 +322,23 @@
                 }
             })
         },
-        cancleSubmit() {
+        cancelSubmit() {
             this.closeSubmitDialog();
         },
         closeEnumDialog() {
-            this.cancleEnum();
+            this.cancelEnum();
         },
         closeReferDialog() {
-            this.cancleBtm();
+            this.cancelBtm();
         },
         confirmBtm() {
             this.attribute.referToId = this.btmRefer.selectItem.oid;
             this.attribute.referToName = this.btmRefer.selectItem.name;
             this.btmRefer.show = false;
+            this.referEditFlag =  true;
+            this.enumEditFlag = false;
         },
-        cancleBtm() {
+        cancelBtm() {
             this.btmRefer.selectItem = {};
             this.btmRefer.show = false;
             this.btmRefer.selectRow = '';
@@ -326,8 +348,13 @@
             this.attribute.dictCode = this.enumRefer.selectItem.name;
             this.attribute.dictValue = this.enumRefer.selectItem.label;
             this.enumRefer.show = false;
+            getDictionary({code :this.enumRefer.selectItem.name}).then(res => {
+                this.dictEnums = res.data.data;
+            });
+            this.referEditFlag =  false;
+            this.enumEditFlag = true;
         },
-        cancleEnum() {
+        cancelEnum() {
             this.enumRefer.selectItem = {};
             this.enumRefer.show = false;
             this.enumRefer.selectRow = '';
@@ -345,13 +372,12 @@
                 this.domain.data = res.data.data;
             })
             this.btmRefer.show = true;
-
         },
         // 鍙傜収绫诲瀷鏍戠殑鐐瑰嚮浜嬩欢
         nodeClick(data) {
             // 鍖哄垎涓氬姟绫诲瀷鐨勬煡璇㈠拰閾炬帴绫诲瀷鐨勬煡璇�
             if (this.attribute.referTypeKey == 'btmType') {
-                btmPage(this.btmRefer.btmPage.currentPage, this.btmRefer.btmPage.pageSize, { domain: data.id }).then(res => {
+                btmPage(this.btmRefer.btmPage.currentPage, this.btmRefer.btmPage.pageSize, { bizDomain: data.id }).then(res => {
                     this.btmRefer.data = res.data.data.records;
                     this.btmRefer.btmPage.total = res.data.data.total;
                 })
@@ -431,18 +457,16 @@
             this.btmRefer.selectItem = {};
             this.btmRefer.selectRow = '';
         },
-        // handleClick(tab){
-        //     // 鍥犱负鍙兘鍙傜収鍜屾灇涓句簩閫変竴銆傛墍浠ュ湪鍒囨崲鐨勬椂鍊欐妸灞炴�х粰娓呯┖銆�
-        //     this.$delete(this.attribute,'referTypeCode');
-        //     this.$delete(this.attribute,'referTypeKey');
-        //     this.$delete(this.attribute,'referTypeValue');
-        //     this.$delete(this.attribute,'referToId');
-        //     this.$delete(this.attribute,'referToName');
-        //     this.$delete(this.attribute,'dictCode');
-        //     this.$delete(this.attribute,'dictKey');
-        //     this.$delete(this.attribute,'dictValue');
-        //     this.$delete(this.attribute,'usingDict');
-        // }
+        handleClick(tab){
+            // 鍥犱负鍙兘鍙傜収鍜屾灇涓句簩閫変竴銆傛墍浠ュ湪鍒囨崲鐨勬椂鍊欐妸灞炴�х粰娓呯┖銆�
+            if (tab.name === 'enumTab'){
+              this.enumInitFlag = true;
+              this.referInitFlag = false;
+            }else {
+              this.enumInitFlag = false;
+              this.referInitFlag = true;
+            }
+        }
     }
 }
 </script>
@@ -462,4 +486,4 @@
 
 .attributeForm>.el-form-item>.el-form-item__content>.el-select>.el-input>.el-input__inner {
     width: 200px;
-}</style>
\ No newline at end of file
+}</style>

--
Gitblit v1.9.3