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'; + } } } }