From daa1033f10e9353129549eb3c42b8b80c986923e Mon Sep 17 00:00:00 2001 From: wangting <675591594@qq.com> Date: 星期四, 06 七月 2023 18:04:26 +0800 Subject: [PATCH] 修改属性分组和验证规则 --- Source/UBCS-WEB/src/components/Tree/attrCrud.vue | 43 +++++++++++++++++++++++++++---------------- 1 files changed, 27 insertions(+), 16 deletions(-) diff --git a/Source/UBCS-WEB/src/components/Tree/attrCrud.vue b/Source/UBCS-WEB/src/components/Tree/attrCrud.vue index ee2e28e..0c3aa5b 100644 --- a/Source/UBCS-WEB/src/components/Tree/attrCrud.vue +++ b/Source/UBCS-WEB/src/components/Tree/attrCrud.vue @@ -7,7 +7,7 @@ <!-- 鍏ㄥ睆缂栬緫--> <el-button v-if=" attrEditVisible == false && attrFlagChiledren==false" size="small" @click="fullscreenHandle" icon="el-icon-full-screen">鍏ㄥ睆缂栬緫</el-button> <!-- 楠岃瘉瑙勫垯--> - <el-button icon="el-icon-info" size="small" @click="rulesVisible=true">楠岃瘉瑙勫垯</el-button> + <el-button icon="el-icon-info" size="small" @click="rulesVisibleHandle">楠岃瘉瑙勫垯</el-button> <!-- 灞炴�у垎缁�--> <el-button icon="el-icon-menu" size="small" @click="attrVisibleHandle">灞炴�у垎缁�</el-button> </el-button-group> @@ -225,7 +225,7 @@ </template> </avue-crud> <div style="display: flex;justify-content: flex-end;margin-top: 15px"> - <el-button size="small" type="primary" @click="busineAddHandle">淇濆瓨</el-button> + <el-button size="small" type="primary" @click="busineAddHandle">纭閫夋嫨</el-button> <el-button size="small" type="primary" @click="addVisible=false">鍙栨秷</el-button> </div> </el-dialog> @@ -267,9 +267,9 @@ <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-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 @@ -1329,24 +1329,25 @@ }, //鏃堕棿涓嬫媺鏍煎紡 DataChangeHandler(editConfig,index){ - listByFlag(editConfig.extraParams).then(res=>{ - console.log(res); - this.option.column[index].data=res; - }) + if(!this.option.column[index].data){ + listByFlag(editConfig.extraParams).then(res=>{ + this.option.column[index].data=res.data; + }) + } }, //灞炴�у垎缁勬寜閽� attrVisibleHandle() { - if (this.attrSelectList.length > 1) { - this.$message.warning('鍙兘閫夋嫨涓�鏉℃ā鏉垮睘鎬�') - } else if (this.attrSelectList < 1) { - this.$message.warning('璇烽�夋嫨涓�鏉℃ā鏉垮睘鎬�') - } else if (this.attrSelectList.length === 1) { - this.attrVisible = true; + if(this.attrSelectList.length==0){ + this.$message.warning('璇烽�夋嫨灞炴��'); + return false; } + this.attrVisible = true; }, //灞炴�у垎缁勬彁浜� attrHandle() { - this.$set(this.attrRow, 'attributeGroup', this.attrModel) + this.attrSelectList.forEach((item)=>{ + this.$set(item, 'attributeGroup', this.attrModel) + }) this.attrModel = "" this.attrVisible = false }, @@ -1531,6 +1532,13 @@ saveRow() { this.editingRow = null; }, + rulesVisibleHandle(){ + if(this.attrSelectList.length==0){ + this.$message.warning('璇烽�夋嫨灞炴��'); + return false; + } + this.rulesVisible = true; + }, //瑙勫垯鏍¢獙锛屽弻鍑昏〃鍗曚簨浠� handleRulesRowDBLClick(row) { this.RulesForm.expressionText = row.bds @@ -1542,6 +1550,9 @@ }, // 楠岃瘉瑙勫垯纭畾 rulesHandle() { + this.attrSelectList.forEach((item)=>{ + this.$set(item, 'verifyRule', this.RulesForm.expressionText) + }) this.rulesVisible = false }, //楠岃瘉瑙勫垯妫�鏌� -- Gitblit v1.9.3