From 3639c456d1889cd3e688191a4398af8a3f49679c Mon Sep 17 00:00:00 2001 From: zhangzengfei <zhangzengfei@smartai.com> Date: 星期三, 12 四月 2023 15:29:21 +0800 Subject: [PATCH] 添加常量的公共数据. 增加场景名称 --- src/views/manageCenter/index.vue | 56 +++++++++++++++++++++++++++++++++----------------------- 1 files changed, 33 insertions(+), 23 deletions(-) diff --git a/src/views/manageCenter/index.vue b/src/views/manageCenter/index.vue index 1a113e1..af17715 100644 --- a/src/views/manageCenter/index.vue +++ b/src/views/manageCenter/index.vue @@ -160,7 +160,7 @@ <div class="hashRate"> <div class="left"> - <div class="title">棰勮鏁版嵁鍗犳瘮:</div> + <div class="title">鏁存敼鏁版嵁璇︽儏</div> <div class="info"> <div class="equipmentInfo" style="margin-top: 25px"> <div class="equipmentCard"> @@ -318,7 +318,23 @@ icon: "/images/manageCenter/push.png", openPath: "/subAccount", path: "/subAccount", - permission: "subAccount" + permission: "accountMng" + }, + + { + name: "鏁版嵁涓婁紶", + icon: "/images/manageCenter/push.png", + openPath: "/dataPush", + path: "/dataPush", + permission: "reportMng" + }, + + { + name: "鏁版嵁鎶ヨ〃", + icon: "/images/manageCenter/push.png", + openPath: "/dataReport", + path: "/dataReport", + permission: "" }, { @@ -333,7 +349,7 @@ icon: "/images/manageCenter/cam.png", openPath: "/invalidCamera", path: "/invalidCamera", - permission: "invalidCamera" + permission: "positionMng" } ], cameraTree: [], @@ -667,17 +683,20 @@ //key 1=璇姤鏁版嵁,2=宸叉暣鏀�,3=鏈暣鏀�,4=宸叉帓鏌� doc_count=鏁伴噺 total=鎬婚噺 decodeWarningRate(b64data) { if (b64data) { - this.warningTotal = 0 - this.warningSolved = 0 - this.warningChecked = 0 + this.warningTotal = 0 // 鎬婚噺 + this.warningSolved = 0 // 宸叉暣鏀� + this.warningChecked = 0 //宸叉帓鏌� + let falseAlarm = 0 // 璇姤 let decodeString = Base64.decode(b64data) if (decodeString != "") { let decodeResult = JSON.parse(decodeString) if (decodeResult && decodeResult.total > 0) { - this.warningTotal = decodeResult.total decodeResult.buckets.forEach((element) => { switch (element.key) { + case 1: + falseAlarm += element.doc_count + break case 2: this.warningSolved += element.doc_count break @@ -688,6 +707,10 @@ break } }) + + // 2023/4/12 淇敼, 棰勮鎬婚噺涓嶇粺璁¤鎶� + // this.warningTotal = decodeResult.total - falseAlarm + this.warningTotal = decodeResult.total } // console.log("WarningRate:", decodeResult) } @@ -758,23 +781,10 @@ this.pieChart.setOption(this.pieOption) }, jump(route) { - const userInfo = JSON.parse(sessionStorage.getItem("userInfo")) - - const val = userInfo.permissions.find((item) => { - return item == route.permission + const { href } = this.$router.resolve({ + path: route.path }) - if (val) { - if (route.path === "/search" || route.path === "/dataView") { - const { href } = this.$router.resolve({ - path: route.path - }) - window.open(href, "_blank") - return - } - this.$router.push(route.path) - } else if (!userInfo.parentId) { - this.$router.push(route.openPath) - } + window.open(href, "_blank") }, refrash() {}, handleSizeChange() {}, -- Gitblit v1.8.0