From a144a18ab582fd3a8c945cba60bc364dbe7f31e8 Mon Sep 17 00:00:00 2001
From: zhuzhuanzhuan
Date: 星期四, 28 三月 2024 16:59:55 +0800
Subject: [PATCH] 1、新增点击设备运行状态图标跳转至设备监控页面并根据状态及当前层级筛选页面对应数据 2、新增点击设备利用率的横向柱状图跳转至统计分析页面并根据所点击层级筛选页面对应数据 3、解决router.push以及router.replace跳转后报错

---
 src/views/dashboard/IndexSignage.vue |   26 ++++++++++++++++++--------
 1 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/src/views/dashboard/IndexSignage.vue b/src/views/dashboard/IndexSignage.vue
index d25dd30..aeb3245 100644
--- a/src/views/dashboard/IndexSignage.vue
+++ b/src/views/dashboard/IndexSignage.vue
@@ -126,10 +126,6 @@
       this.drawCharts()
       this.getChartDataByApi()
     },
-    activated() {
-      console.log('瑙﹀彂activated')
-      this.handleWindowResize()
-    },
     beforeDestroy() {
       window.removeEventListener('resize', this.handleWindowResize)
     },
@@ -149,8 +145,8 @@
       getRunningStateDataByApi() {
         signageApi.getEquipmentStatusStatisticsApi()
           .then(res => {
-            if (res.success) this.runningStateData = res.result
-            this.drawRunningStateChart()
+            if (res.success) this.runningStateData = res.result.list
+            this.drawRunningStateChart(res.result.producitonId)
           })
       },
 
@@ -253,7 +249,7 @@
       },
 
       /* 缁樺埗璁惧杩愯鐘舵�佺帿鐟伴ゼ鍥� */
-      drawRunningStateChart() {
+      drawRunningStateChart(productionId) {
         this.runningStateChart = this.$echarts.init(document.getElementById('running_state_chart'))
         const option = {
           height: 300,
@@ -333,6 +329,13 @@
           ]
         }
         this.runningStateChart.setOption(option, true)
+
+        this.runningStateChart.on('click', params => {
+          this.$router.push({
+            name: 'mdc-base-DeviceBaseInfo',
+            params: { signageData: params.data, productionId }
+          })
+        })
       },
 
       /* 缁樺埗璁惧鍒╃敤鐜囪兌鍥婂浘 */
@@ -526,10 +529,17 @@
         this.efficiencyChart.setOption(option, true)
 
         this.efficiencyChart.on('click', params => {
-
           // 鐐瑰嚮瑙﹀彂鐨勪负鏌辩姸浣擄紝闄ゆ闄ゅ鏄爣棰�
           if (params.componentType === 'series') {
+            // 鏌辩姸浣撹烦杞粺璁″垎鏋愰〉闈㈠睍绀哄搴斿眰绾ф暟鎹�
             console.log('seriesParams===========', params)
+            const productionId = this.efficiencyData.find(item => item.productionCode === params.name).productionId
+            const tierName = this.efficiencyData.find(item => item.productionCode === params.name).name
+            console.log('productionId', productionId)
+            this.$router.push({
+              name: 'mdc-base-StatisticsChart',
+              params: { isEquipment: false, productionId, tierName }
+            })
           } else {
             console.log('yAxisParams===========', params)
             this.$emit('switchToNextSignage', { signageName: 'BranchFactory', productionCode: params.value })

--
Gitblit v1.9.3