From ded6e8d2312e139e8ce770c7f1d5830bf2db4af6 Mon Sep 17 00:00:00 2001
From: xiejun <xj@2023>
Date: 星期三, 19 七月 2023 11:39:41 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/UBCS-WEB/src/components/Tree/attrCrud.vue |   86 +++++++++++++++++++++++++------------------
 1 files changed, 50 insertions(+), 36 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/Tree/attrCrud.vue b/Source/UBCS-WEB/src/components/Tree/attrCrud.vue
index 92ee657..43120ab 100644
--- a/Source/UBCS-WEB/src/components/Tree/attrCrud.vue
+++ b/Source/UBCS-WEB/src/components/Tree/attrCrud.vue
@@ -1,38 +1,38 @@
 <template>
   <div>
-    <div style="display: flex;flex-wrap: wrap;" v-if="this.crudArrayFlag" class="app">
-      <el-button-group>
+    <div style="display: flex;flex-wrap: wrap;" v-if="this.crudArrayFlag">
+
       <!--鏂板-->
-      <el-button v-if="attrEditVisible == false && attrFlagChiledren==false" size="small" type="primary" icon="el-icon-plus" @click="busineHandle">娣诲姞 {{ msg }}</el-button>
+      <el-button v-if="attrEditVisible == false && attrFlagChiledren==false && crudLCStatus=='Editing'" size="small" type="primary" icon="el-icon-plus" @click="busineHandle">娣诲姞 {{ msg }}</el-button>
       <!--        鍏ㄥ睆缂栬緫-->
-      <el-button v-if=" attrEditVisible == false && attrFlagChiledren==false" size="small" @click="fullscreenHandle" icon="el-icon-full-screen">鍏ㄥ睆缂栬緫</el-button>
+      <el-button v-if=" attrEditVisible == false && attrFlagChiledren==false && crudLCStatus=='Editing'" size="small" @click="fullscreenHandle" icon="el-icon-full-screen">鍏ㄥ睆缂栬緫</el-button>
       <!--        楠岃瘉瑙勫垯-->
-      <el-button icon="el-icon-info" size="small" @click="ruleAddHandler">楠岃瘉瑙勫垯</el-button>
+      <el-button v-if="crudLCStatus=='Editing'" icon="el-icon-info" size="small" @click="ruleAddHandler">楠岃瘉瑙勫垯</el-button>
       <!--        灞炴�у垎缁�-->
-      <el-button icon="el-icon-menu" size="small" @click="attrVisibleHandle">灞炴�у垎缁�</el-button>
-      </el-button-group>
-      <el-button-group>
+      <el-button v-if="crudLCStatus=='Editing'" icon="el-icon-menu" size="small" @click="attrVisibleHandle">灞炴�у垎缁�</el-button>
+
+
       <!--        鍒嗙被娉ㄥ叆-->
-      <el-button icon="el-icon-magic-stick" size="small" @click="injectBtn">鍒嗙被娉ㄥ叆</el-button>
+      <el-button v-if="crudLCStatus=='Editing'" icon="el-icon-magic-stick" size="small" @click="injectBtn">鍒嗙被娉ㄥ叆</el-button>
         <!--    缁勫悎瑙勫垯-->
-        <el-button size="small" @click="isShowHandler">缁勫悎瑙勫垯</el-button>
+        <el-button v-if="crudLCStatus=='Editing'" size="small" @click="isShowHandler">缁勫悎瑙勫垯</el-button>
       <!--        鏋氫妇娉ㄥ叆-->
-      <el-button size="small" @click="enmuVisHandle">鏋氫妇娉ㄥ叆</el-button>
+      <el-button v-if="crudLCStatus=='Editing'" size="small" @click="enmuVisHandle">鏋氫妇娉ㄥ叆</el-button>
       <!--    绾ц仈灞炴��-->
-      <el-button size="small" @click="CascadeHandle">绾ц仈灞炴��</el-button>
+      <el-button v-if="crudLCStatus=='Editing'" size="small" @click="CascadeHandle">绾ц仈灞炴��</el-button>
       <!--    棰勮鎺掑簭-->
         <el-button size="small" @click="orderHandle" icon="el-icon-arrow-down">棰勮鎺掑簭</el-button>
-      </el-button-group>
-      <el-button-group>
+
+
       <!--    淇濆瓨-->
-      <el-button size="small" @click="addsHandler" icon="el-icon-check">淇濆瓨</el-button>
+      <el-button v-if="crudLCStatus=='Editing'" size="small" @click="addsHandler" icon="el-icon-check">淇濆瓨</el-button>
       <!--    鍒犻櫎-->
