fix(接口定义): 修复场景无法删除的缺陷

--bug=1018109 --user=王孝刚 【接口测试】接口场景无法删除
https://www.tapd.cn/55049933/s/1262459
This commit is contained in:
wxg0103 2022-10-15 14:44:18 +08:00 committed by wxg0103
parent 58764e4838
commit 9c8008d0b3
4 changed files with 45 additions and 84 deletions

View File

@ -1090,17 +1090,11 @@ export default {
alertMsg += this.$t('api_test.is_continue') + " "; alertMsg += this.$t('api_test.is_continue') + " ";
} }
} }
operationConfirm(alertMsg, '', { operationConfirm(alertMsg, () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
callback: (action) => {
if (action === 'confirm') {
removeScenarioToGcByBatch(param).then(() => { removeScenarioToGcByBatch(param).then(() => {
this.$success(this.$t('commons.delete_success')); this.$success(this.$t('commons.delete_success'));
this.search(); this.search();
}); });
}
}
}); });
}); });
} }
@ -1265,14 +1259,8 @@ export default {
// //
this.$refs.apiDeleteConfirm.open(row, alertMsg); this.$refs.apiDeleteConfirm.open(row, alertMsg);
} else { } else {
operationConfirm(alertMsg, '', { operationConfirm(alertMsg, () => {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
callback: (action) => {
if (action === 'confirm') {
this._handleDelete(row, false); this._handleDelete(row, false);
}
}
}); });
} }
}); });

View File

@ -1005,19 +1005,13 @@ export default {
alertMsg += this.$t('api_test.is_continue') + " "; alertMsg += this.$t('api_test.is_continue') + " ";
} }
} }
operationConfirm(alertMsg, () => {
operationConfirm(alertMsg, '', {
confirmButtonText: this.$t('commons.confirm'),
callback: (action) => {
if (action === 'confirm') {
delCaseToGcByParam(obj).then(() => { delCaseToGcByParam(obj).then(() => {
this.$refs.caseTable.clearSelectRows(); this.$refs.caseTable.clearSelectRows();
this.initTable(); this.initTable();
this.$success(this.$t('commons.delete_success')); this.$success(this.$t('commons.delete_success'));
this.$emit('refreshTable'); this.$emit('refreshTable');
}); });
}
}
}); });
}); });
}, },
@ -1104,19 +1098,13 @@ export default {
alertMsg += this.$t('api_test.is_continue') + " "; alertMsg += this.$t('api_test.is_continue') + " ";
} }
} }
operationConfirm(alertMsg, () => {
operationConfirm(alertMsg, '', {
confirmButtonText: this.$t('commons.confirm'),
callback: (action) => {
if (action === 'confirm') {
deleteToGc(apiCase.id).then(() => { deleteToGc(apiCase.id).then(() => {
this.$success(this.$t('commons.delete_success')); this.$success(this.$t('commons.delete_success'));
this.initTable(); this.initTable();
this.$emit("refreshTree"); this.$emit("refreshTree");
this.$emit('refreshTable'); this.$emit('refreshTable');
}); });
}
}
}); });
}); });
}, },

View File

@ -900,32 +900,22 @@ export default {
}, },
handleDeleteBatch() { handleDeleteBatch() {
if (this.trashEnable) { if (this.trashEnable) {
operationConfirm(this.$t('api_test.definition.request.delete_confirm') + "", '', { operationConfirm(this.$t('api_test.definition.request.delete_confirm') + "", () => {
confirmButtonText: this.$t('commons.confirm'),
callback: (action) => {
if (action === 'confirm') {
deleteBatchByParams(buildBatchParam(this, this.$refs.table.selectIds)).then(() => { deleteBatchByParams(buildBatchParam(this, this.$refs.table.selectIds)).then(() => {
this.$refs.table.clear(); this.$refs.table.clear();
// this.initTable(); // this.initTable();
this.$emit("refreshTable"); this.$emit("refreshTable");
this.$success(this.$t('commons.delete_success')); this.$success(this.$t('commons.delete_success'));
}); });
}
}
}); });
} else { } else {
operationConfirm(this.$t('api_test.definition.request.delete_confirm') + "", '', { operationConfirm(this.$t('api_test.definition.request.delete_confirm') + "", () => {
confirmButtonText: this.$t('commons.confirm'),
callback: (action) => {
if (action === 'confirm') {
removeToGcByParams(buildBatchParam(this, this.$refs.table.selectIds)).then(() => { removeToGcByParams(buildBatchParam(this, this.$refs.table.selectIds)).then(() => {
this.$refs.table.clear(); this.$refs.table.clear();
this.$emit("refreshTable"); this.$emit("refreshTable");
this.$success(this.$t('commons.delete_success')); this.$success(this.$t('commons.delete_success'));
this.$refs.caseList.apiCaseClose(); this.$refs.caseList.apiCaseClose();
}); });
}
}
}); });
} }
}, },

View File

@ -244,10 +244,7 @@ export default {
}); });
}, },
handleDeleteBatch() { handleDeleteBatch() {
operationConfirm(this.$t('api_test.environment.variables_delete_info') + ' ' + " ", '', { operationConfirm(this.$t('api_test.environment.variables_delete_info') + " ", () => {
confirmButtonText: this.$t('commons.confirm'),
callback: (action) => {
if (action === 'confirm') {
let ids = this.$refs.variableTable.selectRows; let ids = this.$refs.variableTable.selectRows;
ids.forEach(row => { ids.forEach(row => {
if (row.name) { if (row.name) {
@ -258,8 +255,6 @@ export default {
this.sortParameters(); this.sortParameters();
this.$refs.variableTable.cancelCurrentRow(); this.$refs.variableTable.cancelCurrentRow();
this.$refs.variableTable.clear(); this.$refs.variableTable.clear();
}
}
}); });
}, },
filter() { filter() {