fix(接口测试): 修复接口定义sql协议编辑保存后仍提示未保存的缺陷

--bug=1012615 --user=王孝刚 【接口测试】接口定义-编辑接口定义后保存成功了,关闭时仍提示未保存。
https://www.tapd.cn/55049933/s/1145356
This commit is contained in:
wxg0103 2022-04-24 14:20:28 +08:00 committed by 刘瑞斌
parent 970955d323
commit 09365548ba
6 changed files with 32 additions and 4 deletions

View File

@ -237,7 +237,6 @@ export default {
},
apiCaseClose() {
if (this.apiCaseList && this.apiCaseList.length > 0) {
console.log(this.apiCaseList)
let message = "";
if (this.$store.state.apiCaseMap.has(this.apiCaseList[0].id) && this.$store.state.apiCaseMap.get(this.apiCaseList[0].id) > 1) {
message += this.apiCaseList[0].name + "";

View File

@ -108,7 +108,15 @@
},
'basicForm.description': {
handler(v, v1) {
if (v && v1 && v !== v1) {
if (v && v1 !== undefined && v !== v1) {
this.apiMapStatus();
}
}
},
'basicForm.tags': {
handler(v, v1) {
this.tagCount++;
if (v && v1 && JSON.stringify(v) !== JSON.stringify(v1) && this.tagCount > 1) {
this.apiMapStatus();
}
}
@ -120,6 +128,7 @@
this.$get('/api/definition/follow/' + this.basisData.id, response => {
this.basicForm.follows = response.data;
});
},
data() {
return {
@ -143,6 +152,7 @@
},
value: API_STATUS[0].id,
options: API_STATUS,
tagCount: 0
}
},
methods: {
@ -160,7 +170,9 @@
reload() {
this.loading = true
this.$nextTick(() => {
this.loading = false
this.loading = false;
this.$store.state.apiStatus.set("fromChange", false);
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
})
},
setModule(id,data) {
@ -173,6 +185,7 @@
this.$emit('callback');
}
})
this.tagCount = 0;
},
createModules() {
this.$emit("createRootModelInTree");

View File

@ -188,6 +188,8 @@ export default {
this.basisData.tags = JSON.stringify(this.basisData.tags);
}
this.$emit('saveApi', this.basisData);
this.$store.state.apiStatus.set("fromChange", false);
this.$store.state.apiMap.set(this.basisData.id, this.$store.state.apiStatus);
}
},
runTest() {

View File

@ -190,6 +190,8 @@ export default {
this.basisData.tags = JSON.stringify(this.basisData.tags);
}
this.$emit('saveApi', this.basisData);
this.$store.state.apiStatus.set("fromChange", false);
this.$store.state.apiMap.set(this.basisData.id, this.$store.state.apiStatus);
}
},
runTest() {

View File

@ -276,6 +276,8 @@ export default {
}
}
this.$emit('saveApi', this.basisData);
this.$store.state.apiStatus.set("fromChange", false);
this.$store.state.apiMap.set(this.basisData.id, this.$store.state.apiStatus);
}
},
runTest() {

View File

@ -118,6 +118,7 @@
id: 'id',
label: 'name',
},
tagCount: 0
}
},
@ -159,7 +160,15 @@
},
'basicForm.description': {
handler(v, v1) {
if (v && v1 && v !== v1) {
if (v && v1 !== undefined && v !== v1) {
this.apiMapStatus();
}
}
},
'basicForm.tags': {
handler(v, v1) {
this.tagCount++;
if (v && v1 && JSON.stringify(v) !== JSON.stringify(v1) && this.tagCount > 1) {
this.apiMapStatus();
}
}
@ -189,6 +198,7 @@
this.$emit('callback');
}
})
this.tagCount = 0;
},
createModules() {
this.$emit("createRootModelInTree");