fix(测试跟踪): 测试计划报告统计目录和左侧导航栏重叠

--bug=1018459 --user=陈建星 【测试跟踪】测试计划-报告统计-目录和左侧导航栏重叠 https://www.tapd.cn/55049933/s/1268757
This commit is contained in:
chenjianxing 2022-10-19 20:50:13 +08:00 committed by jianxing
parent 8a81279a7c
commit 9272e3307b
2 changed files with 17 additions and 11 deletions

View File

@ -162,6 +162,7 @@ export default {
} }
localStorage.removeItem('app-fixed'); localStorage.removeItem('app-fixed');
localStorage.setItem('app-fixed', this.isFixed); localStorage.setItem('app-fixed', this.isFixed);
this.$EventBus.$emit('appFixedChange', this.isFixed);
}, },
collapseOpen() { collapseOpen() {
this.isCollapse = false; this.isCollapse = false;

View File

@ -24,9 +24,7 @@
import MsDrawer from "metersphere-frontend/src/components/MsDrawer"; import MsDrawer from "metersphere-frontend/src/components/MsDrawer";
import {DEFAULT_LANGUAGE, EN_US, ZH_CN} from "metersphere-frontend/src/utils/constants"; import {DEFAULT_LANGUAGE, EN_US, ZH_CN} from "metersphere-frontend/src/utils/constants";
import {getCurrentUser} from "metersphere-frontend/src/utils/token"; import {getCurrentUser} from "metersphere-frontend/src/utils/token";
// import {useStore} from "@/store";
// const store = useStore();
export default { export default {
name: "TestPlanReportNavigationBar", name: "TestPlanReportNavigationBar",
components: {MsDrawer}, components: {MsDrawer},
@ -96,11 +94,6 @@ export default {
uiEnable() { uiEnable() {
this.setData(); this.setData();
}, },
// 'store.appFixed'(newVal){
// if (this.needMoveBar) {
// this.toggleMoveBarClass(newVal);
// }
// },
}, },
computed: { computed: {
navBtnClass() { navBtnClass() {
@ -119,10 +112,20 @@ export default {
}, },
}, },
mounted() { mounted() {
let isFixed = localStorage.getItem('app-fixed') === 'true' || false;
if (this.$EventBus) {
//
this.$EventBus.$on("appFixedChange", this.toggleMoveBarClass);
}
this.setData(); this.setData();
// if (this.needMoveBar) { if (this.needMoveBar) {
// this.toggleMoveBarClass(store.appFixed); this.toggleMoveBarClass(isFixed);
// } }
},
destroyed() {
if (this.$EventBus) {
this.$EventBus.$off("appFixedChange", this.toggleMoveBarClass);
}
}, },
methods: { methods: {
setData() { setData() {
@ -142,10 +145,12 @@ export default {
}); });
}, },
toggleMoveBarClass(val) { toggleMoveBarClass(val) {
if (this.needMoveBar) {
this.moveBarClass = val ? 'fixed-move-bar' : 'move-bar'; this.moveBarClass = val ? 'fixed-move-bar' : 'move-bar';
} }
} }
} }
}
</script> </script>
<style scoped> <style scoped>