diff --git a/frontend/src/business/components/track/plan/view/TestPlanView.vue b/frontend/src/business/components/track/plan/view/TestPlanView.vue index bb66c0f185..b69ab8afeb 100644 --- a/frontend/src/business/components/track/plan/view/TestPlanView.vue +++ b/frontend/src/business/components/track/plan/view/TestPlanView.vue @@ -27,6 +27,12 @@ :plan-id="planId"/> + + @@ -45,10 +51,12 @@ import TestPlanApi from "./comonents/api/TestPlanApi"; import TestPlanLoad from "@/business/components/track/plan/view/comonents/load/TestPlanLoad"; import {getCurrentProjectID} from "@/common/js/utils"; import TestPlanReportContent from "@/business/components/track/plan/view/comonents/report/detail/TestPlanReportContent"; +import IsChangeConfirm from "@/business/components/common/components/IsChangeConfirm"; export default { name: "TestPlanView", components: { + IsChangeConfirm, TestPlanReportContent, TestPlanApi, TestPlanFunctional, @@ -66,6 +74,7 @@ export default { redirectCharType: '', //报表跳转过来的参数-通过哪种数据跳转的 clickType: '', + tmpActiveIndex: '' }; }, computed: { @@ -80,7 +89,7 @@ export default { '$route.params.planId'() { this.genRedirectParam(); this.getTestPlans(); - } + }, }, beforeRouteLeave(to, from, next) { if (!this.$refs.testPlanFunctional) { @@ -131,8 +140,26 @@ export default { this.$router.push('/track/plan/view/' + plan.id); }, handleSelect(key) { + let isTestCaseMinderChanged = this.$store.state.isTestCaseMinderChanged; + if (key !== 'functional' && isTestCaseMinderChanged) { + this.$refs.isChangeConfirm.open(); + this.tmpActiveIndex = key; + return; + } this.activeIndex = key; }, + changeConfirm(isSave) { + if (isSave) { + this.$refs.testPlanFunctional.$refs.minder.save(window.minder.exportJson()); + } + this.$store.commit('setIsTestCaseMinderChanged', false); + this.$nextTick(() => { + if (this.tmpActiveIndex) { + this.activeIndex = this.tmpActiveIndex; + this.tmpActiveIndex = null; + } + }); + }, reloadMenu() { this.isMenuShow = false; this.$nextTick(() => {