feat: 删除按钮增加确认弹框
This commit is contained in:
parent
670fcfbae4
commit
b9b95d63d8
|
@ -623,12 +623,19 @@
|
|||
this.$refs.tag.open();
|
||||
},
|
||||
remove(row, node) {
|
||||
const parent = node.parent
|
||||
const hashTree = parent.data.hashTree || parent.data;
|
||||
const index = hashTree.findIndex(d => d.resourceId != undefined && row.resourceId != undefined && d.resourceId === row.resourceId)
|
||||
hashTree.splice(index, 1);
|
||||
this.sort();
|
||||
this.reload();
|
||||
this.$alert(this.$t('api_test.definition.request.delete_confirm') + ' ' + row.name + " ?", '', {
|
||||
confirmButtonText: this.$t('commons.confirm'),
|
||||
callback: (action) => {
|
||||
if (action === 'confirm') {
|
||||
const parent = node.parent
|
||||
const hashTree = parent.data.hashTree || parent.data;
|
||||
const index = hashTree.findIndex(d => d.resourceId != undefined && row.resourceId != undefined && d.resourceId === row.resourceId)
|
||||
hashTree.splice(index, 1);
|
||||
this.sort();
|
||||
this.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
,
|
||||
copyRow(row, node) {
|
||||
|
|
|
@ -140,10 +140,18 @@
|
|||
methods: {
|
||||
|
||||
deleteCase(index, row) {
|
||||
this.$get('/api/testcase/delete/' + row.id, () => {
|
||||
this.$success(this.$t('commons.delete_success'));
|
||||
this.$emit('refresh');
|
||||
this.$alert(this.$t('api_test.definition.request.delete_confirm') + ' ' + row.name + " ?", '', {
|
||||
confirmButtonText: this.$t('commons.confirm'),
|
||||
callback: (action) => {
|
||||
if (action === 'confirm') {
|
||||
this.$get('/api/testcase/delete/' + row.id, () => {
|
||||
this.$success(this.$t('commons.delete_success'));
|
||||
this.$emit('refresh');
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
singleRun(data) {
|
||||
this.$emit('singleRun', data);
|
||||
|
|
Loading…
Reference in New Issue