12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <template>
- <div id="app">
- <router-view />
- </div>
- </template>
- <script>
- import { mapGetters } from "vuex";
- import store from "./store/index";
- export default {
- data() {
- return {
- system: null,
- };
- },
- computed: {
- ...mapGetters({
- searchValue: "searchValue",
- isRouterAlive: "isRouterAlive",
- }),
- },
- methods: {},
- created() {
- store.state._this = this;
- },
- watch: {
- $route(val) {
- this.system = JSON.parse(sessionStorage.getItem("module_info"));
- if (this.system) {
- // 假设 this.system 是一个数组,每个元素有 modules 属性,每个 module 有 apps 属性
- this.system.forEach(sys => {
- const md = sys.modules.find(module =>
- module.apps.some(app => app.name === val.name)
- );
- if (md) {
- sessionStorage.setItem("active_modules", JSON.stringify(md));
- this.$store.dispatch("setActiveApp", {
- app: md.apps.find(app => app.name === val.name),
- val: this.searchValue,
- });
- this.$store.dispatch("setSSystemModules", sys.modules);
- }
- });
- }
- },
- },
- };
- </script>
- <style>
- body {
- font: 16px/1.5 Helvetica Neue, Helvetica, Arial, Microsoft Yahei,
- Hiragino Sans GB, Heiti SC, WenQuanYi Micro Hei, sans-serif;
- font-family: "微软雅黑";
- min-width: 1200px;
- }
- .rightBar {
- width: 60px;
- height: 100vh;
- background: rgba(255, 255, 255, 0.5);
- box-shadow: 0 2px 5px rgb(0 0 0 / 10%);
- }
- .el-drawer__header {
- padding: 10px !important;
- margin-bottom: 0 !important;
- font-size: 16px !important;
- font-family: PingFang SC-Bold, PingFang SC;
- font-weight: bold !important;
- color: #333333 !important;
- }
- </style>
|