From b4495445fbfc616a2126587ce9eec205fc1cbe19 Mon Sep 17 00:00:00 2001 From: ZZJ <zzjdsg2300@163.com> Date: 星期三, 20 四月 2022 13:52:11 +0800 Subject: [PATCH] 授权时间修改 --- src/views/manageCenter/index.vue | 27 +++++++++++++++++++++------ 1 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/views/manageCenter/index.vue b/src/views/manageCenter/index.vue index 88843ea..b5e1305 100644 --- a/src/views/manageCenter/index.vue +++ b/src/views/manageCenter/index.vue @@ -19,7 +19,7 @@ class="productItem" v-for="(item, index) in productList" :key="index" - @click="jump(item.path)" + @click="jump(item)" > <img :src="item.icon" alt="" /> <div class="name">{{ item.name }}</div> @@ -270,19 +270,25 @@ { name: "璁惧绠$悊", icon: "/images/manageCenter/璁惧绠$悊.png", - path: "/equipmentManagement", + openPath: "/equipmentManagement", + path: "/equipmentList", + permission: "deviceMng", }, { name: "绠楀姏绠$悊", icon: "/images/manageCenter/绠楀姏绠$悊.png", - path: "/hashrate", + openPath: "/hashrate", + path: "/hashrateDetail", + permission: "analysisMng", }, { name: "缁熻鏌ヨ", icon: "/images/manageCenter/绠楀姏绠$悊.png", - path: "/", + openPath: "/searchOpen", + path: "/search", + permission: "statisticMng", }, ], timeList: [ @@ -851,8 +857,17 @@ let myChart = echarts.init(pieDom); myChart.setOption(this.pieOption); }, - jump(path) { - this.$router.push(path); + jump(route) { + const userInfo = JSON.parse(sessionStorage.getItem("userInfo")); + + const val = userInfo.permissions.find((item) => { + return item == route.permission; + }); + if (val) { + this.$router.push(route.path); + } else if (!userInfo.parentId) { + this.$router.push(route.openPath); + } }, refrash() {}, handleSizeChange() {}, -- Gitblit v1.8.0