From 913f86badcc805bac79b9f2350f52eafcba86291 Mon Sep 17 00:00:00 2001 From: zhuzhuanzhuan Date: 星期二, 26 三月 2024 10:15:12 +0800 Subject: [PATCH] 1、调整单柱图x轴标题显示方式由每隔一个显示改为全显示(保证水平完整放置需旋转标题) 2、新增从分厂级看板返回公司级看板功能 3、按照新需求完成客户工段主管层进入后页面所有布局30% --- src/views/dashboard/BranchFactorySignage.vue | 13 src/views/dashboard/IndexSignage.vue | 14 src/views/dashboard/Analysis.vue | 24 src/views/dashboard/WorkshopSectionSignage.vue | 983 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 1,014 insertions(+), 20 deletions(-) diff --git a/src/views/dashboard/Analysis.vue b/src/views/dashboard/Analysis.vue index 59b71a3..5ec7335 100644 --- a/src/views/dashboard/Analysis.vue +++ b/src/views/dashboard/Analysis.vue @@ -1,9 +1,9 @@ <template> <Component :is="currentSignage" :productionCode="productionCode" @switchToBranchFactory="switchToBranchFactory"> <template #back_nav> - <dv-decoration-11 class="back-nav" v-if="userType===4"> - <div @click="backToLastSignage">杩斿洖涓婁竴绾�</div> - </dv-decoration-11> + <div class="back-nav" @click="backToLastSignage" v-if="userType===4"> + <dv-decoration-7>涓婁竴绾�</dv-decoration-7> + </div> </template> </Component> </template> @@ -12,12 +12,14 @@ import signageApi from '@/api/signage' import IndexSignage from './IndexSignage.vue' import BranchFactorySignage from './BranchFactorySignage.vue' + import WorkshopSectionSignage from './WorkshopSectionSignage.vue' export default { name: 'Analysis', components: { IndexSignage, - BranchFactorySignage + BranchFactorySignage, + WorkshopSectionSignage }, data() { return { @@ -37,13 +39,12 @@ signageApi.getUserByIdApi(id) .then(res => { this.userType = res.userType - console.log('瑙﹀彂鍒ゆ柇', this.userType) switch (this.userType) { case 1: this.currentSignage = '' break case 2: - this.currentSignage = 'BranchFactorySignage' + this.currentSignage = 'WorkshopSectionSignage' break case 3: this.currentSignage = 'BranchFactorySignage' @@ -73,5 +74,14 @@ </script> <style lang="less" scoped> - + .back-nav { + width: 100px; + height: 30px; + color: #ccc; + position: absolute; + top: 25px; + left: 25px; + cursor: pointer; + z-index: 9999 + } </style> \ No newline at end of file diff --git a/src/views/dashboard/BranchFactorySignage.vue b/src/views/dashboard/BranchFactorySignage.vue index ff2782f..5c2e663 100644 --- a/src/views/dashboard/BranchFactorySignage.vue +++ b/src/views/dashboard/BranchFactorySignage.vue @@ -8,6 +8,7 @@ <!--</div>--> <div class="content-container"> <div style="width: 25%" class="left-col"> + <slot name="back_nav"></slot> <dv-border-box-9 style="padding: 40px 20px 0"> <!--<div class="first-title">M D C 鍏� 缃� 鎬� 鏁� : 6 0 3 鍙�</div>--> <div id="running_state_chart" style="width:100%;height: 400px;"></div> @@ -752,7 +753,7 @@ xAxis: [{ name: 'OEE杞﹂棿', nameLocation: 'middle', - nameGap: 30, // x杞磏ame涓庢í鍧愭爣杞寸嚎鐨勯棿璺� + nameGap: 40, // x杞磏ame涓庢í鍧愭爣杞寸嚎鐨勯棿璺� type: 'category', data: this.barChartData.map(item => item.name), axisLine: { @@ -761,11 +762,11 @@ } }, axisLabel: { - margin: 10, - color: '#e2e9ff', - textStyle: { - fontSize: 12 - } + show: true, // 鏄惁鏄剧ず鍒诲害鏍囩锛岄粯璁ゆ樉绀� + interval: 0, // 鍧愭爣杞村埢搴︽爣绛剧殑鏄剧ず闂撮殧锛屽湪绫荤洰杞翠腑鏈夋晥锛涢粯璁や細閲囩敤鏍囩涓嶉噸鍙犵殑绛栫暐闂撮殧鏄剧ず鏍囩锛涘彲浠ヨ缃垚0寮哄埗鏄剧ず鎵�鏈夋爣绛撅紱濡傛灉璁剧疆涓�1锛岃〃绀恒�庨殧涓�涓爣绛炬樉绀轰竴涓爣绛俱�忥紝濡傛灉鍊间负2锛岃〃绀洪殧涓や釜鏍囩鏄剧ず涓�涓爣绛撅紝浠ユ绫绘帹銆� + rotate: this.barChartData.length >= 5 ? -30 : 0, // 鍒诲害鏍囩鏃嬭浆鐨勮搴︼紝鍦ㄧ被鐩酱鐨勭被鐩爣绛炬樉绀轰笉涓嬬殑鏃跺�欏彲浠ラ�氳繃鏃嬭浆闃叉鏍囩涔嬮棿閲嶅彔锛涙棆杞殑瑙掑害浠�-90搴﹀埌90搴� + inside: false, // 鍒诲害鏍囩鏄惁鏈濆唴锛岄粯璁ゆ湞澶� + margin: 6 // 鍒诲害鏍囩涓庤酱绾夸箣闂寸殑璺濈 }, axisTick: { show: false diff --git a/src/views/dashboard/IndexSignage.vue b/src/views/dashboard/IndexSignage.vue index 201fc6b..78d9352 100644 --- a/src/views/dashboard/IndexSignage.vue +++ b/src/views/dashboard/IndexSignage.vue @@ -734,7 +734,7 @@ xAxis: [{ name: 'OEE杞﹂棿', nameLocation: 'middle', - nameGap: 30, // x杞磏ame涓庢í鍧愭爣杞寸嚎鐨勯棿璺� + nameGap: 40, // x杞磏ame涓庢í鍧愭爣杞寸嚎鐨勯棿璺� type: 'category', data: this.barChartData.map(item => item.name), axisLine: { @@ -743,11 +743,11 @@ } }, axisLabel: { - margin: 10, - color: '#e2e9ff', - textStyle: { - fontSize: 12 - } + show: true, // 鏄惁鏄剧ず鍒诲害鏍囩锛岄粯璁ゆ樉绀� + interval: 0, // 鍧愭爣杞村埢搴︽爣绛剧殑鏄剧ず闂撮殧锛屽湪绫荤洰杞翠腑鏈夋晥锛涢粯璁や細閲囩敤鏍囩涓嶉噸鍙犵殑绛栫暐闂撮殧鏄剧ず鏍囩锛涘彲浠ヨ缃垚0寮哄埗鏄剧ず鎵�鏈夋爣绛撅紱濡傛灉璁剧疆涓�1锛岃〃绀恒�庨殧涓�涓爣绛炬樉绀轰竴涓爣绛俱�忥紝濡傛灉鍊间负2锛岃〃绀洪殧涓や釜鏍囩鏄剧ず涓�涓爣绛撅紝浠ユ绫绘帹銆� + rotate: this.barChartData.length >= 5 ? -30 : 0, // 鍒诲害鏍囩鏃嬭浆鐨勮搴︼紝鍦ㄧ被鐩酱鐨勭被鐩爣绛炬樉绀轰笉涓嬬殑鏃跺�欏彲浠ラ�氳繃鏃嬭浆闃叉鏍囩涔嬮棿閲嶅彔锛涙棆杞殑瑙掑害浠�-90搴﹀埌90搴� + inside: false, // 鍒诲害鏍囩鏄惁鏈濆唴锛岄粯璁ゆ湞澶� + margin: 6 // 鍒诲害鏍囩涓庤酱绾夸箣闂寸殑璺濈 }, axisTick: { show: false @@ -970,7 +970,7 @@ // ['-', '-'] ], index: true, - columnWidth: [100,300,300], + columnWidth: [100, 300, 300], align: ['center'] } }, diff --git a/src/views/dashboard/WorkshopSectionSignage.vue b/src/views/dashboard/WorkshopSectionSignage.vue new file mode 100644 index 0000000..be246d0 --- /dev/null +++ b/src/views/dashboard/WorkshopSectionSignage.vue @@ -0,0 +1,983 @@ +<template> + <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 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> + <div class="support-plan-container"> + <div class="support-plan-item" style="background:#67C23A"> + <div>涓変繚鏈湀璁″垝</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>鍙�</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> + </div> + </dv-border-box-9> + </div> + + <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> + </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> + </dv-border-box-9> + </div> + </div> + </div> +</template> + +<script> + import signageApi from '@/api/signage' + + export default { + name: 'WorkshopSectionSignage', + props: { + productionCode: { + type: String, + default: '' + } + }, + data() { + return { + runningStateChart: '', + runningStateData: [ + { value: '0', name: '鍏虫満' }, + { value: '0', name: '鎶ヨ' }, + { value: '0', name: '寰呮満' }, + { value: '0', name: '杩愯' } + ], + techConditionChart: '', + techConditionData: [ + { value: '0', name: '鍚堟牸' }, + { value: '0', name: '绂佺敤' }, + { value: '0', name: '闄愮敤' } + ], + warrantyMalfunctionChart: '', + 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' + }, + { + label: '鏈湀瀹屾垚', + value: 229, + background: '#409EFF' + }, + { + label: '涓嬫湀涓変繚璁″垝', + value: 319, + background: '#A8985D' + }, + { + label: '涓嬩笅鏈堜笁淇濊鍒�', + value: 329, + background: '#58D9F9' + } + ], + maintenanceConfig: {}, + problemConfig: {} + } + }, + mounted() { + window.addEventListener('resize', this.handleWindowResize) + this.drawCharts() + this.getChartDataByApi() + }, + activated() { + console.log('瑙﹀彂activated') + this.handleWindowResize() + }, + beforeDestroy() { + window.removeEventListener('resize', this.handleWindowResize) + }, + methods: { + backToLastSignage() { + console.log('瑙﹀彂涓婁竴绾�') + }, + + getChartDataByApi() { + this.getTechConditionDataByApi() + this.getWarrantyMalfunctionDataByApi() + this.getRunningStateDataByApi() + this.getMonthMaintenanceNumByApi() + this.getBarChartDataByApi() + this.getDoubleBarChartDataByApi() + }, + + /* 璋冪敤鎺ュ彛鑾峰彇鎶�鏈姸鎬� */ + getTechConditionDataByApi() { + signageApi.getEquipmentTechnologyStatusListApi(this.productionCode) + .then(res => { + if (res.success) { + this.techConditionData = [ + { value: res.result[0].qualifiedCount, name: '鍚堟牸' }, + { value: res.result[0].disabledCount, name: '绂佺敤' }, + { value: res.result[0].limitedUseCount, name: '闄愮敤' } + ] + } + this.drawTechConditionChart() + }) + }, + + /* 璋冪敤鎺ュ彛鑾峰彇璁惧鎶ヤ慨鏁呴殰 */ + getWarrantyMalfunctionDataByApi() { + signageApi.getReportRepairEquipmentListApi(this.productionCode) + .then(res => { + if (res.success) { + this.warrantyMalfunctionData = [ + { value: res.result[0].failurTotalCount, name: '鎶ヤ慨' }, + { value: res.result[0].stopCount, name: '鍋滄満' }, + { value: res.result[0].noStopCount, name: '杩愯' } + ] + } + this.drawWarrantyMalfunctionChart() + }) + }, + + /* 璋冪敤鎺ュ彛鑾峰彇璁惧杩愯鐘舵�� */ + getRunningStateDataByApi() { + signageApi.getEquipmentStatusStatisticsApi(this.productionCode) + .then(res => { + if (res.success) this.runningStateData = res.result + this.drawRunningStateChart() + }) + }, + + /* 璋冪敤鎺ュ彛鑾峰彇涓変繚璁″垝 */ + getMonthMaintenanceNumByApi() { + signageApi.getThisMonthMaintenanceListApi(this.productionCode) + .then(res => { + if (res.success && res.result) this.thisMonthMaintenancePlanNum = res.result[0].totalCount + }) + signageApi.getThisMonthMaintenanceFinishListApi(this.productionCode) + .then(res => { + if (res.success && res.result) this.thisMonthMaintenanceRealNum = res.result[0].totalCount + }) + signageApi.getNextMonthMaintenanceList(this.productionCode) + .then(res => { + if (res.success && res.result) this.nextMonthMaintenancePlanNum = res.result[0].totalCount + }) + signageApi.getNextNextMonthMaintenanceListApi(this.productionCode) + .then(res => { + if (res.success && res.result) this.nextNextMonthMaintenancePlanNum = res.result[0].totalCount + }) + }, + + /* 璋冪敤鎺ュ彛鑾峰彇璁惧OEE缁熻 */ + getBarChartDataByApi() { + signageApi.getEquipmentOEEStatistics(this.productionCode) + .then(res => { + if (res.success) this.barChartData = res.result + 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'鎴栧叿浣撶殑鍨傜洿鍧愭爣鍊� + textStyle: { + // 涓绘爣棰樻枃鏈牱寮� + fontSize: 18, + fontWeight: 'normal', + color: '#00A8AC' + } + }, + tooltip: { + trigger: 'item', + formatter: function(params) { + if (params.name !== '') { + return `${params.name}:${params.value}(${params.percent}%)` + } + } + }, + legend: { + top: 'bottom', + orient: 'horizontal', + right: 0, + // bottom: "0", + itemWidth: 14, + itemHeight: 14, + icon: 'roundRect', + itemGap: 15, + textStyle: { + color: 'inherit', + fontSize: 14, + padding: [0, 0, 0, 0] + }, + data: ['鍚堟牸', '绂佺敤', '闄愮敤'] + }, + grid: { + containLabel: true + }, + series: [ + { + type: 'pie', + // selectedMode: "single", + radius: ['30%', '50%'], + center: ['50%', '50%'], + color: [ + '#0AA012', + '#237E48', + '#757160' + ], + label: { + position: 'outside', + show: true, + color: 'inherit', + // textBorderColor: 'inherit', + // textBorderWidth: 1, + fontSize: 16, + formatter: function(params) { + if (params.name !== '') { + return `${params.name}:${params.value}` + } + } + }, + labelLine: { + show: true, + length2: 15, + length: 15 + }, + data: this.techConditionData + } + ] + } + this.techConditionChart.setOption(option, true) + }, + + /* 缁樺埗璁惧鎶ヤ慨鏁呴殰楗煎浘 */ + drawWarrantyMalfunctionChart() { + this.warrantyMalfunctionChart = this.$echarts.init(document.getElementById('warranty_malfunction_chart')) + const option = { + title: { + show: true, // 鏄惁鏄剧ず鏍囬锛岄粯璁や负true + text: '璁惧鎶ヤ慨鏁呴殰', // 涓绘爣棰樻枃鏈� + x: 'left', // 鏍囬姘村钩瀹夋斁浣嶇疆锛屽彲閫夊�间负'left'銆�'center'銆�'right'鎴栧叿浣撶殑姘村钩鍧愭爣鍊� + y: 'top', // 鏍囬鍨傜洿瀹夋斁浣嶇疆锛屽彲閫夊�间负'top'銆�'bottom'銆�'center'鎴栧叿浣撶殑鍨傜洿鍧愭爣鍊� + textStyle: { + // 涓绘爣棰樻枃鏈牱寮� + fontSize: 18, + fontWeight: 'normal', + color: '#00A8AC' + } + }, + tooltip: { + trigger: 'item', + formatter: function(params) { + if (params.name !== '') { + return `${params.name}:${params.value}(${params.percent}%)` + } + } + }, + legend: { + top: 'bottom', + orient: 'horizontal', + right: 0, + // bottom: "0", + itemWidth: 14, + itemHeight: 14, + icon: 'roundRect', + itemGap: 15, + textStyle: { + color: 'inherit', + fontSize: 14, + padding: [0, 0, 0, 0] + }, + data: ['鎶ヤ慨', '鍋滄満', '杩愯'] + }, + grid: { + containLabel: true + }, + series: [ + { + type: 'pie', + // selectedMode: "single", + radius: ['30%', '50%'], + center: ['50%', '50%'], + color: [ + '#00CED1', + '#B85B38', + '#A8985D' + ], + label: { + position: 'outside', + show: true, + color: 'inherit', + // textBorderColor: 'inherit', + // textBorderWidth: 1, + fontSize: 16, + formatter: function(params) { + if (params.name !== '') { + return `${params.name}:${params.value}` + } + } + }, + labelLine: { + show: true, + length2: 15, + length: 15 + }, + data: this.warrantyMalfunctionData + } + ] + } + this.warrantyMalfunctionChart.setOption(option, true) + }, + + /* 缁樺埗璁惧杩愯鐘舵�佺帿鐟伴ゼ鍥� */ + drawRunningStateChart() { + this.runningStateChart = this.$echarts.init(document.getElementById('running_state_chart')) + const option = { + title: { + show: true, // 鏄惁鏄剧ず鏍囬锛岄粯璁や负true + text: '璁惧鐘舵��', // 涓绘爣棰樻枃鏈� + x: 'left', // 鏍囬姘村钩瀹夋斁浣嶇疆锛屽彲閫夊�间负'left'銆�'center'銆�'right'鎴栧叿浣撶殑姘村钩鍧愭爣鍊� + y: 'top', // 鏍囬鍨傜洿瀹夋斁浣嶇疆锛屽彲閫夊�间负'top'銆�'bottom'銆�'center'鎴栧叿浣撶殑鍨傜洿鍧愭爣鍊� + textStyle: { + // 涓绘爣棰樻枃鏈牱寮� + fontSize: 18, + fontWeight: 'normal', + color: '#00A8AC' + } + }, + tooltip: { + trigger: 'item', + formatter: function(params) { + if (params.name !== '') { + return `${params.name}:${params.value}(${params.percent}%)` + } + } + }, + legend: { + top: 'bottom', + orient: 'horizontal', + right: 0, + // bottom: "0", + itemWidth: 14, + itemHeight: 14, + icon: 'roundRect', + itemGap: 15, + textStyle: { + color: 'inherit', + fontSize: 14, + padding: [0, 0, 0, 0] + }, + data: ['鍏虫満', '鎶ヨ', '寰呮満', '杩愯'] + }, + grid: { + containLabel: true + }, + series: [ + { + type: 'pie', + roseType: 'angle', // 鐜懓鍥� + // selectedMode: "single", + radius: ['30%', '70%'], + center: ['50%', '50%'], + color: [ + '#686869', + '#AA6349', + '#968A5E', + '#5D975D' + ], + label: { + position: 'outside', + show: true, + color: 'inherit', + // textBorderColor: 'inherit', + // textBorderWidth: 1, + fontSize: 16, + formatter: function(params) { + if (params.name !== '') { + return `${params.name}:${params.value}` + } + } + }, + labelLine: { + show: true, + length2: 10, + length: 10 + }, + data: this.runningStateData + } + ] + } + this.runningStateChart.setOption(option, true) + }, + + /* 缁樺埗鎶樼嚎鍥� */ + drawLineChart() { + this.lineChart = this.$echarts.init(document.getElementById('line_chart')) + const newData = { + xAxis: ['2640221', '2640223', '2640224', '2640225', '2640226', '2640227', '2640228', '2640229', '12640220', '12640221', '12640222'], + yAxis: [ + { + name: '鍒╃敤鐜�', + value: [20, 60, 55, 36, 52, 52, 63, 78, 23, 42, 65] + }, + { + name: '寮�鍔ㄧ巼', + value: [23, 63, 44, 40, 74, 80, 60, 90, 70, 40, 70] + }, + { + name: '寮�鏈虹巼', + value: [90, 70, 40, 70, 80, 65, 73, 60, 70, 90, 40] + } + ], + yAxisName: '鍓�7澶╁埄鐢ㄧ巼' + } + let legendData = [] + let seriesData = [] + let colorArr = ['#09F39E', '#A5F10D', '#09B3F6'] + legendData = newData.yAxis.map((item) => item.name) + seriesData = newData.yAxis.map((item1, index1) => { + return { + name: item1.name, + type: 'line', + symbol: 'circle', + symbolSize: 8, + itemStyle: { + color: colorArr[index1] + }, + lineStyle: { + width: 2 + }, + yAxisIndex: 1, + data: item1.value // 鎶樼嚎鍥剧殑鏁版嵁 + } + }) + + const option = { + grid: { + containLabel: true, + bottom: '1%', + top: '15%', + left: '2%', + right: '1%' + }, + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'shadow' + } + }, + legend: { + top: 20, + right: 'center', + data: legendData, + itemGap: 10, + textStyle: { + fontSize: 16, + color: '#ccc' + } + }, + xAxis: { + triggerEvent: true, + data: newData.xAxis || [], + axisLabel: { + interval: 1, + show: true, + fontSize: 12, + color: '#50729A', + // rotate: -30, + }, + axisLine: { + show: true, + lineStyle: { + color: '#50729A' + } + }, + axisTick: { + show: true, + alignWithLabel:true, + } + }, + yAxis: [ + { + name: newData.yAxisName, + nameTextStyle: { + color: '#00A8AC', + fontSize: 18, + padding: [0, 0, 0, 80] + }, + type: 'value', + position: 'left', + axisLine: { + show: true, + lineStyle: { + color: '#50729A' + } + }, + axisTick: { + show: false + }, + splitLine: { + show: false, + lineStyle: { + color: '#3E4A82' + } + } + }, + { + type: 'value', + position: 'right', + splitNumber: 5, + axisLabel: { + show: true, + fontSize: 16, + color: '#50729A' + }, + axisLine: { + show: true, + lineStyle: { + color: '#50729A' + } + }, + axisTick: { + show: true + }, + splitLine: { + show: false, + lineStyle: { + color: '#3E4A82' + } + } + } + ], + series: seriesData + } + this.lineChart.setOption(option, true) + + }, + + /* 缁樺埗鍗曟煴鍥� */ + drawBarChart() { + this.barChart = this.$echarts.init(document.getElementById('bar_chart')) + const option = { + tooltip: { + trigger: 'axis', + axisPointer: { + type: 'shadow' + }, + // backgroundColor: 'rgba(9, 24, 48, 0.5)', + borderColor: 'rgba(75, 253, 238, 0.4)', + textStyle: { + // color: '#CFE3FC' + }, + borderWidth: 1 + }, + grid: { + top: '15%', + left: '10%' + }, + xAxis: [{ + name: 'OEE杞﹂棿', + nameLocation: 'middle', + nameGap: 30, // x杞磏ame涓庢í鍧愭爣杞寸嚎鐨勯棿璺� + type: 'category', + data: this.barChartData.map(item => item.name), + axisLine: { + lineStyle: { + color: '#FFFFFF' + } + }, + 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)' + } + } + }], + series: [{ + type: 'bar', + data: this.barChartData, + barWidth: '15%', + itemStyle: { + color: '#7DB17F' + }, + label: { + show: true, + lineHeight: 10, + formatter: params => { + if (+params.value === 0) return '' + else return params.value + }, + position: 'inside', + textStyle: { + 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 + '%' + } + }, + 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' + } + } + }, + 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 + } + } + } + ] + } + this.doubleBarChart.setOption(option, true) + }, + + /* 缁樺埗闂婊氬姩琛� */ + drawProblemChart() { + this.problemConfig = { + indexHeader: '搴忓彿', + header: ['鏃堕棿', '闂鍐呭'], + headerBGC: '#83B883', + oddRowBGC: '#556955', + evenRowBGC: '#556955', + data: [], + index: true, + columnWidth: [100, 300, 300], + align: ['center'] + } + }, + + /** + * 绐楀彛灏哄鍙樺寲鏃惰Е鍙� + * 璋冩暣鍥捐〃灏哄浠ラ�傚簲鍒嗚鲸鐜� + */ + handleWindowResize() { + 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.barChart) this.barChart.resize() + if (this.doubleBarChart) this.doubleBarChart.resize() + } + } + } +</script> + +<style lang="less" scoped> + .page-container { + .page-title { + display: flex; + justify-content: space-evenly; + flex-wrap: wrap; + color: #fff; + margin-bottom: 10px; + + .workshop-nav { + width: 120px; + height: 40px; + font-size: 12px; + cursor: pointer; + } + } + + .content-container { + padding-top: 5px; + display: flex; + justify-content: space-between; + + .left-col { + .support-plan-container { + width: 100%; + display: flex; + justify-content: space-around; + flex-wrap: wrap; + color: #fff; + padding-top: 5px; + + .support-plan-item { + border-radius: 3px; + width: 45%; + padding: 5px 10px; + margin-bottom: 10px; + + .plan-value-container { + display: flex; + justify-content: center; + align-items: center; + + .plan-value { + margin-right: 20px; + font-size: 30px; + color: #EAC910; + } + } + } + } + } + + .middle-col { + .first-title { + color: #00A8AC; + font-size: 20px; + text-align: center; + font-weight: bold; + } + + } + } + } + + /deep/ .dv-scroll-board .header { + height: 35px; + } +</style> \ No newline at end of file -- Gitblit v1.9.3