From 9d783b455d6d704281ca2743ae45113e23422aad Mon Sep 17 00:00:00 2001
From: lyh <925863403@qq.com>
Date: 星期四, 31 七月 2025 09:23:17 +0800
Subject: [PATCH] 升版导入

---
 src/views/dashboard/WorkshopSectionSignage.vue | 1250 +++++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 833 insertions(+), 417 deletions(-)

diff --git a/src/views/dashboard/WorkshopSectionSignage.vue b/src/views/dashboard/WorkshopSectionSignage.vue
index be246d0..7523ffb 100644
--- a/src/views/dashboard/WorkshopSectionSignage.vue
+++ b/src/views/dashboard/WorkshopSectionSignage.vue
@@ -2,62 +2,35 @@
   <div class="page-container">
     <div class="content-container">
       <div style="width: 30%" class="left-col">
-        <slot name="back_nav"></slot>
-        <dv-border-box-9 style="padding: 15px">
-          <div id="tech_condition_chart" style="width:100%;height: 230px;"></div>
-          <div id="warranty_malfunction_chart" style="width:100%;height: 230px;"></div>
-          <div style="display: flex;">
+        <div class="back-nav" @click="$emit('backToLastSignage','BranchFactory')" v-if="userType>=3">
+          <dv-decoration-7>涓婁竴绾�</dv-decoration-7>
+        </div>
 
-            <div style="flex:0.5;display: flex;flex-direction:column;align-items: center">
-              <dv-decoration-11 style="width:90%;height:60px;color: #ccc;font-size: 20px">涓変繚璁″垝</dv-decoration-11>
+        <dv-border-box-9 style="padding: 15px 15px 0">
+          <div id="tech_condition_chart" style="width:100%;height: 240px;"></div>
+          <div id="warranty_malfunction_chart" style="width:100%;height: 240px;"></div>
+          <div>
+            <div style="display: flex;flex-direction:column;align-items: center">
+              <dv-decoration-11 style="width:45%;height:60px;color: #fff;font-size: 20px;align-self: flex-start">涓変繚璁″垝
+              </dv-decoration-11>
               <div class="support-plan-container">
-                <div class="support-plan-item" style="background:#67C23A">
-                  <div>涓変繚鏈湀璁″垝</div>
+                <div v-for="(item,index) in supportPlanList" :key="index" class="support-plan-item"
+                     :style="{background:item.backgroundColor}" @click="openMaintenanceModal(item)">
+                  <div>{{item.planTime}}</div>
                   <div class="plan-value-container">
-                    <div class="plan-value">{{thisMonthMaintenancePlanNum}}</div>
-                    <div>鍙�</div>
-                  </div>
-                </div>
-                <div class="support-plan-item" style="background:#409EFF">
-                  <div>鏈湀瀹屾垚閲�</div>
-                  <div class="plan-value-container">
-                    <div class="plan-value">{{thisMonthMaintenanceRealNum}}</div>
-                    <div>鍙�</div>
-                  </div>
-                </div>
-                <div class="support-plan-item" style="background:#E6A23C">
-                  <div>寤舵湡</div>
-                  <div class="plan-value-container">
-                    <div class="plan-value">{{nextMonthMaintenancePlanNum}}</div>
-                    <div>鍙�</div>
-                  </div>
-                </div>
-                <div class="support-plan-item" style="background:#F56C6C">
-                  <div>瓒呮湡</div>
-                  <div class="plan-value-container">
-                    <div class="plan-value">{{nextNextMonthMaintenancePlanNum}}</div>
-                    <div>鍙�</div>
-                  </div>
-                </div>
-                <div class="support-plan-item" style="background:#719D8E">
-                  <div>涓嬫湀璁″垝</div>
-                  <div class="plan-value-container">
-                    <div class="plan-value">{{nextNextMonthMaintenancePlanNum}}</div>
-                    <div>鍙�</div>
-                  </div>
-                </div>
-                <div class="support-plan-item" style="background:#58D9F9">
-                  <div>涓嬩笅鏈堣鍒�</div>
-                  <div class="plan-value-container">
-                    <div class="plan-value">{{nextNextMonthMaintenancePlanNum}}</div>
+                    <div class="plan-value">{{$data[item.planValueLabel]}}</div>
                     <div>鍙�</div>
                   </div>
                 </div>
               </div>
             </div>
 
-            <div style="flex:0.5;display: flex;justify-content: center">
-              <dv-decoration-11 style="width:90%;height:60px;color: #ccc;font-size: 20px">浜屼繚璁″垝</dv-decoration-11>
+            <div style="display: flex;margin-top: 10px;justify-content: space-between;align-items: center;">
+              <dv-decoration-11 style="width:45%;height:60px;font-size: 20px;color: #fff">浜屼繚璁″垝</dv-decoration-11>
+              <div
+                style="flex:1;text-align:center;font-size: 25px;color: #9BD890;overflow: hidden;text-overflow: ellipsis;white-space: nowrap">
+                2024骞�4鏈�1鏃ュぇ淇�
+              </div>
             </div>
           </div>
         </dv-border-box-9>
@@ -66,36 +39,67 @@
       <div style="width: 38%" class="middle-col">
         <dv-border-box-9 style="padding: 15px">
           <div id="running_state_chart" style="width:100%;height: 400px;"></div>
-          <div id="line_chart" style="width:100%;height: 400px;"></div>
+          <div id="first7DaysEfficiency_chart" style="width:100%;height: 400px;"></div>
         </dv-border-box-9>
       </div>
-      <div style="width: 30%">
-        <dv-border-box-9 style="padding: 30px 0">
-          <div id="bar_chart" style="width:100%;height: 250px;"></div>
-          <div id="double_bar_chart" style="width:100%;height: 300px;"></div>
-          <div style="padding: 0 20px;">
-            <dv-scroll-board :config="problemConfig" style="width:100%;height:220px"/>
+
+      <div style="width: 30%" class="right-col">
+        <dv-border-box-9 style="padding: 15px">
+          <a-form layout="inline"
+                  @keyup.enter.native="switchToEquipmentSignage">
+            <a-form-item label="璁惧缂栧彿">
+              <a-auto-complete
+                @select="handleSelectChange"
+                placeholder="鍥炶溅閿煡璇�"
+                :allowClear="true"
+                :filter-option="filterOption"
+                :dataSource="first7DaysEfficiencyData.mdcEquipmentList.map(item=>item.equipmentId)"
+                size="large"
+              />
+            </a-form-item>
+          </a-form>
+          <div style="display: flex;flex-wrap: wrap">
+            <div id="gauge_chart1" class="gauge-chart"></div>
+            <div id="gauge_chart2" class="gauge-chart"></div>
+            <div id="gauge_chart3" class="gauge-chart"></div>
+            <div id="gauge_chart4" class="gauge-chart"></div>
           </div>
+          <div id="bar_chart" style="width:100%;height: 330px;"></div>
         </dv-border-box-9>
       </div>
     </div>
+
+    <SignageModal :modalVisible="modalVisible" :modalTitle=modalTitle :modalDataApiUrl="modalDataApiUrl"
+                  :modalDataApiParams="modalDataApiParams"
+                  @closeModal="modalVisible=false"/>
   </div>
 </template>
 
 <script>
   import signageApi from '@/api/signage'
