From 8365e5bfea0a769f27e28a058f58dfc1c664b995 Mon Sep 17 00:00:00 2001 From: fanluyan <754122931@qq.com> Date: Thu, 28 Mar 2024 14:45:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/parameterArea.vue | 45 ++++++++++++------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/src/views/realTimeMonitor/components/parameterArea.vue b/src/views/realTimeMonitor/components/parameterArea.vue index 39e30b6..735486a 100644 --- a/src/views/realTimeMonitor/components/parameterArea.vue +++ b/src/views/realTimeMonitor/components/parameterArea.vue @@ -91,7 +91,7 @@ 历史图片 @@ -247,7 +247,8 @@ export default { selectTowerId: "", collectFlag: false, //收藏 btnShowList: [], - menuList: [], + hisShowbtn: true, + menuShowList: [], }; }, @@ -263,24 +264,29 @@ export default { return this.$store.state.currentData; }, showButtonMap() { - return this.btnShowList.reduce((map, button) => { - map[button.key] = true; // 假设只要key存在,就显示按钮 - return map; - }, {}); + if (this.roleUser !== "0") { + return this.btnShowList.reduce((map, button) => { + map[button.key] = true; // 假设只要key存在,就显示按钮 + return map; + }, {}); + } }, - showButtonhisMap() { - return this.menuList.reduce((map, button) => { - map[button.key] = true; // 假设只要key存在,就显示按钮 - return map; - }, {}); + showhisButtonMap() { + if (this.roleUser !== "0") { + return this.menuShowList.reduce((map, button) => { + map[button.key] = true; // 假设只要key存在,就显示按钮 + return map; + }, {}); + } }, }, created() { this.roleUser = localStorage.getItem("role"); console.log("asdsaddddddddddddddddddddddddd", this.roleUser); this.btnShowList = JSON.parse(localStorage.getItem("btnPermission")); - this.menuList = JSON.parse(localStorage.getItem("menuPermission")); - console.log(this.btnShowList); + this.menuShowList = JSON.parse(localStorage.getItem("menuPermission")); + + console.log(this.btnShowList, this.menuShowList); }, mounted() { this.getDateTime(); @@ -288,11 +294,18 @@ export default { methods: { //控制显示与隐藏 showButton(key) { - return this.showButtonMap[key] || false; + if (this.roleUser !== "0") { + return this.showButtonMap[key] || false; + } else { + return true; + } }, - //控制显示与隐藏 showhisButton(key) { - return this.showButtonhisMap[key] || false; + if (this.roleUser !== "0") { + return this.showhisButtonMap[key] || false; + } else { + return true; + } }, //双击选中复制 handleDblClick(val) {