From 8b29c5daf0cde34304208adeb07fdccae36ae58d Mon Sep 17 00:00:00 2001 From: ludc Date: 星期二, 01 八月 2023 21:20:22 +0800 Subject: [PATCH] 代码整合 --- Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue | 31 ++++++++++++++++++++++--------- 1 files changed, 22 insertions(+), 9 deletions(-) diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue b/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue index 34a0cec..7a950f4 100644 --- a/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue +++ b/Source/UBCS-WEB/src/components/Theme/ThemeAttrCrud.vue @@ -14,7 +14,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> <!-- 鍒犻櫎--> @@ -166,11 +166,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> @@ -218,7 +218,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" @@ -1536,12 +1536,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() { @@ -1677,15 +1680,16 @@ 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){ @@ -1705,6 +1709,7 @@ } // this.$refs.referConfigFormDialog.onloadAttrData(); }else if(column.property == 'classifyInvokeText'){ + this.injectVisible=true; if (this.CurrentCell.classifyInvokeAttr != '') { this.injectOption = { classifyInvokeAttr: this.CurrentCell.classifyInvokeAttr, @@ -1741,6 +1746,9 @@ this.rulesVisible=true; }else if(column.property == 'attributeGroup'){ this.attrVisible = true; + if(this.CurrentCell.attributeGroup !== ''){ + this.attrModel=this.CurrentCell.attributeGroup + } } } }, @@ -1889,6 +1897,7 @@ this.$set(this.attrSelectList[0],'classifyInvokeText',data) } this.injectHandleReset() + if(this.injectOption.classifyInvokeLevel !== 'min'){ this.injectOption.classifyInvokeLevel=this.injectOption.classifyNumber; }else { @@ -1995,6 +2004,10 @@ editOpen(){ this.editOpenFlag=true; }, + //瀹氫箟涓�涓叧闂紪杈戠殑鏂规硶渚涘瓙缁勪欢浣跨敤 + editClose(){ + this.editOpenFlag=false; + }, //鎵归噺璁剧疆switch batchSetFlag(value){ this.attrSelectList.forEach(item=>{ -- Gitblit v1.9.3