fix(项目设置): 修复环境配置中http配置模块条件控制台报错的缺陷 (#15993)

--bug=1015066 --user=王孝刚 [接口测试]#15958v1.20.10 环境配置 - http配置 - 启用条件选择模块 -
选择模块保存后无法删除 https://www.tapd.cn/55049933/s/1205075

Co-authored-by: wxg0103 <727495428@qq.com>
This commit is contained in:
MeterSphere Bot 2022-07-21 11:32:13 +08:00 committed by GitHub
parent d084fb13a3
commit 8964dec435
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 58 additions and 52 deletions

View File

@ -368,7 +368,7 @@ export default {
this.editData = {delimiter: ",", quotedData: 'false', files: []};
this.editData.type = this.selectType;
this.showDelete = false;
if (this.editData.type === 'CSV') {
if (this.editData.type === 'CSV' && this.$refs.csv) {
this.$refs.csv.cleanPreview();
}
this.$refs.variableTable.cancelCurrentRow();

View File

@ -1,7 +1,8 @@
<template>
<div v-loading="loading">
<div class="mask" v-show="isShowSelect"></div>
<el-popover placement="bottom-start" :width="popoverWidth" trigger="manual" v-model="isShowSelect" @hide="popoverHide" v-outside-click="outsideClick">
<el-popover placement="bottom-start" :width="popoverWidth" trigger="manual" v-model="isShowSelect"
@hide="popoverHide" v-outside-click="outsideClick">
<el-input
size="mini"
prefix-icon="el-icon-search"
@ -32,7 +33,9 @@
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
<el-row>
<el-button v-if="multiple" class="ok" @click="isShowSelect=false" size="mini" type="text">{{ $t('commons.confirm') }}</el-button>
<el-button v-if="multiple" class="ok" @click="isShowSelect=false" size="mini" type="text">
{{ $t('commons.confirm') }}
</el-button>
</el-row>
</el-popover>
</div>
@ -271,8 +274,11 @@ export default {
});
this.returnDatas = t;
}
this.selectNodeIds = [];
if (data) {
this.getChildNodeId(data, this.selectNodeIds);
}
},
getChildNodeId(rootNode, nodeIds) {
//ID
@ -318,7 +324,7 @@ export default {
this.options = [];
thisKeys.map((item) => {//option
let node = this.$refs.tree.getNode(item); // node
if(node){
if (node) {
t.push(node.data);
this.options.push({label: node.label, value: node.key});
return {label: node.label, value: node.key};
@ -429,26 +435,26 @@ export default {
},
deep: true
},
defaultKey:{
handler:function(){
defaultKey: {
handler: function () {
this.init();
if(this.data && this.data.length > 0){
if(this.defaultKey instanceof Array){
if (this.data && this.data.length > 0) {
if (this.defaultKey instanceof Array) {
this.$refs.tree.setCheckedKeys(this.defaultKey);
}
}
},
deep:true
deep: true
},
data:{
handler:function(){
if(this.defaultKey && this.defaultKey.length > 0 && this.defaultKey instanceof Array){
if(this.defaultKey instanceof Array){
data: {
handler: function () {
if (this.defaultKey && this.defaultKey.length > 0 && this.defaultKey instanceof Array) {
if (this.defaultKey instanceof Array) {
this.$refs.tree.setCheckedKeys(this.defaultKey);
}
}
},
deep:true
deep: true
},
filterText(val) {
this.$nextTick(() => {