From b9b95d63d82a5095a4173352869a968541202223 Mon Sep 17 00:00:00 2001 From: wenyann <64353056+wenyann@users.noreply.github.com> Date: Mon, 4 Jan 2021 14:13:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=A0=E9=99=A4=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A1=AE=E8=AE=A4=E5=BC=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../automation/scenario/EditApiScenario.vue | 19 +++++++++++++------ .../components/case/ApiCaseItem.vue | 14 +++++++++++--- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue index 7339386fa3..0fcd3a79ab 100644 --- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue @@ -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) { diff --git a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue index 9585e3dee7..7db0d7ff40 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue @@ -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);