From 2f1d2636adbd763d729c5836aa720fe8844ba9f3 Mon Sep 17 00:00:00 2001 From: wang1 <844966816@qq.com> Date: 星期五, 14 七月 2023 18:01:23 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/UBCS-WEB/src/components/Tree/attrCrud.vue | 59 ++++++++++++++++++++++++++++++++++------------------------- 1 files changed, 34 insertions(+), 25 deletions(-) diff --git a/Source/UBCS-WEB/src/components/Tree/attrCrud.vue b/Source/UBCS-WEB/src/components/Tree/attrCrud.vue index 63aa823..7c68f93 100644 --- a/Source/UBCS-WEB/src/components/Tree/attrCrud.vue +++ b/Source/UBCS-WEB/src/components/Tree/attrCrud.vue @@ -1,7 +1,7 @@ <template> <div> <div style="display: flex;flex-wrap: wrap;" v-if="this.crudArrayFlag"> - <el-button-group> + <!--鏂板--> <el-button v-if="attrEditVisible == false && attrFlagChiledren==false" size="small" type="primary" icon="el-icon-plus" @click="busineHandle">娣诲姞 {{ msg }}</el-button> <!-- 鍏ㄥ睆缂栬緫--> @@ -10,8 +10,8 @@ <el-button 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 icon="el-icon-magic-stick" size="small" @click="injectBtn">鍒嗙被娉ㄥ叆</el-button> <!-- 缁勫悎瑙勫垯--> @@ -22,8 +22,8 @@ <el-button 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> <!-- 鍒犻櫎--> @@ -32,7 +32,7 @@ <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> <!-- 楠岃瘉瑙勫垯--> @@ -270,12 +270,12 @@ @blur="saveRows"></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' " @focus="DataChangeHandler(item.editConfig,index)"> + <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)"> <el-option v-for="optionItem in item.data" - :key="optionItem.key" - :label="optionItem.value" - :value="optionItem.key"> + :key="optionItem.dictValue" + :label="optionItem.dictValue" + :value="optionItem.dictValue"> </el-option> </el-select> <el-switch @@ -304,6 +304,7 @@ <script> import {AttrByBtm, gridCodeClassifyTemplateAttr, batchAddSave, copyto,listByFlag} from '@/api/template/templateAttr' +import {getList} from "@/api/refer/table"; export default { name: "attrCrud .vue", @@ -373,6 +374,7 @@ editingRows: null, editShows:"", attrFlag: false, + referObject:{}, //缂栫爜鐢宠棰勮option applicationoption: { column: [] @@ -1359,7 +1361,11 @@ ) }, created() { - + this.option.column.forEach((item,index) => { + if (item.edit == 'select') { + this.selectChangeHandler(item.editConfig,index) + } + }) }, methods: { formAttr(row, column) { @@ -1386,20 +1392,24 @@ //鍙傜収閰嶇疆瀛愮粍浠� echoReferConfig(val){ console.log('val--',val) + this.referObject=val this.$set(this.CurrentCell,'referConfig',JSON.stringify(val)) }, - //鏃堕棿涓嬫媺鏍煎紡 - DataChangeHandler(editConfig,index){ + //鍙緭鍙�変笅鎷� + selectChangeHandler(editConfig,index){ + let that=this; + /*if(that.option.column[index].data && that.option.column[index].data.length>=0){ + return; + }*/ listByFlag(editConfig.extraParams).then(res=>{ - console.log(res); - this.option.column[index].data=res; + that.option.column[index].data=res.data.data; }) }, //灞炴�у垎缁勬寜閽� attrVisibleHandle() { if (this.attrSelectList < 1) { - this.$message.warning('璇烽�夋嫨涓�鏉℃ā鏉垮睘鎬�') + this.$message.warning('璇烽�夋嫨妯℃澘灞炴��') } else { this.attrVisible = true; console.log(this.attrSelectList) @@ -1537,7 +1547,7 @@ console.log(row) }, //琛ㄦ牸閫夋嫨 - selectionChange(list,) { + selectionChange(list) { this.attrSelectList = list; console.log(list) }, @@ -1646,11 +1656,9 @@ }, //楠岃瘉瑙勫垯鎸夐挳 ruleAddHandler(){ - if(this.attrSelectList.length>1){ - this.$message.warning('鍙兘閫夋嫨涓�鏉℃暟鎹�') - }else if(this.attrSelectList.length<1){ - this.$message.warning('璇烽�夋嫨涓�鎻愭ā鏉垮睘鎬�') - }else if(this.attrSelectList.length === 1){ + if (this.attrSelectList < 1) { + this.$message.warning('璇烽�夋嫨妯℃澘灞炴��') + } else{ this.rulesVisible=true } @@ -1667,11 +1675,12 @@ }, // 楠岃瘉瑙勫垯纭畾 rulesHandle() { - if(this.CurrentCell.length>0){ + if(this.CurrentCell){ this.$set(this.CurrentCell,'verifyRule',this.RulesForm.expressionText) }else { - console.log(this.attrSelectList) - this.$set(this.attrSelectList[0],'verifyRule',this.RulesForm.expressionText) + this.attrSelectList.forEach((item)=>{ + this.$set(item,'verifyRule',this.RulesForm.expressionText) + }) this.rulesremove() } this.rulesVisible = false -- Gitblit v1.9.3