From 15a9f1b16ae150eda723592917878c3c524d2e72 Mon Sep 17 00:00:00 2001
From: zhuzhuanzhuan
Date: 星期四, 28 三月 2024 17:31:18 +0800
Subject: [PATCH] 调整车间层级看板设备运行状态统计图表内外圈直径

---
 src/views/dashboard/BranchFactorySignage.vue |   73 ++++++++++++++++++------------------
 1 files changed, 37 insertions(+), 36 deletions(-)

diff --git a/src/views/dashboard/BranchFactorySignage.vue b/src/views/dashboard/BranchFactorySignage.vue
index 5c2e663..997f634 100644
--- a/src/views/dashboard/BranchFactorySignage.vue
+++ b/src/views/dashboard/BranchFactorySignage.vue
@@ -8,7 +8,9 @@
     <!--</div>-->
     <div class="content-container">
       <div style="width: 25%" class="left-col">
-        <slot name="back_nav"></slot>
+        <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>
@@ -79,6 +81,9 @@
       productionCode: {
         type: String,
         default: ''
+      },
+      userType: {
+        type: Number
       }
     },
     data() {
@@ -113,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: {}
       }
@@ -143,10 +126,6 @@
       window.addEventListener('resize', this.handleWindowResize)
       this.drawCharts()
       this.getChartDataByApi()
-    },
-    activated() {
-      console.log('瑙﹀彂activated')
-      this.handleWindowResize()
     },
     beforeDestroy() {
       window.removeEventListener('resize', this.handleWindowResize)
@@ -167,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)
           })
       },
 
@@ -271,10 +250,9 @@
       },
 
       /* 缁樺埗璁惧杩愯鐘舵�佺帿鐟伴ゼ鍥� */
-      drawRunningStateChart() {
+      drawRunningStateChart(productionId) {
         this.runningStateChart = this.$echarts.init(document.getElementById('running_state_chart'))
         const option = {
-          height: 300,
           title: {
             show: true, // 鏄惁鏄剧ず鏍囬锛岄粯璁や负true
             text: '璁惧杩愯鐘舵�佺粺璁�', // 涓绘爣棰樻枃鏈�
@@ -320,8 +298,8 @@
               type: 'pie',
               roseType: 'angle', // 鐜懓鍥�
               // selectedMode: "single",
-              radius: ['60%', '80%'],
-              center: ['50%', '60%'],
+              radius: ['40%', '60%'],
+              center: ['53%', '50%'],
               color: [
                 '#686869',
                 '#AA6349',
@@ -351,6 +329,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 }
+          })
+        })
       },
 
       /* 缁樺埗璁惧鍒╃敤鐜囪兌鍥婂浘 */
@@ -544,14 +530,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 })
           }
         })
       },
@@ -1018,6 +1008,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