From f1ce06843ba7498ff0966d506304670e687c29ae Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期五, 05 九月 2025 17:47:57 +0800 Subject: [PATCH] 1、mdc首页工段级看板删除二保计划 2、调整mdc首页整体背景颜色 --- src/views/dashboard/WorkshopSectionSignage.vue | 909 ++++++++++++++++++++++++++++++++++++-------------------- 1 files changed, 583 insertions(+), 326 deletions(-) diff --git a/src/views/dashboard/WorkshopSectionSignage.vue b/src/views/dashboard/WorkshopSectionSignage.vue index 3a76eb1..976e442 100644 --- a/src/views/dashboard/WorkshopSectionSignage.vue +++ b/src/views/dashboard/WorkshopSectionSignage.vue @@ -7,63 +7,17 @@ </div> <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:#5FE0AF"> - <div>涓変繚鏈湀璁″垝</div> - <div class="plan-value-container"> - <div class="plan-value">{{thisMonthMaintenancePlanNum}}</div> - <div>鍙�</div> - </div> + <div id="tech_condition_chart" style="width:100%;height: 280px;"></div> + <div id="warranty_malfunction_chart" style="width:100%;height: 280px;"></div> + <div style="display: flex;flex-direction:column;align-items: center;margin-top: 40px"> + <div class="support-plan-container"> + <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">{{$data[item.planValueLabel]}}</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:#FCAA29"> - <div>寤舵湡</div> - <div class="plan-value-container"> - <div class="plan-value">{{maintenanceExtensionNum}}</div> - <div>鍙�</div> - </div> - </div> - <div class="support-plan-item" style="background:#F56C6C"> - <div>瓒呮湡</div> - <div class="plan-value-container"> - <div class="plan-value">{{maintenanceOverdueNum}}</div> - <div>鍙�</div> - </div> - </div> - <div class="support-plan-item" style="background:#D6BC52"> - <div>涓嬫湀璁″垝</div> - <div class="plan-value-container"> - <div class="plan-value">{{nextMonthMaintenancePlanNum}}</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="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> @@ -73,19 +27,21 @@ <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%" class="right-col"> <dv-border-box-9 style="padding: 15px"> <a-form layout="inline" - @keyup.enter.native="$emit('switchToNextSignage', { signageName: 'Equipment', productionCode: equipmentId })"> + @keyup.enter.native="switchToEquipmentSignage"> <a-form-item label="璁惧缂栧彿"> <a-auto-complete - v-model="equipmentId" + @select="handleSelectChange" placeholder="鍥炶溅閿煡璇�" :allowClear="true" + :filter-option="filterOption" + :dataSource="first7DaysEfficiencyData.mdcEquipmentList.map(item=>item.equipmentId)" size="large" /> </a-form-item> @@ -100,15 +56,22 @@ </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' + import * as echarts from 'echarts' export default { name: 'WorkshopSectionSignage', + components: { SignageModal }, props: { productionCode: { type: String, @@ -120,7 +83,12 @@ }, data() { return { + firstEnterClientWidth: null, + pieChartRadius: ['40%', '60%'], + normalPieChartRadius: ['40%', '60%'], + currentPageProductionId: null, runningStateChart: '', + runningStateChartDataRequireFinished: false, runningStateData: [ { value: '0', name: '鍏虫満' }, { value: '0', name: '鎶ヨ' }, @@ -128,16 +96,56 @@ { 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: '杩愯' } + ], + supportPlanList: [ + { + planTime: '鏈湀涓変繚璁″垝', + planValueLabel: 'thisMonthMaintenancePlanNum', + backgroundColor: '#719D8E', + code: 'bysbzs' + }, + { + planTime: '鏈湀瀹屾垚閲�', + planValueLabel: 'thisMonthMaintenanceRealNum', + backgroundColor: '#409EFF', + code: 'bwc' + }, + { + planTime: '寤舵湡', + planValueLabel: 'maintenanceExtensionNum', + backgroundColor: '#E89D29', + code: '' + }, + { + planTime: '瓒呮湡', + planValueLabel: 'maintenanceOverdueNum', + backgroundColor: '#F56C6C', + code: '' + }, + { + planTime: '涓嬫湀璁″垝', + planValueLabel: 'nextMonthMaintenancePlanNum', + backgroundColor: '#A8985D', + code: 'xysb' + }, + { + planTime: '涓嬩笅鏈堣鍒�', + planValueLabel: 'nextNextMonthMaintenancePlanNum', + backgroundColor: '#58D9F9', + code: 'xxysb' + } ], thisMonthMaintenancePlanNum: 0, thisMonthMaintenanceRealNum: 0, @@ -145,8 +153,11 @@ maintenanceOverdueNum: 0, nextMonthMaintenancePlanNum: 0, nextNextMonthMaintenancePlanNum: 0, - lineChart: '', - lineChartData: {}, + first7DaysEfficiencyChart: '', + first7DaysEfficiencyData: { + dataList: [], + mdcEquipmentList: [] + }, gaugeChart1: '', gaugeChart2: '', gaugeChart3: '', @@ -159,136 +170,200 @@ }, barChart: '', barChartData: [], - equipmentId: '' + 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() }, beforeDestroy() { window.removeEventListener('resize', this.handleWindowResize) if (this.barChartCarouselTime) clearInterval(this.barChartCarouselTime) - if (this.lineChartCarouselTime) clearInterval(this.lineChartCarouselTime) + if (this.first7DaysEfficiencyChartCarouselTime) clearInterval(this.first7DaysEfficiencyChartCarouselTime) }, methods: { + /* 璋冪敤鎺ュ彛鑾峰彇鍥捐〃鏁版嵁姹囨�绘柟娉� */ getChartDataByApi() { - this.getTechConditionDataByApi() - this.getWarrantyMalfunctionDataByApi() + this.getTechConditionAndWarrantyMalfunctionDataByApi() this.getRunningStateDataByApi() - this.getMonthMaintenanceNumByApi() - this.getLineChartDataByApi() + this.getThirdMaintenanceNumByApi() + this.getFirst7DaysEfficiencyDataByApi() this.getGaugeChartDataByApi() this.getBarChartDataByApi() }, - /* 璋冪敤鎺ュ彛鑾峰彇鎶�鏈姸鎬� */ - getTechConditionDataByApi() { - signageApi.getEquipmentTechnologyStatusListApi(this.productionCode) + /* 璋冪敤鎺ュ彛鑾峰彇鎶�鏈姸鎬佷笌鏁呴殰鎶ヤ慨 */ + getTechConditionAndWarrantyMalfunctionDataByApi() { + this.techConditionChart = this.$echarts.init(document.getElementById('tech_condition_chart')) + this.warrantyMalfunctionChart = this.$echarts.init(document.getElementById('warranty_malfunction_chart')) + this.techConditionChart.showLoading({ + text: '鏁版嵁鍔犺浇涓� ...', + color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊 + textColor: 'rgba(0, 0, 0, .45)' + }) + this.warrantyMalfunctionChart.showLoading({ + text: '鏁版嵁鍔犺浇涓� ...', + color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊 + textColor: 'rgba(0, 0, 0, .45)' + }) + signageApi.getEquipmentTechnologyStatusAndReportRepairEquipmentListApi(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.jszt.length > 0 ? res.result.jszt.find(item => item.code === 'QUALIFIED').value : 0, + name: '鍚堟牸', + technologyStatus: 'QUALIFIED' + }, + { + value: res.result.jszt.length > 0 ? res.result.jszt.find(item => item.code === 'RESTRICTED').value : 0, + name: '闄愮敤', + technologyStatus: 'RESTRICTED' + }, + { + value: res.result.jszt.length > 0 ? res.result.jszt.find(item => item.code === 'PROHIBITED').value : 0, + name: '绂佺敤', + technologyStatus: 'PROHIBITED' + } ] - } - 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: '杩愯' } + { + value: res.result.bxqk.length > 0 ? res.result.bxqk.find(item => item.code === 'run').value : 0, + name: '杩愯', + code: 'run' + }, + { + value: res.result.bxqk.length > 0 ? res.result.bxqk.find(item => item.code === 'stop').value : 0, + name: '鍋滄満', + code: 'stop' + }, + { + value: res.result.bxqk.length > 0 ? res.result.bxqk.find(item => item.code === 'bx').value : 0, + name: '鎶ヤ慨', + code: 'bx' + } ] + this.techConditionChartRequireFinished = true + this.warrantyMalfunctionChartRequireFinished = true + this.drawTechConditionChart() + this.drawWarrantyMalfunctionChart() } - this.drawWarrantyMalfunctionChart() }) }, /* 璋冪敤鎺ュ彛鑾峰彇涓変繚璁″垝 */ - getMonthMaintenanceNumByApi() { - signageApi.getThisMonthMaintenanceListApi(this.productionCode) + getThirdMaintenanceNumByApi() { + signageApi.getThirdMaintenanceConditionApi(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 + if (res.success && res.result) { + this.thisMonthMaintenancePlanNum = res.result.find(item => item.code === 'bysbzs').value + this.thisMonthMaintenanceRealNum = res.result.find(item => item.code === 'bwc').value + this.nextMonthMaintenancePlanNum = res.result.find(item => item.code === 'xysb').value + this.nextNextMonthMaintenancePlanNum = res.result.find(item => item.code === 'xxysb').value + } }) }, /* 璋冪敤鎺ュ彛鑾峰彇璁惧杩愯鐘舵�� */ getRunningStateDataByApi() { + this.runningStateChart = this.$echarts.init(document.getElementById('running_state_chart')) + this.runningStateChart.showLoading({ + text: '鏁版嵁鍔犺浇涓� ...', + color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊 + textColor: 'rgba(0,0,0,.45)' + }) signageApi.getEquipmentStatusStatisticsApi(this.productionCode) .then(res => { - if (res.success) this.runningStateData = res.result.list - this.drawRunningStateChart(res.result.producitonId) + if (res.success) { + this.runningStateData = res.result.list + this.currentPageProductionId = res.result.productionId + this.runningStateChartDataRequireFinished = true + this.drawRunningStateChart(res.result.productionId) + } }) }, /* 璋冪敤鎺ュ彛鑾峰彇鍓�7澶╁埄鐢ㄧ巼 */ - getLineChartDataByApi() { + getFirst7DaysEfficiencyDataByApi() { + this.first7DaysEfficiencyChart = this.$echarts.init(document.getElementById('first7DaysEfficiency_chart')) + this.first7DaysEfficiencyChart.showLoading({ + text: '鏁版嵁鍔犺浇涓� ...', + color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊 + textColor: 'rgba(0,0,0,.45)' + }) signageApi.getEquipmentDayUtilizationStatisticsApi(this.productionCode) .then(res => { - if (res.success) this.lineChartData = res.result - this.drawLineChart() + 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: 'rgba(0,0,0,.45)' + }) + this.gaugeChart2.showLoading({ + text: '鏁版嵁鍔犺浇涓� ...', + color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊 + textColor: 'rgba(0,0,0,.45)' + }) + this.gaugeChart3.showLoading({ + text: '鏁版嵁鍔犺浇涓� ...', + color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊 + textColor: 'rgba(0,0,0,.45)' + }) + this.gaugeChart4.showLoading({ + text: '鏁版嵁鍔犺浇涓� ...', + color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊 + textColor: 'rgba(0,0,0,.45)' + }) signageApi.getEquipmentEfficiencyStatisticsApi(this.productionCode) .then(res => { - console.log('res=', res) if (res.success) this.gaugeChartData = res.result - this.drawGaugeChart(res.result.productionId) + this.drawGaugeChart() }) }, /* 璋冪敤鎺ュ彛鑾峰彇涓婃湀OEE */ getBarChartDataByApi() { + this.barChart = this.$echarts.init(document.getElementById('bar_chart')) + this.barChart.showLoading({ + text: '鏁版嵁鍔犺浇涓� ...', + color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊 + textColor: 'rgba(0,0,0,.45)' + }) signageApi.getEquipmentOEEMonthStatisticsApi(this.productionCode) .then(res => { - if (res.success) { + if (res.success && res.result) { this.barChartData = res.result.map(item => { return { name: item.equipmentId, value: item.overallEquipmentEfficiency } }) + this.drawBarChart() } - this.drawBarChart() }) - }, - - /* 缁樺埗鍥捐〃姹囨�绘柟娉� */ - drawCharts() { - this.drawRunningStateChart() - this.drawTechConditionChart() - this.drawWarrantyMalfunctionChart() - this.drawGaugeChart() - this.drawBarChart() }, /* 缁樺埗鎶�鏈姸鎬侀ゼ鍥� */ drawTechConditionChart() { - this.techConditionChart = this.$echarts.init(document.getElementById('tech_condition_chart')) const option = { title: { show: true, // 鏄惁鏄剧ず鏍囬锛岄粯璁や负true @@ -313,17 +388,15 @@ 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] + color: 'rgba(0,0,0,.45)', + fontSize: 14 }, - data: ['鍚堟牸', '绂佺敤', '闄愮敤'] + data: ['鍚堟牸', '闄愮敤', '绂佺敤'] }, grid: { containLabel: true @@ -331,20 +404,17 @@ series: [ { type: 'pie', - // selectedMode: "single", - radius: ['40%', '60%'], + radius: this.pieChartRadius, center: ['50%', '50%'], color: [ - '#0FC61A', - '#0DAF15', - '#8B8B8B' + '#0AA012', + '#247F49', + '#757160' ], label: { position: 'outside', show: true, - color: 'inherit', - // textBorderColor: 'inherit', - // textBorderWidth: 1, + color: 'rgba(0,0,0,.45)', fontSize: 16, formatter: function(params) { if (params.name !== '') { @@ -355,22 +425,35 @@ labelLine: { show: true, length2: 15, - length: 15 + length: 15, + lineStyle: { + color: 'rgba(0,0,0,.45)' + } }, data: this.techConditionData } ] } 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 - text: '璁惧鎶ヤ慨鏁呴殰', // 涓绘爣棰樻枃鏈� + text: '璁惧鎶ヤ慨鏁呴殰鎯呭喌', // 涓绘爣棰樻枃鏈� x: 'left', // 鏍囬姘村钩瀹夋斁浣嶇疆锛屽彲閫夊�间负'left'銆�'center'銆�'right'鎴栧叿浣撶殑姘村钩鍧愭爣鍊� y: 'top', // 鏍囬鍨傜洿瀹夋斁浣嶇疆锛屽彲閫夊�间负'top'銆�'bottom'銆�'center'鎴栧叿浣撶殑鍨傜洿鍧愭爣鍊� textStyle: { @@ -391,15 +474,13 @@ 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] + color: 'rgba(0,0,0,.45)', + fontSize: 14 }, data: ['鎶ヤ慨', '鍋滄満', '杩愯'] }, @@ -409,20 +490,17 @@ series: [ { type: 'pie', - // selectedMode: "single", - radius: ['40%', '60%'], + radius: this.pieChartRadius, center: ['50%', '50%'], color: [ - '#24F2F5', - '#F56436', - '#FFFF40' + '#00CED1', + '#B85B38', + '#FFFF88' ], label: { position: 'outside', show: true, - color: 'inherit', - // textBorderColor: 'inherit', - // textBorderWidth: 1, + color: 'rgba(0,0,0,.45)', fontSize: 16, formatter: function(params) { if (params.name !== '') { @@ -433,22 +511,35 @@ labelLine: { show: true, length2: 15, - length: 15 + length: 15, + lineStyle: { + color: 'rgba(0,0,0,.45)' + } }, data: this.warrantyMalfunctionData } ] } 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(productionId) { - this.runningStateChart = this.$echarts.init(document.getElementById('running_state_chart')) const option = { title: { show: true, // 鏄惁鏄剧ず鏍囬锛岄粯璁や负true - text: '璁惧鐘舵��', // 涓绘爣棰樻枃鏈� + text: '璁惧杩愯鐘舵�佺粺璁�', // 涓绘爣棰樻枃鏈� x: 'left', // 鏍囬姘村钩瀹夋斁浣嶇疆锛屽彲閫夊�间负'left'銆�'center'銆�'right'鎴栧叿浣撶殑姘村钩鍧愭爣鍊� y: 'top', // 鏍囬鍨傜洿瀹夋斁浣嶇疆锛屽彲閫夊�间负'top'銆�'bottom'銆�'center'鎴栧叿浣撶殑鍨傜洿鍧愭爣鍊� textStyle: { @@ -469,17 +560,15 @@ 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] + color: 'rgba(0,0,0,.45)', + fontSize: 14 }, - data: ['鍏虫満', '鎶ヨ', '寰呮満', '杩愯'] + data: ['杩愯', '寰呮満', '鎶ヨ', '鍏虫満'] }, grid: { containLabel: true @@ -488,22 +577,19 @@ { type: 'pie', roseType: 'angle', // 鐜懓鍥� - // selectedMode: "single", - radius: ['35%', '55%'], + radius: this.pieChartRadius, center: ['50%', '50%'], color: [ - '#8B8B8B', - '#F56436', - '#FFFF40', - '#0FC61A' + '#686869', + '#AA6349', + '#FFFF88', + '#5D975D' ], label: { position: 'outside', show: true, - color: 'inherit', - // textBorderColor: 'inherit', - // textBorderWidth: 1, - fontSize: 30, + color: 'rgba(0,0,0,.45)', + fontSize: 16, formatter: function(params) { if (params.name !== '') { return `${params.name}:${params.value}` @@ -513,13 +599,17 @@ labelLine: { show: true, length2: 20, - length: 30 + length: 30, + lineStyle: { + color: 'rgba(0,0,0,.45)' + } }, data: this.runningStateData } ] } this.runningStateChart.setOption(option, true) + this.runningStateChart.hideLoading() this.runningStateChart.on('click', params => { this.$router.push({ @@ -529,60 +619,89 @@ }) }, - /* 缁樺埗鎶樼嚎鍥� */ - drawLineChart() { - this.lineChart = this.$echarts.init(document.getElementById('line_chart')) - this.lineChartData.equipmentIdList.forEach(item => { - if (!this.lineChartData.dataList.map(item => item.equipmentId).includes(item)) { + /* 缁樺埗鍓�7澶╁埄鐢ㄧ巼鏌卞浘 */ + drawFirst7DaysEfficiencyDataChart() { + this.first7DaysEfficiencyData.mdcEquipmentList.forEach(item => { + if (!this.first7DaysEfficiencyData.dataList.map(item => item.equipmentId).includes(item)) { const equipmentIdObj = { - equipmentId: item, + equipmentId: item.equipmentId, + equipmentName: item.equipmentName, openRate: 0, startRate: 0, utilizationRate: 0 } - this.lineChartData.dataList.push(equipmentIdObj) + this.first7DaysEfficiencyData.dataList.push(equipmentIdObj) } }) - const equipmentIdList = this.lineChartData.dataList.map(item => item.equipmentId) + const equipmentIdList = this.first7DaysEfficiencyData.dataList.map(item => item.equipmentId) const newData = { xAxis: equipmentIdList, yAxis: [ { - name: '鍒╃敤鐜�', - value: this.lineChartData.dataList.map(item => item.utilizationRate) + name: 'TEEP', + value: this.first7DaysEfficiencyData.dataList.map(item => item.utilizationRate) }, { name: '寮�鍔ㄧ巼', - value: this.lineChartData.dataList.map(item => item.startRate) + value: this.first7DaysEfficiencyData.dataList.map(item => item.startRate) }, { name: '寮�鏈虹巼', - value: this.lineChartData.dataList.map(item => item.openRate) + value: this.first7DaysEfficiencyData.dataList.map(item => item.openRate) } - ], - yAxisName: '鍓�7澶╁埄鐢ㄧ巼(%)' + ] } let legendData = [] let seriesData = [] - let colorArr = ['#09F39E', '#A5F10D', '#09B3F6'] + let colorArr = ['#1890FF', '#2EC35C', '#EA967B'] legendData = newData.yAxis.map((item) => item.name) seriesData = newData.yAxis.map((item1, index1) => { return { name: item1.name, - type: 'line', + type: 'bar', symbol: 'circle', + barGap: '0%', symbolSize: 8, itemStyle: { - color: colorArr[index1] + color: colorArr[index1], + barBorderRadius: 4 }, lineStyle: { width: 2 }, + markPoint: { + show: true + }, yAxisIndex: 1, - data: item1.value // 鎶樼嚎鍥剧殑鏁版嵁 + data: item1.value,// 鎶樼嚎鍥剧殑鏁版嵁 + label: { + show: true, + lineHeight: 10, + formatter: params => { + if (+params.value === 0) return '' + else return params.value + }, + position: index1 % 2 === 0 ? 'top' : 'inside', + textStyle: { + color: 'rgba(0,0,0,.45)', + fontSize: 10 + } + } } }) const option = { + title: { + show: true, // 鏄惁鏄剧ず鏍囬锛岄粯璁や负true + text: '鍓�7澶㏕EEP(%)', // 涓绘爣棰樻枃鏈� + x: 'left', // 鏍囬姘村钩瀹夋斁浣嶇疆锛屽彲閫夊�间负'left'銆�'center'銆�'right'鎴栧叿浣撶殑姘村钩鍧愭爣鍊� + y: 'top', // 鏍囬鍨傜洿瀹夋斁浣嶇疆锛屽彲閫夊�间负'top'銆�'bottom'銆�'center'鎴栧叿浣撶殑鍨傜洿鍧愭爣鍊� + textStyle: { + // 涓绘爣棰樻枃鏈牱寮� + fontSize: 18, + fontWeight: 'normal', + color: '#1AD8DE' + } + }, grid: { containLabel: true, bottom: '1%', @@ -614,23 +733,22 @@ itemGap: 10, textStyle: { fontSize: 14, - color: '#fff' + color: 'rgba(0,0,0,.45)' } }, xAxis: { - triggerEvent: true, data: newData.xAxis || [], axisLabel: { interval: 0, show: true, - fontSize: 12, - color: '#fff' - // rotate: -30, + fontSize: 14, + margin: 10, + color: 'rgba(0,0,0,.45)' }, axisLine: { show: true, lineStyle: { - color: '#fff' + color: 'rgba(0,0,0,.45)' } }, axisTick: { @@ -643,8 +761,7 @@ name: newData.yAxisName, nameTextStyle: { color: '#1AD8DE', - fontSize: 18, - padding: [0, 0, 0, 110] + fontSize: 18 }, nameGap: 30, type: 'value', @@ -652,41 +769,37 @@ axisLine: { show: true, lineStyle: { - color: '#fff' + color: 'rgba(0,0,0,.45)' } }, axisTick: { show: false }, splitLine: { - show: false, - lineStyle: { - color: '#fff' - } + show: false } }, { type: 'value', position: 'right', splitNumber: 5, + max: 100, axisLabel: { show: true, - color: '#fff' + color: 'rgba(0,0,0,.45)', + fontSize: 14 }, axisLine: { show: true, lineStyle: { - color: '#fff' + color: 'rgba(0,0,0,.45)' } }, axisTick: { show: true }, splitLine: { - show: false, - lineStyle: { - color: '#fff' - } + show: false } } ], @@ -697,16 +810,31 @@ endValue: 6 // 涓�娆℃�у睍绀哄嚑涓� } } - this.lineChart.setOption(option, true) + this.first7DaysEfficiencyChart.setOption(option, true) + this.first7DaysEfficiencyChart.hideLoading() - if (this.lineChartData.equipmentIdList.length <= 7) return - this.lineChartCarouselTime = setInterval(() => { + 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(() => { + colorArr.push(colorArr.shift()) newData.xAxis.push(newData.xAxis.shift()) newData.yAxis.forEach(item => item.value.push(item.value.shift())) this.$nextTick(() => { - this.lineChart.setOption(option, true) + this.first7DaysEfficiencyChart.setOption(option, true) }) - }, 3000) + }, 30000) }, /* 缁樺埗浠〃鐩樺浘琛� */ @@ -721,8 +849,7 @@ // 涓绘爣棰樻枃鏈牱寮� fontSize: 18, fontWeight: 'normal', - color: '#1AD8DE', - fontWeight: 'bold' + color: '#1AD8DE' } }, tooltip: { @@ -754,14 +881,14 @@ show: true, length: 10, lineStyle: { - color: '#fff', + color: 'rgba(0,0,0,.45)', width: 2 } }, axisTick: { length: 5, lineStyle: { - color: '#fff', + color: 'rgba(0,0,0,.45)', width: 1 } }, @@ -776,8 +903,8 @@ lineStyle: { // 灞炴�ineStyle鎺у埗绾挎潯鏍峰紡 color: [ //琛ㄧ洏棰滆壊 [0.3, '#F56436'],//0-30%澶勭殑棰滆壊 - [0.7, '#FFFF40'],//30%-60%澶勭殑棰滆壊 - [1, '#0FC61A']//90%-100%澶勭殑棰滆壊 + [0.6, '#FFFF40'],//30%-60%澶勭殑棰滆壊 + [1, '#0FC61A']//60%-100%澶勭殑棰滆壊 ], width: 15//琛ㄧ洏瀹藉害 } @@ -804,12 +931,23 @@ /* 缁樺埗鍒╃敤鐜囦华琛ㄧ洏鍥捐〃 */ drawGaugeChart1(opt) { - this.gaugeChart1 = this.$echarts.init(document.getElementById('gauge_chart1')) const option = Object.assign({}, opt) - option.title.text = moment().subtract(1, 'days').format('M鏈圖鏃�') + `鍒╃敤鐜嘸 - option.series[0].name = '鍒╃敤鐜�' - option.series[0].data = [this.gaugeChartData.utilizationRate] - this.gaugeChart1.setOption(option, true) + + 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 @@ -828,12 +966,22 @@ /* 缁樺埗寮�鍔ㄧ巼浠〃鐩樺浘琛� */ drawGaugeChart2(opt) { - this.gaugeChart2 = this.$echarts.init(document.getElementById('gauge_chart2')) const option = Object.assign({}, opt) - 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) + + 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 @@ -852,12 +1000,22 @@ /* 缁樺埗寮�鏈虹巼浠〃鐩樺浘琛� */ drawGaugeChart3(opt) { - this.gaugeChart3 = this.$echarts.init(document.getElementById('gauge_chart3')) const option = Object.assign({}, opt) - 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) + + 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 @@ -876,23 +1034,29 @@ /* 缁樺埗OEE浠〃鐩樺浘琛� */ drawGaugeChart4(opt) { - this.gaugeChart4 = this.$echarts.init(document.getElementById('gauge_chart4')) const option = Object.assign({}, opt) - 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) + + 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-StatisticsChart', - params: { - isEquipment: false, - productionId: this.gaugeChartData.productionId, - tierName: this.gaugeChartData.productionName - } + name: 'mdc-base-OEEAnalysis', + params: { isEquipment: false, productionId: this.gaugeChartData.productionId } }) } }) @@ -900,7 +1064,16 @@ /* 缁樺埗鍗曟煴鍥� */ drawBarChart() { - this.barChart = this.$echarts.init(document.getElementById('bar_chart')) + const defaultData = [] + const colorArray = ['#79CEAA', '#F589A2', '#6FBF9D', '#66DFE2', '#A7F0C1', '#FAE893', '#F7B7A0'] + let barTopColor = ['#EA967B', '#62AC75', '#32ACBF', '#7196CE'] + let barBottomColor = ['#F8E18B', '#A8D07C', '#7BCAC5', '#8DCCEF'] + const dataMax = this.barChartData.length > 0 ? +this.barChartData.sort((x, y) => +y.value - +x.value)[0].value : 0 + 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, @@ -913,8 +1086,7 @@ // 涓绘爣棰樻枃鏈牱寮� fontSize: 18, fontWeight: 'normal', - color: '#1AD8DE', - fontWeight: 'bold' + color: '#1AD8DE' } }, tooltip: { @@ -922,11 +1094,11 @@ 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: { @@ -934,39 +1106,37 @@ left: '6%', right: '3%' }, - 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 // 鍒诲害鏍囩涓庤酱绾夸箣闂寸殑璺濈 - }, - axisTick: { - show: true, - alignWithLabel: true + xAxis: { + type: 'category', + data: xAisData, + axisLine: { + lineStyle: { + color: 'rgba(0,0,0,.45)' } - }], + }, + axisLabel: { + show: true, // 鏄惁鏄剧ず鍒诲害鏍囩锛岄粯璁ゆ樉绀� + interval: 0, // 鍧愭爣杞村埢搴︽爣绛剧殑鏄剧ず闂撮殧锛屽湪绫荤洰杞翠腑鏈夋晥锛涢粯璁や細閲囩敤鏍囩涓嶉噸鍙犵殑绛栫暐闂撮殧鏄剧ず鏍囩锛涘彲浠ヨ缃垚0寮哄埗鏄剧ず鎵�鏈夋爣绛撅紱濡傛灉璁剧疆涓�1锛岃〃绀恒�庨殧涓�涓爣绛炬樉绀轰竴涓爣绛俱�忥紝濡傛灉鍊间负2锛岃〃绀洪殧涓や釜鏍囩鏄剧ず涓�涓爣绛撅紝浠ユ绫绘帹銆� + inside: false, // 鍒诲害鏍囩鏄惁鏈濆唴锛岄粯璁ゆ湞澶� + margin: 10, // 鍒诲害鏍囩涓庤酱绾夸箣闂寸殑璺濈 + fontSize: 14 + }, + axisTick: { + show: true, + alignWithLabel: true + } + }, yAxis: [ { - // name: '鏁伴噺', - // nameLocation: 'middle', - // nameGap: 30, // x杞磏ame涓庢í鍧愭爣杞寸嚎鐨勯棿璺� + name: '%', + min: 0, + max: yAxisMax, + interval: yAxisInterval, position: 'left', axisLabel: { formatter: '{value}', - color: '#fff' + color: 'rgba(0,0,0,.45)', + fontSize: 14 }, axisTick: { show: true @@ -974,14 +1144,11 @@ axisLine: { show: true, lineStyle: { - color: '#fff' + color: 'rgba(0,0,0,.45)' } }, splitLine: { - show: false, - lineStyle: { - color: 'rgba(255,255,255,0.12)' - } + show: false } }, { @@ -989,33 +1156,68 @@ axisLine: { show: true, lineStyle: { - color: '#fff' + color: 'rgba(0,0,0,.45)' } } } ], - series: [{ - type: 'bar', - data: this.barChartData, - barWidth: '25%', - itemStyle: { - color: '#17C1F0', - barBorderRadius: [10, 10, 10, 10] - }, - label: { - show: false, - lineHeight: 10, - formatter: params => { - if (+params.value === 0) return '' - else return params.value + series: [ + { + type: 'pictorialBar', + symbolSize: [26, 10], + symbolOffset: [0, -5], + z: 12, + itemStyle: { + color: function(params) { + return barBottomColor[params.dataIndex % barBottomColor.length] + } }, - position: 'inside', - textStyle: { - color: '#fff', - fontSize: 18 - } + label: { + show: true, + position: 'top', + fontSize: 12, + color: 'rgba(0,0,0,.45)' + }, + symbolPosition: 'end', + data: this.barChartData + }, + { + type: 'pictorialBar', + symbolSize: [26, 10], + symbolOffset: [0, 5], + z: 12, + itemStyle: { + color: function(params) { + return barTopColor[params.dataIndex % barTopColor.length] + } + }, + data: this.barChartData + }, + { + type: 'bar', + itemStyle: { + color: function(params) { + return new echarts.graphic.LinearGradient( + 0, 0, 0, 1, + [{ + offset: 1, + color: barTopColor[params.dataIndex % barTopColor.length] + }, + { + offset: 0, + color: barBottomColor[params.dataIndex % barBottomColor.length] + } + ] + ) + }, + opacity: .9 + }, + z: 16, + barWidth: 26, + barGap: '-100%', + data: this.barChartData } - }], + ], dataZoom: { show: false, startValue: 0, // 浠庡ご寮�濮嬨�� @@ -1024,15 +1226,76 @@ } 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()) + barTopColor.push(barTopColor.shift()) + barBottomColor.push(barBottomColor.shift()) this.$nextTick(() => { this.barChart.setOption(option, true) }) }, 3000) + }, + + 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, + code: record.code + } + this.modalDataApiUrl = '/eam/home/maintenanceList' + 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() + }) }, /** @@ -1040,15 +1303,14 @@ * 璋冩暣鍥捐〃灏哄浠ラ�傚簲鍒嗚鲸鐜� */ 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.runningStateChart) this.runningStateChart.resize() - if (this.lineChart) this.lineChart.resize() - if (this.gaugeChart1) this.gaugeChart1.resize() - if (this.gaugeChart2) this.gaugeChart2.resize() - if (this.gaugeChart3) this.gaugeChart3.resize() - if (this.gaugeChart4) this.gaugeChart4.resize() + if (this.first7DaysEfficiencyChart) this.first7DaysEfficiencyChart.resize() if (this.barChart) this.barChart.resize() + if (this.doubleBarChart) this.doubleBarChart.resize() } } } @@ -1056,15 +1318,6 @@ <style lang="less" scoped> .page-container { - .page-title { - display: flex; - justify-content: space-evenly; - flex-wrap: wrap; - color: #fff; - margin-bottom: 10px; - - } - .content-container { padding-top: 5px; display: flex; @@ -1077,13 +1330,13 @@ justify-content: space-around; flex-wrap: wrap; color: #fff; - padding-top: 20px; .support-plan-item { border-radius: 3px; width: 30%; padding: 5px 10px; margin-bottom: 10px; + cursor: pointer; .plan-value-container { display: flex; @@ -1093,7 +1346,7 @@ .plan-value { margin-right: 20px; font-size: 30px; - color: #EAC910; + color: #fff; } } } @@ -1115,7 +1368,7 @@ } /deep/ .ant-form .ant-form-item-label label { - color: #fff; + color: rgba(0, 0, 0, .45); font-size: 18px; } @@ -1125,12 +1378,16 @@ /deep/ .ant-select-selection__clear { background: transparent !important; - color: #fff; + color: rgba(0, 0, 0, .45); + } + + /deep/ .ant-select { + color: rgba(0, 0, 0, .45); } /deep/ .ant-input { - border: 1px solid #689ACA; - color: #fff; + border: 1px solid rgba(0, 0, 0, .45); + color: rgba(0, 0, 0, .45); background: transparent !important; } </style> \ No newline at end of file -- Gitblit v1.9.3