fix(系统设置): 批量添加全局变量错误
--bug=1008074 --user=王孝刚 【系统设置】批量添加全局变量错误 https://www.tapd.cn/55049933/s/1070140
This commit is contained in:
parent
bb5646bdee
commit
521f8e9963
|
@ -54,6 +54,7 @@
|
|||
confirm() {
|
||||
this.dialogVisible = false;
|
||||
this.$emit("batchSave", this.parameters);
|
||||
this.parameters = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -307,7 +307,7 @@ export default {
|
|||
let required = false;
|
||||
keyValues.unshift(new KeyValue({
|
||||
name: line[0],
|
||||
required: required,
|
||||
required: !required,
|
||||
value: line[1],
|
||||
description: line[2],
|
||||
type: "text",
|
||||
|
|
|
@ -109,16 +109,13 @@ export default {
|
|||
let params = data.split("\n");
|
||||
let keyValues = [];
|
||||
params.forEach(item => {
|
||||
let line = item.split(/,|,/);
|
||||
let line = item.split(/:|:/);
|
||||
let required = false;
|
||||
if (line[1] === '必填' || line[1] === 'Required' || line[1] === 'true') {
|
||||
required = true;
|
||||
}
|
||||
keyValues.push(new KeyValue({
|
||||
keyValues.unshift(new KeyValue({
|
||||
name: line[0],
|
||||
required: required,
|
||||
value: line[2],
|
||||
description: line[3],
|
||||
value: line[1],
|
||||
description: line[2],
|
||||
type: "text",
|
||||
valid: false,
|
||||
file: false,
|
||||
|
@ -135,9 +132,19 @@ export default {
|
|||
batchSave(data) {
|
||||
if (data) {
|
||||
let keyValues = this._handleBatchVars(data);
|
||||
keyValues.forEach(item => {
|
||||
this.items.unshift(item);
|
||||
});
|
||||
keyValues.forEach(keyValue => {
|
||||
let isAdd = true;
|
||||
for (let i in this.items) {
|
||||
let item = this.items[i];
|
||||
if (item.name === keyValue.name) {
|
||||
item.value = keyValue.value;
|
||||
isAdd = false;
|
||||
}
|
||||
}
|
||||
if (isAdd) {
|
||||
this.items.unshift(keyValue);
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue