菜单栏创建测试计划

This commit is contained in:
chenjianxing 2020-04-08 16:27:24 +08:00
parent 54201699a4
commit b64fa89e0c
6 changed files with 22 additions and 7 deletions

View File

@ -214,7 +214,7 @@ const router = new VueRouter({
component: TestCase, component: TestCase,
}, },
{ {
path: "plan/:projectId", path: "plan/:type",
name: "testPlan", name: "testPlan",
component: TestPlan component: TestPlan
}, },

View File

@ -88,6 +88,7 @@
} }
if (path.indexOf("/track/case/edit") >= 0){ if (path.indexOf("/track/case/edit") >= 0){
this.openRecentTestCaseEditDialog(); this.openRecentTestCaseEditDialog();
this.$router.push('/track/case/all');
} }
} }
}, },

View File

@ -31,9 +31,6 @@
<span style="padding-left: 5px;">{{$t('test_track.case_list')}}</span> <span style="padding-left: 5px;">{{$t('test_track.case_list')}}</span>
</el-menu-item> </el-menu-item>
<el-menu-item :index="testCaseEditPath" class="blank_item"></el-menu-item> <el-menu-item :index="testCaseEditPath" class="blank_item"></el-menu-item>
<!--<el-menu-item :index="'/' + beaseUrl + '/case/create'">-->
<!--<el-button type="text">{{$t('test_track.create_case')}}</el-button>-->
<!--</el-menu-item>-->
</el-submenu> </el-submenu>
<el-submenu v-if="isCurrentWorkspaceUser" <el-submenu v-if="isCurrentWorkspaceUser"

View File

@ -25,6 +25,20 @@
return { return {
} }
}, },
mounted() {
if (this.$route.path.indexOf("/track/plan/create") >= 0){
this.openTestPlanEditDialog();
this.$router.push('/track/plan/all');
}
},
watch: {
'$route'(to, from) {
if (to.path.indexOf("/track/plan/create") >= 0){
this.openTestPlanEditDialog();
this.$router.push('/track/plan/all');
}
}
},
methods: { methods: {
openTestPlanEditDialog(data) { openTestPlanEditDialog(data) {
this.$refs.testPlanEditDialog.openTestPlanEditDialog(data); this.$refs.testPlanEditDialog.openTestPlanEditDialog(data);

View File

@ -13,19 +13,20 @@
<test-case-plan-list <test-case-plan-list
@openTestCaseRelevanceDialog="openTestCaseRelevanceDialog" @openTestCaseRelevanceDialog="openTestCaseRelevanceDialog"
@editTestPlanTestCase="editTestPlanTestCase" @editTestPlanTestCase="editTestPlanTestCase"
@refresh="refresh"
:plan-id="planId" :plan-id="planId"
ref="testCasePlanList"></test-case-plan-list> ref="testCasePlanList"></test-case-plan-list>
</el-main> </el-main>
</el-container> </el-container>
<test-case-relevance <test-case-relevance
@refresh="getPlanCases" @refresh="refresh"
:plan-id="planId" :plan-id="planId"
ref="testCaseRelevance"></test-case-relevance> ref="testCaseRelevance"></test-case-relevance>
<test-plan-test-case-edit <test-plan-test-case-edit
ref="testPlanTestCaseEdit" ref="testPlanTestCaseEdit"
@refresh="getPlanCases"> @refresh="refresh">
</test-plan-test-case-edit> </test-plan-test-case-edit>
@ -65,7 +66,8 @@
}, },
methods: { methods: {
refresh() { refresh() {
this.getPlanCases();
this.getNodeTreeByPlanId();
}, },
getPlanCases(nodeIds) { getPlanCases(nodeIds) {
this.$refs.testCasePlanList.initTableData(nodeIds); this.$refs.testCasePlanList.initTableData(nodeIds);

View File

@ -211,6 +211,7 @@
let testCaseId = testCase.id; let testCaseId = testCase.id;
this.$post('/test/plan/case/delete/' + testCaseId, {}, () => { this.$post('/test/plan/case/delete/' + testCaseId, {}, () => {
this.initTableData(); this.initTableData();
this.$emit("refresh");
this.$message({ this.$message({
message: this.$t('commons.delete_success'), message: this.$t('commons.delete_success'),
type: 'success' type: 'success'