From 02ae1148049e47cc50d6d1a76e701ce9aae7aff4 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Mon, 6 Dec 2021 18:03:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E6=8F=90=E7=A4=BA=E4=BF=9D=E5=AD=98=E8=84=91?= =?UTF-8?q?=E5=9B=BE=20--bug=3D1008131=20--user=3D=E9=99=88=E5=BB=BA?= =?UTF-8?q?=E6=98=9F=20=E3=80=90github#7831=E3=80=91=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E3=80=90=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA=E3=80=91-?= =?UTF-8?q?=E3=80=90=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E3=80=91=EF=BC=8C?= =?UTF-8?q?=E6=A0=87=E8=AE=B0=E7=94=A8=E4=BE=8B=E6=89=A7=E8=A1=8C=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=EF=BC=8C=E7=82=B9=E5=87=BB=E5=85=B6=E4=BB=96=E7=AA=97?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E6=9C=AA=E6=8F=90=E7=A4=BA=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=EF=BC=8C=E5=AF=BC=E8=87=B4=E7=94=A8=E4=BE=8B=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E8=AE=B0=E5=BD=95=E4=B8=A2=E5=A4=B1=E3=80=82?= =?UTF-8?q?=20https://www.tapd.cn/55049933/s/10781699?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../track/plan/view/TestPlanView.vue | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) 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(() => {