From 8f38a93c9c9ddaf547200a542aecced93f8857a3 Mon Sep 17 00:00:00 2001
From: zhaowei <zhaowei>
Date: 星期一, 11 十一月 2024 15:11:50 +0800
Subject: [PATCH] 报警分析页面子表格持续时间增加默认升序排序功能

---
 src/views/mdc/base/MasterControlWorkshopSignage.vue | 1038 +++++++++++++++++++++++++++++++--------------------------
 1 files changed, 565 insertions(+), 473 deletions(-)

diff --git a/src/views/mdc/base/MasterControlWorkshopSignage.vue b/src/views/mdc/base/MasterControlWorkshopSignage.vue
index 30196c6..c100666 100644
--- a/src/views/mdc/base/MasterControlWorkshopSignage.vue
+++ b/src/views/mdc/base/MasterControlWorkshopSignage.vue
@@ -23,38 +23,58 @@
         <div class="page-title">
 
           <div style="position: relative">
-            <img src="../../../assets/image/logo.jpg">
-            涓�鎷栧ぇ鎷栬閰嶅巶
+            <img src="@/assets/logo-yt.png">
+            <span style="cursor: pointer"
+                  @dblclick="modalVisible=true">{{isFakeData?fakeData.title:'涓�鎷栧ぇ鎷栬閰嶅巶'}}</span>
           </div>
-          <div>鏁板瓧鍖栬溅闂存櫤鑳界鐞嗙郴缁�</div>
+          <div style="cursor: pointer" @dblclick="isFakeData = !isFakeData">
+            {{isFakeData?fakeData.subheading:'鏁板瓧鍖栬溅闂存櫤鑳界鐞嗙郴缁�'}}
+          </div>
         </div>
+
         <div class="workshop-bg">
-          <div class="navigate-container" style="left: 5%;">
-            <div @click="navigateTo(item)" v-for="(item,index) in navigateList" :key="index" class="navigate-item">
-              <template v-if="index<5">
-                <div :style="{backgroundColor:item.backgroundColor}" class="navigate-item-index">{{index+1}}</div>
-                <div :style="{backgroundColor:item.backgroundColor}" class="navigate-item-label">
-                  {{item.label}}
+          <div class="navigate-container" style="top:0;left: 5%;">
+            <div @click="navigateToSubWorkshopSignage(item)" v-for="item in productionLineList" :key="item.id"
+                 class="navigate-item">
+              <template v-if="item.productionOrder<5">
+                <div :style="{backgroundColor:productionLineBackgroundColorList[item.productionOrder%4]}"
+                     class="navigate-item-index">
+                  {{item.productionOrder+1}}
+                </div>
+                <div :style="{backgroundColor:productionLineBackgroundColorList[item.productionOrder%4]}"
+                     class="navigate-item-label">
+                  {{item.productionName}}
                 </div>
               </template>
             </div>
           </div>
-          <div class="navigate-container" style="bottom:5%;right: 5%;">
-            <div @click="navigateTo(item)" v-for="(item,index) in navigateList" :key="index" class="navigate-item">
-              <template v-if="index>=5">
-                <div :style="{backgroundColor:item.backgroundColor}" class="navigate-item-index">{{index+1}}</div>
-                <div :style="{backgroundColor:item.backgroundColor}" class="navigate-item-label">
-                  {{item.label}}
+          <div class="navigate-container" style="bottom:0;right: 5%;">
+            <div @click="navigateToSubWorkshopSignage(item)" v-for="item in productionLineList" :key="item.id"
+                 class="navigate-item">
+              <template v-if="item.productionOrder>=5">
+                <div :style="{backgroundColor:productionLineBackgroundColorList[item.productionOrder%4]}"
+                     class="navigate-item-index">
+                  {{item.productionOrder+1}}
+                </div>
+                <div :style="{backgroundColor:productionLineBackgroundColorList[item.productionOrder%4]}"
+                     class="navigate-item-label">
+                  {{item.productionName}}
                 </div>
               </template>
             </div>
           </div>
         </div>
+
         <div class="switch-container">
-          <div @click="activeIndex=index" class="switch-item" v-for="(item,index) in switchList" :key="index"
-               :style="{backgroundColor:activeIndex===index?'#848284':'#6B6D6B',color:activeIndex==index?'#27A2DB':'#000'}">
-            {{item.label}}
+          <div class="switch-item" v-for="(item,index) in switchList" :key="index" @click="navigateToOthers(item,index)"
+               :style="{color:activeIndex==index?'#27A2DB':'#000'}">
+            <img src="@/assets/navigateImg.png">
+            <span>{{item.label}}</span>
           </div>
+        </div>
+
+        <div class="page-description">
+          {{isFakeData?fakeData.description:'涓�鎷栧伐鏉愭墍 涓� 鐏电鏅鸿兘 鑱斿悎寮�鍙�'}}
         </div>
       </div>
       <div class="right-col">
@@ -62,152 +82,239 @@
           <div class="chart-container" id="right-col-chart1"></div>
         </div>
         <div class="col-content">
-          <div class="content-title">浠婃棩璁惧寮�鏈虹巼(%)</div>
+          <div class="content-title">璁惧浠婃棩寮�鏈虹巼锛�%锛�</div>
           <div class="chart-container" id="right-col-chart2"></div>
         </div>
         <div class="col-content">
-          <div class="content-title">浠婃棩璁惧鍒╃敤鐜�(%)</div>
+          <div class="content-title">璁惧浠婃棩鍒╃敤鐜囷紙%锛�</div>
           <div class="chart-container" id="right-col-chart3"></div>
         </div>
         <div class="col-content">
