fix(测试计划): 测试计划修改所属项目时的提示问题

This commit is contained in:
shiziyuan9527 2020-09-18 17:04:50 +08:00
parent da23e9cc46
commit 95b722e86c
3 changed files with 22 additions and 10 deletions

@ -1 +1 @@
Subproject commit d5b4969642fd8d10cc2f949d7377e0a0e5217a3a
Subproject commit 321c869938357e8c2253e5bd86c963828664ae23

View File

@ -131,6 +131,7 @@ export default {
stage: '',
description: ''
},
dbProjectIds: [],
rules: {
name: [
{required: true, message: this.$t('test_track.plan.input_plan_name'), trigger: 'blur'},
@ -159,6 +160,7 @@ export default {
let tmp = {};
Object.assign(tmp, testPlan);
Object.assign(this.form, tmp);
this.dbProjectIds = JSON.parse(JSON.stringify(this.form.projectIds));
}
listenGoBack(this.close);
this.dialogFormVisible = true;
@ -176,15 +178,25 @@ export default {
param.workspaceId = localStorage.getItem(WORKSPACE_ID);
if (this.operationType === 'edit') {
this.$confirm('取消项目关联会同时取消该项目下已关联的测试用例', '提示', {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.editTestPlan(param);
}).catch(() => {
this.$info(this.$t('commons.cancel'))
const nowIds = param.projectIds;
let sign = true;
this.dbProjectIds.forEach(dbId => {
if (nowIds.indexOf(dbId) === -1 && sign) {
sign = false;
this.$confirm('取消项目关联会同时取消该项目下已关联的测试用例', '提示', {
confirmButtonText: this.$t('commons.confirm'),
cancelButtonText: this.$t('commons.cancel'),
type: 'warning'
}).then(() => {
this.editTestPlan(param);
}).catch(() => {
this.$info(this.$t('commons.cancel'))
});
}
});
if (sign) {
this.editTestPlan(param);
}
} else {
this.editTestPlan(param);
}

@ -1 +1 @@
Subproject commit 0a375848d034d20eaf05caf11769e1c75c39235c
Subproject commit f2d5a342c82e629f510550d5778d752bb73bf5e7