From a2109930695034bc9fe3e2d38f97649b0d2d2a12 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期一, 31 七月 2023 20:46:04 +0800
Subject: [PATCH] Merge branch 'master' of http://dev.vci-tech.com:1065/r/ubcs

---
 Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue |  137 ++++++++++++++++++++++++++++++++++++---------
 1 files changed, 109 insertions(+), 28 deletions(-)

diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue b/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue
index 5fdbfbf..3f35190 100644
--- a/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue
+++ b/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue
@@ -1,6 +1,7 @@
 <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>
@@ -10,6 +11,16 @@
       <el-button v-if="(!checkStatus || crudLCStatus=='Editing' )&& editOpenFlag" icon="el-icon-info" size="small" @click="ruleAddHandler">楠岃瘉瑙勫垯</el-button>
       <!--        灞炴�у垎缁�-->
       <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-menu" size="small" @click="attrVisibleHandle">灞炴�у垎缁�</el-button>
+      </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 size="small" @click="orderHandle" icon="el-icon-arrow-down">棰勮鎺掑簭</el-button>
+        <!--    鍒犻櫎-->
+        <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" 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-group>
       <el-button-group>
         <!--鏂板-->
@@ -22,17 +33,7 @@
       <!--    绾ц仈灞炴��-->
       <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" icon="el-icon-coin" size="small" @click="CascadeHandle">绾ц仈灞炴��</el-button>
       </el-button-group>
-      <el-button-group>
-      <!--    棰勮鎺掑簭-->
-        <el-button size="small" @click="orderHandle" icon="el-icon-arrow-down">棰勮鎺掑簭</el-button>
-        <!--鏂板-->
-      <!--    淇濆瓨-->
-      <el-button v-if="(!checkStatus|| crudLCStatus=='Editing') && editOpenFlag" size="small" @click="addsHandler" icon="el-icon-check">淇濆瓨</el-button>
-      <!--    鍒犻櫎-->
-      <el-button v-if="(!checkStatus || crudLCStatus=='Editing') && editOpenFlag" 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-group>
+
       <el-button-group>
       <!--    鍚屾鍒板叾浠栨ā鏉�-->
       <el-button size="small"@click="syncHandle" icon="el-icon-share">鍚屾鍒板叾浠栨ā鏉�</el-button>
@@ -47,6 +48,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>
@@ -206,8 +217,8 @@
         </el-container>
       </el-dialog>
       <!--        鍏ㄥ睆缂栬緫-->
-      <el-dialog :visible.sync="attrEditVisible" append-to-body fullscreen="true">
-        <attrCrud :ProData="this.ProData" :attrFlagChiledren="this.attrFlag" :editOpenFlag="editOpenFlag" :crudArrayFlag="this.crudArrayFlag"></attrCrud>
+      <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>
       </el-dialog>
       <!--      缁勫悎瑙勫垯-->
       <formula-editor :systemVariableTableData="systemVariableTableData"
@@ -251,10 +262,11 @@
     </div>
     <el-table :data="ProData"
               style="width: 100%"
-              :height="this.editStyleFlag ? 450 : 900"
+              :height="this.editStyleFlag? 800 : 343"
               @cell-click="handleCellClicks"
               @select="selectHandle"
               @selection-change="selectionChange"
+              @row-click="rowClick"
               v-if="this.crudArrayFlag"
               ref="referAttrCrud"
               v-loading="loading"
@@ -276,8 +288,8 @@
                        v-if="item.edit !='referName'"
       >
         <template slot-scope="{ row }">
-          <el-input v-if="editingRows === row && editShows== item.prop && item.prop != 'codeDateFormat' && (item.edit == 'text'  ||item.edit == 'refer' )" v-model="row[item.prop]"
-                    @blur="saveRows" ></el-input>
+          <el-input ref="inputRef" v-if="editingRows === row && editShows== item.prop && item.prop != 'codeDateFormat' && (item.edit == 'text'  ||item.edit == 'refer' )" v-model="row[item.prop]"
+                    @blur="saveRows" autofocus ></el-input>
           <el-input-number size="small" controls-position="right" v-if="editingRows === row && editShows== item.prop && item.edit == 'number'" v-model="row[item.prop]"
                            @blur="saveRows" :style="{width:(item.width-10)+'px'}"></el-input-number>
           <el-select v-model="row[item.prop]" filterable  allow-create  default-first-option slot="prepend" v-if="editingRows === row && editShows== item.prop && item.edit == 'select' " @blur="selectChangeHandler(item.editConfig,index)">
