From 3d828ba07224d1935f47cb0c20dcb959281361d6 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期四, 07 十二月 2023 14:06:23 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
Source/UBCS-WEB/src/views/ruleBasic/prefixConfig.vue | 69 +++++++++++++++++++++++++++++-----
1 files changed, 58 insertions(+), 11 deletions(-)
diff --git a/Source/UBCS-WEB/src/views/ruleBasic/prefixConfig.vue b/Source/UBCS-WEB/src/views/ruleBasic/prefixConfig.vue
index fe196c6..edecfe5 100644
--- a/Source/UBCS-WEB/src/views/ruleBasic/prefixConfig.vue
+++ b/Source/UBCS-WEB/src/views/ruleBasic/prefixConfig.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: "prefixConfig",
+ name: "usableCharacter",
data() {
return {
loading: false,
+ editValueList: [],
//涓嬫媺妗嗘暟缁�
queryReleasedList: [],
//涓嬫媺妗嗗垵濮嬫暟鎹暟缁�
@@ -131,7 +148,8 @@
characterEditOldValue: "",
tableData: [],
select: "",
- selectValue: ""
+ selectValue: "",
+ editVisble: false
}
},
watch: {
@@ -145,9 +163,34 @@
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 if (row[column.property] === undefined || row[column.property] === null) {
+ this.$message.warning('璇锋鏌ュ瓧绗﹂泦鏄惁鏈夌┖鍊硷紒');
+ } else {
+ this.editValueList.push(row[column.property]);
+ }
},
async getCodeRule() {
try {
@@ -160,14 +203,12 @@
const res2 = await getList({codeRuleId: this.select, chartType: "prefix", 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());
@@ -196,12 +237,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: "prefix",
@@ -246,6 +289,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 +307,18 @@
if (!targetObject) {
return; // 鏌ユ壘瀵瑰簲typeText
}
+ const value = this.editValueList.join("");
const codeRuleCharacterVO = {
codeRuleId: this.select,
chartType: "prefix",
- 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