From 9272e3307b60117a904b8edd63b19c1ff7c1de4c Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 19 Oct 2022 20:50:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=AE=A1=E5=88=92=E6=8A=A5=E5=91=8A=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E7=9B=AE=E5=BD=95=E5=92=8C=E5=B7=A6=E4=BE=A7=E5=AF=BC?= =?UTF-8?q?=E8=88=AA=E6=A0=8F=E9=87=8D=E5=8F=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1018459 --user=陈建星 【测试跟踪】测试计划-报告统计-目录和左侧导航栏重叠 https://www.tapd.cn/55049933/s/1268757 --- .../src/business/app-layout/index.vue | 1 + .../detail/TestPlanReportNavigationBar.vue | 27 +++++++++++-------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/framework/sdk-parent/frontend/src/business/app-layout/index.vue b/framework/sdk-parent/frontend/src/business/app-layout/index.vue index 86ba315fbb..0cf6e7ad64 100644 --- a/framework/sdk-parent/frontend/src/business/app-layout/index.vue +++ b/framework/sdk-parent/frontend/src/business/app-layout/index.vue @@ -162,6 +162,7 @@ export default { } localStorage.removeItem('app-fixed'); localStorage.setItem('app-fixed', this.isFixed); + this.$EventBus.$emit('appFixedChange', this.isFixed); }, collapseOpen() { this.isCollapse = false; diff --git a/test-track/frontend/src/business/plan/view/comonents/report/detail/TestPlanReportNavigationBar.vue b/test-track/frontend/src/business/plan/view/comonents/report/detail/TestPlanReportNavigationBar.vue index cc10d82e7a..9a3dc98aad 100644 --- a/test-track/frontend/src/business/plan/view/comonents/report/detail/TestPlanReportNavigationBar.vue +++ b/test-track/frontend/src/business/plan/view/comonents/report/detail/TestPlanReportNavigationBar.vue @@ -24,9 +24,7 @@ import MsDrawer from "metersphere-frontend/src/components/MsDrawer"; import {DEFAULT_LANGUAGE, EN_US, ZH_CN} from "metersphere-frontend/src/utils/constants"; import {getCurrentUser} from "metersphere-frontend/src/utils/token"; -// import {useStore} from "@/store"; -// const store = useStore(); export default { name: "TestPlanReportNavigationBar", components: {MsDrawer}, @@ -96,11 +94,6 @@ export default { uiEnable() { this.setData(); }, - // 'store.appFixed'(newVal){ - // if (this.needMoveBar) { - // this.toggleMoveBarClass(newVal); - // } - // }, }, computed: { navBtnClass() { @@ -119,10 +112,20 @@ export default { }, }, mounted() { + let isFixed = localStorage.getItem('app-fixed') === 'true' || false; + if (this.$EventBus) { + // 导出的报告不走这里 + this.$EventBus.$on("appFixedChange", this.toggleMoveBarClass); + } this.setData(); - // if (this.needMoveBar) { - // this.toggleMoveBarClass(store.appFixed); - // } + if (this.needMoveBar) { + this.toggleMoveBarClass(isFixed); + } + }, + destroyed() { + if (this.$EventBus) { + this.$EventBus.$off("appFixedChange", this.toggleMoveBarClass); + } }, methods: { setData() { @@ -142,7 +145,9 @@ export default { }); }, toggleMoveBarClass(val) { - this.moveBarClass = val ? 'fixed-move-bar' : 'move-bar'; + if (this.needMoveBar) { + this.moveBarClass = val ? 'fixed-move-bar' : 'move-bar'; + } } } }