From a0b5604fcefa0c7900ecc50830b718f77bba8f39 Mon Sep 17 00:00:00 2001 From: heyujie <516346543@qq.com> Date: 星期五, 15 七月 2022 14:43:40 +0800 Subject: [PATCH] add cluster pwd --- src/views/manageCenter/index.vue | 33 +++++++++++++++++++++++++-------- 1 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/views/manageCenter/index.vue b/src/views/manageCenter/index.vue index 8b5b91a..5242a6c 100644 --- a/src/views/manageCenter/index.vue +++ b/src/views/manageCenter/index.vue @@ -5,7 +5,7 @@ <div class="centerTitle"> <div class="heart"> - <div class="welcome">{{ userName }},娆㈣繋鎮ㄨ礉鎬濈绠$悊涓績.</div> + <div class="welcome">{{ userName }}, 娆㈣繋鎮ㄥ洖鍒拌礉鎬濈绠$悊涓績銆�</div> <div class="time">{{ timeMsg }}</div> </div> </div> @@ -19,11 +19,10 @@ class="productItem" v-for="(item, index) in productList" :key="index" + @click="jump(item)" > - <router-link :to="item.path"> - <img :src="item.icon" alt="" /> - <div class="name">{{ item.name }}</div> - </router-link> + <img :src="item.icon" alt="" /> + <div class="name">{{ item.name }}</div> </div> </div> </div> @@ -271,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: [ @@ -852,6 +857,18 @@ let myChart = echarts.init(pieDom); myChart.setOption(this.pieOption); }, + 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