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'), removeScenarioToGcByBatch(param).then(() => {
cancelButtonText: this.$t('commons.cancel'), this.$success(this.$t('commons.delete_success'));
callback: (action) => { this.search();
if (action === 'confirm') { });
removeScenarioToGcByBatch(param).then(() => {
this.$success(this.$t('commons.delete_success'));
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'), this._handleDelete(row, false);
cancelButtonText: this.$t('commons.cancel'),
callback: (action) => {
if (action === 'confirm') {
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, '', { delCaseToGcByParam(obj).then(() => {
confirmButtonText: this.$t('commons.confirm'), this.$refs.caseTable.clearSelectRows();
callback: (action) => { this.initTable();
if (action === 'confirm') { this.$success(this.$t('commons.delete_success'));
delCaseToGcByParam(obj).then(() => { this.$emit('refreshTable');
this.$refs.caseTable.clearSelectRows(); });
this.initTable();
this.$success(this.$t('commons.delete_success'));
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, '', { deleteToGc(apiCase.id).then(() => {
confirmButtonText: this.$t('commons.confirm'), this.$success(this.$t('commons.delete_success'));
callback: (action) => { this.initTable();
if (action === 'confirm') { this.$emit("refreshTree");
deleteToGc(apiCase.id).then(() => { this.$emit('refreshTable');
this.$success(this.$t('commons.delete_success')); });
this.initTable();
this.$emit("refreshTree");
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'), deleteBatchByParams(buildBatchParam(this, this.$refs.table.selectIds)).then(() => {
callback: (action) => { this.$refs.table.clear();
if (action === 'confirm') { // this.initTable();
deleteBatchByParams(buildBatchParam(this, this.$refs.table.selectIds)).then(() => { this.$emit("refreshTable");
this.$refs.table.clear(); this.$success(this.$t('commons.delete_success'));
// this.initTable(); });
this.$emit("refreshTable");
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'), removeToGcByParams(buildBatchParam(this, this.$refs.table.selectIds)).then(() => {
callback: (action) => { this.$refs.table.clear();
if (action === 'confirm') { this.$emit("refreshTable");
removeToGcByParams(buildBatchParam(this, this.$refs.table.selectIds)).then(() => { this.$success(this.$t('commons.delete_success'));
this.$refs.table.clear(); this.$refs.caseList.apiCaseClose();
this.$emit("refreshTable"); });
this.$success(this.$t('commons.delete_success'));
this.$refs.caseList.apiCaseClose();
});
}
}
}); });
} }
}, },

View File

@ -244,22 +244,17 @@ 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'), let ids = this.$refs.variableTable.selectRows;
callback: (action) => { ids.forEach(row => {
if (action === 'confirm') { if (row.name) {
let ids = this.$refs.variableTable.selectRows; const index = this.variables.findIndex(d => d.name === row.name);
ids.forEach(row => { this.variables.splice(index, 1);
if (row.name) {
const index = this.variables.findIndex(d => d.name === row.name);
this.variables.splice(index, 1);
}
});
this.sortParameters();
this.$refs.variableTable.cancelCurrentRow();
this.$refs.variableTable.clear();
} }
} });
this.sortParameters();
this.$refs.variableTable.cancelCurrentRow();
this.$refs.variableTable.clear();
}); });
}, },
filter() { filter() {