-      <el-button size="small" @click="CrudRemove" icon="el-icon-delete">鍒犻櫎</el-button>
+      <el-button v-if="crudLCStatus=='Editing'" size="small" @click="CrudRemove" icon="el-icon-delete">鍒犻櫎</el-button>
       <!--    閲嶇疆-->
       <el-button size="small" @click="reset" icon="el-icon-refresh-right">閲嶇疆</el-button>
       <!--    鍚屾鍒板叾浠栨ā鏉�-->
       <el-button size="small"@click="syncHandle" icon="el-icon-share">鍚屾鍒板叾浠栨ā鏉�</el-button>
-      </el-button-group>
+
       <!--    缂栫爜鐢宠棰勮-->
       <el-button size="small" @click="applicationHandle" style="">缂栫爜鐢宠棰勮</el-button>
       <!--        楠岃瘉瑙勫垯-->
@@ -242,7 +242,7 @@
     </div>
     <el-table :data="ProData"
               style="width: 100%"
-              :height='attrEditVisible == false && attrFlagChiledren==false?400 :750'
+              height="750"
               @cell-click="handleCellClicks"
               @select="selectHandle"
               @selection-change="selectionChange"
@@ -316,6 +316,10 @@
       type: String,
       default: ''
     },
+    crudLCStatus: {
+      type: String,
+      default: 'Editing'
+    },
     crudArray: {
       type: Array,
     },
@@ -374,6 +378,7 @@
       editingRows: null,
       editShows:"",
       attrFlag: false,
+      referObject:{},
       //缂栫爜鐢宠棰勮option
       applicationoption: {
         column: []
@@ -936,13 +941,11 @@
         column: [
           {
             label: "灞炴�ц嫳鏂囧悕绉�",
-            prop: "id",
-            width:110
+            prop: "id"
           },
           {
             label: "灞炴�т腑鏂囧悕绉�",
-            prop: "name",
-            width:110
+            prop: "name"
           },
           {
             label: "闀垮害",
@@ -1393,6 +1396,7 @@
     //鍙傜収閰嶇疆瀛愮粍浠�
     echoReferConfig(val){
       console.log('val--',val)
+      this.referObject=val
       this.$set(this.CurrentCell,'referConfig',JSON.stringify(val))
 
     },
@@ -1486,7 +1490,6 @@
     //涓氬姟绫诲瀷閫夋嫨
     businessSelect(selection, row) {
       this.busineSelectList = selection
-      console.log(selection)
     },
     // 浠庝笟鍔$被鍨嬩腑閫夋嫨鏁版嵁寮圭獥
     busineHandle() {
@@ -1548,7 +1551,7 @@
       console.log(row)
     },
     //琛ㄦ牸閫夋嫨
-    selectionChange(list,) {
+    selectionChange(list) {
       this.attrSelectList = list;
       console.log(list)
     },
@@ -1590,6 +1593,8 @@
       }else if(column.property == 'verifyRule'){
         this.RulesForm.expressionTextt=this.CurrentCell.verifyRule;
         this.rulesVisible=true;
+        console.log(this.CurrentCell.verifyRule)
+        console.log(this.RulesForm.expressionText)
       }
     },
     saveRows() {
@@ -1636,15 +1641,26 @@
     },
     //鏋氫妇娉ㄥ叆淇濆瓨
     enumAddHandle() {
-      if (this.enumRow.length < 1) {
-        this.$message.warning('璇疯嚦灏戦�夋嫨涓�鏉℃暟鎹�')
-      } else {
-        if(this.CurrentCell){
-          this.$set(this.CurrentCell, 'enumString', JSON.stringify(this.enumRow));
+      let hasError = false; // 娣诲姞涓�涓彉閲�
+      this.tableData.forEach((item, index) => {
+        if (item.key === '') {
+          this.$message.warning(`绗�${index + 1}琛岀殑閫夐」鍊间笉鑳戒负绌篳);
+          hasError = true;
+          return;
+        } else if (item.value === '') {
+          this.$message.warning(`绗�${index + 1}琛岀殑閫夐」涓枃鏍囩涓嶈兘涓虹┖`);
+          hasError = true;
+          return;
+        }
+      });
+        // 淇濆瓨鎵ц閫昏緫
+      if (!hasError) {
+        if (this.CurrentCell) {
+          this.$set(this.CurrentCell, 'enumString', JSON.stringify(this.tableData));
           this.enumVisible = false;
-        }else {
-          this.$set(this.attrSelectList[0], 'enumString', JSON.stringify(this.enumRow));
-          this.tableData=[]
+        } else {
+          this.$set(this.attrSelectList[0], 'enumString', JSON.stringify(this.tableData));
+          this.tableData=[];
           this.enumVisible = false;
         }
       }
@@ -1816,9 +1832,7 @@
 </script>
 
 <style scoped lang="scss" >
-.app {
-   /deep/ .el-button {
-     margin: 0 10px 10px 0;
-     }
+/deep/ .el-button {
+  margin: 0 10px 10px 0;
 }
 </style>

--
Gitblit v1.9.3