diff --git a/api-test/frontend/src/business/definition/ApiDefinition.vue b/api-test/frontend/src/business/definition/ApiDefinition.vue index 36c7df6cd0..4e55c0b1b3 100644 --- a/api-test/frontend/src/business/definition/ApiDefinition.vue +++ b/api-test/frontend/src/business/definition/ApiDefinition.vue @@ -753,7 +753,8 @@ export default { if ( store.apiMap.get(t.api.id).get('responseChange') === true || store.apiMap.get(t.api.id).get('requestChange') === true || - store.apiMap.get(t.api.id).get('fromChange') === true + store.apiMap.get(t.api.id).get('fromChange') === true || + store.apiMap.get(t.api.id).get('customFormChange') === true ) { message += t.api.name; id = t.api.id; @@ -1049,6 +1050,12 @@ export default { t.isCopy = false; } }); + store.apiStatus.set('fromChange', false); + store.apiStatus.set('requestChange', false); + store.apiStatus.set('responseChange', false); + store.apiMap.set(data.id, store.apiStatus); + // 保存后将保存状态置为true + store.saveMap.set(data.id, true); }, showExecResult(row) { diff --git a/api-test/frontend/src/business/definition/components/ApiConfig.vue b/api-test/frontend/src/business/definition/components/ApiConfig.vue index 59c4355e75..fbc4e9cbf1 100644 --- a/api-test/frontend/src/business/definition/components/ApiConfig.vue +++ b/api-test/frontend/src/business/definition/components/ApiConfig.vue @@ -375,10 +375,6 @@ export default { }); this.responseCount = 0; this.count = 0; - store.apiStatus.set('fromChange', false); - store.apiStatus.set('requestChange', false); - store.apiStatus.set('responseChange', false); - store.apiMap.set(this.currentApi.id, store.apiStatus); }, handleSave() { if (this.$refs.httpApi) { diff --git a/api-test/frontend/src/business/definition/components/complete/ApiBaseInfo.vue b/api-test/frontend/src/business/definition/components/complete/ApiBaseInfo.vue index 75ce15acca..f58b7df100 100644 --- a/api-test/frontend/src/business/definition/components/complete/ApiBaseInfo.vue +++ b/api-test/frontend/src/business/definition/components/complete/ApiBaseInfo.vue @@ -218,7 +218,7 @@ export default { customFieldForm: { handler(v, v1) { if (v && v1 && store.apiMap && this.basicForm.id) { - this.apiMapStatus(); + this.customApiMapStatus(); } }, deep: true, @@ -231,6 +231,15 @@ export default { store.apiMap.set(this.basicForm.id, store.apiStatus); } }, + customApiMapStatus() { + if(store.saveMap.get(this.basicForm.id)){ + store.saveMap.set(this.basicForm.id, false); + store.apiStatus.set('customFormChange',false ); + } else { + store.apiStatus.set('customFormChange',true ); + } + + }, setModule(id, data) { this.basicForm.moduleId = id; this.basicForm.modulePath = data.path; diff --git a/api-test/frontend/src/store/state.js b/api-test/frontend/src/store/state.js index 729d8073ec..f63eb57c8a 100644 --- a/api-test/frontend/src/store/state.js +++ b/api-test/frontend/src/store/state.js @@ -10,6 +10,8 @@ export default { apiStatus: new Map(), apiCaseMap: new Map(), forceRerenderIndex: '', + // 存储保存状态的map,只针对自定义属性change。 + saveMap: new Map(), }), getters: { currentApi(store) {