fix: 修复删除的时候开源版报错的问题

This commit is contained in:
CaptainB 2022-01-25 20:17:41 +08:00 committed by zhangdahai112
parent cf07ddc580
commit cefaaeadd6
4 changed files with 33 additions and 4 deletions

View File

@ -1151,8 +1151,16 @@ export default {
// //
this.$refs.apiDeleteConfirm.open(row, alertMsg); this.$refs.apiDeleteConfirm.open(row, alertMsg);
} else { } else {
this.$alert(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

@ -818,8 +818,15 @@ export default {
// //
this.$refs.apiDeleteConfirm.open(api, this.$t('api_test.definition.request.delete_confirm')); this.$refs.apiDeleteConfirm.open(api, this.$t('api_test.definition.request.delete_confirm'));
} else { } else {
this.$alert(this.$t('api_test.definition.request.delete_confirm') + ' ' + api.name + " ", '', {
confirmButtonText: this.$t('commons.confirm'),
callback: (action) => {
if (action === 'confirm') {
this._handleDelete(api, false); this._handleDelete(api, false);
} }
}
});
}
}, },
_handleDelete(api, deleteCurrentVersion) { _handleDelete(api, deleteCurrentVersion) {
// //

View File

@ -260,8 +260,15 @@ export default {
// //
this.$refs.apiDeleteConfirm.open(test, this.$t('load_test.delete_confirm')); this.$refs.apiDeleteConfirm.open(test, this.$t('load_test.delete_confirm'));
} else { } else {
this.$alert(this.$t('load_test.delete_confirm') + test.name + "", '', {
confirmButtonText: this.$t('commons.confirm'),
callback: (action) => {
if (action === 'confirm') {
this._handleDelete(test, false); this._handleDelete(test, false);
} }
}
});
}
}, },
_handleDelete(test, deleteCurrentVersion) { _handleDelete(test, deleteCurrentVersion) {
if (deleteCurrentVersion) { if (deleteCurrentVersion) {

View File

@ -901,8 +901,15 @@ export default {
// //
this.$refs.apiDeleteConfirm.open(testCase, this.$t('test_track.case.delete_confirm')); this.$refs.apiDeleteConfirm.open(testCase, this.$t('test_track.case.delete_confirm'));
} else { } else {
this.$alert(this.$t('test_track.case.delete_confirm') + '\'' + testCase.name + '\'' + "", '', {
confirmButtonText: this.$t('commons.confirm'),
callback: (action) => {
if (action === 'confirm') {
this._handleDeleteVersion(testCase, false); this._handleDeleteVersion(testCase, false);
} }
}
});
}
}, },
batchReduction() { batchReduction() {
let param = buildBatchParam(this, this.$refs.table.selectIds); let param = buildBatchParam(this, this.$refs.table.selectIds);