fix_接口测试用例_另存为新用例_tab页关不掉修复

This commit is contained in:
wxg0103 2021-11-09 10:32:57 +08:00 committed by 刘瑞斌
parent d67ec08cd1
commit b3d56018cb
4 changed files with 55 additions and 19 deletions

View File

@ -97,7 +97,9 @@
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
if (this.basicForm.id) {
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
}
}
}
},
@ -105,7 +107,9 @@
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
if (this.basicForm.id) {
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
}
}
}
},
@ -113,7 +117,9 @@
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
if (this.basicForm.id) {
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
}
}
}
},
@ -121,7 +127,9 @@
handler(v, v1) {
if (v && v1 && JSON.stringify(v) !== JSON.stringify(v1)) {
this.$store.state.apiStatus.set("fromChange", true);
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
if (this.basicForm.id) {
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
}
}
}
},
@ -129,7 +137,9 @@
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
if (this.basicForm.id) {
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
}
}
}
},

View File

@ -200,7 +200,9 @@
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus);
if (this.httpForm.id) {
this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus);
}
}
}
},
@ -208,7 +210,9 @@
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus);
if (this.httpForm.id) {
this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus);
}
}
}
},
@ -216,7 +220,9 @@
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus);
if (this.httpForm.id) {
this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus);
}
}
}
},
@ -224,7 +230,9 @@
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus);
if (this.httpForm.id) {
this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus);
}
}
}
},
@ -232,7 +240,9 @@
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus);
if (this.httpForm.id) {
this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus);
}
}
}
},
@ -240,7 +250,9 @@
handler(v, v1) {
if (v && v1 && JSON.stringify(v) !== JSON.stringify(v1)) {
this.$store.state.apiStatus.set("fromChange", true);
this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus);
if (this.httpForm.id) {
this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus);
}
}
}
},
@ -248,7 +260,9 @@
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus);
if (this.httpForm.id) {
this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus);
}
}
}
},

View File

@ -141,7 +141,9 @@
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
if (this.basicForm.id) {
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
}
}
}
},
@ -149,7 +151,9 @@
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
if (this.basicForm.id) {
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
}
}
}
},
@ -157,7 +161,9 @@
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
if (this.basicForm.id) {
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
}
}
}
},
@ -165,7 +171,9 @@
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
if (this.basicForm.id) {
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
}
}
}
},
@ -173,7 +181,9 @@
handler(v, v1) {
if (v && v1 && JSON.stringify(v) !== JSON.stringify(v1)) {
this.$store.state.apiStatus.set("fromChange", true);
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
if (this.basicForm.id) {
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
}
}
}
},
@ -181,7 +191,9 @@
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
if (this.basicForm.id) {
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
}
}
}
},

View File

@ -345,7 +345,7 @@ export default {
},
closeConfirm(targetName) {
let t = this.tabs.filter(tab => tab.name === targetName);
if (t && this.$store.state.testCaseMap.has(t[0].testCaseInfo.id) && this.$store.state.testCaseMap.get(t[0].testCaseInfo.id) > 1) {
if (t && this.$store.state.testCaseMap.has(t[0].testCaseInfo.id) && this.$store.state.testCaseMap.get(t[0].testCaseInfo.id) > 2) {
this.$alert("用例[ " + t[0].testCaseInfo.name + " ]未保存,是否确认关闭?", '', {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),