diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java index 9961681125..410e2c568c 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java @@ -127,7 +127,7 @@ public class TestPlanService { @Resource private ApiScenarioMapper apiScenarioMapper; - public synchronized void addTestPlan(AddTestPlanRequest testPlan) { + public synchronized String addTestPlan(AddTestPlanRequest testPlan) { if (getTestPlanByName(testPlan.getName()).size() > 0) { MSException.throwException(Translator.get("plan_name_already_exists")); } @@ -156,6 +156,7 @@ public class TestPlanService { .event(NoticeConstants.Event.CREATE) .build(); noticeSendService.send(NoticeConstants.TaskType.TEST_PLAN_TASK, noticeModel); + return testPlan.getId(); } public List getTestPlanByName(String name) { diff --git a/frontend/src/business/components/track/plan/components/TestPlanEdit.vue b/frontend/src/business/components/track/plan/components/TestPlanEdit.vue index 7e9966d138..525236deda 100644 --- a/frontend/src/business/components/track/plan/components/TestPlanEdit.vue +++ b/frontend/src/business/components/track/plan/components/TestPlanEdit.vue @@ -109,6 +109,9 @@ @click="savePlan"> {{ $t('test_track.confirm') }} + + {{ $t('test_track.planning_execution') }} + @@ -170,6 +173,33 @@ export default { listenGoBack(this.close); this.dialogFormVisible = true; }, + testPlanInfo() { + this.$refs['planFrom'].validate((valid) => { + if (valid) { + let param = {}; + Object.assign(param, this.form); + param.name = param.name.trim(); + if (param.name === '') { + this.$warning(this.$t('test_track.plan.input_plan_name')); + return; + } + param.workspaceId = localStorage.getItem(WORKSPACE_ID); + if (this.form.tags instanceof Array) { + this.form.tags = JSON.stringify(this.form.tags); + } + param.tags = this.form.tags; + this.$post('/test/plan/' + this.operationType, param, response => { + this.$success(this.$t('commons.save_success')); + this.dialogFormVisible = false; + this.$router.push('/track/plan/view/' + response.data); + // 发送广播,刷新 head 上的最新列表 + TrackEvent.$emit(LIST_CHANGE); + }); + } else { + return false; + } + }); + }, savePlan() { this.$refs['planFrom'].validate((valid) => { if (valid) { diff --git a/frontend/src/business/components/track/plan/components/TestPlanList.vue b/frontend/src/business/components/track/plan/components/TestPlanList.vue index 70e57c609e..5848071fb4 100644 --- a/frontend/src/business/components/track/plan/components/TestPlanList.vue +++ b/frontend/src/business/components/track/plan/components/TestPlanList.vue @@ -3,9 +3,9 @@