fix(接口测试): 接口定义页面tabs无法关闭

This commit is contained in:
wxg0103 2021-11-26 13:56:56 +08:00 committed by 刘瑞斌
parent 431c1ee61e
commit 501fe437bf
2 changed files with 14 additions and 1 deletions

View File

@ -267,6 +267,8 @@ export default {
this.$emit('saveApi', data);
});
this.$store.state.apiMap.delete(this.currentApi.id);
this.responseCount = 0;
this.count = 0
},
handleSave() {
if (this.$refs.httpApi) {

View File

@ -72,7 +72,7 @@
<el-row>
<el-col :span="8">
<el-form-item :label="$t('commons.tag')" prop="tag">
<ms-input-tag :currentScenario="httpForm" ref="tag"/>
<ms-input-tag :currentScenario="httpForm" ref="tag" v-model="httpForm.tags"/>
</el-form-item>
</el-col>
<el-col :span="8">
@ -179,6 +179,7 @@
label: 'name',
},
mockBaseUrl: "",
count: 0
}
},
props: {moduleOptions: {}, request: {}, response: {}, basisData: {}, syncTabs: Array, projectId: String},
@ -232,6 +233,14 @@
}
}
},
'httpForm.tags': {
handler(v, v1) {
this.count++;
if (v && v1 && JSON.stringify(v) !== JSON.stringify(v1) && this.count > 1) {
this.apiMapStatus();
}
}
},
syncTabs() {
if (this.basisData && this.syncTabs && this.syncTabs.includes(this.basisData.id)) {
//
@ -337,6 +346,8 @@
if (valid) {
this.setParameter();
this.$emit('saveApi', this.httpForm);
this.count = 0;
this.$store.state.apiMap.delete(this.httpForm.id);
} else {
return false;
}