| | |
| | | </div> |
| | | <div style="margin-left: 2rem"> |
| | | <span style="color: rgb(255, 255, 255); font-size: 0.88rem" |
| | | >å§åï¼è¶
级管çå</span |
| | | >å§åï¼{{ userName }}</span |
| | | > |
| | | </div> |
| | | <img |
| | |
| | | @import "./index.less"; |
| | | </style> |
| | | <script> |
| | | import { getTreeMenu } from "@/api/menu.js"; |
| | | // import { getTreeMenu } from "@/api/menu.js"; |
| | | import { baseUrl } from "../utils"; |
| | | |
| | | import loading from "@/components/basic/RouterLoading"; |
| | |
| | | Object.assign(_config.$tabs, { open: open, close: close }); |
| | | |
| | | //åå§åèå |
| | | getTreeMenu().then((res) => { |
| | | console.log("meanu", res); |
| | | res.push({ id: "1", name: "é¦é¡µ", url: "/home" }); // 为äºè·åéä¸idä½¿ç¨ |
| | | res.forEach((d) => { |
| | | d.path = (d.url || "").replace("/Manager", ""); |
| | | d.to = (d.url || "").replace("/Manager", ""); |
| | | if (!d.icon || d.icon.substring(0, 3) != "el-") { |
| | | d.icon = "el-icon-menu"; |
| | | } |
| | | }); |
| | | // getTreeMenu().then((res) => { |
| | | // console.log("meanu", res); |
| | | // res.push({ id: "1", name: "é¦é¡µ", url: "/home" }); // 为äºè·åéä¸idä½¿ç¨ |
| | | // res.forEach((d) => { |
| | | // d.path = (d.url || "").replace("/Manager", ""); |
| | | // d.to = (d.url || "").replace("/Manager", ""); |
| | | // if (!d.icon || d.icon.substring(0, 3) != "el-") { |
| | | // d.icon = "el-icon-menu"; |
| | | // } |
| | | // }); |
| | | |
| | | store.dispatch("setPermission", res); |
| | | // store.dispatch("setPermission", res); |
| | | |
| | | console.log("æé", store.state); |
| | | menuOptions.value = res; |
| | | permissionInited.value = true; |
| | | // console.log("æé", store.state); |
| | | // menuOptions.value = res; |
| | | // permissionInited.value = true; |
| | | |
| | | //å¼å¯æ¶æ¯æ¨éï¼main.jsä¸è®¾ç½®æ¯å¦å¼å¯signalRï¼2022.05.05 |
| | | if (_config.$global.signalR) { |
| | | MessageConfig(http, (result) => { |
| | | messageList.unshift(result); |
| | | // console.log(result) |
| | | }); |
| | | } |
| | | // //å¼å¯æ¶æ¯æ¨éï¼main.jsä¸è®¾ç½®æ¯å¦å¼å¯signalRï¼2022.05.05 |
| | | // if (_config.$global.signalR) { |
| | | // MessageConfig(http, (result) => { |
| | | // messageList.unshift(result); |
| | | // // console.log(result) |
| | | // }); |
| | | // } |
| | | |
| | | //å½åå·æ°æ¯ä¸æ¯é¦é¡µ |
| | | if (router.currentRoute.value.path != navigation[0].path) { |
| | | //æ¥æ¾ç³»ç»èå |
| | | let item = menuOptions.value.find((x) => { |
| | | return x.path == router.currentRoute.value.path; //this.$route.path; |
| | | }); |
| | | if (item) return onSelect(item.id); |
| | | //æ¥æ¾é¡¶é¨å¿«æ·è¿æ¥ |
| | | item = links.value.find((x) => { |
| | | return x.path == router.currentRoute.value.path; //this.$route.path; |
| | | }); |
| | | //æ¥æ¾æå䏿¬¡è·³è½¬çé¡µé¢ |
| | | if (!item) { |
| | | item = getItem(); |
| | | } |
| | | if (item) { |
| | | return open(item, false); |
| | | } |
| | | } |
| | | selectId.value = "1"; |
| | | }); |
| | | // //å½åå·æ°æ¯ä¸æ¯é¦é¡µ |
| | | // if (router.currentRoute.value.path != navigation[0].path) { |
| | | // //æ¥æ¾ç³»ç»èå |
| | | // let item = menuOptions.value.find((x) => { |
| | | // return x.path == router.currentRoute.value.path; //this.$route.path; |
| | | // }); |
| | | // if (item) return onSelect(item.id); |
| | | // //æ¥æ¾é¡¶é¨å¿«æ·è¿æ¥ |
| | | // item = links.value.find((x) => { |
| | | // return x.path == router.currentRoute.value.path; //this.$route.path; |
| | | // }); |
| | | // //æ¥æ¾æå䏿¬¡è·³è½¬çé¡µé¢ |
| | | // if (!item) { |
| | | // item = getItem(); |
| | | // } |
| | | // if (item) { |
| | | // return open(item, false); |
| | | // } |
| | | // } |
| | | // selectId.value = "1"; |
| | | // }); |
| | | }; |
| | | created(); |
| | | return { |