refactor(接口测试): 优化接口用例未保存提示

--story=1012512 --user=王孝刚 新建接口case优化
https://www.tapd.cn/55049933/s/1397203
This commit is contained in:
wxg0103 2023-07-25 15:23:58 +08:00 committed by fit2-zhao
parent 848a3589ed
commit 2877049e62
2 changed files with 6 additions and 8 deletions

View File

@ -349,7 +349,6 @@ export default {
beforeUpdateRequest: {}, beforeUpdateRequest: {},
compare: [], compare: [],
isSave: false, isSave: false,
tagCount: 0,
requestCount: 0, requestCount: 0,
readonly: false, readonly: false,
noShowSyncRuleRelation: false, noShowSyncRuleRelation: false,
@ -463,20 +462,20 @@ export default {
}, },
}, },
'apiCase.tags': { 'apiCase.tags': {
handler(v) { handler(v, v1) {
this.tagCount++; if (v1) {
if (this.tagCount > 2) {
this.saveStatus(); this.saveStatus();
} }
}, }
}, },
'apiCase.request': { 'apiCase.request': {
handler(v) { handler(v) {
this.requestCount++; this.requestCount++;
if (this.requestCount > 1) { if (this.requestCount > 2) {
this.saveStatus(); this.saveStatus();
} }
}, },
deep: true
}, },
'caseSyncRuleRelation.showUpdateRule': { 'caseSyncRuleRelation.showUpdateRule': {
handler(v) { handler(v) {
@ -747,7 +746,6 @@ export default {
row.updateUser = getCurrentUser().name; row.updateUser = getCurrentUser().name;
row.type = null; row.type = null;
this.$success(this.$t('commons.save_success')); this.$success(this.$t('commons.save_success'));
this.tagCount = 0;
this.requestCount = 0; this.requestCount = 0;
this.reload(); this.reload();
this.isSave = false; this.isSave = false;

View File

@ -303,7 +303,7 @@ export default {
apiCaseClose() { apiCaseClose() {
if (this.apiCaseList && this.apiCaseList.length > 0) { if (this.apiCaseList && this.apiCaseList.length > 0) {
let message = ''; let message = '';
if (store.apiCaseMap.has(this.apiCaseList[0].id) && store.apiCaseMap.get(this.apiCaseList[0].id) > 1) { if (store.apiCaseMap.has(this.apiCaseList[0].id) && store.apiCaseMap.get(this.apiCaseList[0].id) > 0) {
message += this.apiCaseList[0].name + ''; message += this.apiCaseList[0].name + '';
} }
if (this.apiCaseList[0].type === 'AddCase') { if (this.apiCaseList[0].type === 'AddCase') {