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/BranchFactorySignage.vue |   79 ++++++++++++++++++++-------------------
 1 files changed, 41 insertions(+), 38 deletions(-)

diff --git a/src/views/dashboard/BranchFactorySignage.vue b/src/views/dashboard/BranchFactorySignage.vue
index ff2782f..7699025 100644
--- a/src/views/dashboard/BranchFactorySignage.vue
+++ b/src/views/dashboard/BranchFactorySignage.vue
@@ -8,6 +8,9 @@
     <!--</div>-->
     <div class="content-container">
       <div style="width: 25%" class="left-col">
+        <div class="back-nav" @click="$emit('backToLastSignage','Index')" v-if="userType===4">
+          <dv-decoration-7>涓婁竴绾�</dv-decoration-7>
+        </div>
         <dv-border-box-9 style="padding: 40px 20px 0">
           <!--<div class="first-title">M D C 鍏� 缃� 鎬� 鏁� : 6 0 3 鍙�</div>-->
           <div id="running_state_chart" style="width:100%;height: 400px;"></div>
@@ -78,6 +81,9 @@
       productionCode: {
         type: String,
         default: ''
+      },
+      userType: {
+        type: Number
       }
     },
     data() {
@@ -112,28 +118,6 @@
         barChartData: [],
         doubleBarChart: '',
         doubleBarChartData: {},
-        supportPlanList: [
-          {
-            label: '鏈湀涓変繚璁″垝',
-            value: 299,
-            background: '#719D8E'
-          },
-          {
-            label: '鏈湀瀹屾垚',
-            value: 229,
-            background: '#409EFF'
-          },
-          {
-            label: '涓嬫湀涓変繚璁″垝',
-            value: 319,
-            background: '#A8985D'
-          },
-          {
-            label: '涓嬩笅鏈堜笁淇濊鍒�',
-            value: 329,
-            background: '#58D9F9'
-          }
-        ],
         maintenanceConfig: {},
         problemConfig: {}
       }
@@ -142,10 +126,6 @@
       window.addEventListener('resize', this.handleWindowResize)
       this.drawCharts()
       this.getChartDataByApi()
-    },
-    activated() {
-      console.log('瑙﹀彂activated')
-      this.handleWindowResize()
     },
     beforeDestroy() {
       window.removeEventListener('resize', this.handleWindowResize)
@@ -166,8 +146,8 @@
       getRunningStateDataByApi() {
         signageApi.getEquipmentStatusStatisticsApi(this.productionCode)
           .then(res => {
-            if (res.success) this.runningStateData = res.result
-            this.drawRunningStateChart()
+            if (res.success) this.runningStateData = res.result.list
+            this.drawRunningStateChart(res.result.producitonId)
           })
       },
 
@@ -270,7 +250,7 @@
       },
 
       /* 缁樺埗璁惧杩愯鐘舵�佺帿鐟伴ゼ鍥� */
-      drawRunningStateChart() {
+      drawRunningStateChart(productionId) {
         this.runningStateChart = this.$echarts.init(document.getElementById('running_state_chart'))
         const option = {
           height: 300,
@@ -350,6 +330,14 @@
           ]
         }
         this.runningStateChart.setOption(option, true)
+
+        this.runningStateChart.on('click', params => {
+          console.log('params', params)
+          this.$router.push({
+            name: 'mdc-base-DeviceBaseInfo',
+            params: { signageData: params.data, productionId }
+          })
+        })
       },
 
       /* 缁樺埗璁惧鍒╃敤鐜囪兌鍥婂浘 */
@@ -543,14 +531,18 @@
         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
+            this.$router.push({
+              name: 'mdc-base-StatisticsChart',
+              params: { isEquipment: false, productionId, tierName }
+            })
           } else {
             console.log('yAxisParams===========', params)
-            this.$emit('switchToBranchFactory', params.value)
+            this.$emit('switchToNextSignage', { signageName: 'WorkshopSection', productionCode: params.value })
           }
         })
       },
@@ -752,7 +744,7 @@
           xAxis: [{
             name: 'OEE杞﹂棿',
             nameLocation: 'middle',
-            nameGap: 30, // x杞磏ame涓庢í鍧愭爣杞寸嚎鐨勯棿璺�
+            nameGap: 40, // x杞磏ame涓庢í鍧愭爣杞寸嚎鐨勯棿璺�
             type: 'category',
             data: this.barChartData.map(item => item.name),
             axisLine: {
@@ -761,11 +753,11 @@
               }
             },
             axisLabel: {
-              margin: 10,
-              color: '#e2e9ff',
-              textStyle: {
-                fontSize: 12
-              }
+              show: true, // 鏄惁鏄剧ず鍒诲害鏍囩锛岄粯璁ゆ樉绀�
+              interval: 0, // 鍧愭爣杞村埢搴︽爣绛剧殑鏄剧ず闂撮殧锛屽湪绫荤洰杞翠腑鏈夋晥锛涢粯璁や細閲囩敤鏍囩涓嶉噸鍙犵殑绛栫暐闂撮殧鏄剧ず鏍囩锛涘彲浠ヨ缃垚0寮哄埗鏄剧ず鎵�鏈夋爣绛撅紱濡傛灉璁剧疆涓�1锛岃〃绀恒�庨殧涓�涓爣绛炬樉绀轰竴涓爣绛俱�忥紝濡傛灉鍊间负2锛岃〃绀洪殧涓や釜鏍囩鏄剧ず涓�涓爣绛撅紝浠ユ绫绘帹銆�
+              rotate: this.barChartData.length >= 5 ? -30 : 0, // 鍒诲害鏍囩鏃嬭浆鐨勮搴︼紝鍦ㄧ被鐩酱鐨勭被鐩爣绛炬樉绀轰笉涓嬬殑鏃跺�欏彲浠ラ�氳繃鏃嬭浆闃叉鏍囩涔嬮棿閲嶅彔锛涙棆杞殑瑙掑害浠�-90搴﹀埌90搴�
+              inside: false, // 鍒诲害鏍囩鏄惁鏈濆唴锛岄粯璁ゆ湞澶�
+              margin: 6 // 鍒诲害鏍囩涓庤酱绾夸箣闂寸殑璺濈
             },
             axisTick: {
               show: false
@@ -1017,6 +1009,17 @@
       justify-content: space-between;
 
       .left-col {
+        .back-nav {
+          width: 100px;
+          height: 30px;
+          color: #eee;
+          position: absolute;
+          top: 25px;
+          left: 25px;
+          cursor: pointer;
+          z-index: 9999
+        }
+
         .first-title {
           color: #00A8AC;
           font-size: 20px;

--
Gitblit v1.9.3