-          <div class="content-title">鏈堣澶囧埄鐢ㄧ巼(%)</div>
+          <div class="content-title">璁惧鏈堝埄鐢ㄧ巼锛�%锛�</div>
           <div class="chart-container" id="right-col-chart4"></div>
         </div>
       </div>
     </div>
+
+    <SignageModal :fakeData="fakeData" :modalVisible="modalVisible"
+                  @closeModal="modalVisible=false" @reloadData="reloadData"></SignageModal>
   </div>
 </template>
 
 <script>
   import * as echarts from 'echarts'
+  import api from '@/api/mdc'
+  import SignageModal from './modules/MasterControlWorkshopSignage/SignageModal'
 
   export default {
     name: 'MasterControlWorkshopSignage',
-    components: {},
+    components: { SignageModal },
     data() {
       return {
-        activeIndex: 0,
+        isFakeData: true,
+        fakeData: {},
+        modalVisible: false,
+        activeIndex: null,
         firstEnterDevicePixelRatio: null,
         currentDevicePixelRatio: null,
         leftColChart1: '',
+        leftColChart1Data: '',
         leftColChart2: '',
+        leftColChart2Data: '',
         leftColChart3: '',
+        leftColChart3Data: '',
         leftColChart4: '',
-        navigateList: [
-          {
-            label: '1024鍚庣鍔犲伐绾�',
-            id: '1',
-            backgroundColor: '#0000FF'
-          },
-          {
-            label: '1024鍓嶇鍔犲伐绾�',
-            id: '2',
-            backgroundColor: '#FF8E00'
-          },
-          {
-            label: '鍓嶆墭鏋跺姞宸ョ嚎',
-            id: '3',
-            backgroundColor: '#DE1439'
-          },
-          {
-            label: '80浼犲姩澹充綋鍔犲伐绾�',
-            id: '4',
-            backgroundColor: '#006500'
-          },
-          {
-            label: '80鍑忛�熷櫒澹充綋鍔犲伐绾�',
-            id: '5',
-            backgroundColor: '#0000FF'
-          },
-          {
-            label: '绠变綋鍔犲伐绾�',
-            id: '6',
-            backgroundColor: '#FF8E00'
-          },
-          {
-            label: '宸�熷櫒杞存壙搴у姞宸ョ嚎',
-            id: '7',
-            backgroundColor: '#DE1439'
-          },
-          {
-            label: '鍒跺姩鍣ㄦ椿濉炲姞宸ョ嚎',
-            id: '8',
-            backgroundColor: '#006500'
-          },
-          {
-            label: '涓皬浠跺姞宸ョ嚎',
-            id: '9',
-            backgroundColor: '#0000FF'
-          }
-        ],
+        leftColChart4Data: '',
+        productionLineList: [],
+        productionLineBackgroundColorList: ['#0000FF', '#FF8E00', '#DE1439', '#006500'],
         switchList: [
           {
             label: 'MES',
-            index: 0
+            index: 0,
+            isNavigateToWeb: true,
+            webUrl: 'http://172.16.52.71:8081',
+            batPath: ''
           },
           {
             label: '鍒�鍏风鐞�',
-            index: 1
+            index: 1,
+            isNavigateToWeb: true,
+            webUrl: 'http://172.16.52.99/tms',
+            batPath: ''
           },
           {
-            label: '鏁呴殰',
-            index: 2
+            label: '璁惧璇婃柇',
+            index: 2,
+            isNavigateToWeb: false,
+            webUrl: '',
+            batPath: 'yituoSBZD://'
           },
           {
-            label: '3D',
-            index: 3
+            label: '涓夌淮鐩戞帶',
+            index: 3,
+            isNavigateToWeb: false,
+            webUrl: '',
+            batPath: 'yituoVR://'
           },
           {
             label: '瀹夐槻',
-            index: 4
+            index: 4,
+            isNavigateToWeb: false,
+            webUrl: '',
+            batPath: 'yituoAF://'
           }
         ],
         rightColChart1: '',
         rightColChart2: '',
         rightColChart3: '',
+        rightColChart2Data: '',
+        rightColChart3Data: '',
+        rightColChart2And3Data: '',
+        rightColChart2CarouselTime: null,
+        rightColChart3CarouselTime: null,
         rightColChart4: '',
+        rightColChart4Data: '',
         rightColChart4CarouselTime: null
       }
     },
     mounted() {
       this.firstEnterDevicePixelRatio = window.devicePixelRatio
       window.addEventListener('resize', this.handleWindowResize)
-      this.getChartDataByApi()
+      this.getProductionListByApi()
     },
     beforeDestroy() {
       window.removeEventListener('resize', this.handleWindowResize)
+      if (this.rightColChart2CarouselTime) clearInterval(this.rightColChart2CarouselTime)
+      if (this.rightColChart3CarouselTime) clearInterval(this.rightColChart3CarouselTime)
       if (this.rightColChart4CarouselTime) clearInterval(this.rightColChart4CarouselTime)
     },
+    watch: {
+      isFakeData: {
+        handler(value) {
+          if (value) {
+            this.getFakeDataByApi()
+          } else {
+            this.getChartDataByApi()
+          }
+        },
+        immediate: true
+      }
+    },
     methods: {
+      getProductionListByApi() {
+        api.getProductionLineListApi()
+          .then(res => {
+            if (res.success) this.productionLineList = res.result
+          })
+      },
+
+      getFakeDataByApi() {
+        api.getFakeDataApi()
+          .then(res => {
+            console.log('res', res)
+            if (res.success) this.fakeData = res.result
+            this.leftColChart1Data = [
+              {
+                name: '浜у搧鍚堟牸鐜�',
+                count: res.result.passRate / 100
+              },
+              {
+                name: '璁惧鍒╃敤鐜�',
+                count: res.result.utilizationRate / 100
+              },
+              {
+                name: '璁″垝瀹屾垚鐜�',
+                count: res.result.planCompleteRate / 100
+              }
+            ]
+            this.leftColChart2Data = res.result.todayProductionList
+            this.leftColChart3Data = res.result.todayPassRateList
+            this.leftColChart4Data = res.result.todayShiftCountList
+            this.rightColChart2Data = res.result.todayOpenRateList
+            this.rightColChart3Data = res.result.todayUtilizationRateList
+            this.rightColChart4Data = res.result.monthUtilizationRateList
+            this.$nextTick(() => {
+              this.drawLeftColChart1()
+              this.drawLeftColChart2()
+              this.drawLeftColChart3()
+              this.drawLeftColChart4()
+              this.drawRightColChart2()
+              this.drawRightColChart3()
+              this.drawRightColChart4()
+            })
+          })
+      },
+
+      reloadData() {
+        this.modalVisible = false
+        if (this.isFakeData) this.getFakeDataByApi()
+      },
+
       getChartDataByApi() {
         this.getLeftColChart1DataByApi()
         this.getLeftColChart2DataByApi()
         this.getLeftColChart3DataByApi()
         this.getLeftColChart4DataByApi()
         // this.getRightColChart1DataByApi()
-        this.getRightColChart2DataByApi()
-        this.getRightColChart3DataByApi()
+        this.getRightColChart2And3DataByApi()
         this.getRightColChart4DataByApi()
       },
 
       getLeftColChart1DataByApi() {
-        this.leftColChart1 = this.$echarts.init(document.getElementById('left-col-chart1'))
-        this.drawLeftColChart1()
+        api.getYesterdayOverviewApi()
+          .then(res => {
+            // console.log('res', res)
+            if (res.success) {
+              this.leftColChart1Data = [
+                {
+                  'name': '浜у搧鍚堟牸鐜�',
+                  'count': res.result.passRate ? res.result.passRate / 100 : 0
+                },
+                {
+                  'name': '璁惧鍒╃敤鐜�',
+                  'count': res.result.utilizationRate ? res.result.utilizationRate / 100 : 0
+                },
+                {
+                  'name': '璁″垝瀹屾垚鐜�',
+                  'count': res.result.planCompleteRate ? res.result.planCompleteRate / 100 : 0
+                }
+              ]
+              this.drawLeftColChart1()
+            }
+          })
       },
 
       getLeftColChart2DataByApi() {
-        this.leftColChart2 = this.$echarts.init(document.getElementById('left-col-chart2'))
-        this.drawLeftColChart2()
+        api.getTodayProductionProgressApi()
+          .then(res => {
+            // console.log('res', res)
+            if (res.success) {
+              this.leftColChart2Data = res.result
+              this.drawLeftColChart2()
+            }
+          })
       },
 
       getLeftColChart3DataByApi() {
-        this.leftColChart3 = this.$echarts.init(document.getElementById('left-col-chart3'))
-        this.drawLeftColChart3()
+        api.getTodayProductPassRateApi()
+          .then(res => {
+            // console.log('res', res)
+            if (res.success) {
+              this.leftColChart3Data = res.result
+              this.drawLeftColChart3()
+            }
+          })
       },
 
       getLeftColChart4DataByApi() {
-        this.leftColChart4 = this.$echarts.init(document.getElementById('left-col-chart4'))
-        this.drawLeftColChart4()
+        api.getTeamCompletionCountApi()
+          .then(res => {
+            // console.log('res', res)
+            if (res.success) {
+              this.leftColChart4Data = res.result
+              this.drawLeftColChart4()
+            }
+          })
       },
 
       getRightColChart1DataByApi() {
@@ -215,46 +322,34 @@
         this.drawRightColChart1()
       },
 
-      getRightColChart2DataByApi() {
-        this.rightColChart2 = this.$echarts.init(document.getElementById('right-col-chart2'))
-        this.drawRightColChart2()
-      },
-
-      getRightColChart3DataByApi() {
-        this.rightColChart3 = this.$echarts.init(document.getElementById('right-col-chart3'))
-        this.drawRightColChart3()
+      getRightColChart2And3DataByApi() {
+        api.getTodayEquipmentWorkEfficiencyApi()
+          .then(res => {
+            // console.log('res', res)
+            if (res.success) {
+              this.rightColChart2And3Data = res.result
+              this.drawRightColChart2()
+              this.drawRightColChart3()
+            }
+          })
       },
 
       getRightColChart4DataByApi() {
-        this.rightColChart4 = this.$echarts.init(document.getElementById('right-col-chart4'))
-        this.drawRightColChart4()
+        api.getMonthEquipmentUtilizationRateApi()
+          .then(res => {
+            // console.log('res', res)
+            if (res.success) {
+              this.rightColChart4Data = res.result
+              this.drawRightColChart4()
+            }
+          })
       },
 
       /* 缁樺埗宸︿晶绗竴涓浘琛� */
       drawLeftColChart1() {
-        const data = [
-          {
-            'number': null,
-            'name': '浜у搧鍚堟牸鐜�',
-            'count': 1,
-            'planCount': null,
-            'rateCount': null
-          },
-          {
-            'number': null,
-            'name': '璁惧鍒╃敤鐜�',
-            'count': 0.89,
-            'planCount': null,
-            'rateCount': null
-          },
-          {
-            'number': null,
-            'name': '璁″垝瀹屾垚鐜�',
-            'count': 0.95,
-            'planCount': null,
-            'rateCount': null
-          }
-        ]
+        this.leftColChart1 = this.$echarts.init(document.getElementById('left-col-chart1'))
+        console.log('leftColChart1Data', this.leftColChart1Data)
+
         const yAxisData = []
         const option = {
           radar: [
@@ -373,7 +468,7 @@
 
           ]
         }
-        data.forEach((item, index) => {
+        this.leftColChart1Data.forEach((item, index) => {
           yAxisData.push(parseFloat(item.count * 100 > 100 ? 100 : item.count * 100))
           option.radar[1].indicator[index].num = item.count * 100 > 100 ? 100 : item.count * 100
         })
@@ -383,101 +478,34 @@
 
       /* 缁樺埗宸︿晶绗簩涓浘琛� */
       drawLeftColChart2() {
-        const data1 = [
-          {
-            'number': 'A_1',
-            'name': '鍓嶇鍓�',
-            'count': 190
-          },
-          {
-            'number': 'A_2',
-            'name': '1024鍚庣',
-            'count': 180
-          },
-          {
-            'number': 'A_3',
-            'name': '宸�熷櫒',
-            'count': 200
-          },
-          {
-            'number': 'A_4',
-            'name': '杞存壙搴�',
-            'count': 100
-          },
-          {
-            'number': 'A_5',
-            'name': '80鍑�',
-            'count': 200
-          },
-          {
-            'number': 'A_6',
-            'name': '80浼�',
-            'count': 90
-          },
-          {
-            'number': 'A_7',
-            'name': '1024鍓�',
-            'count': 200
-          }
-        ]
-        const data2 = [
-          {
-            'number': 'A_1',
-            'name': '鍓嶇鍓�',
-            'count': 165
-          },
-          {
-            'number': 'A_2',
-            'name': '1024鍚庣',
-            'count': 166
-          },
-          {
-            'number': 'A_3',
-            'name': '宸�熷櫒',
-            'count': 167
-          },
-          {
-            'number': 'A_4',
-            'name': '杞存壙搴�',
-            'count': 90
-          },
-          {
-            'number': 'A_5',
-            'name': '80鍑�',
-            'count': 100
-          },
-          {
-            'number': 'A_6',
-            'name': '80浼�',
-            'count': 55
-          },
-          {
-            'number': 'A_7',
-            'name': '1024鍓�',
-            'count': 171
-          }
-        ]
+        this.leftColChart2 = this.$echarts.init(document.getElementById('left-col-chart2'))
         const xAxisData = []
         const seriesData1 = []
         const seriesData2 = []
-        data1.forEach(item => {
-          xAxisData.push(item.name == null ? '' : item.name)
-          seriesData1.push({
-            value: item.count == null ? '' : item.count,
-            hostType: (item.number == null ? '' : item.number)
+        if (this.isFakeData) {
+          this.leftColChart2Data.forEach(item => {
+            if (item.label) {
+              xAxisData.push(item.label == null ? '' : item.label)
+              seriesData1.push({ value: item.value1 == null ? '' : item.value1 })
+              seriesData2.push({ value: item.value2 == null ? '' : item.value2 })
+            }
           })
-        })
-        data2.forEach(item => {
-          seriesData2.push({
-            value: item.count == null ? '' : item.count,
-            hostType: (item.number == null ? '' : item.number)
+        } else {
+          this.leftColChart2Data.forEach(item => {
+            xAxisData.push(item.productName == null ? '' : item.productName)
+            seriesData1.push({ value: item.planCount == null ? '' : item.planCount })
+            seriesData2.push({ value: item.completionCount == null ? '' : item.completionCount })
           })
-        })
+        }
+
         const option = {
           tooltip: {
             show: true,
-            trigger: 'item',
-            formatter: params => `${params.name}锛�${params.value}浠禶
+            trigger: 'axis',
+            formatter: params => {
+              // console.log('params', params)
+              return params[0].name + '<br>' + `${params[0].seriesName}锛�${params[0].value}浠禶 + '<br>' + `${params[1].seriesName}锛�${params[1].value}浠禶
+            }
           },
           legend: {
             show: false,
@@ -544,7 +572,7 @@
           },
           series: [
             {
-              name: '鍒╃敤鐜�',
+              name: '璁″垝閲�',
               type: 'bar',
               barWidth: '35%',//鏌卞浘瀹藉害
               data: [],
@@ -579,7 +607,7 @@
               }
             },
             {
-              name: '鍒╃敤鐜�',
+              name: '瀹屾垚閲�',
               type: 'bar',
               barWidth: '35%',//鏌卞浘瀹藉害
               data: [],
@@ -622,6 +650,7 @@
 
       /* 缁樺埗宸︿晶绗笁涓浘琛� */
       drawLeftColChart3() {
+        this.leftColChart3 = this.$echarts.init(document.getElementById('left-col-chart3'))
         const data = [
           {
             'number': 'A_1',
@@ -675,13 +704,24 @@
         ]
         const xAxisData = []
         const seriesData = []
-        data.forEach(item => {
-          xAxisData.push(item.name == null ? '' : item.name)
-          seriesData.push({
-            value: this.toDecimal2NoZero(((item.count == null ? '' : item.count) * 100) > 100 ? 100 : (((item.count == null ? '' : item.count) * 100))),
-            hostType: (item.number == null ? '' : item.number)
+        if (this.isFakeData) {
+          this.leftColChart3Data.forEach(item => {
+            if (item.label) {
+              xAxisData.push(item.label == null ? '' : item.label)
+              seriesData.push({
+                value: this.toDecimal2NoZero(((item.value1 == null ? '' : item.value1) * 100) > 100 ? 100 : (((item.value1 == null ? '' : item.value1) * 100)))
+              })
+            }
           })
-        })
+        } else {
+          this.leftColChart3Data.forEach(item => {
+            xAxisData.push(item.productionName == null ? '' : item.productionName)
+            seriesData.push({
+              value: this.toDecimal2NoZero(((item.passRate == null ? '' : item.passRate) * 100) > 100 ? 100 : (((item.passRate == null ? '' : item.passRate) * 100)))
+            })
+          })
+        }
+
         const option = {
           tooltip: {
             show: true,
@@ -884,66 +924,22 @@
 
       /* 缁樺埗宸︿晶绗洓涓浘琛� */
       drawLeftColChart4() {
-        const data = [
-          {
-            'number': 'A_1',
-            'name': '鍓嶇鐝�',
-            'count': 54,
-            'planCount': null,
-            'rateCount': null
-          },
-          {
-            'number': 'A_2',
-            'name': '鍚庣鐝�',
-            'count': 55,
-            'planCount': null,
-            'rateCount': null
-          },
-          {
-            'number': 'A_3',
-            'name': '80浼犵彮',
-            'count': 56,
-            'planCount': null,
-            'rateCount': null
-          },
-          {
-            'number': 'A_4',
-            'name': '80鍑忕彮',
-            'count': 57,
-            'planCount': null,
-            'rateCount': null
-          },
-          {
-            'number': 'A_5',
-            'name': '鎵樻灦鐝�',
-            'count': 58,
-            'planCount': null,
-            'rateCount': null
-          },
-          {
-            'number': 'A_6',
-            'name': '杞存壙搴曞骇鐝�',
-            'count': 59,
-            'planCount': null,
-            'rateCount': null
-          },
-          {
-            'number': 'A_7',
-            'name': '宸�熷櫒鐝�',
-            'count': 90,
-            'planCount': null,
-            'rateCount': null
-          }
-        ]
+        this.leftColChart4 = this.$echarts.init(document.getElementById('left-col-chart4'))
         const xAxisData = []
         const seriesData = []
-        data.forEach(item => {
-          xAxisData.push(item.name == null ? '' : item.name)
-          seriesData.push({
-            value: item.count == null ? '' : item.count,
-            hostType: (item.number == null ? '' : item.number)
+        if (this.isFakeData) {
+          this.leftColChart4Data.forEach(item => {
+            if (item.label) {
+              xAxisData.push(item.label == null ? '' : item.label)
+              seriesData.push({ value: item.value1 == null ? '' : item.value1 })
+            }
           })
-        })
+        } else {
+          this.leftColChart4Data.forEach(item => {
+            xAxisData.push(item.clazz == null ? '' : item.clazz)
+            seriesData.push({ value: item.completionCount == null ? '' : item.completionCount })
+          })
+        }
         const option = {
           tooltip: {
             show: true,
@@ -1302,6 +1298,7 @@
 
       /* 缁樺埗鍙充晶绗簩涓浘琛� */
       drawRightColChart2() {
+        this.rightColChart2 = this.$echarts.init(document.getElementById('right-col-chart2'))
         const data = [
           {
             'number': 'A_1',
@@ -1376,13 +1373,109 @@
         ]
         const xAxisData = []
         const seriesData = []
-        data.forEach(item => {
-          xAxisData.push(item.name == null ? '' : item.name)
-          seriesData.push({
-            value: this.toDecimal2NoZero(((item.count == null ? '' : item.count) * 100) > 100 ? 100 : (((item.count == null ? '' : item.count) * 100))),
-            hostType: (item.number == null ? '' : item.number)
+        const colorList = [
+          new echarts.graphic.LinearGradient(
+            0, 0, 1, 0,
+            [
+
+              { offset: 0, color: '#4A7DBD' },
+              { offset: 1, color: '#31557B' }
+            ]
+          ),
+          new echarts.graphic.LinearGradient(
+            0, 0, 1, 0,
+            [
+              { offset: 0, color: '#BD4D4A' },
+              { offset: 1, color: '#7B3031' }
+            ]
+          ),
+          new echarts.graphic.LinearGradient(
+            0, 0, 1, 0,
+            [
+              { offset: 0, color: '#94AF52' },
+              { offset: 1, color: '#637A39' }
+            ]
+          ),
+          new echarts.graphic.LinearGradient(
+            0, 0, 1, 0,
+            [
+              { offset: 0, color: '#7B61A4' },
+              { offset: 1, color: '#52416B' }
+            ]
+          ),
+          new echarts.graphic.LinearGradient(
+            0, 0, 1, 0,
+            [
+              { offset: 0, color: '#4AAAC6' },
+              { offset: 1, color: '#29697B' }
+            ]
+          ),
+          new echarts.graphic.LinearGradient(
+            0, 0, 1, 0,
+            [
+              { offset: 0, color: '#F79642' },
+              { offset: 1, color: '#9C5D29' }
+            ]
+          ),
+          new echarts.graphic.LinearGradient(
+            0, 0, 1, 0,
+            [
+
+              { offset: 0, color: '#4A7DBD' },
+              { offset: 1, color: '#31557B' }
+            ]
+          ),
+          new echarts.graphic.LinearGradient(
+            0, 0, 1, 0,
+            [
+              { offset: 0, color: '#BD4D4A' },
+              { offset: 1, color: '#7B3031' }
+            ]
+          ),
+          new echarts.graphic.LinearGradient(
+            0, 0, 1, 0,
+            [
+              { offset: 0, color: '#94AF52' },
+              { offset: 1, color: '#637A39' }
+            ]
+          ),
+          new echarts.graphic.LinearGradient(
+            0, 0, 1, 0,
+            [
+              { offset: 0, color: '#7B61A4' },
+              { offset: 1, color: '#52416B' }
+            ]
+          ),
+          new echarts.graphic.LinearGradient(
+            0, 0, 1, 0,
+            [
+              { offset: 0, color: '#4AAAC6' },
+              { offset: 1, color: '#29697B' }
+            ]
+          ),
+          new echarts.graphic.LinearGradient(
+            0, 0, 1, 0,
+            [
+              { offset: 0, color: '#F79642' },
+              { offset: 1, color: '#9C5D29' }
+            ]
+          )
+        ]
+
+        if (this.isFakeData) {
+          this.rightColChart2Data.forEach(item => {
+            if (item.label) {
+              xAxisData.push(item.label == null ? '' : item.label)
+              seriesData.push({ value: item.value1 })
+            }
           })
-        })
+        } else {
+          this.rightColChart2And3Data.forEach(item => {
+            xAxisData.push(item.equipmentName == null ? '' : item.equipmentName)
+            seriesData.push({ value: item.openRate })
+          })
+        }
+
         const option = {
           tooltip: {
             show: true,
@@ -1418,6 +1511,7 @@
               color: '#fff',
               // rotate: 45,
               margin: 15,
+              interval: 0,
               fontSize: '55%',
               formatter(value) {
                 const data = xAxisData
@@ -1476,94 +1570,6 @@
               itemStyle: {
                 barBorderRadius: '',
                 color: function(params) {
-                  const colorList = [
-                    new echarts.graphic.LinearGradient(
-                      0, 0, 1, 0,
-                      [
-
-                        { offset: 0, color: '#4A7DBD' },
-                        { offset: 1, color: '#31557B' }
-                      ]
-                    ),
-                    new echarts.graphic.LinearGradient(
-                      0, 0, 1, 0,
-                      [
-                        { offset: 0, color: '#BD4D4A' },
-                        { offset: 1, color: '#7B3031' }
-                      ]
-                    ),
-                    new echarts.graphic.LinearGradient(
-                      0, 0, 1, 0,
-                      [
-                        { offset: 0, color: '#94AF52' },
-                        { offset: 1, color: '#637A39' }
-                      ]
-                    ),
-                    new echarts.graphic.LinearGradient(
-                      0, 0, 1, 0,
-                      [
-                        { offset: 0, color: '#7B61A4' },
-                        { offset: 1, color: '#52416B' }
-                      ]
-                    ),
-                    new echarts.graphic.LinearGradient(
-                      0, 0, 1, 0,
-                      [
-                        { offset: 0, color: '#4AAAC6' },
-                        { offset: 1, color: '#29697B' }
-                      ]
-                    ),
-                    new echarts.graphic.LinearGradient(
-                      0, 0, 1, 0,
-                      [
-                        { offset: 0, color: '#F79642' },
-                        { offset: 1, color: '#9C5D29' }
-                      ]
-                    ),
-                    new echarts.graphic.LinearGradient(
-                      0, 0, 1, 0,
-                      [
-
-                        { offset: 0, color: '#4A7DBD' },
-                        { offset: 1, color: '#31557B' }
-                      ]
-                    ),
-                    new echarts.graphic.LinearGradient(
-                      0, 0, 1, 0,
-                      [
-                        { offset: 0, color: '#BD4D4A' },
-                        { offset: 1, color: '#7B3031' }
-                      ]
-                    ),
-                    new echarts.graphic.LinearGradient(
-                      0, 0, 1, 0,
-                      [
-                        { offset: 0, color: '#94AF52' },
-                        { offset: 1, color: '#637A39' }
-                      ]
-                    ),
-                    new echarts.graphic.LinearGradient(
-                      0, 0, 1, 0,
-                      [
-                        { offset: 0, color: '#7B61A4' },
-                        { offset: 1, color: '#52416B' }
-                      ]
-                    ),
-                    new echarts.graphic.LinearGradient(
-                      0, 0, 1, 0,
-                      [
-                        { offset: 0, color: '#4AAAC6' },
-                        { offset: 1, color: '#29697B' }
-                      ]
-                    ),
-                    new echarts.graphic.LinearGradient(
-                      0, 0, 1, 0,
-                      [
-                        { offset: 0, color: '#F79642' },
-                        { offset: 1, color: '#9C5D29' }
-                      ]
-                    )
-                  ]
                   return colorList[params.dataIndex]
                   // build a color map as your need.
 
@@ -1575,16 +1581,34 @@
                   shadowColor: 'rgba(218,170, 58, 0.8)'
                 }
               }
+            }
+          ],
+          dataZoom: [
+            {
+              show: false,
+              startValue: 0, // 浠庡ご寮�濮嬨��
+              endValue: 9 // 涓�娆℃�у睍绀哄嚑涓�
             }
           ]
         }
         option.xAxis.data = xAxisData
         option.series[0].data = seriesData
         this.rightColChart2.setOption(option, true)
+
+        clearInterval(this.rightColChart2CarouselTime)
+        this.rightColChart2CarouselTime = setInterval(() => {
+          xAxisData.push(xAxisData.shift())
+          seriesData.push(seriesData.shift())
+          colorList.push(colorList.shift())
+          this.$nextTick(() => {
+            this.rightColChart2.setOption(option, true)
+          })
+        }, 3000)
       },
 
       /* 缁樺埗鍙充晶绗笁涓浘琛� */
       drawRightColChart3() {
+        this.rightColChart3 = this.$echarts.init(document.getElementById('right-col-chart3'))
         const data = [
           {
             'number': 'A_1',
@@ -1659,13 +1683,107 @@
         ]
         const xAxisData = []
         const seriesData = []
-        data.forEach(item => {
-          xAxisData.push(item.name == null ? '' : item.name)
-          seriesData.push({
-            value: this.toDecimal2NoZero(((item.count == null ? '' : item.count) * 100) > 100 ? 100 : (((item.count == null ? '' : item.count) * 100))),
-            hostType: (item.number == null ? '' : item.number)
+        const colorList = [
+          new echarts.graphic.LinearGradient(
+            0, 0, 1, 0,
+            [
+
+              { offset: 0, color: '#4A7DBD' },
+              { offset: 1, color: '#31557B' }
+            ]
+          ),
+          new echarts.graphic.LinearGradient(
+            0, 0, 1, 0,
+            [
+              { offset: 0, color: '#BD4D4A' },
+              { offset: 1, color: '#7B3031' }
+            ]
+          ),
+          new echarts.graphic.LinearGradient(
+            0, 0, 1, 0,
+            [
+              { offset: 0, color: '#94AF52' },
+              { offset: 1, color: '#637A39' }
+            ]
+          ),
+          new echarts.graphic.LinearGradient(
+            0, 0, 1, 0,
+            [
+              { offset: 0, color: '#7B61A4' },
+              { offset: 1, color: '#52416B' }
+            ]
+          ),
+          new echarts.graphic.LinearGradient(
+            0, 0, 1, 0,
+            [
+              { offset: 0, color: '#4AAAC6' },
+              { offset: 1, color: '#29697B' }
+            ]
+          ),
+          new echarts.graphic.LinearGradient(
+            0, 0, 1, 0,
+            [
+              { offset: 0, color: '#F79642' },
+              { offset: 1, color: '#9C5D29' }
+            ]
+          ),
+          new echarts.graphic.LinearGradient(
+            0, 0, 1, 0,
+            [
+
+              { offset: 0, color: '#4A7DBD' },
+              { offset: 1, color: '#31557B' }
+            ]
+          ),
+          new echarts.graphic.LinearGradient(
+            0, 0, 1, 0,
+            [
+              { offset: 0, color: '#BD4D4A' },
+              { offset: 1, color: '#7B3031' }
+            ]
+          ),
+          new echarts.graphic.LinearGradient(
+            0, 0, 1, 0,
+            [
+              { offset: 0, color: '#94AF52' },
+              { offset: 1, color: '#637A39' }
+            ]
+          ),
+          new echarts.graphic.LinearGradient(
+            0, 0, 1, 0,
+            [
+              { offset: 0, color: '#7B61A4' },
+              { offset: 1, color: '#52416B' }
+            ]
+          ),
+          new echarts.graphic.LinearGradient(
+            0, 0, 1, 0,
+            [
+              { offset: 0, color: '#4AAAC6' },
+              { offset: 1, color: '#29697B' }
+            ]
+          ),
+          new echarts.graphic.LinearGradient(
+            0, 0, 1, 0,
+            [
+              { offset: 0, color: '#F79642' },
+              { offset: 1, color: '#9C5D29' }
+            ]
+          )
+        ]
+        if (this.isFakeData) {
+          this.rightColChart3Data.forEach(item => {
+            if (item.label) {
+              xAxisData.push(item.label == null ? '' : item.label)
+              seriesData.push({ value: item.value1 })
+            }
           })
-        })
+        } else {
+          this.rightColChart2And3Data.forEach(item => {
+            xAxisData.push(item.equipmentName == null ? '' : item.equipmentName)
+            seriesData.push({ value: item.utilizationRate })
+          })
+        }
         const option = {
           tooltip: {
             show: true,
@@ -1700,6 +1818,7 @@
             axisLabel: {
               color: '#fff',
               // rotate: 45,
+              interval: 0,
               margin: 15,
               fontSize: '55%',
               formatter(value) {
@@ -1735,7 +1854,6 @@
               show: false
             }
           },
-
           series: [
             {
               name: '鍒╃敤鐜�',
@@ -1760,94 +1878,6 @@
               itemStyle: {
                 barBorderRadius: '',
                 color: function(params) {
-                  const colorList = [
-                    new echarts.graphic.LinearGradient(
-                      0, 0, 1, 0,
-                      [
-
-                        { offset: 0, color: '#4A7DBD' },
-                        { offset: 1, color: '#31557B' }
-                      ]
-                    ),
-                    new echarts.graphic.LinearGradient(
-                      0, 0, 1, 0,
-                      [
-                        { offset: 0, color: '#BD4D4A' },
-                        { offset: 1, color: '#7B3031' }
-                      ]
-                    ),
-                    new echarts.graphic.LinearGradient(
-                      0, 0, 1, 0,
-                      [
-                        { offset: 0, color: '#94AF52' },
-                        { offset: 1, color: '#637A39' }
-                      ]
-                    ),
-                    new echarts.graphic.LinearGradient(
-                      0, 0, 1, 0,
-                      [
-                        { offset: 0, color: '#7B61A4' },
-                        { offset: 1, color: '#52416B' }
-                      ]
-                    ),
-                    new echarts.graphic.LinearGradient(
-                      0, 0, 1, 0,
-                      [
-                        { offset: 0, color: '#4AAAC6' },
-                        { offset: 1, color: '#29697B' }
-                      ]
-                    ),
-                    new echarts.graphic.LinearGradient(
-                      0, 0, 1, 0,
-                      [
-                        { offset: 0, color: '#F79642' },
-                        { offset: 1, color: '#9C5D29' }
-                      ]
-                    ),
-                    new echarts.graphic.LinearGradient(
-                      0, 0, 1, 0,
-                      [
-
-                        { offset: 0, color: '#4A7DBD' },
-                        { offset: 1, color: '#31557B' }
-                      ]
-                    ),
-                    new echarts.graphic.LinearGradient(
-                      0, 0, 1, 0,
-                      [
-                        { offset: 0, color: '#BD4D4A' },
-                        { offset: 1, color: '#7B3031' }
-                      ]
-                    ),
-                    new echarts.graphic.LinearGradient(
-                      0, 0, 1, 0,
-                      [
-                        { offset: 0, color: '#94AF52' },
-                        { offset: 1, color: '#637A39' }
-                      ]
-                    ),
-                    new echarts.graphic.LinearGradient(
-                      0, 0, 1, 0,
-                      [
-                        { offset: 0, color: '#7B61A4' },
-                        { offset: 1, color: '#52416B' }
-                      ]
-                    ),
-                    new echarts.graphic.LinearGradient(
-                      0, 0, 1, 0,
-                      [
-                        { offset: 0, color: '#4AAAC6' },
-                        { offset: 1, color: '#29697B' }
-                      ]
-                    ),
-                    new echarts.graphic.LinearGradient(
-                      0, 0, 1, 0,
-                      [
-                        { offset: 0, color: '#F79642' },
-                        { offset: 1, color: '#9C5D29' }
-                      ]
-                    )
-                  ]
                   return colorList[params.dataIndex]
                   // build a color map as your need.
 
@@ -1860,15 +1890,33 @@
                 }
               }
             }
+          ],
+          dataZoom: [
+            {
+              show: false,
+              startValue: 0, // 浠庡ご寮�濮嬨��
+              endValue: 9 // 涓�娆℃�у睍绀哄嚑涓�
+            }
           ]
         }
         option.xAxis.data = xAxisData
         option.series[0].data = seriesData
         this.rightColChart3.setOption(option, true)
+
+        clearInterval(this.rightColChart3CarouselTime)
+        this.rightColChart3CarouselTime = setInterval(() => {
+          xAxisData.push(xAxisData.shift())
+          seriesData.push(seriesData.shift())
+          colorList.push(colorList.shift())
+          this.$nextTick(() => {
+            this.rightColChart3.setOption(option, true)
+          })
+        }, 3000)
       },
 
       /* 缁樺埗鍙充晶绗洓涓浘琛� */
       drawRightColChart4() {
+        this.rightColChart4 = this.$echarts.init(document.getElementById('right-col-chart4'))
         const data = [
           {
             'number': 'A_1',
@@ -2111,13 +2159,19 @@
             ]
           )
         ]
-        data.forEach(item => {
-          xAxisData.push(item.name == null ? '' : item.name)
-          seriesData.push({
-            value: this.toDecimal2NoZero(((item.count == null ? '' : item.count) * 100) > 100 ? 100 : (((item.count == null ? '' : item.count) * 100))),
-            hostType: (item.number == null ? '' : item.number)
+        if (this.isFakeData) {
+          this.rightColChart4Data.forEach(item => {
+            if (item.label) {
+              xAxisData.push(item.label == null ? '' : item.label)
+              seriesData.push({ value: item.value1 })
+            }
           })
-        })
+        } else {
+          this.rightColChart4Data.forEach(item => {
+            xAxisData.push(item.date == null ? '' : item.date)
+            seriesData.push({ value: item.utilizationRate })
+          })
+        }
         const option = {
           tooltip: {
             show: true,
@@ -2228,6 +2282,7 @@
         option.series[0].data = seriesData
         this.rightColChart4.setOption(option, true)
 
+        clearInterval(this.rightColChart4CarouselTime)
         this.rightColChart4CarouselTime = setInterval(() => {
           xAxisData.push(xAxisData.shift())
           seriesData.push(seriesData.shift())
@@ -2245,10 +2300,27 @@
         return s
       },
 
-      navigateTo(record) {
-        const url = this.$router.resolve(`/SubControlWorkshopSignage/${record.id}`).href
+      navigateToSubWorkshopSignage(record) {
+        const url = this.$router.resolve({
+          path: '/SubControlWorkshopSignage',
+          query: {
+            productionId: record.id,
+            productionName: record.productionName,
+            productionOrder: record.productionOrder + 1
+          }
+        }).href
         window.open(url, '_blank')
       },
+
+      navigateToOthers(record, index) {
+        this.activeIndex = index
+        if (record.isNavigateToWeb && record.webUrl) {
+          window.open(record.webUrl, '_blank')
+        } else {
+          window.location.href = record.batPath
+        }
+      },
+
 
       /**
        * 绐楀彛灏哄鍙樺寲鏃惰Е鍙�
@@ -2312,8 +2384,9 @@
           text-align: center;
 
           img {
+            height: 100%;
+            width: 10%;
             position: absolute;
-            width: 12%;
             left: 12%;
           }
         }
@@ -2321,7 +2394,7 @@
         .workshop-bg {
           position: relative;
           height: 60%;
-          background-image: url("../../../assets/yt_background.jpg");
+          background-image: url("../../../assets/yt_background.png");
           background-size: 100% 100%;
           background-repeat: no-repeat;
 
@@ -2358,8 +2431,27 @@
             flex: 1;
             text-align: center;
             cursor: pointer;
+            position: relative;
+
+            span {
+              position: relative;
+              z-index: 1;
+            }
+            img {
+              width: 100%;
+              height: 100%;
+              position: absolute;
+              top: 0;
+              left: 0;
+            }
           }
         }
+
+        .page-description {
+          text-align: center;
+          color: #fff;
+          font-size: 0.7vw;
+        }
       }
 
       .left-col, .right-col {

--
Gitblit v1.9.3