From 9941378cc6e6eefa0f927cde165c47c5585c00ea Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期三, 02 八月 2023 10:45:58 +0800
Subject: [PATCH] 主题库停用加后缀名

---
 Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue |  160 ++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 114 insertions(+), 46 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue b/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue
index 1a3157b..56e9efa 100644
--- a/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue
+++ b/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue
@@ -1,7 +1,6 @@
 <template>
   <div>
     <div style="display: flex;flex-wrap: wrap;" v-if="this.crudArrayFlag" class="app">
-
       <el-button-group>
       <!--鏂板-->
       <el-button v-if="attrEditVisible == false && attrFlagChiledren==false && editOpenFlag &&  (!checkStatus || crudLCStatus=='Editing' )" size="small" type="primary" icon="el-icon-plus" plain @click="busineHandle">娣诲姞 {{ msg }}</el-button>
@@ -14,7 +13,7 @@
       </el-button-group>
       <el-button-group>
         <!--    淇濆瓨-->
-        <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" size="small" type="success" plain @click="addsHandler" icon="el-icon-check">淇濆瓨</el-button>
+        <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" size="small" type="success" plain @click.prevent="addsHandler" icon="el-icon-check">淇濆瓨</el-button>
         <!--    棰勮鎺掑簭-->
         <el-button size="small" @click="orderHandle" icon="el-icon-arrow-down">棰勮鎺掑簭</el-button>
         <!--    鍒犻櫎-->
@@ -48,6 +47,16 @@
     <el-button-group>
       <el-button size="small" plain  icon="el-icon-view"  v-if="(!checkStatus|| crudLCStatus=='Editing') && !editOpenFlag && attrEditVisible == false && attrFlagChiledren==false" @click="editOpen" >寮�鍚紪杈�</el-button>
     </el-button-group>
+      <el-select v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag"  size="small" v-model="selectvalue" placeholder="璇烽�夋嫨">
+        <el-option
+          v-for="item in selectoptions"
+          :key="item.value"
+          :label="item.label"
+          :value="item.value">
+        </el-option>
+      </el-select>
+      <el-switch v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag"  v-model="switchvalue" @change="batchSetFlag" active-value="true" style="margin:6px 0 0 10px">
+      </el-switch>
     </div>
 <!--    寮圭獥-->
     <div>
@@ -156,11 +165,11 @@
         </div>
       </el-dialog>
       <!--        灞炴�у垎缁�-->
-      <el-dialog :visible.sync="attrVisible" append-to-body style="width: 800px; left:30vw;top: 10vh ;"
+      <el-dialog :visible.sync="attrVisible" append-to-body :before-close="attrClose" style="width: 800px; left:30vw;top: 10vh ;"
                  title="杈撳叆鍒嗙粍鐨勫悕绉�">
         <el-form ref="form" label-width="70px">
           <el-form-item label="灞炴�у垎缁�">
-            <el-input v-model="attrModel"></el-input>
+            <el-input v-model="attrModel" autofocus></el-input>
           </el-form-item>
           <div style="display: flex;justify-content: flex-end">
             <el-button size="small" type="primary" @click="attrHandle">鎻愪氦</el-button>
@@ -208,7 +217,7 @@
       </el-dialog>
       <!--        鍏ㄥ睆缂栬緫-->
       <el-dialog :visible.sync="attrEditVisible" append-to-body fullscreen="true" :before-close="escEdit" >
-        <attrCrud :ProData="this.ProData" :attrFlagChiledren="this.attrFlag" :editStyleFlag="editStyleFlag" :editOpenFlag="editOpenFlag" :crudArrayFlag="this.crudArrayFlag"></attrCrud>
+        <attrCrud :ProData="this.ProData" :attrFlagChiledren="this.attrFlag" @editCloseChildren="editClose" :editStyleFlag="editStyleFlag" :editOpenFlag="editOpenFlag" :crudArrayFlag="this.crudArrayFlag"></attrCrud>
       </el-dialog>
       <!--      缁勫悎瑙勫垯-->
       <formula-editor :systemVariableTableData="systemVariableTableData"
