Commit 5745676c authored by “yiyousong”'s avatar “yiyousong”

perf:优化新增应用字段

parent 26150078
......@@ -64,10 +64,10 @@
<a-input v-model="v.value" placeholder="请输入值" />
</a-space>
</div>
<a-button type="primary" @click="insertion(i)"
<a-button type="primary" @click="insertion(i, 'fieldType')"
><a-icon type="plus"
/></a-button>
<a-button type="danger" @click="delrow(i)"
<a-button type="danger" @click="delrow(i, 'fieldType')"
><a-icon type="minus"
/></a-button>
</a-space>
......@@ -100,10 +100,10 @@
<a-input v-model="v.value" placeholder="请输入映射字段" />
</a-space>
</div>
<a-button type="primary" @click="insertion(i, 'params')"
<a-button type="primary" @click="insertion(i, 'apiParams')"
><a-icon type="plus"
/></a-button>
<a-button type="danger" @click="delrow(i, 'params')"
<a-button type="danger" @click="delrow(i, 'apiParams')"
><a-icon type="minus"
/></a-button>
</a-space>
......@@ -428,25 +428,14 @@ export default {
key: "",
value: "",
};
if (type == "params") {
this.apiParams.splice(index + 1, 0, obj);
} else {
this.fieldType.splice(index + 1, 0, obj);
}
this[type].splice(index + 1, 0, obj);
},
// 删除数据配置行数
delrow(index, type) {
if (type == "params") {
if (this.apiParams.length == 1) {
return;
}
this.apiParams.splice(index, 1);
} else {
if (this.fieldType.length == 1) {
if (this[type].length == 1) {
return;
}
this.fieldType.splice(index, 1);
}
this[type].splice(index, 1);
},
// 切换字段类型
changeFieldType(val) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment