From 76e60f7f82423935dcf501c62e318e78ded7d3fd Mon Sep 17 00:00:00 2001 From: wangting <675591594@qq.com> Date: 星期五, 07 七月 2023 20:20:53 +0800 Subject: [PATCH] 修改可输可选下拉框 --- Source/UBCS-WEB/src/components/Tree/attrCrud.vue | 49 ++++++++++++++++++++++++++++++++----------------- 1 files changed, 32 insertions(+), 17 deletions(-) diff --git a/Source/UBCS-WEB/src/components/Tree/attrCrud.vue b/Source/UBCS-WEB/src/components/Tree/attrCrud.vue index 1eb7dde..016b46f 100644 --- a/Source/UBCS-WEB/src/components/Tree/attrCrud.vue +++ b/Source/UBCS-WEB/src/components/Tree/attrCrud.vue @@ -211,7 +211,7 @@ ></formula-editor> <!-- 鏂板 --> <el-dialog :visible.sync="addVisible" append-to-body title="浠庝笟鍔$被鍨嬩腑閫夋嫨灞炴��"> - <avue-crud :data="businessData" :option="businessOption" @selection-change="businessSelect"> + <avue-crud ref="AddOriginPlace" :data="businessData" :option="businessOption" @selection-change="businessSelect"> <template slot="menuLeft"> <div style="display: flex;"> <el-select v-model="SelectValue" placeholder="璇烽�夋嫨" style="width: 150px !important;"> @@ -269,12 +269,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' " @visible-change="DataChangeHandler($event,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 @@ -303,6 +303,7 @@ <script> import {AttrByBtm, gridCodeClassifyTemplateAttr, batchAddSave, copyto,listByFlag} from '@/api/template/templateAttr' +import {getList} from "@/api/refer/table"; export default { name: "attrCrud .vue", @@ -350,6 +351,7 @@ }, data() { return { + screenWidth: document.documentElement.clientWidth, // 灞忓箷瀹藉害 //褰撳墠鍗曞厓鏍� CurrentCell:'', // 鏂板 @@ -1341,6 +1343,17 @@ } }, mounted() { + window.addEventListener( + 'resize', + () => { + if(Math.abs(this.screenWidth - document.body.clientWidth) > 20) { + this.$nextTick(() => { + this.$refs.AddOriginPlace.refreshTable(); + }) + } + this.screenWidth = document.body.clientWidth; + } + ) }, created() { @@ -1374,27 +1387,29 @@ }, //鏃堕棿涓嬫媺鏍煎紡 - DataChangeHandler(editConfig,index){ + DataChangeHandler($event,editConfig,index){ + let that=this; + if(!$event){ + 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.length > 1) { - this.$message.warning('鍙兘閫夋嫨涓�鏉℃ā鏉垮睘鎬�') - } else if (this.attrSelectList < 1) { + if (this.attrSelectList < 1) { this.$message.warning('璇烽�夋嫨涓�鏉℃ā鏉垮睘鎬�') - } else if (this.attrSelectList.length === 1) { + } else { this.attrVisible = true; + console.log(this.attrSelectList) } }, //灞炴�у垎缁勬彁浜� attrHandle() { - this.$set(this.attrRow, 'attributeGroup', JSON.stringify(this.attrModel)) - this.attrModel = "" - this.attrVisible = false + this.$set(this.attrRow, 'attributeGroup', this.attrModel) + this.attrModel = ""; + this.attrVisible = false; }, //灞炴�у垎缁勬竻绌� attrRemove() { @@ -1482,7 +1497,6 @@ 'conditionMap[classifyTemplateOid]': this.Formlist[0].oid, 'conditionMap[oid_notequal]': this.attrOid }).then(res => { - console.log(res) this.CascadeData = res.data.data; }) } @@ -1514,8 +1528,9 @@ console.log(row) }, //琛ㄦ牸閫夋嫨 - selectionChange(list) { + selectionChange(list,) { this.attrSelectList = list; + console.log(list) }, //淇濆瓨 addsHandler() { -- Gitblit v1.9.3