From 8f261f14b56702d1348f3f76df14682ab536f0d0 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Thu, 20 Oct 2022 14:40:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20MessageBox=E6=98=BE=E7=A4=BA=E5=B1=82?= =?UTF-8?q?=E7=BA=A7=E7=9A=84=E9=94=99=E4=B9=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1018527 --user=陈建星 【测试跟踪】测试计划-接口测试-选择运行环境-通用配置-设置变量-批量删除 https://www.tapd.cn/55049933/s/1269286 --bug=1018315 --user=陈建星 【测试跟踪】测试计划-点击取消关联缺陷无反应 https://www.tapd.cn/55049933/s/1269563 --- .../src/business/automation/scenario/ApiScenarioList.vue | 4 ++-- .../definition/components/import/SwaggerTaskList.vue | 2 +- .../definition/components/list/ApiCaseSimpleList.vue | 4 ++-- .../src/business/definition/components/list/ApiList.vue | 6 +++--- .../business/definition/components/mock/MockConfig.vue | 2 +- .../src/business/definition/components/mock/MockTab.vue | 2 +- .../business/definition/components/mock/TcpMockConfig.vue | 2 +- .../src/business/home/components/ApiRunningTaskList.vue | 2 +- .../src/business/home/components/RunningTaskList.vue | 2 +- .../sdk-parent/frontend/src/business/login/index.vue | 2 +- .../environment/commons/ApiScenarioVariables.vue | 2 +- .../frontend/src/components/personal/ApiKeys.vue | 2 +- framework/sdk-parent/frontend/src/utils/index.js | 6 ++---- .../frontend/src/business/home/EditProject.vue | 2 +- .../src/business/menu/environment/EnvironmentList.vue | 2 +- .../src/business/menu/file/edit/EditFileMetadata.vue | 2 +- .../src/business/menu/file/list/FileMetadataList.vue | 4 ++-- .../src/business/menu/file/quote/QuoteFileList.vue | 4 ++-- .../frontend/src/business/menu/member/Member.vue | 2 +- .../frontend/src/business/menu/user.group/GroupMember.vue | 2 +- .../components/list/ProjectReportList.vue | 2 +- .../frontend/src/business/system/SystemWorkspace.vue | 2 +- .../frontend/src/business/system/group/GroupMember.vue | 2 +- .../frontend/src/business/system/plugin/PluginConfig.vue | 2 +- .../src/business/system/pool/TestResourcePool.vue | 2 +- system-setting/frontend/src/business/system/user/User.vue | 2 +- .../business/workspace/environment/EnvironmentList.vue | 2 +- .../src/business/workspace/project/EditProject.vue | 2 +- .../frontend/src/business/workspace/project/MsProject.vue | 2 +- .../src/business/case/components/TestCaseIssueRelate.vue | 2 +- .../src/business/case/components/TestCaseList.vue | 8 ++++---- .../case/components/public/PublicTestCaseList.vue | 4 ++-- .../src/business/plan/components/TestPlanList.vue | 2 +- 33 files changed, 44 insertions(+), 46 deletions(-) diff --git a/api-test/frontend/src/business/automation/scenario/ApiScenarioList.vue b/api-test/frontend/src/business/automation/scenario/ApiScenarioList.vue index 069c0b673e..a133b786f0 100644 --- a/api-test/frontend/src/business/automation/scenario/ApiScenarioList.vue +++ b/api-test/frontend/src/business/automation/scenario/ApiScenarioList.vue @@ -1090,7 +1090,7 @@ export default { alertMsg += this.$t('api_test.is_continue') + " ?"; } } - operationConfirm(alertMsg, () => { + operationConfirm(this, alertMsg, () => { removeScenarioToGcByBatch(param).then(() => { this.$success(this.$t('commons.delete_success')); this.search(); @@ -1259,7 +1259,7 @@ export default { // 删除提供列表删除和全部版本删除 this.$refs.apiDeleteConfirm.open(row, alertMsg); } else { - operationConfirm(alertMsg, () => { + operationConfirm(this, alertMsg, () => { this._handleDelete(row, false); }); } diff --git a/api-test/frontend/src/business/definition/components/import/SwaggerTaskList.vue b/api-test/frontend/src/business/definition/components/import/SwaggerTaskList.vue index bce57be194..f533535c84 100644 --- a/api-test/frontend/src/business/definition/components/import/SwaggerTaskList.vue +++ b/api-test/frontend/src/business/definition/components/import/SwaggerTaskList.vue @@ -87,7 +87,7 @@ export default { message = this.$t('api_test.home_page.running_task_list.confirm.open_title'); } row.enable = !row.enable; - operationConfirm(message, () => { + operationConfirm(this, message, () => { row.enable = !row.enable this.updateTask(row); }); diff --git a/api-test/frontend/src/business/definition/components/list/ApiCaseSimpleList.vue b/api-test/frontend/src/business/definition/components/list/ApiCaseSimpleList.vue index f160fc79a4..88a94e62ea 100644 --- a/api-test/frontend/src/business/definition/components/list/ApiCaseSimpleList.vue +++ b/api-test/frontend/src/business/definition/components/list/ApiCaseSimpleList.vue @@ -1006,7 +1006,7 @@ export default { alertMsg += this.$t('api_test.is_continue') + " ?"; } } - operationConfirm(alertMsg, () => { + operationConfirm(this, alertMsg, () => { delCaseToGcByParam(obj).then(() => { this.$refs.caseTable.clearSelectRows(); this.initTable(); @@ -1099,7 +1099,7 @@ export default { alertMsg += this.$t('api_test.is_continue') + " ?"; } } - operationConfirm(alertMsg, () => { + operationConfirm(this, alertMsg, () => { deleteToGc(apiCase.id).then(() => { this.$success(this.$t('commons.delete_success')); this.initTable(); diff --git a/api-test/frontend/src/business/definition/components/list/ApiList.vue b/api-test/frontend/src/business/definition/components/list/ApiList.vue index 432b59dffc..77cae65958 100644 --- a/api-test/frontend/src/business/definition/components/list/ApiList.vue +++ b/api-test/frontend/src/business/definition/components/list/ApiList.vue @@ -888,7 +888,7 @@ export default { }, handleDeleteBatch() { if (this.trashEnable) { - operationConfirm(this.$t('api_test.definition.request.delete_confirm') + "?", () => { + operationConfirm(this, this.$t('api_test.definition.request.delete_confirm') + "?", () => { deleteBatchByParams(buildBatchParam(this, this.$refs.table.selectIds)).then(() => { this.$refs.table.clear(); // this.initTable(); @@ -897,7 +897,7 @@ export default { }); }); } else { - operationConfirm(this.$t('api_test.definition.request.delete_confirm') + "?", () => { + operationConfirm(this, this.$t('api_test.definition.request.delete_confirm') + "?", () => { removeToGcByParams(buildBatchParam(this, this.$refs.table.selectIds)).then(() => { this.$refs.table.clear(); this.$emit("refreshTable"); @@ -973,7 +973,7 @@ export default { // 删除提供列表删除和全部版本删除 this.$refs.apiDeleteConfirm.open(api, this.$t('api_test.definition.request.delete_confirm')); } else { - operationConfirm(this.$t('api_test.definition.request.delete_confirm') + ' ' + api.name, () => { + operationConfirm(this, this.$t('api_test.definition.request.delete_confirm') + ' ' + api.name, () => { this._handleDelete(api, false); }); } diff --git a/api-test/frontend/src/business/definition/components/mock/MockConfig.vue b/api-test/frontend/src/business/definition/components/mock/MockConfig.vue index d74834ae4b..554f58615a 100644 --- a/api-test/frontend/src/business/definition/components/mock/MockConfig.vue +++ b/api-test/frontend/src/business/definition/components/mock/MockConfig.vue @@ -221,7 +221,7 @@ export default { }, removeExpect(row) { - operationConfirm(this.$t('api_test.mock.delete_mock_expect'), () => { + operationConfirm(this, this.$t('api_test.mock.delete_mock_expect'), () => { let mockInfoId = row.mockConfigId; delMock(row.id).then(response => { this.cleanMockExpectConfig(); diff --git a/api-test/frontend/src/business/definition/components/mock/MockTab.vue b/api-test/frontend/src/business/definition/components/mock/MockTab.vue index 739064603e..09d1042b7b 100644 --- a/api-test/frontend/src/business/definition/components/mock/MockTab.vue +++ b/api-test/frontend/src/business/definition/components/mock/MockTab.vue @@ -382,7 +382,7 @@ export default { }); }, removeExpect(row) { - operationConfirm(this.$t('api_test.mock.delete_mock_expect'), () => { + operationConfirm(this, this.$t('api_test.mock.delete_mock_expect'), () => { let mockInfoId = row.mockConfigId; delMock(row.id).then(response => { this.refreshMockInfo(mockInfoId); diff --git a/api-test/frontend/src/business/definition/components/mock/TcpMockConfig.vue b/api-test/frontend/src/business/definition/components/mock/TcpMockConfig.vue index a0587b409e..2a227ec1ba 100644 --- a/api-test/frontend/src/business/definition/components/mock/TcpMockConfig.vue +++ b/api-test/frontend/src/business/definition/components/mock/TcpMockConfig.vue @@ -216,7 +216,7 @@ export default { }); }, removeExpect(row) { - operationConfirm(this.$t('api_test.mock.delete_mock_expect'), () => { + operationConfirm(this, this.$t('api_test.mock.delete_mock_expect'), () => { let mockInfoId = row.mockConfigId; delMock(row.id).then(response => { this.cleanMockExpectConfig(); diff --git a/api-test/frontend/src/business/home/components/ApiRunningTaskList.vue b/api-test/frontend/src/business/home/components/ApiRunningTaskList.vue index 1ff595f8df..fc77b6566d 100644 --- a/api-test/frontend/src/business/home/components/ApiRunningTaskList.vue +++ b/api-test/frontend/src/business/home/components/ApiRunningTaskList.vue @@ -138,7 +138,7 @@ export default { closeTaskConfirm(row) { let flag = row.taskStatus; row.taskStatus = !flag; //保持switch点击前的状态 - operationConfirm(this.$t('api_test.home_page.running_task_list.confirm.close_title'), () => { + operationConfirm(this, this.$t('api_test.home_page.running_task_list.confirm.close_title'), () => { this.updateTask(row); }); }, diff --git a/api-test/frontend/src/business/home/components/RunningTaskList.vue b/api-test/frontend/src/business/home/components/RunningTaskList.vue index 3daba4c029..ff9ca2fd43 100644 --- a/api-test/frontend/src/business/home/components/RunningTaskList.vue +++ b/api-test/frontend/src/business/home/components/RunningTaskList.vue @@ -142,7 +142,7 @@ export default { closeTaskConfirm(row) { let flag = row.taskStatus; row.taskStatus = !flag; //保持switch点击前的状态 - operationConfirm(this.$t('api_test.home_page.running_task_list.confirm.close_title'), () => { + operationConfirm(this, this.$t('api_test.home_page.running_task_list.confirm.close_title'), () => { this.updateTask(row); }); }, diff --git a/framework/sdk-parent/frontend/src/business/login/index.vue b/framework/sdk-parent/frontend/src/business/login/index.vue index 2104272193..fcba3915e2 100644 --- a/framework/sdk-parent/frontend/src/business/login/index.vue +++ b/framework/sdk-parent/frontend/src/business/login/index.vue @@ -300,7 +300,7 @@ export default { return; } } - operationConfirm(this.$t('commons.auth_redirect_tip'), () => { + operationConfirm(this, this.$t('commons.auth_redirect_tip'), () => { let config = JSON.parse(source.configuration); let redirectUrl = eval('`' + config.redirectUrl + '`'); let url; diff --git a/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue b/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue index d01c9c839f..4eeb877809 100644 --- a/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue +++ b/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue @@ -244,7 +244,7 @@ export default { }); }, handleDeleteBatch() { - operationConfirm(this.$t('api_test.environment.variables_delete_info') + " ?", () => { + operationConfirm(this, this.$t('api_test.environment.variables_delete_info') + " ?", () => { let ids = this.$refs.variableTable.selectRows; ids.forEach(row => { if (row.name) { diff --git a/framework/sdk-parent/frontend/src/components/personal/ApiKeys.vue b/framework/sdk-parent/frontend/src/components/personal/ApiKeys.vue index d20d3cd9bb..3aa161ff4e 100644 --- a/framework/sdk-parent/frontend/src/components/personal/ApiKeys.vue +++ b/framework/sdk-parent/frontend/src/components/personal/ApiKeys.vue @@ -104,7 +104,7 @@ export default { ) }, deleteApiKey(row) { - operationConfirm(this.$t('user.apikey_delete_confirm'), () => { + operationConfirm(this, this.$t('user.apikey_delete_confirm'), () => { this.result = deleteUserKey(row.id) .then(response => { this.$success(this.$t('commons.delete_success')); diff --git a/framework/sdk-parent/frontend/src/utils/index.js b/framework/sdk-parent/frontend/src/utils/index.js index d968b75eeb..dd8ba21ec4 100644 --- a/framework/sdk-parent/frontend/src/utils/index.js +++ b/framework/sdk-parent/frontend/src/utils/index.js @@ -198,13 +198,11 @@ export function exportPdf(name, canvasList) { } -let confirm = MessageBox.confirm; - -export function operationConfirm(tip, success, cancel) { +export function operationConfirm(v, tip, success, cancel) { if (tip[tip.length - 1] !== '?' && tip[tip.length - 1] !== '?') { tip += '?'; } - return confirm(tip, '', { + return v.$confirm(tip, '', { confirmButtonText: i18n.t('commons.confirm'), cancelButtonText: i18n.t('commons.cancel'), type: 'warning', diff --git a/project-management/frontend/src/business/home/EditProject.vue b/project-management/frontend/src/business/home/EditProject.vue index c3c89f23c6..81b992cd7d 100644 --- a/project-management/frontend/src/business/home/EditProject.vue +++ b/project-management/frontend/src/business/home/EditProject.vue @@ -313,7 +313,7 @@ export default { this.$refs.deleteConfirm.open(project); }, _handleDelete(project) { - operationConfirm(this.$t('project.delete_tip'), () => { + operationConfirm(this, this.$t('project.delete_tip'), () => { deleteProjectById(project.id).then(() => { if (project.id === getCurrentProjectID()) { localStorage.removeItem(PROJECT_ID); diff --git a/project-management/frontend/src/business/menu/environment/EnvironmentList.vue b/project-management/frontend/src/business/menu/environment/EnvironmentList.vue index a3157c7d4a..d040dd2afa 100644 --- a/project-management/frontend/src/business/menu/environment/EnvironmentList.vue +++ b/project-management/frontend/src/business/menu/environment/EnvironmentList.vue @@ -317,7 +317,7 @@ export default { }, deleteEnv(environment) { if (environment.id) { - operationConfirm(this.$t('commons.confirm_delete') + environment.name, () => { + operationConfirm(this, this.$t('commons.confirm_delete') + environment.name, () => { this.loading = delEnvironmentById(environment.id).then(() => { this.$success(this.$t('commons.delete_success')); this.list(); diff --git a/project-management/frontend/src/business/menu/file/edit/EditFileMetadata.vue b/project-management/frontend/src/business/menu/file/edit/EditFileMetadata.vue index d3b6e22378..79f2a56d66 100644 --- a/project-management/frontend/src/business/menu/file/edit/EditFileMetadata.vue +++ b/project-management/frontend/src/business/menu/file/edit/EditFileMetadata.vue @@ -263,7 +263,7 @@ export default { this.$emit("download", this.data); }, deleteData() { - operationConfirm(this.$t('project.file_delete_tip', [this.data.name]), () => { + operationConfirm(this, this.$t('project.file_delete_tip', [this.data.name]), () => { this.close(); this.data.confirm = true; this.$emit("delete", this.data); diff --git a/project-management/frontend/src/business/menu/file/list/FileMetadataList.vue b/project-management/frontend/src/business/menu/file/list/FileMetadataList.vue index abb3d379b5..c52ed686f3 100644 --- a/project-management/frontend/src/business/menu/file/list/FileMetadataList.vue +++ b/project-management/frontend/src/business/menu/file/list/FileMetadataList.vue @@ -389,7 +389,7 @@ export default { }, handleDeleteBatch() { - operationConfirm(this.$t('project.file_delete_tip', [this.$refs.table.selectIds.length + " 条 "]), () => { + operationConfirm(this, this.$t('project.file_delete_tip', [this.$refs.table.selectIds.length + " 条 "]), () => { batchDeleteMetaData(this.$refs.table.selectIds).then(() => { this.$refs.table.clear(); this.$success(this.$t('commons.delete_success')); @@ -407,7 +407,7 @@ export default { }); return; } - operationConfirm(this.$t('project.file_delete_tip', [row.name]), () => { + operationConfirm(this, this.$t('project.file_delete_tip', [row.name]), () => { deleteFileMetaById(row.id).then(() => { this.$success(this.$t('commons.delete_success')); this.getProjectFiles(); diff --git a/project-management/frontend/src/business/menu/file/quote/QuoteFileList.vue b/project-management/frontend/src/business/menu/file/quote/QuoteFileList.vue index 0c4386a3d0..a51aaffada 100644 --- a/project-management/frontend/src/business/menu/file/quote/QuoteFileList.vue +++ b/project-management/frontend/src/business/menu/file/quote/QuoteFileList.vue @@ -265,7 +265,7 @@ export default { }, handleDeleteBatch() { - operationConfirm(this.$t('project.file_delete_tip', [this.$refs.table.selectIds.length + " 条 "]), () => { + operationConfirm(this, this.$t('project.file_delete_tip', [this.$refs.table.selectIds.length + " 条 "]), () => { batchDeleteMetaData(this.$refs.table.selectIds).then(() => { this.$refs.table.clear(); this.$success(this.$t('commons.delete_success')); @@ -274,7 +274,7 @@ export default { }); }, handleDelete(row) { - operationConfirm(this.$t('project.file_delete_tip', [row.name]), () => { + operationConfirm(this, this.$t('project.file_delete_tip', [row.name]), () => { deleteFileMetaById(row.id).then(() => { this.$success(this.$t('commons.delete_success')); this.getProjectFiles(); diff --git a/project-management/frontend/src/business/menu/member/Member.vue b/project-management/frontend/src/business/menu/member/Member.vue index 789546e6b9..ca979cf42f 100644 --- a/project-management/frontend/src/business/menu/member/Member.vue +++ b/project-management/frontend/src/business/menu/member/Member.vue @@ -168,7 +168,7 @@ export default { this.$set(this.form, 'groupIds', groupIds); }, del(row) { - operationConfirm(this.$t('member.remove_member'), () => { + operationConfirm(this, this.$t('member.remove_member'), () => { this.cardLoading = deleteProjectMember(this.projectId, encodeURIComponent(row.id)).then(() => { this.$success(this.$t('commons.remove_success')); this.initTableData(); diff --git a/project-management/frontend/src/business/menu/user.group/GroupMember.vue b/project-management/frontend/src/business/menu/user.group/GroupMember.vue index 05173b262c..1d3e518c96 100644 --- a/project-management/frontend/src/business/menu/user.group/GroupMember.vue +++ b/project-management/frontend/src/business/menu/user.group/GroupMember.vue @@ -262,7 +262,7 @@ export default { }) }, removeMember(row) { - operationConfirm(this.$t('member.remove_member'), () => { + operationConfirm(this, this.$t('member.remove_member'), () => { if (this.initUserUrl === 'user/ws/current/member/list') { if (row.id === getCurrentUserId()) { this.$warning(this.$t('group.unable_to_remove_current_member')); diff --git a/report-stat/frontend/src/business/enterprisereport/components/list/ProjectReportList.vue b/report-stat/frontend/src/business/enterprisereport/components/list/ProjectReportList.vue index 5b32e3ed90..fc219e795e 100644 --- a/report-stat/frontend/src/business/enterprisereport/components/list/ProjectReportList.vue +++ b/report-stat/frontend/src/business/enterprisereport/components/list/ProjectReportList.vue @@ -203,7 +203,7 @@ export default { let param = {id: row.scheduleId, enable: row.scheduleIsOpen}; row.scheduleIsOpen = !row.scheduleIsOpen; - operationConfirm(titles, () => { + operationConfirm(this, titles, () => { row.scheduleIsOpen = !row.scheduleIsOpen; this.updateTask(param); }); diff --git a/system-setting/frontend/src/business/system/SystemWorkspace.vue b/system-setting/frontend/src/business/system/SystemWorkspace.vue index d2805d106a..8f2ace32ff 100644 --- a/system-setting/frontend/src/business/system/SystemWorkspace.vue +++ b/system-setting/frontend/src/business/system/SystemWorkspace.vue @@ -408,7 +408,7 @@ export default { this.$refs.deleteConfirm.open(workspace); }, _handleDelete(workspace) { - operationConfirm(this.$t('workspace.delete_confirm'), () => { + operationConfirm(this, this.$t('workspace.delete_confirm'), () => { this.loading = delWorkspaceSpecial(workspace.id).then(() => { this.$success(this.$t('commons.delete_success')); this.list(); diff --git a/system-setting/frontend/src/business/system/group/GroupMember.vue b/system-setting/frontend/src/business/system/group/GroupMember.vue index 8515cef9c5..876d7b8fad 100644 --- a/system-setting/frontend/src/business/system/group/GroupMember.vue +++ b/system-setting/frontend/src/business/system/group/GroupMember.vue @@ -258,7 +258,7 @@ export default { }) }, removeMember(row) { - operationConfirm(this.$t('member.remove_member'), () => { + operationConfirm(this, this.$t('member.remove_member'), () => { if (this.initUserUrl === 'user/ws/current/member/list') { if (row.id === getCurrentUserId()) { this.$warning(this.$t('group.unable_to_remove_current_member')); diff --git a/system-setting/frontend/src/business/system/plugin/PluginConfig.vue b/system-setting/frontend/src/business/system/plugin/PluginConfig.vue index 911cc47a76..bf6b83d497 100644 --- a/system-setting/frontend/src/business/system/plugin/PluginConfig.vue +++ b/system-setting/frontend/src/business/system/plugin/PluginConfig.vue @@ -132,7 +132,7 @@ export default { this.$refs.scriptView.open(row.scriptId); }, handleDelete(id) { - operationConfirm(this.$t('api_test.jar_config.delete_tip'), () => { + operationConfirm(this, this.$t('api_test.jar_config.delete_tip'), () => { this.loading = delPluginById(id).then(() => { this.$success(this.$t('commons.delete_success')); this.initPlugins(); diff --git a/system-setting/frontend/src/business/system/pool/TestResourcePool.vue b/system-setting/frontend/src/business/system/pool/TestResourcePool.vue index 10e578b3d1..4734c2fa38 100644 --- a/system-setting/frontend/src/business/system/pool/TestResourcePool.vue +++ b/system-setting/frontend/src/business/system/pool/TestResourcePool.vue @@ -474,7 +474,7 @@ export default { this.infoList = resources; }, del(row) { - operationConfirm(this.$t('test_resource_pool.delete_prompt'), () => { + operationConfirm(this, this.$t('test_resource_pool.delete_prompt'), () => { this.loading = delResourcePoolById(row.id).then(() => { this.initTableData(); this.$success(this.$t('commons.delete_success')); diff --git a/system-setting/frontend/src/business/system/user/User.vue b/system-setting/frontend/src/business/system/user/User.vue index 92cf1dc244..052c5ffa26 100644 --- a/system-setting/frontend/src/business/system/user/User.vue +++ b/system-setting/frontend/src/business/system/user/User.vue @@ -290,7 +290,7 @@ export default { listenGoBack(this.handleClose); }, del(row) { - operationConfirm(this.$t('user.delete_confirm'), () => { + operationConfirm(this, this.$t('user.delete_confirm'), () => { this.loading = specialDeleteUserById(encodeURIComponent(row.id)).then(() => { this.$success(this.$t('commons.delete_success')); this.search(); diff --git a/system-setting/frontend/src/business/workspace/environment/EnvironmentList.vue b/system-setting/frontend/src/business/workspace/environment/EnvironmentList.vue index 71e7757ece..c0e261c0ed 100644 --- a/system-setting/frontend/src/business/workspace/environment/EnvironmentList.vue +++ b/system-setting/frontend/src/business/workspace/environment/EnvironmentList.vue @@ -344,7 +344,7 @@ export default { }, deleteEnv(environment) { if (environment.id) { - operationConfirm(this.$t('commons.confirm_delete') + environment.name, () => { + operationConfirm(this, this.$t('commons.confirm_delete') + environment.name, () => { this.loading = delEnvironmentById(environment.id).then(() => { this.$success(this.$t('commons.delete_success')); this.list(); diff --git a/system-setting/frontend/src/business/workspace/project/EditProject.vue b/system-setting/frontend/src/business/workspace/project/EditProject.vue index b155d07a67..79c67bf0b9 100644 --- a/system-setting/frontend/src/business/workspace/project/EditProject.vue +++ b/system-setting/frontend/src/business/workspace/project/EditProject.vue @@ -315,7 +315,7 @@ export default { this.$refs.deleteConfirm.open(project); }, _handleDelete(project) { - operationConfirm(this.$t('project.delete_tip'), () => { + operationConfirm(this, this.$t('project.delete_tip'), () => { deleteProjectById(project.id).then(() => { if (project.id === getCurrentProjectID()) { localStorage.removeItem(PROJECT_ID); diff --git a/system-setting/frontend/src/business/workspace/project/MsProject.vue b/system-setting/frontend/src/business/workspace/project/MsProject.vue index c0752344ca..f7914a9885 100644 --- a/system-setting/frontend/src/business/workspace/project/MsProject.vue +++ b/system-setting/frontend/src/business/workspace/project/MsProject.vue @@ -344,7 +344,7 @@ export default { this.$refs.deleteConfirm.open(project); }, _handleDelete(project) { - operationConfirm(this.$t('project.delete_tip'), () => { + operationConfirm(this, this.$t('project.delete_tip'), () => { delProjectById(project.id).then(() => { if (project.id === getCurrentProjectID()) { localStorage.removeItem(PROJECT_ID); diff --git a/test-track/frontend/src/business/case/components/TestCaseIssueRelate.vue b/test-track/frontend/src/business/case/components/TestCaseIssueRelate.vue index 8afe087c24..d9e9f525cf 100644 --- a/test-track/frontend/src/business/case/components/TestCaseIssueRelate.vue +++ b/test-track/frontend/src/business/case/components/TestCaseIssueRelate.vue @@ -250,7 +250,7 @@ export default { } }, deleteIssue(row) { - operationConfirm(this.$t('test_track.issue.delete_warning'), () => { + operationConfirm(this, this.$t('test_track.issue.delete_warning'), () => { this.page.result.loading = true; deleteIssueRelate({ id: row.id, diff --git a/test-track/frontend/src/business/case/components/TestCaseList.vue b/test-track/frontend/src/business/case/components/TestCaseList.vue index f911f5d8c4..948a349e1d 100644 --- a/test-track/frontend/src/business/case/components/TestCaseList.vue +++ b/test-track/frontend/src/business/case/components/TestCaseList.vue @@ -793,7 +793,7 @@ export default { }); }, handleDelete(testCase) { - operationConfirm(this.$t('test_track.case.delete_confirm') + '\'' + testCase.name + '\'', () => { + operationConfirm(this, this.$t('test_track.case.delete_confirm') + '\'' + testCase.name + '\'', () => { this._handleDelete(testCase); }); }, @@ -815,7 +815,7 @@ export default { // 删除提供列表删除和全部版本删除 this.$refs.apiDeleteConfirm.open(testCase, this.$t('test_track.case.delete_confirm')); } else { - operationConfirm(this.$t('test_track.case.delete_confirm') + '\'' + testCase.name + '\'', () => { + operationConfirm(this, this.$t('test_track.case.delete_confirm') + '\'' + testCase.name + '\'', () => { this._handleDeleteVersion(testCase, false); }); } @@ -831,7 +831,7 @@ export default { }); }, handleDeleteBatch() { - operationConfirm(this.$t('test_track.case.delete_confirm'), () => { + operationConfirm(this, this.$t('test_track.case.delete_confirm'), () => { let param = buildBatchParam(this, this.$refs.table.selectIds); testCaseBatchDelete(param) .then(() => { @@ -854,7 +854,7 @@ export default { }); }, handleDeleteBatchToGc() { - operationConfirm(this.$t('test_track.case.delete_confirm'), () => { + operationConfirm(this, this.$t('test_track.case.delete_confirm'), () => { let param = buildBatchParam(this, this.$refs.table.selectIds); testCaseBatchDeleteToGc(param) .then(() => { diff --git a/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue b/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue index 7a5c72168d..eb0497576e 100644 --- a/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue +++ b/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue @@ -423,7 +423,7 @@ export default { // 删除提供列表删除和全部版本删除 this.$refs.apiDeleteConfirm.open(testCase, this.$t('test_track.case.delete_confirm')); } else { - operationConfirm(this.$t('test_track.case.delete_confirm') + '\'' + testCase.name + '\'', () => { + operationConfirm(this, this.$t('test_track.case.delete_confirm') + '\'' + testCase.name + '\'', () => { this._handleDeleteVersion(testCase, false); }); } @@ -486,7 +486,7 @@ export default { this.$emit('refreshAll'); }, handleDeleteBatchToPublic() { - operationConfirm(this.$t('test_track.case.delete_confirm'), () => { + operationConfirm(this, this.$t('test_track.case.delete_confirm'), () => { let param = buildBatchParam(this, this.$refs.table.selectIds); testCasePublicBatchDeleteToGc(param) .then(() => { diff --git a/test-track/frontend/src/business/plan/components/TestPlanList.vue b/test-track/frontend/src/business/plan/components/TestPlanList.vue index 7199130cd8..2d17cbcf5e 100644 --- a/test-track/frontend/src/business/plan/components/TestPlanList.vue +++ b/test-track/frontend/src/business/plan/components/TestPlanList.vue @@ -707,7 +707,7 @@ export default { message = this.$t('api_test.home_page.running_task_list.confirm.open_title'); } - operationConfirm(message, () => { + operationConfirm(this, message, () => { this.cardLoading = true; testPlanUpdateScheduleEnable(param) .then(response => {