fix(测试跟踪): 功能用例修改后提示保存优化

This commit is contained in:
wxg0103 2021-11-18 15:08:20 +08:00 committed by 刘瑞斌
parent 91c62328fc
commit c5ec9087da
4 changed files with 797 additions and 832 deletions

View File

@ -96,50 +96,35 @@
'basicForm.name': {
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
if (this.basicForm.id) {
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
}
this.apiMapStatus();
}
}
},
'basicForm.moduleId': {
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
if (this.basicForm.id) {
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
}
this.apiMapStatus();
}
}
},
'basicForm.status': {
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
if (this.basicForm.id) {
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
}
this.apiMapStatus();
}
}
},
'basicForm.follows': {
handler(v, v1) {
if (v && v1 && JSON.stringify(v) !== JSON.stringify(v1)) {
this.$store.state.apiStatus.set("fromChange", true);
if (this.basicForm.id) {
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
}
this.apiMapStatus();
}
}
},
'basicForm.description': {
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
if (this.basicForm.id) {
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
}
this.apiMapStatus();
}
}
},
@ -176,8 +161,14 @@
}
},
methods: {
apiMapStatus() {
this.$store.state.apiStatus.set("fromChange", true);
if (this.httpForm.id) {
this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus);
}
},
getMaintainerOptions() {
this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()},response => {
this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => {
this.maintainerOptions = response.data;
});
},

View File

@ -201,70 +201,49 @@
'httpForm.name': {
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
if (this.httpForm.id) {
this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus);
}
this.apiMapStatus();
}
}
},
'httpForm.path': {
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
if (this.httpForm.id) {
this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus);
}
this.apiMapStatus();
}
}
},
'httpForm.userId': {
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
if (this.httpForm.id) {
this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus);
}
this.apiMapStatus();
}
}
},
'httpForm.moduleId': {
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
if (this.httpForm.id) {
this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus);
}
this.apiMapStatus();
}
}
},
'httpForm.status': {
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
if (this.httpForm.id) {
this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus);
}
this.apiMapStatus();
}
}
},
'httpForm.follows': {
handler(v, v1) {
if (v && v1 && JSON.stringify(v) !== JSON.stringify(v1)) {
this.$store.state.apiStatus.set("fromChange", true);
if (this.httpForm.id) {
this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus);
}
this.apiMapStatus();
}
}
},
'httpForm.description': {
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
if (this.httpForm.id) {
this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus);
}
this.apiMapStatus();
}
}
},
@ -325,16 +304,22 @@
}
},
methods: {
apiMapStatus() {
this.$store.state.apiStatus.set("fromChange", true);
if (this.httpForm.id) {
this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus);
}
},
currentUser: () => {
return getCurrentUser();
},
openHis(){
this.$refs.changeHistory.open(this.httpForm.id,["接口定义" , "接口定義" , "Api definition"]);
openHis() {
this.$refs.changeHistory.open(this.httpForm.id, ["接口定义", "接口定義", "Api definition"]);
},
mockSetting() {
if(this.basisData.id){
this.$store.state.currentApiCase={mock : getUUID()};
this.$emit('changeTab','mock');
if (this.basisData.id) {
this.$store.state.currentApiCase = {mock: getUUID()};
this.$emit('changeTab', 'mock');
}else {
this.$alert(this.$t('api_test.mock.create_error'));
}

View File

@ -140,65 +140,53 @@
'basicForm.name': {
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
if (this.basicForm.id) {
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
}
this.apiMapStatus();
}
}
},
'basicForm.userId': {
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
if (this.basicForm.id) {
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
}
this.apiMapStatus();
}
}
},
'basicForm.moduleId': {
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
if (this.basicForm.id) {
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
}
this.apiMapStatus();
}
}
},
'basicForm.status': {
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
if (this.basicForm.id) {
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
}
this.apiMapStatus();
}
}
},
'basicForm.follows': {
handler(v, v1) {
if (v && v1 && JSON.stringify(v) !== JSON.stringify(v1)) {
this.$store.state.apiStatus.set("fromChange", true);
if (this.basicForm.id) {
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
}
this.apiMapStatus();
}
}
},
'basicForm.description': {
handler(v, v1) {
if (v && v1 && v !== v1) {
this.$store.state.apiStatus.set("fromChange", true);
if (this.basicForm.id) {
this.$store.state.apiMap.set(this.basicForm.id, this.$store.state.apiStatus);
}
this.apiMapStatus();
}
}
},
},
methods: {
apiMapStatus() {
this.$store.state.apiStatus.set("fromChange", true);
if (this.httpForm.id) {
this.$store.state.apiMap.set(this.httpForm.id, this.$store.state.apiStatus);
}
},
getMaintainerOptions() {
this.$post('/user/project/member/tester/list', {projectId: getCurrentProjectID()}, response => {
this.maintainerOptions = response.data;