+  import moment from 'moment'
+  import SignageModal from './modules/SignageModal'
 
   export default {
     name: 'WorkshopSectionSignage',
+    components: { SignageModal },
     props: {
       productionCode: {
         type: String,
         default: ''
+      },
+      userType: {
+        type: Number
       }
     },
     data() {
       return {
+        firstEnterClientWidth: null,
+        pieChartRadius: ['40%', '60%'],
+        normalPieChartRadius: ['40%', '60%'],
+        currentPageProductionId: null,
         runningStateChart: '',
+        runningStateChartDataRequireFinished: false,
         runningStateData: [
           { value: '0', name: '鍏虫満' },
           { value: '0', name: '鎶ヨ' },
@@ -103,115 +107,155 @@
           { value: '0', name: '杩愯' }
         ],
         techConditionChart: '',
+        techConditionChartRequireFinished: false,
         techConditionData: [
           { value: '0', name: '鍚堟牸' },
           { value: '0', name: '绂佺敤' },
           { value: '0', name: '闄愮敤' }
         ],
         warrantyMalfunctionChart: '',
+        warrantyMalfunctionChartRequireFinished: false,
         warrantyMalfunctionData: [
           { value: '0', name: '鎶ヤ慨' },
           { value: '0', name: '鍋滄満' },
           { value: '0', name: '杩愯' }
         ],
-        thisMonthMaintenancePlanNum: 0,
-        thisMonthMaintenanceRealNum: 0,
-        nextMonthMaintenancePlanNum: 0,
-        nextNextMonthMaintenancePlanNum: 0,
-        lineChart: '',
-        lineChartData: [],
-        barChart: '',
-        barChartData: [],
-        doubleBarChart: '',
-        doubleBarChartData: {},
         supportPlanList: [
           {
-            label: '鏈湀涓変繚璁″垝',
-            value: 299,
-            background: '#719D8E'
+            planTime: '鏈湀涓変繚璁″垝',
+            planValueLabel: 'thisMonthMaintenancePlanNum',
+            backgroundColor: '#5FE0AF',
+            apiUrl: '/eam/calibrationOrder/showThisMonthMaintenanceList'
+          },
+
+          {
+            planTime: '鏈湀瀹屾垚閲�',
+            planValueLabel: 'thisMonthMaintenanceRealNum',
+            backgroundColor: '#409EFF',
+            apiUrl: '/eam/calibrationOrder/showThisMonthMaintenanceFinishList'
           },
           {
-            label: '鏈湀瀹屾垚',
-            value: 229,
-            background: '#409EFF'
+            planTime: '寤舵湡',
+            planValueLabel: 'maintenanceExtensionNum',
+            backgroundColor: '#FCAA29',
+            apiUrl: '/eam/calibrationOrder/show3MaintenancePostponeList'
+          },
+
+          {
+            planTime: '瓒呮湡',
+            planValueLabel: 'maintenanceOverdueNum',
+            backgroundColor: '#F56C6C',
+            apiUrl: '/eam/calibrationOrder/show3MaintenanceOverdueList'
           },
           {
-            label: '涓嬫湀涓変繚璁″垝',
-            value: 319,
-            background: '#A8985D'
+            planTime: '涓嬫湀璁″垝',
+            planValueLabel: 'nextMonthMaintenancePlanNum',
+            backgroundColor: '#D6BC52',
+            apiUrl: '/eam/calibrationOrder/showNextMonthMaintenanceList'
           },
           {
-            label: '涓嬩笅鏈堜笁淇濊鍒�',
-            value: 329,
-            background: '#58D9F9'
+            planTime: '涓嬩笅鏈堣鍒�',
+            planValueLabel: 'nextNextMonthMaintenancePlanNum',
+            backgroundColor: '#58D9F9',
+            apiUrl: '/eam/calibrationOrder/showNextNextMonthMaintenanceList'
           }
         ],
-        maintenanceConfig: {},
-        problemConfig: {}
+        thisMonthMaintenancePlanNum: 0,
+        thisMonthMaintenanceRealNum: 0,
+        maintenanceExtensionNum: 0,
+        maintenanceOverdueNum: 0,
+        nextMonthMaintenancePlanNum: 0,
+        nextNextMonthMaintenancePlanNum: 0,
+        first7DaysEfficiencyChart: '',
+        first7DaysEfficiencyData: {
+          dataList: [],
+          mdcEquipmentList: []
+        },
+        gaugeChart1: '',
+        gaugeChart2: '',
+        gaugeChart3: '',
+        gaugeChart4: '',
+        gaugeChartData: {
+          utilizationRate: 0,
+          startRate: 0,
+          openRate: 0,
+          overallEquipmentEfficiency: 0
+        },
+        barChart: '',
+        barChartData: [],
+        equipmentId: '',
+        modalVisible: false,
+        modalTitle: '',
+        modalDataApiUrl: '',
+        modalTableColumns: [],
+        modalDataApiParams: {}
       }
     },
     mounted() {
+      this.firstEnterClientWidth = document.body.clientWidth || document.documentElement.clientWidth
       window.addEventListener('resize', this.handleWindowResize)
-      this.drawCharts()
       this.getChartDataByApi()
-    },
-    activated() {
-      console.log('瑙﹀彂activated')
-      this.handleWindowResize()
     },
     beforeDestroy() {
       window.removeEventListener('resize', this.handleWindowResize)
+      if (this.barChartCarouselTime) clearInterval(this.barChartCarouselTime)
+      if (this.first7DaysEfficiencyChartCarouselTime) clearInterval(this.first7DaysEfficiencyChartCarouselTime)
     },
     methods: {
-      backToLastSignage() {
-        console.log('瑙﹀彂涓婁竴绾�')
-      },
-
+      /* 璋冪敤鎺ュ彛鑾峰彇鍥捐〃鏁版嵁姹囨�绘柟娉� */
       getChartDataByApi() {
         this.getTechConditionDataByApi()
         this.getWarrantyMalfunctionDataByApi()
         this.getRunningStateDataByApi()
         this.getMonthMaintenanceNumByApi()
+        this.getFirst7DaysEfficiencyDataByApi()
+        this.getGaugeChartDataByApi()
         this.getBarChartDataByApi()
-        this.getDoubleBarChartDataByApi()
       },
 
       /* 璋冪敤鎺ュ彛鑾峰彇鎶�鏈姸鎬� */
       getTechConditionDataByApi() {
+        this.techConditionChart = this.$echarts.init(document.getElementById('tech_condition_chart'))
+        this.techConditionChart.showLoading({
+          text: '鏁版嵁鍔犺浇涓� ...',
+          color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊
+          textColor: '#fff',
+          maskColor: 'rgba(1, 25, 75, 0.2)' // 閬僵灞�
+        })
         signageApi.getEquipmentTechnologyStatusListApi(this.productionCode)
           .then(res => {
-            if (res.success) {
+            if (res.success && res.result) {
               this.techConditionData = [
-                { value: res.result[0].qualifiedCount, name: '鍚堟牸' },
-                { value: res.result[0].disabledCount, name: '绂佺敤' },
-                { value: res.result[0].limitedUseCount, name: '闄愮敤' }
+                { value: res.result[0].qualifiedCount, name: '鍚堟牸', technologyStatus: 'qualified' },
+                { value: res.result[0].disabledCount, name: '绂佺敤', technologyStatus: 'disabled' },
+                { value: res.result[0].limitedUseCount, name: '闄愮敤', technologyStatus: 'limitedUse' }
               ]
+              this.techConditionChartRequireFinished = true
+              this.drawTechConditionChart()
             }
-            this.drawTechConditionChart()
           })
       },
 
       /* 璋冪敤鎺ュ彛鑾峰彇璁惧鎶ヤ慨鏁呴殰 */
       getWarrantyMalfunctionDataByApi() {
+        this.warrantyMalfunctionChart = this.$echarts.init(document.getElementById('warranty_malfunction_chart'))
+        this.warrantyMalfunctionChart.showLoading({
+          text: '鏁版嵁鍔犺浇涓� ...',
+          color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊
+          textColor: '#fff',
+          maskColor: 'rgba(1, 25, 75, 0.2)' // 閬僵灞�
+        })
         signageApi.getReportRepairEquipmentListApi(this.productionCode)
           .then(res => {
-            if (res.success) {
+            if (res.success && res.result) {
               this.warrantyMalfunctionData = [
-                { value: res.result[0].failurTotalCount, name: '鎶ヤ慨' },
-                { value: res.result[0].stopCount, name: '鍋滄満' },
-                { value: res.result[0].noStopCount, name: '杩愯' }
+                { value: res.result[0].failurTotalCount, name: '鎶ヤ慨', isStop: '' },
+                { value: res.result[0].stopCount, name: '鍋滄満', isStop: '2' },
+                { value: res.result[0].noStopCount, name: '杩愯', isStop: '1' }
               ]
+              this.warrantyMalfunctionChartRequireFinished = true
+              this.drawWarrantyMalfunctionChart()
             }
-            this.drawWarrantyMalfunctionChart()
-          })
-      },
-
-      /* 璋冪敤鎺ュ彛鑾峰彇璁惧杩愯鐘舵�� */
-      getRunningStateDataByApi() {
-        signageApi.getEquipmentStatusStatisticsApi(this.productionCode)
-          .then(res => {
-            if (res.success) this.runningStateData = res.result
-            this.drawRunningStateChart()
           })
       },
 
@@ -235,57 +279,125 @@
           })
       },
 
-      /* 璋冪敤鎺ュ彛鑾峰彇璁惧OEE缁熻 */
+      /* 璋冪敤鎺ュ彛鑾峰彇璁惧杩愯鐘舵�� */
+      getRunningStateDataByApi() {
+        this.runningStateChart = this.$echarts.init(document.getElementById('running_state_chart'))
+        this.runningStateChart.showLoading({
+          text: '鏁版嵁鍔犺浇涓� ...',
+          color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊
+          textColor: '#fff',
+          maskColor: 'rgba(1, 25, 75, 0.2)' // 閬僵灞�
+        })
+        signageApi.getEquipmentStatusStatisticsApi(this.productionCode)
+          .then(res => {
+            if (res.success) {
+              this.runningStateData = res.result.list
+              this.currentPageProductionId = res.result.productionId
+              this.runningStateChartDataRequireFinished = true
+              this.drawRunningStateChart(res.result.productionId)
+            }
+          })
+      },
+
+      /* 璋冪敤鎺ュ彛鑾峰彇鍓�7澶╁埄鐢ㄧ巼 */
+      getFirst7DaysEfficiencyDataByApi() {
+        this.first7DaysEfficiencyChart = this.$echarts.init(document.getElementById('first7DaysEfficiency_chart'))
+        this.first7DaysEfficiencyChart.showLoading({
+          text: '鏁版嵁鍔犺浇涓� ...',
+          color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊
+          textColor: '#fff',
+          maskColor: 'rgba(1, 25, 75, 0.2)' // 閬僵灞�
+        })
+        signageApi.getEquipmentDayUtilizationStatisticsApi(this.productionCode)
+          .then(res => {
+            if (res.success) {
+              this.first7DaysEfficiencyData = res.result
+              this.drawFirst7DaysEfficiencyDataChart()
+            }
+          })
+      },
+
+      /* 璋冪敤鎺ュ彛鑾峰彇璁惧鏁堢巼缁熻 */
+      getGaugeChartDataByApi() {
+        this.gaugeChart1 = this.$echarts.init(document.getElementById('gauge_chart1'))
+        this.gaugeChart2 = this.$echarts.init(document.getElementById('gauge_chart2'))
+        this.gaugeChart3 = this.$echarts.init(document.getElementById('gauge_chart3'))
+        this.gaugeChart4 = this.$echarts.init(document.getElementById('gauge_chart4'))
+        this.gaugeChart1.showLoading({
+          text: '鏁版嵁鍔犺浇涓� ...',
+          color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊
+          textColor: '#fff',
+          maskColor: 'rgba(1, 25, 75, 0.2)' // 閬僵灞�
+        })
+        this.gaugeChart2.showLoading({
+          text: '鏁版嵁鍔犺浇涓� ...',
+          color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊
+          textColor: '#fff',
+          maskColor: 'rgba(1, 25, 75, 0.2)' // 閬僵灞�
+        })
+        this.gaugeChart3.showLoading({
+          text: '鏁版嵁鍔犺浇涓� ...',
+          color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊
+          textColor: '#fff',
+          maskColor: 'rgba(1, 25, 75, 0.2)' // 閬僵灞�
+        })
+        this.gaugeChart4.showLoading({
+          text: '鏁版嵁鍔犺浇涓� ...',
+          color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊
+          textColor: '#fff',
+          maskColor: 'rgba(1, 25, 75, 0.2)' // 閬僵灞�
+        })
+        signageApi.getEquipmentEfficiencyStatisticsApi(this.productionCode)
+          .then(res => {
+            if (res.success) this.gaugeChartData = res.result
+            this.drawGaugeChart()
+          })
+      },
+
+      /* 璋冪敤鎺ュ彛鑾峰彇涓婃湀OEE */
       getBarChartDataByApi() {
-        signageApi.getEquipmentOEEStatistics(this.productionCode)
+        this.barChart = this.$echarts.init(document.getElementById('bar_chart'))
+        this.barChart.showLoading({
+          text: '鏁版嵁鍔犺浇涓� ...',
+          color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊
+          textColor: '#fff',
+          maskColor: 'rgba(1, 25, 75, 0.2)' // 閬僵灞�
+        })
+        signageApi.getEquipmentOEEMonthStatisticsApi(this.productionCode)
           .then(res => {
-            if (res.success) this.barChartData = res.result
-            this.drawBarChart()
-          })
-      },
+            if (res.success && res.result && res.result.length > 0) {
+              this.barChartData = res.result.map(item => {
+                return {
+                  name: item.equipmentId,
+                  value: item.overallEquipmentEfficiency
+                }
+              })
+              this.drawBarChart()
+            }
 
-      /* 璋冪敤鎺ュ彛鑾峰彇璁惧OEE鍜屽埄鐢ㄧ巼瀵规瘮 */
-      getDoubleBarChartDataByApi() {
-        signageApi.getEquipmentMonthStatisticsApi(this.productionCode)
-          .then(res => {
-            if (res.success) this.doubleBarChartData = res.result
-            this.drawDoubleBarChart()
           })
-      },
-
-      /* 缁樺埗鍥捐〃姹囨�绘柟娉� */
-      drawCharts() {
-        this.drawRunningStateChart()
-        this.drawTechConditionChart()
-        this.drawWarrantyMalfunctionChart()
-        this.drawLineChart()
-        this.drawBarChart()
-        this.drawDoubleBarChart()
-        this.drawProblemChart()
       },
 
       /* 缁樺埗鎶�鏈姸鎬侀ゼ鍥� */
       drawTechConditionChart() {
-        this.techConditionChart = this.$echarts.init(document.getElementById('tech_condition_chart'))
         const option = {
           title: {
             show: true, // 鏄惁鏄剧ず鏍囬锛岄粯璁や负true
             text: '鎶�鏈姸鎬�', // 涓绘爣棰樻枃鏈�
             x: 'left', // 鏍囬姘村钩瀹夋斁浣嶇疆锛屽彲閫夊�间负'left'銆�'center'銆�'right'鎴栧叿浣撶殑姘村钩鍧愭爣鍊�
-            y: 'top', // 鏍囬鍨傜洿瀹夋斁浣嶇疆锛屽彲閫夊�间负'top'銆�'bottom'銆�'center'鎴栧叿浣撶殑鍨傜洿鍧愭爣鍊�
+            y: this.userType >= 3 ? '25' : 'top', // 鏍囬鍨傜洿瀹夋斁浣嶇疆锛屽彲閫夊�间负'top'銆�'bottom'銆�'center'鎴栧叿浣撶殑鍨傜洿鍧愭爣鍊�
             textStyle: {
               // 涓绘爣棰樻枃鏈牱寮�
               fontSize: 18,
               fontWeight: 'normal',
-              color: '#00A8AC'
+              color: '#1AD8DE'
             }
           },
           tooltip: {
             trigger: 'item',
             formatter: function(params) {
-              if (params.name !== '') {
-                return `${params.name}:${params.value}(${params.percent}%)`
-              }
+              return '<span style="font-weight:bolder;">' + params.name + '</span><br/>' +
+                '<span style="display:inline-block; width:10px; height:10px; border-radius:100px; margin-right:5px; background:' + params.color + '"></span>' + `${params.value}锛�${params.percent}%锛塦
             }
           },
           legend: {
@@ -311,12 +423,12 @@
             {
               type: 'pie',
               // selectedMode: "single",
-              radius: ['30%', '50%'],
+              radius: this.pieChartRadius,
               center: ['50%', '50%'],
               color: [
-                '#0AA012',
-                '#237E48',
-                '#757160'
+                '#0FC61A',
+                '#F56436',
+                '#8B8B8B'
               ],
               label: {
                 position: 'outside',
@@ -341,11 +453,21 @@
           ]
         }
         this.techConditionChart.setOption(option, true)
+        this.techConditionChart.hideLoading()
+
+        this.techConditionChart.on('click', params => {
+          this.modalTitle = `鎶�鏈姸鎬侊紙${params.name}锛塦
+          this.modalDataApiParams = {
+            technologyStatus: this.techConditionData.find(item => item.name === params.name).technologyStatus,
+            productionCode: this.productionCode
+          }
+          this.modalDataApiUrl = '/eam/calibrationOrder/showEquipmentByTechnologyStatus'
+          this.modalVisible = true
+        })
       },
 
       /* 缁樺埗璁惧鎶ヤ慨鏁呴殰楗煎浘 */
       drawWarrantyMalfunctionChart() {
-        this.warrantyMalfunctionChart = this.$echarts.init(document.getElementById('warranty_malfunction_chart'))
         const option = {
           title: {
             show: true, // 鏄惁鏄剧ず鏍囬锛岄粯璁や负true
@@ -356,15 +478,14 @@
               // 涓绘爣棰樻枃鏈牱寮�
               fontSize: 18,
               fontWeight: 'normal',
-              color: '#00A8AC'
+              color: '#1AD8DE'
             }
           },
           tooltip: {
             trigger: 'item',
             formatter: function(params) {
-              if (params.name !== '') {
-                return `${params.name}:${params.value}(${params.percent}%)`
-              }
+              return '<span style="font-weight:bolder;">' + params.name + '</span><br/>' +
+                '<span style="display:inline-block; width:10px; height:10px; border-radius:100px; margin-right:5px; background:' + params.color + '"></span>' + `${params.value}锛�${params.percent}%锛塦
             }
           },
           legend: {
@@ -390,12 +511,12 @@
             {
               type: 'pie',
               // selectedMode: "single",
-              radius: ['30%', '50%'],
+              radius: this.pieChartRadius,
               center: ['50%', '50%'],
               color: [
-                '#00CED1',
-                '#B85B38',
-                '#A8985D'
+                '#24F2F5',
+                '#F56436',
+                '#FFFF40'
               ],
               label: {
                 position: 'outside',
@@ -420,11 +541,21 @@
           ]
         }
         this.warrantyMalfunctionChart.setOption(option, true)
+        this.warrantyMalfunctionChart.hideLoading()
+
+        this.warrantyMalfunctionChart.on('click', params => {
+          this.modalTitle = `鎶ヤ慨鏁呴殰锛�${params.name}锛塦
+          this.modalDataApiParams = {
+            isStop: this.warrantyMalfunctionData.find(item => item.name === params.name).isStop,
+            productionCode: this.productionCode
+          }
+          this.modalDataApiUrl = '/eam/calibrationOrder/showEquipmentByReportRepair'
+          this.modalVisible = true
+        })
       },
 
       /* 缁樺埗璁惧杩愯鐘舵�佺帿鐟伴ゼ鍥� */
-      drawRunningStateChart() {
-        this.runningStateChart = this.$echarts.init(document.getElementById('running_state_chart'))
+      drawRunningStateChart(productionId) {
         const option = {
           title: {
             show: true, // 鏄惁鏄剧ず鏍囬锛岄粯璁や负true
@@ -435,15 +566,14 @@
               // 涓绘爣棰樻枃鏈牱寮�
               fontSize: 18,
               fontWeight: 'normal',
-              color: '#00A8AC'
+              color: '#1AD8DE'
             }
           },
           tooltip: {
             trigger: 'item',
             formatter: function(params) {
-              if (params.name !== '') {
-                return `${params.name}:${params.value}(${params.percent}%)`
-              }
+              return '<span style="font-weight:bolder;">' + params.name + '</span><br/>' +
+                '<span style="display:inline-block; width:10px; height:10px; border-radius:100px; margin-right:5px; background:' + params.color + '"></span>' + `${params.value}锛�${params.percent}%锛塦
             }
           },
           legend: {
@@ -470,13 +600,13 @@
               type: 'pie',
               roseType: 'angle', // 鐜懓鍥�
               // selectedMode: "single",
-              radius: ['30%', '70%'],
+              radius: this.pieChartRadius,
               center: ['50%', '50%'],
               color: [
-                '#686869',
-                '#AA6349',
-                '#968A5E',
-                '#5D975D'
+                '#8B8B8B',
+                '#F56436',
+                '#FFFF40',
+                '#0FC61A'
               ],
               label: {
                 position: 'outside',
@@ -484,7 +614,7 @@
                 color: 'inherit',
                 // textBorderColor: 'inherit',
                 // textBorderWidth: 1,
-                fontSize: 16,
+                fontSize: 30,
                 formatter: function(params) {
                   if (params.name !== '') {
                     return `${params.name}:${params.value}`
@@ -493,58 +623,81 @@
               },
               labelLine: {
                 show: true,
-                length2: 10,
-                length: 10
+                length2: 20,
+                length: 30
               },
               data: this.runningStateData
             }
           ]
         }
         this.runningStateChart.setOption(option, true)
+        this.runningStateChart.hideLoading()
+
+        this.runningStateChart.on('click', params => {
+          this.$router.push({
+            name: 'mdc-base-DeviceBaseInfo',
+            params: { signageData: params.data, productionId }
+          })
+        })
       },
 
-      /* 缁樺埗鎶樼嚎鍥� */
-      drawLineChart() {
-        this.lineChart = this.$echarts.init(document.getElementById('line_chart'))
+      /* 缁樺埗鍓�7澶╁埄鐢ㄧ巼鏌卞浘 */
+      drawFirst7DaysEfficiencyDataChart() {
+        this.first7DaysEfficiencyData.mdcEquipmentList.forEach(item => {
+          if (!this.first7DaysEfficiencyData.dataList.map(item => item.equipmentId).includes(item)) {
+            const equipmentIdObj = {
+              equipmentId: item.equipmentId,
+              equipmentName: item.equipmentName,
+              openRate: 0,
+              startRate: 0,
+              utilizationRate: 0
+            }
+            this.first7DaysEfficiencyData.dataList.push(equipmentIdObj)
+          }
+        })
+        const equipmentIdList = this.first7DaysEfficiencyData.dataList.map(item => item.equipmentId)
         const newData = {
-          xAxis: ['2640221', '2640223', '2640224', '2640225', '2640226', '2640227', '2640228', '2640229', '12640220', '12640221', '12640222'],
+          xAxis: equipmentIdList,
           yAxis: [
             {
-              name: '鍒╃敤鐜�',
-              value: [20, 60, 55, 36, 52, 52, 63, 78, 23, 42, 65]
+              name: 'TEEP',
+              value: this.first7DaysEfficiencyData.dataList.map(item => item.utilizationRate)
             },
             {
               name: '寮�鍔ㄧ巼',
-              value: [23, 63, 44, 40, 74, 80, 60, 90, 70, 40, 70]
+              value: this.first7DaysEfficiencyData.dataList.map(item => item.startRate)
             },
             {
               name: '寮�鏈虹巼',
-              value: [90, 70, 40, 70, 80, 65, 73, 60, 70, 90, 40]
+              value: this.first7DaysEfficiencyData.dataList.map(item => item.openRate)
             }
           ],
-          yAxisName: '鍓�7澶╁埄鐢ㄧ巼'
+          yAxisName: '鍓�7澶㏕EEP(%)'
         }
         let legendData = []
         let seriesData = []
-        let colorArr = ['#09F39E', '#A5F10D', '#09B3F6']
+        let colorArr = ['#A7F0C1', '#FAE893', '#66DFE2']
         legendData = newData.yAxis.map((item) => item.name)
         seriesData = newData.yAxis.map((item1, index1) => {
           return {
             name: item1.name,
-            type: 'line',
+            type: 'bar',
             symbol: 'circle',
             symbolSize: 8,
             itemStyle: {
-              color: colorArr[index1]
+              color: colorArr[index1],
+              barBorderRadius: 100
             },
             lineStyle: {
               width: 2
+            },
+            markPoint: {
+              show: true
             },
             yAxisIndex: 1,
             data: item1.value // 鎶樼嚎鍥剧殑鏁版嵁
           }
         })
-
         const option = {
           grid: {
             containLabel: true,
@@ -557,6 +710,17 @@
             trigger: 'axis',
             axisPointer: {
               type: 'shadow'
+            },
+            formatter: function(params) {
+              let result = ''
+              params.forEach((item, index) => {
+                let dom = `<span style="display:inline-block;width:10px;height:10px;border-radius:100px;margin-right:5px;background:${item.color}"></span>${item.seriesName}锛�${item.value}%`
+                if (index === 0) {
+                  result = `<span style="font-weight:bolder;">${item.name}</span>`
+                }
+                result += '<br />' + dom
+              })
+              return result
             }
           },
           legend: {
@@ -565,45 +729,45 @@
             data: legendData,
             itemGap: 10,
             textStyle: {
-              fontSize: 16,
-              color: '#ccc'
+              fontSize: 14,
+              color: '#fff'
             }
           },
           xAxis: {
-            triggerEvent: true,
             data: newData.xAxis || [],
             axisLabel: {
-              interval: 1,
+              interval: 0,
               show: true,
-              fontSize: 12,
-              color: '#50729A',
+              fontSize: 14,
+              color: '#fff'
               // rotate: -30,
             },
             axisLine: {
               show: true,
               lineStyle: {
-                color: '#50729A'
+                color: '#fff'
               }
             },
             axisTick: {
               show: true,
-              alignWithLabel:true,
+              alignWithLabel: true
             }
           },
           yAxis: [
             {
               name: newData.yAxisName,
               nameTextStyle: {
-                color: '#00A8AC',
+                color: '#1AD8DE',
                 fontSize: 18,
-                padding: [0, 0, 0, 80]
+                padding: [0, 0, 0, 110]
               },
+              nameGap: 30,
               type: 'value',
               position: 'left',
               axisLine: {
                 show: true,
                 lineStyle: {
-                  color: '#50729A'
+                  color: '#fff'
                 }
               },
               axisTick: {
@@ -612,7 +776,7 @@
               splitLine: {
                 show: false,
                 lineStyle: {
-                  color: '#3E4A82'
+                  color: '#fff'
                 }
               }
             },
@@ -620,15 +784,16 @@
               type: 'value',
               position: 'right',
               splitNumber: 5,
+              max: 100,
               axisLabel: {
                 show: true,
-                fontSize: 16,
-                color: '#50729A'
+                color: '#fff',
+                fontSize: 14
               },
               axisLine: {
                 show: true,
                 lineStyle: {
-                  color: '#50729A'
+                  color: '#fff'
                 }
               },
               axisTick: {
@@ -637,91 +802,396 @@
               splitLine: {
                 show: false,
                 lineStyle: {
-                  color: '#3E4A82'
+                  color: '#fff'
                 }
               }
             }
           ],
-          series: seriesData
+          series: seriesData,
+          dataZoom: {
+            show: false,
+            startValue: 0, // 浠庡ご寮�濮嬨��
+            endValue: 6 // 涓�娆℃�у睍绀哄嚑涓�
+          }
+          // toolbox: {
+          //   show: true,
+          //   feature: {
+          //     mark: { show: true },
+          //     magicType: { show: true, type: ['line', 'bar'] },
+          //     restore: { show: true },
+          //     saveAsImage: { show: true, name: '鍓�7澶╁埄鐢ㄧ巼缁熻鍥�', pixelRatio: 1 }
+          //   }
+          // }
         }
-        this.lineChart.setOption(option, true)
+        this.first7DaysEfficiencyChart.setOption(option, true)
+        this.first7DaysEfficiencyChart.hideLoading()
 
+        this.first7DaysEfficiencyChart.on('click', params => {
+          this.$router.push({
+            name: 'mdc-base-StatisticsChart',
+            params: {
+              isEquipment: true,
+              productionId: params.name,
+              tierName: this.first7DaysEfficiencyData.dataList.find(item => item.equipmentId === params.name).equipmentName
+            }
+          })
+        })
+
+
+        // 璁惧鍒楄〃澶т簬7涓椂寮�鍚嚜鍔ㄨ疆鎾�
+        if (this.first7DaysEfficiencyData.mdcEquipmentList.length <= 7) return
+        this.first7DaysEfficiencyChartCarouselTime = setInterval(() => {
+          newData.xAxis.push(newData.xAxis.shift())
+          newData.yAxis.forEach(item => item.value.push(item.value.shift()))
+          this.$nextTick(() => {
+            this.first7DaysEfficiencyChart.setOption(option, true)
+          })
+        }, 30000)
+      },
+
+      /* 缁樺埗浠〃鐩樺浘琛� */
+      drawGaugeChart() {
+        const option = {
+          title: {
+            show: true, // 鏄惁鏄剧ず鏍囬锛岄粯璁や负true
+            text: '', // 涓绘爣棰樻枃鏈�
+            x: 'center', // 鏍囬姘村钩瀹夋斁浣嶇疆锛屽彲閫夊�间负'left'銆�'center'銆�'right'鎴栧叿浣撶殑姘村钩鍧愭爣鍊�
+            y: 'top', // 鏍囬鍨傜洿瀹夋斁浣嶇疆锛屽彲閫夊�间负'top'銆�'bottom'銆�'center'鎴栧叿浣撶殑鍨傜洿鍧愭爣鍊�
+            textStyle: {
+              // 涓绘爣棰樻枃鏈牱寮�
+              fontSize: 18,
+              fontWeight: 'normal',
+              color: '#1AD8DE'
+            }
+          },
+          tooltip: {
+            trigger: 'item',
+            formatter: params => {
+              return params.seriesName + '锛�' + params.value + '%'
+            }
+          },
+          grid: {
+            left: '1%',
+            top: '1%',
+            right: '10%',
+            bottom: '1%'
+          },
+          series: [
+            {
+              name: '',
+              type: 'gauge',
+              radius: '80%',
+              center: ['50%', '60%'],    // 榛樿鍏ㄥ眬灞呬腑
+              pointer: {
+                width: 6,
+                length: '50%',
+                itemStyle: {
+                  color: 'inherit'
+                }
+              },
+              splitLine: {
+                show: true,
+                length: 10,
+                lineStyle: {
+                  color: '#fff',
+                  width: 2
+                }
+              },
+              axisTick: {
+                length: 5,
+                lineStyle: {
+                  color: '#fff',
+                  width: 1
+                }
+              },
+              axisLabel: {
+                show: false,
+                fontSize: 18,
+                formatter: function(value) {
+                  return value + '%'
+                }
+              },
+              axisLine: {
+                lineStyle: { // 灞炴�ineStyle鎺у埗绾挎潯鏍峰紡
+                  color: [ //琛ㄧ洏棰滆壊
+                    [0.3, '#F56436'],//0-30%澶勭殑棰滆壊
+                    [0.6, '#FFFF40'],//30%-60%澶勭殑棰滆壊
+                    [1, '#0FC61A']//60%-100%澶勭殑棰滆壊
+                  ],
+                  width: 15//琛ㄧ洏瀹藉害
+                }
+              },
+              detail: {
+                formatter: '{score|{value}%}',
+                offsetCenter: [0, '50%'],
+                height: 30,
+                rich: {
+                  score: {
+                    fontSize: 20
+                  }
+                }
+              },
+              data: []
+            }
+          ]
+        }
+        this.drawGaugeChart1(option)
+        this.drawGaugeChart2(option)
+        this.drawGaugeChart3(option)
+        this.drawGaugeChart4(option)
+      },
+
+      /* 缁樺埗鍒╃敤鐜囦华琛ㄧ洏鍥捐〃 */
+      drawGaugeChart1(opt) {
+        const option = Object.assign({}, opt)
+
+        signageApi.getGaugeColorByTypeApi('lyl')
+          .then(res => {
+            if (res.success) {
+              const colorRange = res.result.map(item => item = [+item.maximumRange / 100, item.rateParameterColor])
+              option.series[0].axisLine.lineStyle.color = colorRange
+            }
+          })
+          .finally(() => {
+            option.title.text = moment().subtract(1, 'days').format('M鏈圖鏃�') + `TEEP`
+            option.series[0].name = 'TEEP'
+            option.series[0].data = [this.gaugeChartData.utilizationRate]
+            this.gaugeChart1.setOption(option, true)
+            this.gaugeChart1.hideLoading()
+          })
+
+
+        this.gaugeChart1.getZr().on('click', params => {
+          // 浠呮湁鐐瑰嚮琛ㄧ洏鍖哄煙鎵嶄細鏈変互涓嬪睘鎬э紝topTarget琛ㄧず瑙﹀彂浜嬩欢瀵硅薄锛宻hape琛ㄧず瑙﹀彂浜嬩欢瀵硅薄鐨勫浘鍍忓睘鎬э紝clockwise琛ㄧず琛ㄧ洏鏄惁浠ラ『鏃堕拡鎺掑垪锛岄粯璁や负true
+          if (params.topTarget && params.topTarget.shape && params.topTarget.shape.clockwise !== undefined) {
+            this.$router.push({
+              name: 'mdc-base-StatisticsChart',
+              params: {
+                isEquipment: false,
+                productionId: this.gaugeChartData.productionId,
+                tierName: this.gaugeChartData.productionName
+              }
+            })
+          }
+        })
+      },
+
+      /* 缁樺埗寮�鍔ㄧ巼浠〃鐩樺浘琛� */
+      drawGaugeChart2(opt) {
+        const option = Object.assign({}, opt)
+
+        signageApi.getGaugeColorByTypeApi('kdl')
+          .then(res => {
+            if (res.success) {
+              const colorRange = res.result.map(item => item = [+item.maximumRange / 100, item.rateParameterColor])
+              option.series[0].axisLine.lineStyle.color = colorRange
+            }
+          })
+          .finally(() => {
+            option.title.text = moment().subtract(1, 'days').format('M鏈圖鏃�') + '寮�鍔ㄧ巼'
+            option.series[0].name = '寮�鍔ㄧ巼'
+            option.series[0].data = [this.gaugeChartData.startRate]
+            this.gaugeChart2.setOption(option, true)
+            this.gaugeChart2.hideLoading()
+          })
+
+        this.gaugeChart2.getZr().on('click', params => {
+          // 浠呮湁鐐瑰嚮琛ㄧ洏鍖哄煙鎵嶄細鏈変互涓嬪睘鎬э紝topTarget琛ㄧず瑙﹀彂浜嬩欢瀵硅薄锛宻hape琛ㄧず瑙﹀彂浜嬩欢瀵硅薄鐨勫浘鍍忓睘鎬э紝clockwise琛ㄧず琛ㄧ洏鏄惁浠ラ『鏃堕拡鎺掑垪锛岄粯璁や负true
+          if (params.topTarget && params.topTarget.shape && params.topTarget.shape.clockwise !== undefined) {
+            this.$router.push({
+              name: 'mdc-base-StatisticsChart',
+              params: {
+                isEquipment: false,
+                productionId: this.gaugeChartData.productionId,
+                tierName: this.gaugeChartData.productionName
+              }
+            })
+          }
+        })
+      },
+
+      /* 缁樺埗寮�鏈虹巼浠〃鐩樺浘琛� */
+      drawGaugeChart3(opt) {
+        const option = Object.assign({}, opt)
+
+        signageApi.getGaugeColorByTypeApi('kdl')
+          .then(res => {
+            if (res.success) {
+              const colorRange = res.result.map(item => item = [+item.maximumRange / 100, item.rateParameterColor])
+              option.series[0].axisLine.lineStyle.color = colorRange
+            }
+          })
+          .finally(() => {
+            option.title.text = moment().subtract(1, 'days').format('M鏈圖鏃�') + '寮�鏈虹巼'
+            option.series[0].name = '寮�鏈虹巼'
+            option.series[0].data = [this.gaugeChartData.openRate]
+            this.gaugeChart3.setOption(option, true)
+            this.gaugeChart3.hideLoading()
+          })
+
+        this.gaugeChart3.getZr().on('click', params => {
+          // 浠呮湁鐐瑰嚮琛ㄧ洏鍖哄煙鎵嶄細鏈変互涓嬪睘鎬э紝topTarget琛ㄧず瑙﹀彂浜嬩欢瀵硅薄锛宻hape琛ㄧず瑙﹀彂浜嬩欢瀵硅薄鐨勫浘鍍忓睘鎬э紝clockwise琛ㄧず琛ㄧ洏鏄惁浠ラ『鏃堕拡鎺掑垪锛岄粯璁や负true
+          if (params.topTarget && params.topTarget.shape && params.topTarget.shape.clockwise !== undefined) {
+            this.$router.push({
+              name: 'mdc-base-StatisticsChart',
+              params: {
+                isEquipment: false,
+                productionId: this.gaugeChartData.productionId,
+                tierName: this.gaugeChartData.productionName
+              }
+            })
+          }
+        })
+      },
+
+      /* 缁樺埗OEE浠〃鐩樺浘琛� */
+      drawGaugeChart4(opt) {
+        const option = Object.assign({}, opt)
+
+        signageApi.getGaugeColorByTypeApi('lyl')
+          .then(res => {
+            if (res.success) {
+              const colorRange = res.result.map(item => item = [+item.maximumRange / 100, item.rateParameterColor])
+              option.series[0].axisLine.lineStyle.color = colorRange
+            }
+          })
+          .finally(() => {
+            option.title.text = moment().subtract(1, 'months').format('M鏈�') + `OEE`
+            option.series[0].name = 'OEE'
+            option.series[0].data = [this.gaugeChartData.overallEquipmentEfficiency]
+            this.gaugeChart4.setOption(option, true)
+            this.gaugeChart4.hideLoading()
+          })
+
+        this.gaugeChart4.getZr().on('click', params => {
+          // 浠呮湁鐐瑰嚮琛ㄧ洏鍖哄煙鎵嶄細鏈変互涓嬪睘鎬э紝topTarget琛ㄧず瑙﹀彂浜嬩欢瀵硅薄锛宻hape琛ㄧず瑙﹀彂浜嬩欢瀵硅薄鐨勫浘鍍忓睘鎬э紝clockwise琛ㄧず琛ㄧ洏鏄惁浠ラ『鏃堕拡鎺掑垪锛岄粯璁や负true
+          if (params.topTarget && params.topTarget.shape && params.topTarget.shape.clockwise !== undefined) {
+            this.$router.push({
+              name: 'mdc-base-OEEAnalysis',
+              params: { isEquipment: false, productionId: this.gaugeChartData.productionId }
+            })
+          }
+        })
       },
 
       /* 缁樺埗鍗曟煴鍥� */
       drawBarChart() {
-        this.barChart = this.$echarts.init(document.getElementById('bar_chart'))
+        const defaultData = []
+        const colorArray = ['#79CEAA', '#F589A2', '#6FBF9D', '#66DFE2', '#A7F0C1', '#FAE893', '#F7B7A0']
+        const dataMax = +this.barChartData.sort((x, y) => +y.value - +x.value)[0].value
+        let yAxisMax
+        if (dataMax === 0) yAxisMax = 1 // 鑻ユ暟鎹腑鏈�澶у�间负0锛屽垯灏嗚儗鏅粯璁ゅ�艰缃负1
+        else yAxisMax = Math.ceil(dataMax / 5) * 5 // 璁剧疆鏌卞浘鑳屾櫙闃村奖榛樿鍊硷紝鎬濊矾涓烘暟鎹渶澶у�兼渶鎺ヨ繎鐨勮兘琚�5鏁撮櫎鐨勬暟瀛�
+        const yAxisInterval = yAxisMax / 5 // 鍚屾椂灏嗗埢搴﹀�煎垎鎴�5浠�
+        this.barChartData.forEach(item => defaultData.push(yAxisMax))
+        const xAisData = this.barChartData.map(item => item.name)
         const option = {
+          height: 260,
+          title: {
+            show: true, // 鏄惁鏄剧ず鏍囬锛岄粯璁や负true
+            text: '', // 涓绘爣棰樻枃鏈�
+            x: 'center', // 鏍囬姘村钩瀹夋斁浣嶇疆锛屽彲閫夊�间负'left'銆�'center'銆�'right'鎴栧叿浣撶殑姘村钩鍧愭爣鍊�
+            y: 'top', // 鏍囬鍨傜洿瀹夋斁浣嶇疆锛屽彲閫夊�间负'top'銆�'bottom'銆�'center'鎴栧叿浣撶殑鍨傜洿鍧愭爣鍊�
+            textStyle: {
+              // 涓绘爣棰樻枃鏈牱寮�
+              fontSize: 18,
+              fontWeight: 'normal',
+              color: '#1AD8DE'
+            }
+          },
           tooltip: {
             trigger: 'axis',
             axisPointer: {
               type: 'shadow'
             },
-            // backgroundColor: 'rgba(9, 24, 48, 0.5)',
-            borderColor: 'rgba(75, 253, 238, 0.4)',
-            textStyle: {
-              // color: '#CFE3FC'
+            formatter: function(params) {
+              return '<span style="font-weight:bolder;">' + params[0].name + '</span><br/>' +
+                '<span style="display:inline-block; width:10px; height:10px; border-radius:100px; margin-right:5px; background:' + params[0].color + '"></span>' + ' OEE: ' + params[0].value + '%'
             },
+            borderColor: 'rgba(75, 253, 238, 0.4)',
             borderWidth: 1
           },
           grid: {
             top: '15%',
-            left: '10%'
+            left: '6%',
+            right: '3%'
           },
-          xAxis: [{
-            name: 'OEE杞﹂棿',
-            nameLocation: 'middle',
-            nameGap: 30, // x杞磏ame涓庢í鍧愭爣杞寸嚎鐨勯棿璺�
-            type: 'category',
-            data: this.barChartData.map(item => item.name),
-            axisLine: {
-              lineStyle: {
-                color: '#FFFFFF'
+          xAxis: [
+            {
+              // name: '涓婁釜鏈圤EE',
+              // nameLocation: 'middle',
+              // nameGap: 40, // x杞磏ame涓庢í鍧愭爣杞寸嚎鐨勯棿璺�
+              type: 'category',
+              data: xAisData,
+              axisLine: {
+                lineStyle: {
+                  color: '#fff'
+                }
+              },
+              axisLabel: {
+                show: true, // 鏄惁鏄剧ず鍒诲害鏍囩锛岄粯璁ゆ樉绀�
+                interval: 0, // 鍧愭爣杞村埢搴︽爣绛剧殑鏄剧ず闂撮殧锛屽湪绫荤洰杞翠腑鏈夋晥锛涢粯璁や細閲囩敤鏍囩涓嶉噸鍙犵殑绛栫暐闂撮殧鏄剧ず鏍囩锛涘彲浠ヨ缃垚0寮哄埗鏄剧ず鎵�鏈夋爣绛撅紱濡傛灉璁剧疆涓�1锛岃〃绀恒�庨殧涓�涓爣绛炬樉绀轰竴涓爣绛俱�忥紝濡傛灉鍊间负2锛岃〃绀洪殧涓や釜鏍囩鏄剧ず涓�涓爣绛撅紝浠ユ绫绘帹銆�
+                // rotate: this.barChartData.length >= 5 ? -30 : 0, // 鍒诲害鏍囩鏃嬭浆鐨勮搴︼紝鍦ㄧ被鐩酱鐨勭被鐩爣绛炬樉绀轰笉涓嬬殑鏃跺�欏彲浠ラ�氳繃鏃嬭浆闃叉鏍囩涔嬮棿閲嶅彔锛涙棆杞殑瑙掑害浠�-90搴﹀埌90搴�
+                inside: false, // 鍒诲害鏍囩鏄惁鏈濆唴锛岄粯璁ゆ湞澶�
+                margin: 6, // 鍒诲害鏍囩涓庤酱绾夸箣闂寸殑璺濈
+                fontSize: 14
+              },
+              axisTick: {
+                show: true,
+                alignWithLabel: true
+              }
+            }],
+          yAxis: [
+            {
+              name: '%',
+              min: 0,
+              max: yAxisMax,
+              interval: yAxisInterval,
+              position: 'left',
+              axisLabel: {
+                formatter: '{value}',
+                color: '#fff',
+                fontSize: 14
+              },
+              axisTick: {
+                show: true
+              },
+              axisLine: {
+                show: true,
+                lineStyle: {
+                  color: '#fff'
+                }
+              },
+              splitLine: {
+                show: false,
+                lineStyle: {
+                  color: 'rgba(255,255,255,0.12)'
+                }
               }
             },
-            axisLabel: {
-              margin: 10,
-              color: '#e2e9ff',
-              textStyle: {
-                fontSize: 12
-              }
-            },
-            axisTick: {
-              show: false
-            }
-          }],
-          yAxis: [{
-            name: '鏁伴噺',
-            nameLocation: 'middle',
-            nameGap: 30, // x杞磏ame涓庢í鍧愭爣杞寸嚎鐨勯棿璺�
-            axisLabel: {
-              formatter: '{value}',
-              color: '#e2e9ff'
-            },
-            axisTick: {
-              show: false
-            },
-            axisLine: {
-              show: false,
-              lineStyle: {
-                color: '#FFFFFF'
-              }
-            },
-            splitLine: {
-              lineStyle: {
-                color: 'rgba(255,255,255,0.12)'
+            {
+              position: 'right',
+              axisLine: {
+                show: true,
+                lineStyle: {
+                  color: '#fff'
+                }
               }
             }
-          }],
+          ],
           series: [{
             type: 'bar',
             data: this.barChartData,
-            barWidth: '15%',
+            barWidth: this.barChartData.length > 5 ? '40%' : 30,
             itemStyle: {
-              color: '#7DB17F'
+              color: function(params) {
+                let num = colorArray.length
+                return colorArray[params.dataIndex % num]
+              },
+              barBorderRadius: 100
             },
             label: {
-              show: true,
+              show: false,
               lineHeight: 10,
               formatter: params => {
                 if (+params.value === 0) return ''
@@ -732,169 +1202,96 @@
                 color: '#fff',
                 fontSize: 18
               }
-            }
-          }]
-        }
-        this.barChart.setOption(option, true)
-      },
-
-      /* 缁樺埗鍙屾煴鍥� */
-      drawDoubleBarChart() {
-        this.doubleBarChart = this.$echarts.init(document.getElementById('double_bar_chart'))
-        const option = {
-          color: ['#4992FF', '#4DC0B1'],
-          tooltip: {
-            confine: true,
-            formatter: function(params) {
-              return '<span style="font-weight:bolder;">' + params.name + '</span><br/>' +
-                '<span style="display:inline-block; width:10px; height:10px; border-radius:100px; margin-right:5px; background:' + params.color + '"></span>' + params.seriesName + ' : ' + params.value + '%'
-            }
+            },
+            zlevel: 1
           },
-          grid: {
-            left: '5%',
-            right: '4%',
-            bottom: '10%',
-            top: '20%',
-            containLabel: true
-          },
-          legend: {
-            icon: 'roundRect',
-            orient: 'horizontal',
-            left: 'center',
-            itemWidth: 14,
-            itemHeight: 14,
-            formatter: ['{a|{name}}'].join('\n'),
-            textStyle: {
-              fontSize: 14,
-              color: '#6A93B9',
-              height: 8,
-              rich: {
-                a: {
-                  verticalAlign: 'bottom'
-                }
+            {
+              name: '鑳屾櫙',
+              type: 'bar',
+              barWidth: this.barChartData.length > 5 ? '40%' : 30,
+              barGap: '-100%',
+              data: defaultData,
+              itemStyle: {
+                color: '#11294d',
+                barBorderRadius: 100
               }
-            },
-            data: ['OEE', '鍒╃敤鐜�']
-          },
-          xAxis: {
-            type: 'category',
-            data: this.doubleBarChartData.dateList,
-            axisLine: {
-              lineStyle: {
-                color: 'rgba(255,255,255,0.45)'
-              }
-            },
-            axisLabel: {
-              fontSize: 12,
-              color: '#6A93B9'
-            },
-            axisTick: {
-              show: false
-            }
-          },
-          yAxis: [{
-            name: '%',
-            type: 'value',
-            min: 0,
-            minInterval: 1,
-            splitArea: {
-              show: false
-            },
-            axisLine: {
-              show: false
-            },
-            axisTick: {
-              show: false
-            },
-            splitLine: {
-              lineStyle: {
-                color: 'rgba(255, 255, 255, 0.15)'
-                // type: 'dashed', // dotted 铏氱嚎
-              }
-            },
-            axisLabel: {
-              fontSize: 12,
-              color: '#6A93B9',
-              fontFamily: 'Bebas'
-            }
-          }, {
-            type: 'value',
-            axisLine: {
-              show: false
-            },
-            axisTick: {
-              show: false
-            },
-            splitLine: {
-              show: false
-            },
-            axisLabel: {
-              fontSize: 12,
-              formatter: '{value}%', // 鍙充晶Y杞存枃瀛楁樉绀�
-              fontFamily: 'Bebas',
-              color: '#6A93B9'
-            },
-            splitArea: {
-              show: false
-            }
-          }],
-          series: [{
-            type: 'bar',
-            barWidth: 15,
-            itemStyle: { barBorderRadius: [3, 3, 0, 0] },
-            name: 'OEE',
-            data: this.doubleBarChartData.oeeList,
-            label: {
-              show: true,
-              lineHeight: 10,
-              formatter: params => {
-                if (+params.value === 0) return ''
-                else return params.value
-              },
-              position: 'inside',
-              textStyle: {
-                color: '#fff',
-                fontSize: 12
-              }
-            }
-          }, {
-            type: 'bar',
-            barWidth: 15,
-            itemStyle: { barBorderRadius: [3, 3, 0, 0] },
-            name: '鍒╃敤鐜�',
-            data: this.doubleBarChartData.utilizationList,
-            label: {
-              show: true,
-              lineHeight: 10,
-              formatter: params => {
-                if (+params.value === 0) return ''
-                else return params.value
-              },
-              position: 'inside',
-              textStyle: {
-                color: '#fff',
-                fontSize: 12
-              }
-            }
+            }],
+          dataZoom: {
+            show: false,
+            startValue: 0, // 浠庡ご寮�濮嬨��
+            endValue: 5 // 涓�娆℃�у睍绀哄嚑涓�
           }
-          ]
         }
-        this.doubleBarChart.setOption(option, true)
+        option.title.text = `${moment().subtract(1, 'months').format('M')}鏈圤EE`
+        this.barChart.setOption(option, true)
+        this.barChart.hideLoading()
+
+        this.barChart.on('click', params => {
+          const productionId = params.name
+          this.$router.push({
+            name: 'mdc-base-OEEAnalysis',
+            params: { isEquipment: true, productionId }
+          })
+        })
+
+        // 璁惧鍒楄〃澶т簬6涓椂寮�鍚嚜鍔ㄨ疆鎾�
+        if (this.barChartData.length <= 6) return
+        this.barChartCarouselTime = setInterval(() => {
+          this.barChartData.push(this.barChartData.shift())
+          xAisData.push(xAisData.shift())
+          colorArray.push(colorArray.shift())
+          this.$nextTick(() => {
+            this.barChart.setOption(option, true)
+          })
+        }, 3000)
       },
 
-      /* 缁樺埗闂婊氬姩琛� */
-      drawProblemChart() {
-        this.problemConfig = {
-          indexHeader: '搴忓彿',
-          header: ['鏃堕棿', '闂鍐呭'],
-          headerBGC: '#83B883',
-          oddRowBGC: '#556955',
-          evenRowBGC: '#556955',
-          data: [],
-          index: true,
-          columnWidth: [100, 300, 300],
-          align: ['center']
+      handleSelectChange(value) {
+        this.equipmentId = value
+      },
+
+      filterOption(input, option) {
+        return (
+          option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
+        )
+      },
+
+      switchToEquipmentSignage() {
+        if (this.equipmentId) {
+          this.$emit('switchToNextSignage', {
+            signageName: 'Equipment',
+            productionCode: this.equipmentId
+          })
         }
+      },
+
+      /**
+       * 鐐瑰嚮涓変繚灞曠ず鏍忓悗鎵撳紑寮圭獥
+       * @param record 鐐瑰嚮褰撳墠涓変繚淇℃伅
+       */
+      openMaintenanceModal(record) {
+        this.modalTitle = record.planTime
+        this.modalDataApiParams = {
+          productionCode: this.productionCode
+        }
+        this.modalDataApiUrl = record.apiUrl
+        this.modalVisible = true
+      },
+
+      re_drawPieChart() {
+        const clientWidth = document.body.clientWidth || document.documentElement.clientWidth
+        if (this.firstEnterClientWidth != 1920) {
+          this.pieChartRadius = this.normalPieChartRadius.map(item => item = (+item.slice(0, -1) * (clientWidth / 1920)) + '%')
+        } else {
+          this.pieChartRadius = this.normalPieChartRadius.map(item => item = (+item.slice(0, -1) * (clientWidth / this.firstEnterClientWidth)) + '%')
+        }
+        console.log('pieChartRadius', this.pieChartRadius)
+        this.$nextTick(() => {
+          // 鏁版嵁鏈姞杞藉畬鎴愭棤闇�閲嶇粯鍥捐〃锛屼笉鐒舵棤娉曞尯鍒嗘帴鍙h繑鍥炴甯镐笌鍚�
+          if (this.runningStateChartDataRequireFinished) this.drawRunningStateChart(this.currentPageProductionId)
+          if (this.techConditionChartRequireFinished) this.drawTechConditionChart()
+          if (this.warrantyMalfunctionChartRequireFinished) this.drawWarrantyMalfunctionChart()
+        })
       },
 
       /**
@@ -902,10 +1299,12 @@
        * 璋冩暣鍥捐〃灏哄浠ラ�傚簲鍒嗚鲸鐜�
        */
       handleWindowResize() {
+        this.re_drawPieChart()
         if (this.runningStateChart) this.runningStateChart.resize()
         if (this.efficiencyChart) this.efficiencyChart.resize()
         if (this.techConditionChart) this.techConditionChart.resize()
         if (this.warrantyMalfunctionChart) this.warrantyMalfunctionChart.resize()
+        if (this.first7DaysEfficiencyChart) this.first7DaysEfficiencyChart.resize()
         if (this.barChart) this.barChart.resize()
         if (this.doubleBarChart) this.doubleBarChart.resize()
       }
@@ -922,12 +1321,6 @@
       color: #fff;
       margin-bottom: 10px;
 
-      .workshop-nav {
-        width: 120px;
-        height: 40px;
-        font-size: 12px;
-        cursor: pointer;
-      }
     }
 
     .content-container {
@@ -942,13 +1335,14 @@
           justify-content: space-around;
           flex-wrap: wrap;
           color: #fff;
-          padding-top: 5px;
+          padding-top: 20px;
 
           .support-plan-item {
             border-radius: 3px;
-            width: 45%;
+            width: 30%;
             padding: 5px 10px;
             margin-bottom: 10px;
+            cursor: pointer;
 
             .plan-value-container {
               display: flex;
@@ -965,19 +1359,41 @@
         }
       }
 
-      .middle-col {
-        .first-title {
-          color: #00A8AC;
-          font-size: 20px;
-          text-align: center;
-          font-weight: bold;
+      .right-col {
+        .gauge-chart {
+          width: 50%;
+          height: 200px;
         }
-
       }
     }
   }
 
-  /deep/ .dv-scroll-board .header {
-    height: 35px;
+  /deep/ .ant-form.ant-form-inline {
+    text-align: center;
+    margin-bottom: 20px;
+  }
+
+  /deep/ .ant-form .ant-form-item-label label {
+    color: #fff;
+    font-size: 18px;
+  }
+
+  /deep/ .ant-select-selection {
+    background: transparent !important;
+  }
+
+  /deep/ .ant-select-selection__clear {
+    background: transparent !important;
+    color: #fff;
+  }
+
+  /deep/ .ant-select {
+    color: #fff;
+  }
+
+  /deep/ .ant-input {
+    border: 1px solid #689ACA;
+    color: #fff;
+    background: transparent !important;
   }
 </style>
\ No newline at end of file

--
Gitblit v1.9.3