@@ -256,6 +265,7 @@
               @cell-click="handleCellClicks"
               @select="selectHandle"
               @selection-change="selectionChange"
+              @row-click="rowClick"
               v-if="this.crudArrayFlag"
               ref="referAttrCrud"
               v-loading="loading"
@@ -331,6 +341,7 @@
       type: Boolean,
       default: false
     },
+    //鎺у埗鏄惁寮�鍚紪杈�
     editOpenFlag:{
       type: Boolean,
       default: false
@@ -360,9 +371,16 @@
     crudArrayFlag:{
       type: Boolean,
       default: false
-    }
+    },
   },
   watch:{
+    crudOid:{
+      handler(newval,oldval){
+        if(newval){
+          this.editOpenFlag=false
+        }
+      }
+    },
     crudArray:{
       handler(newval,oldval){
         if(newval != undefined){
@@ -395,7 +413,6 @@
       }
     },
     'injectOption.classifyInvokeAttr': function(newVal) {
-      console.log('newVal',newVal)
       if (newVal === "name") {
         this.injectOption.classifyInvokeAttrName='鍒嗙被鍚嶇О'
       } else if (newVal === "id") {
@@ -405,7 +422,7 @@
     },
     editOpenFlag:{
       handler(newval,oldval){
-        console.log(newval)
+        console.log('editOpenFlag',newval)
       },
       deep:true,
       immediate:true
@@ -1394,7 +1411,50 @@
       codeDataFlag:false,
     //  缁勫悎瑙勫崟鍏冩牸缂栬緫鍥炲~
       componentRuleText:"",
-
+      //妯℃澘灞炴�т笅鎷夎缃畇witch
+      selectoptions: [{
+        value: 'keyAttrFlag',
+        label: '鍏抽敭灞炴��'
+      }, {
+        value: 'queryAttrFlag',
+        label: '鏌ヨ灞炴��'
+      }, {
+        value: 'seniorQueryAttrFlag',
+        label: '楂樼骇鏌ヨ灞炴��'
+      }, {
+        value: 'sameRepeatAttrFlag',
+        label: '鐩镐技鏌ラ噸灞炴��'
+      }, {
+        value: 'barcodeFlag',
+        label: '涓�缁寸爜'
+      }, {
+        value: 'qrcodeFlag',
+        label: '浜岀淮鐮�'
+      }, {
+        value: 'requireFlag',
+        label: '蹇呰緭'
+      }, {
+        value: 'formDisplayFlag',
+        label: '琛ㄥ崟鏄剧ず'
+      }, {
+        value: 'tableDisplayFlag',
+        label: '鍒楄〃鏄剧ず'
+      }, {
+        value: 'readonlyFlag',
+        label: '鍙'
+      }, {
+        value: 'sortAttrFlag',
+        label: '鍒楄〃鎺掑簭'
+      }, {
+        value: 'textareaFlag',
+        label: '澶氳鏂囨湰'
+      }, {
+        value: 'imageFlag',
+        label: '棰勮鍥�'
+      }],
+      //妯℃澘灞炴�т笅鎷夐�変腑鍊�
+      selectvalue: 'keyAttrFlag',
+      switchvalue:'false'
     }
   },
   computed:{
@@ -1423,9 +1483,6 @@
     })
   },
   methods: {
-    formAttr(row, column) {
-      console.log(row,column)
-    },
     //鏂板鎼滅储
     AddFindHandler(){
       if(this.SelectValue == 'id'){
@@ -1446,7 +1503,6 @@
     },
     //鍙傜収閰嶇疆瀛愮粍浠�
     echoReferConfig(val){
-      console.log('val--',val)
       this.referObject=val
       this.$set(this.CurrentCell,'referConfig',JSON.stringify(val))
 
@@ -1467,12 +1523,10 @@
         this.$message.warning('璇烽�夋嫨妯℃澘灞炴��')
       } else  {
         this.attrVisible = true;
-       console.log(this.attrSelectList)
       }
     },
     //灞炴�у垎缁勬彁浜�
     attrHandle() {
-      console.log(this.attrSelectList)
       this.attrSelectList.forEach(item=>{
         item.attributeGroup=this.attrModel
       })
@@ -1481,12 +1535,15 @@
       }else {
         this.$set(this.attrSelectList[0], 'attributeGroup', this.attrModel)
       }
-      this.attrModel = "";
-      this.attrVisible = false;
+      this.attrClose()
     },
     //灞炴�у垎缁勬竻绌�
     attrRemove() {
       this.attrModel = ""
+    },
+    attrClose(){
+      this.attrModel = "";
+      this.attrVisible=false
     },
     //琛ㄦ牸鏁版嵁
     CrudRend() {
@@ -1549,7 +1606,6 @@
     //涓氬姟绫诲瀷閫夋嫨
     businessSelect(selection, row) {
       this.busineSelectList = selection;
-      console.log(selection)
     },
     // 浠庝笟鍔$被鍨嬩腑閫夋嫨鏁版嵁寮圭獥
     busineHandle() {
@@ -1608,23 +1664,31 @@
     selectHandle(selection, row) {
       this.attrOid = row.oid;
       this.attrRow = row;
-      console.log(row)
     },
     //琛ㄦ牸閫夋嫨
     selectionChange(list) {
       this.attrSelectList = list;
-      console.log(list)
+    },
+    rowClick(row){
+      this.$refs.referAttrCrud.clearSelection();
+      this.attrSelectList = [row];
+      this.$refs.referAttrCrud.setCurrentRow(row);
+      this.$refs.referAttrCrud.toggleRowSelection(row); //閫変腑褰撳墠琛�
+
+      this.attrOid = row.oid;
+      this.attrRow = row;
     },
     //淇濆瓨
-    addsHandler() {
+    addsHandler(event) {
       batchAddSave(JSON.parse(JSON.stringify(this.ProData))).then(res => {
         this.$message.success('淇濆瓨鎴愬姛')
-        this.editOpenFlag=false
+        this.editOpenFlag=false;
+        // 璋冪敤鐖剁粍浠朵慨鏀规寜閽姸鎬�
+        this.$emit('editCloseChildren')
       }).catch(()=>{
         this.$message.warning('淇濆瓨澶辫触锛岃鏌ョ湅鎺у埗鍙拌緭鍑猴紒')
       })
     },
-
     //琛ㄦ牸琛岀紪杈�
     handleCellClicks(row, column) {
        if(this.editOpenFlag){
@@ -1633,7 +1697,6 @@
          this.rowOid = row.oid;
          this.CurrentCell=row;
          if(column.property == 'referConfig' ){
-           console.log( this.CurrentCell.referConfig)
            this.referConfigVisble= true;
            this.referConfigOption = {
              referConfig: this.CurrentCell.referConfig || '',
@@ -1643,10 +1706,20 @@
                referConfig:'',
              }
            }
-           console.log('--',this.referConfigOption)
            // this.$refs.referConfigFormDialog.onloadAttrData();
          }else if(column.property == 'classifyInvokeText'){
            this.injectVisible=true;
+           if (this.CurrentCell.classifyInvokeAttr != '') {
+             this.injectOption = {
+               classifyInvokeAttr: this.CurrentCell.classifyInvokeAttr,
+               classifyInvokeAttrName: this.CurrentCell.classifyInvokeAttrName,
+               classifyInvokeEditFlag: this.CurrentCell.classifyInvokeEditFlag,
+               classifyInvokeLevel: this.CurrentCell.classifyInvokeLevel == 'min' ? 'min' : 'max',
+               classifyNumber: this.CurrentCell.classifyInvokeLevel == 'min' ? '' : this.CurrentCell.classifyInvokeLevel
+             };
+           } else {
+             this.injectHandleReset();
+           }
          }else if(column.property == 'componentRule'){
            if(this.CurrentCell){
              this.CurrentCell.componentRule=this.componentRuleText;
@@ -1664,7 +1737,6 @@
              'conditionMap[oid_notequal]': this.CurrentCell.oid,
              limit:-1
            }).then(res => {
-             console.log(res)
              this.CascadeData = res.data.data;
            })
            this.CascadeVisible=true;
@@ -1673,6 +1745,9 @@
            this.rulesVisible=true;
          }else if(column.property == 'attributeGroup'){
            this.attrVisible = true;
+           if(this.CurrentCell.attributeGroup !== ''){
+                this.attrModel=this.CurrentCell.attributeGroup
+           }
          }
        }
     },
@@ -1785,7 +1860,6 @@
     },
     //楠岃瘉瑙勫垯妫�鏌�
     rulesExamine() {
-      console.log(this.RulesForm.expressionText)
       const regex = new RegExp(this.rulesData.ruleRowBds);
       if(regex.test(this.RulesForm.TestContent)){
         this.$message.success('鏍¢獙鎴愬姛')
@@ -1810,23 +1884,6 @@
         "灞傜骇璁剧疆": this.injectOption.classifyInvokeLevel=='max'?this.injectOption.classifyNumber :'min',
         "鏄惁鍙慨鏀�": this.injectOption.classifyInvokeEditFlag
       }
-      //鍗曞厓鏍肩紪杈戣祴鍊间竴閬�
-      // noinspection JSCheckFunctionSignatures
-      if(this.CurrentCell){
-        //濡傛灉鏄寚瀹氬眰璧嬪�间负鏁板瓧
-        if(this.injectOption.classifyInvokeLevel!== 'min'){
-          this.CurrentCell.classifyInvokeLevel=this.injectOption.classifyNumber
-        }else {
-          this.CurrentCell.classifyInvokeLevel='min'
-        }
-        //鍏朵綑姝e父璧嬪��
-        this.CurrentCell.classifyInvokeAttr=this.injectOption.classifyInvokeAttr,
-        this.CurrentCell.classifyInvokeAttrName=this.injectOption.classifyInvokeAttrName,
-        this.CurrentCell.classifyInvokeEditFlag=this.injectOption.classifyInvokeEditFlag,
-        // this.$set(this.CurrentCell, 'classifyInvokeText', data)
-          this.CurrentCell.classifyInvokeText = data;
-        this.injectHandleReset()
-      }else {
         //鍕鹃�夋搷浣�
         for (const key in this.injectOption) {
           this.attrSelectList[0][key] = this.injectOption[key];
@@ -1839,7 +1896,7 @@
           this.$set(this.attrSelectList[0],'classifyInvokeText',data)
         }
         this.injectHandleReset()
-      }
+
       if(this.injectOption.classifyInvokeLevel !== 'min'){
         this.injectOption.classifyInvokeLevel=this.injectOption.classifyNumber;
       }else  {
@@ -1858,7 +1915,8 @@
     },
     // 鍒嗙被娉ㄥ叆鍙栨秷
     injectRemove() {
-      this.injectVisible = false
+      this.injectVisible = false;
+      this.injectHandleReset()
     },
     //灞炴�фā鏉胯〃鏍煎崟鍏冩牸鐐瑰嚮浜嬩欢
     //琛ㄦ牸鎿嶄綔鏍忓垹闄�
@@ -1944,6 +2002,16 @@
     //寮�鍚紪杈�
     editOpen(){
       this.editOpenFlag=true;
+    },
+    //瀹氫箟涓�涓叧闂紪杈戠殑鏂规硶渚涘瓙缁勪欢浣跨敤
+    editClose(){
+      this.editOpenFlag=false;
+    },
+    //鎵归噺璁剧疆switch
+    batchSetFlag(value){
+      this.attrSelectList.forEach(item=>{
+        item[this.selectvalue]=value;
+      })
     }
   }
 }

--
Gitblit v1.9.3