feat(测试计划): 测试报告中失败用例支持跳转

This commit is contained in:
shiziyuan9527 2020-09-29 17:32:11 +08:00
parent 0cf960b7d1
commit ee47268c68
6 changed files with 23 additions and 3 deletions

@ -1 +1 @@
Subproject commit cf6b06526324326a563d933e07118fac014a63b4 Subproject commit c2dacf960cdb1ed35664bdd3432120b1203b73d8

View File

@ -0,0 +1,2 @@
import Vue from 'vue';
export const hub = new Vue();

View File

@ -359,6 +359,8 @@ export default {
handleClose() { handleClose() {
removeGoBackListener(this.handleClose); removeGoBackListener(this.handleClose);
this.showDialog = false; this.showDialog = false;
this.searchParam.status = null;
this.$emit('update:search-param', this.searchParam);
}, },
cancel() { cancel() {
this.handleClose(); this.handleClose();

View File

@ -196,7 +196,7 @@
<test-plan-test-case-edit <test-plan-test-case-edit
ref="testPlanTestCaseEdit" ref="testPlanTestCaseEdit"
:search-param="condition" :search-param.sync="condition"
@refresh="initTableData" @refresh="initTableData"
:is-read-only="isReadOnly" :is-read-only="isReadOnly"
@refreshTable="search"/> @refreshTable="search"/>
@ -233,6 +233,7 @@
import ShowMoreBtn from "../../../case/components/ShowMoreBtn"; import ShowMoreBtn from "../../../case/components/ShowMoreBtn";
import BatchEdit from "../../../case/components/BatchEdit"; import BatchEdit from "../../../case/components/BatchEdit";
import ClassicEditor from "@ckeditor/ckeditor5-build-classic"; import ClassicEditor from "@ckeditor/ckeditor5-build-classic";
import {hub} from "@/business/components/track/plan/event-bus";
export default { export default {
name: "TestPlanTestCaseList", name: "TestPlanTestCaseList",
@ -336,9 +337,17 @@
} }
}, },
mounted() { mounted() {
hub.$on("openFailureTestCase", row => {
this.isReadOnly = true;
this.condition.status = 'Failure';
this.$refs.testPlanTestCaseEdit.openTestCaseEdit(row);
});
this.refreshTableAndPlan(); this.refreshTableAndPlan();
this.isTestManagerOrTestUser = checkoutTestManagerOrTestUser(); this.isTestManagerOrTestUser = checkoutTestManagerOrTestUser();
}, },
beforeDestroy() {
hub.$off("openFailureTestCase");
},
methods: { methods: {
initTableData() { initTableData() {
if (this.planId) { if (this.planId) {

View File

@ -4,6 +4,7 @@
<template> <template>
<el-table <el-table
row-key="id" row-key="id"
@row-click="goFailureTestCase"
:data="failureTestCases"> :data="failureTestCases">
<el-table-column <el-table-column
prop="num" prop="num"
@ -91,6 +92,7 @@
import TypeTableItem from "../../../../../common/tableItems/planview/TypeTableItem"; import TypeTableItem from "../../../../../common/tableItems/planview/TypeTableItem";
import MethodTableItem from "../../../../../common/tableItems/planview/MethodTableItem"; import MethodTableItem from "../../../../../common/tableItems/planview/MethodTableItem";
import StatusTableItem from "../../../../../common/tableItems/planview/StatusTableItem"; import StatusTableItem from "../../../../../common/tableItems/planview/StatusTableItem";
import {hub} from "@/business/components/track/plan/event-bus";
export default { export default {
name: "FailureResultComponent", name: "FailureResultComponent",
components: {StatusTableItem, MethodTableItem, TypeTableItem, PriorityTableItem, CommonComponent}, components: {StatusTableItem, MethodTableItem, TypeTableItem, PriorityTableItem, CommonComponent},
@ -122,6 +124,11 @@
] ]
} }
} }
},
methods: {
goFailureTestCase(row) {
hub.$emit("openFailureTestCase", row);
}
} }
} }
</script> </script>

@ -1 +1 @@
Subproject commit 06d935cd1d22ab36f09763745c2aff8ad3fb08c1 Subproject commit cc38137a69a0f20fadece9c0f9f50a9468c4ace9