@@ -330,7 +342,12 @@
       type: Boolean,
       default: false
     },
+    //鎺у埗鏄惁寮�鍚紪杈�
     editOpenFlag:{
+      type: Boolean,
+      default: false
+    },
+    editStyleFlag:{
       type: Boolean,
       default: false
     },
@@ -355,9 +372,16 @@
     crudArrayFlag:{
       type: Boolean,
       default: false
-    }
+    },
   },
   watch:{
+    crudOid:{
+      handler(newval,oldval){
+        if(newval){
+          this.editOpenFlag=false
+        }
+      }
+    },
     crudArray:{
       handler(newval,oldval){
         if(newval != undefined){
@@ -400,7 +424,7 @@
     },
     editOpenFlag:{
       handler(newval,oldval){
-        console.log(newval)
+        console.log('editOpenFlag',newval)
       },
       deep:true,
       immediate:true
@@ -410,7 +434,7 @@
   data() {
     return {
       //鍏ㄥ睆缂栬緫楂樺害鐘舵��
-      edittStyleFlag:false,
+      editStyleFlag:false,
       loading:false,
       referConfigText:"",
       referConfigVisble:false,
@@ -508,7 +532,7 @@
           desc: "褰撳墠鐢ㄦ埛鐨勫鍚�"
         },
         {
-          formula: "#CURRENTUSER.SECRETGRADE#",
+          formula: "#CURRENTUSER.SECRETARIAT#",
           desc: "褰撳墠鐢ㄦ埛瀵嗙骇"
         },
         {
@@ -1389,7 +1413,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:{
@@ -1486,7 +1553,7 @@
     //琛ㄦ牸鏁版嵁
     CrudRend() {
       if (this.crudOid != '') {
-        gridCodeClassifyTemplateAttr({'conditionMap[classifyTemplateOid]': this.crudOid}).then(res => {
+        gridCodeClassifyTemplateAttr({'conditionMap[classifyTemplateOid]': this.crudOid,limit:-1}).then(res => {
           this.loading=true
           setTimeout(() => {
             this.ProData = res.data.data;
@@ -1540,7 +1607,6 @@
         }
       })
       this.addVisible = false;
-
     },
     //涓氬姟绫诲瀷閫夋嫨
     businessSelect(selection, row) {
@@ -1609,7 +1675,15 @@
     //琛ㄦ牸閫夋嫨
     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() {
@@ -1631,7 +1705,7 @@
          if(column.property == 'referConfig' ){
            this.referConfigVisble= true;
            this.referConfigOption = {
-             referConfig: this.referConfigText || '',
+             referConfig: this.CurrentCell.referConfig || '',
            }
            if(this.CurrentCell.referConfig == ''){
              this.referConfigOption = {
@@ -1656,7 +1730,8 @@
          }else if(column.property == 'parentCode'){
            gridCodeClassifyTemplateAttr({
              'conditionMap[classifyTemplateOid]': this.Formlist[0].oid,
-             'conditionMap[oid_notequal]': this.CurrentCell.oid
+             'conditionMap[oid_notequal]': this.CurrentCell.oid,
+             limit:-1
            }).then(res => {
              console.log(res)
              this.CascadeData = res.data.data;
@@ -1901,8 +1976,7 @@
       if (this.crudArray.length < 1) {
         this.$message.warning('璇烽�夋嫨涓�涓ā鏉�')
       } else {
-        this.editStyleFlag=!this.editStyleFlag;
-        // this.editOpenFlag=true;
+        this.editStyleFlag=true;
         this.attrEditVisible = true;
         this.attrFlag = true;
       }
@@ -1912,6 +1986,7 @@
     escEdit() {
       this.attrFlagChiledren = false;
       this.attrEditVisible = false;
+      this.editStyleFlag=false;
     },
     //缁勫悎瑙勫垯纭畾
     updataFormlaContent(val) {
@@ -1938,6 +2013,12 @@
     //寮�鍚紪杈�
     editOpen(){
       this.editOpenFlag=true;
+    },
+    //鎵归噺璁剧疆switch
+    batchSetFlag(value){
+      this.attrSelectList.forEach(item=>{
+        item[this.selectvalue]=value;
+      })
     }
   }
 }

--
Gitblit v1.9.3