From dc3531814c2cfbf6d42065972abd5278e9afa086 Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期一, 04 十二月 2023 10:12:22 +0800 Subject: [PATCH] 规则基础配置模块优化修改+删除 --- Source/UBCS-WEB/src/views/ruleBasic/delimiterConfig.vue | 69 ++++++++++++++++++++++++++++------ 1 files changed, 57 insertions(+), 12 deletions(-) diff --git a/Source/UBCS-WEB/src/views/ruleBasic/delimiterConfig.vue b/Source/UBCS-WEB/src/views/ruleBasic/delimiterConfig.vue index a78ad01..de2e56a 100644 --- a/Source/UBCS-WEB/src/views/ruleBasic/delimiterConfig.vue +++ b/Source/UBCS-WEB/src/views/ruleBasic/delimiterConfig.vue @@ -101,14 +101,30 @@ </el-table> </el-main> <el-footer> - <div style="width: 260px; display: flex; align-items: center;margin-top: 5px"> + <div style="width: 460px; display: flex; align-items: center;margin-top: 5px"> <p>鍊硷細</p> - <el-input v-model="characterValue" size="small" style="flex: 1;"></el-input> + <el-input v-model="characterValue" size="small" style="flex: 1; display: flex;"> + <template slot="prefix"> + <div style="display: flex; align-items: center;height: 100%;text-align: center;margin-left: 5px"> + <el-tag v-for="(item,index) in this.editValueList" :key="index" closable size="small" + @close="handleClose(item,index)"> + {{ item }} + </el-tag> + </div> + </template> + </el-input> </div> </el-footer> + <el-dialog :visible.sync="editVisble" append-to-body title="淇敼鍙敤瀛楃" width="40%"> + <el-input v-model="characterValue" size="small"></el-input> + <span slot="footer" class="dialog-footer"> + <el-button @click="editVisble = false">鍙� 娑�</el-button> + <el-button type="primary" @click="editSaveHandler">纭� 瀹�</el-button> + </span> + </el-dialog> <div style="margin-bottom: 10px;text-align: center"> <el-button icon="el-icon-plus" plain size="small" type="success" @click="addSaveHandler">娣诲姞</el-button> - <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editSaveHandler">淇敼</el-button> + <el-button icon="el-icon-edit" plain size="small" type="primary" @click="editDialog">淇敼</el-button> <el-button icon="el-icon-delete" plain size="small" type="danger" @click="delSaveHandler">鍒犻櫎</el-button> </div> </basic-container> @@ -119,10 +135,11 @@ import {gridCodeRule} from "@/api/code/codeCharcter" export default { - name: "delimiterConfig", + name: "usableCharacter", data() { return { loading: false, + editValueList: [], //涓嬫媺妗嗘暟缁� queryReleasedList: [], //涓嬫媺妗嗗垵濮嬫暟鎹暟缁� @@ -131,7 +148,8 @@ characterEditOldValue: "", tableData: [], select: "", - selectValue: "" + selectValue: "", + editVisble: false } }, watch: { @@ -145,9 +163,32 @@ this.getCodeRule(); }, methods: { + editDialog(){ + if(this.editValueList.length > 1){ + this.$message.warning('鍙兘閫夋嫨涓�鏉℃暟鎹紒'); + return; + } + if(this.editValueList.length === 0){ + this.$message.warning('璇烽�夋嫨涓�鏉℃暟鎹紒'); + return; + } + this.editVisble = true; + }, + handleClose(tag, index) { + this.$delete(this.editValueList, index); + if (this.editValueList.length === 0) { + this.characterValue = ""; + return; + } + }, cellClickHandler(row, column) { this.characterValue = row[column.property]; - this.characterEditOldValue = row[column.property] + this.characterEditOldValue = row[column.property]; + if (this.editValueList.includes(row[column.property])) { + this.$message.warning('璇锋鏌ュ瓧绗﹂泦鏄惁鏈夐噸澶嶏紒') + } else { + this.editValueList.push(row[column.property]); + } }, async getCodeRule() { try { @@ -160,14 +201,12 @@ const res2 = await getList({codeRuleId: this.select, chartType: "separator", chartValue: this.characterValue}); this.tableData = res2.data.data; this.loading = false; - // console.log("this.tableData", this.tableData); } catch (error) { this.$message.warning(error) } }, //缂栫爜瑙勫垯涓嬫媺妗嗘悳绱� filterValue(query) { - console.log(query) if (query !== "") { this.queryReleasedList = this.characterReleasedList.filter(item => { return item.name.includes(query.toString()); @@ -185,7 +224,7 @@ this.loading = true; // const targetObject = this.characterReleasedList.find(obj => obj.oid === this.selectValue); // const chartValue = targetObject.name; - getList({codeRuleId: this.select, chartType: "separator", chartValue: this.characterValue}).then(res => { + getList({codeRuleId: this.select, chartType: "fillerChar", chartValue: this.characterValue}).then(res => { console.log(res.data.data); this.tableData = res.data.data; this.loading = false; @@ -196,12 +235,14 @@ this.$message.warning('璇峰~鍐欒娣诲姞鐨勫�硷紒'); return; // 鍒ゆ柇杈撳叆鍊� } - + if (this.editValueList.length != 0) { + this.$message.warning('璇峰厛鍙栨秷宸查�夋嫨鐨勫�硷紒'); + return; // 鍒ゆ柇杈撳叆鍊� + } const targetObject = this.characterReleasedList.find(obj => obj.oid === this.select); if (!targetObject) { return; // 鏌ユ壘瀵瑰簲typeText } - const codeRuleCharacterVO = { codeRuleId: this.select, chartType: "separator", @@ -246,6 +287,8 @@ .then(res => { this.$message.success(res.data.msg); this.characterValue = ""; + this.editVisble = false; + this.editValueList = []; this.getTableData(); }).catch(error => { this.$message.error('淇敼澶辫触'); @@ -262,16 +305,18 @@ if (!targetObject) { return; // 鏌ユ壘瀵瑰簲typeText } + const value = this.editValueList.join(""); const codeRuleCharacterVO = { codeRuleId: this.select, chartType: "separator", - chartValue: this.characterValue, + chartValue: value, chartTypeText: targetObject.name }; deleteSave(codeRuleCharacterVO) .then(res => { this.$message.success(res.data.msg); + this.editValueList = []; this.characterValue = ""; this.getTableData(); }).catch(error => { -- Gitblit v1.9.3