fix: MessageBox显示层级的错乱

--bug=1018527 --user=陈建星 【测试跟踪】测试计划-接口测试-选择运行环境-通用配置-设置变量-批量删除 https://www.tapd.cn/55049933/s/1269286
--bug=1018315 --user=陈建星 【测试跟踪】测试计划-点击取消关联缺陷无反应 https://www.tapd.cn/55049933/s/1269563
This commit is contained in:
chenjianxing 2022-10-20 14:40:55 +08:00 committed by jianxing
parent 2060d78fba
commit 8f261f14b5
33 changed files with 44 additions and 46 deletions

View File

@ -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);
});
}

View File

@ -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);
});

View File

@ -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();

View File

@ -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);
});
}

View File

@ -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();

View File

@ -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);

View File

@ -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();

View File

@ -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);
});
},

View File

@ -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);
});
},

View File

@ -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;

View File

@ -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) {

View File

@ -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'));

View File

@ -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',

View File

@ -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);

View File

@ -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();

View File

@ -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);

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -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'));

View File

@ -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);
});

View File

@ -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();

View File

@ -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'));

View File

@ -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();

View File

@ -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'));

View File

@ -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();

View File

@ -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();

View File

@ -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);

View File

@ -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);

View File

@ -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,

View File

@ -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(() => {

View File

@ -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(() => {

View File

@ -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 => {