From a751e547d67c4f8e2c6fddf958c1559f792515bd Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期五, 27 六月 2025 16:11:50 +0800 Subject: [PATCH] 添加工作流 --- src/views/dashboard/WorkshopSectionSignage.vue | 369 +++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 260 insertions(+), 109 deletions(-) diff --git a/src/views/dashboard/WorkshopSectionSignage.vue b/src/views/dashboard/WorkshopSectionSignage.vue index 2931790..7523ffb 100644 --- a/src/views/dashboard/WorkshopSectionSignage.vue +++ b/src/views/dashboard/WorkshopSectionSignage.vue @@ -14,45 +14,11 @@ <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 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:#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 class="plan-value">{{$data[item.planValueLabel]}}</div> <div>鍙�</div> </div> </div> @@ -102,15 +68,21 @@ </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, @@ -122,7 +94,12 @@ }, data() { return { + firstEnterClientWidth: null, + pieChartRadius: ['40%', '60%'], + normalPieChartRadius: ['40%', '60%'], + currentPageProductionId: null, runningStateChart: '', + runningStateChartDataRequireFinished: false, runningStateData: [ { value: '0', name: '鍏虫満' }, { value: '0', name: '鎶ヨ' }, @@ -130,16 +107,58 @@ { 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: '#5FE0AF', + apiUrl: '/eam/calibrationOrder/showThisMonthMaintenanceList' + }, + + { + planTime: '鏈湀瀹屾垚閲�', + planValueLabel: 'thisMonthMaintenanceRealNum', + backgroundColor: '#409EFF', + apiUrl: '/eam/calibrationOrder/showThisMonthMaintenanceFinishList' + }, + { + planTime: '寤舵湡', + planValueLabel: 'maintenanceExtensionNum', + backgroundColor: '#FCAA29', + apiUrl: '/eam/calibrationOrder/show3MaintenancePostponeList' + }, + + { + planTime: '瓒呮湡', + planValueLabel: 'maintenanceOverdueNum', + backgroundColor: '#F56C6C', + apiUrl: '/eam/calibrationOrder/show3MaintenanceOverdueList' + }, + { + planTime: '涓嬫湀璁″垝', + planValueLabel: 'nextMonthMaintenancePlanNum', + backgroundColor: '#D6BC52', + apiUrl: '/eam/calibrationOrder/showNextMonthMaintenanceList' + }, + { + planTime: '涓嬩笅鏈堣鍒�', + planValueLabel: 'nextNextMonthMaintenancePlanNum', + backgroundColor: '#58D9F9', + apiUrl: '/eam/calibrationOrder/showNextNextMonthMaintenanceList' + } ], thisMonthMaintenancePlanNum: 0, thisMonthMaintenanceRealNum: 0, @@ -164,10 +183,16 @@ }, 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.getChartDataByApi() }, @@ -201,12 +226,13 @@ .then(res => { 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() }) }, @@ -223,12 +249,13 @@ .then(res => { 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() }) }, @@ -263,8 +290,12 @@ }) signageApi.getEquipmentStatusStatisticsApi(this.productionCode) .then(res => { - if (res.success) this.runningStateData = res.result.list - this.drawRunningStateChart(res.result.productionId) + if (res.success) { + this.runningStateData = res.result.list + this.currentPageProductionId = res.result.productionId + this.runningStateChartDataRequireFinished = true + this.drawRunningStateChart(res.result.productionId) + } }) }, @@ -279,8 +310,10 @@ }) signageApi.getEquipmentDayUtilizationStatisticsApi(this.productionCode) .then(res => { - if (res.success) this.first7DaysEfficiencyData = res.result - this.drawFirst7DaysEfficiencyDataChart() + if (res.success) { + this.first7DaysEfficiencyData = res.result + this.drawFirst7DaysEfficiencyDataChart() + } }) }, @@ -332,15 +365,16 @@ }) signageApi.getEquipmentOEEMonthStatisticsApi(this.productionCode) .then(res => { - if (res.success) { + if (res.success && res.result && res.result.length > 0) { this.barChartData = res.result.map(item => { return { name: item.equipmentId, value: item.overallEquipmentEfficiency } }) + this.drawBarChart() } - this.drawBarChart() + }) }, @@ -389,11 +423,11 @@ { type: 'pie', // selectedMode: "single", - radius: ['40%', '60%'], + radius: this.pieChartRadius, center: ['50%', '50%'], color: [ '#0FC61A', - '#0DAF15', + '#F56436', '#8B8B8B' ], label: { @@ -420,6 +454,16 @@ } 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 + }) }, /* 缁樺埗璁惧鎶ヤ慨鏁呴殰楗煎浘 */ @@ -467,7 +511,7 @@ { type: 'pie', // selectedMode: "single", - radius: ['40%', '60%'], + radius: this.pieChartRadius, center: ['50%', '50%'], color: [ '#24F2F5', @@ -498,6 +542,16 @@ } 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 + }) }, /* 缁樺埗璁惧杩愯鐘舵�佺帿鐟伴ゼ鍥� */ @@ -546,7 +600,7 @@ type: 'pie', roseType: 'angle', // 鐜懓鍥� // selectedMode: "single", - radius: ['35%', '55%'], + radius: this.pieChartRadius, center: ['50%', '50%'], color: [ '#8B8B8B', @@ -606,7 +660,7 @@ xAxis: equipmentIdList, yAxis: [ { - name: '鍒╃敤鐜�', + name: 'TEEP', value: this.first7DaysEfficiencyData.dataList.map(item => item.utilizationRate) }, { @@ -618,11 +672,11 @@ 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 { @@ -631,7 +685,8 @@ symbol: 'circle', symbolSize: 8, itemStyle: { - color: colorArr[index1] + color: colorArr[index1], + barBorderRadius: 100 }, lineStyle: { width: 2 @@ -683,7 +738,7 @@ axisLabel: { interval: 0, show: true, - fontSize: 12, + fontSize: 14, color: '#fff' // rotate: -30, }, @@ -732,7 +787,8 @@ max: 100, axisLabel: { show: true, - color: '#fff' + color: '#fff', + fontSize: 14 }, axisLine: { show: true, @@ -805,8 +861,7 @@ // 涓绘爣棰樻枃鏈牱寮� fontSize: 18, fontWeight: 'normal', - color: '#1AD8DE', - fontWeight: 'bold' + color: '#1AD8DE' } }, tooltip: { @@ -860,8 +915,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//琛ㄧ洏瀹藉害 } @@ -889,11 +944,22 @@ /* 缁樺埗鍒╃敤鐜囦华琛ㄧ洏鍥捐〃 */ drawGaugeChart1(opt) { 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) - this.gaugeChart1.hideLoading() + + 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 @@ -912,13 +978,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) - this.gaugeChart2.hideLoading() + + 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 @@ -937,13 +1012,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) - this.gaugeChart3.hideLoading() + + 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 @@ -962,13 +1046,22 @@ /* 缁樺埗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) - this.gaugeChart4.hideLoading() + + 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 @@ -983,6 +1076,14 @@ /* 缁樺埗鍗曟煴鍥� */ drawBarChart() { + 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, @@ -995,8 +1096,7 @@ // 涓绘爣棰樻枃鏈牱寮� fontSize: 18, fontWeight: 'normal', - color: '#1AD8DE', - fontWeight: 'bold' + color: '#1AD8DE' } }, tooltip: { @@ -1004,11 +1104,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: { @@ -1033,7 +1133,8 @@ interval: 0, // 鍧愭爣杞村埢搴︽爣绛剧殑鏄剧ず闂撮殧锛屽湪绫荤洰杞翠腑鏈夋晥锛涢粯璁や細閲囩敤鏍囩涓嶉噸鍙犵殑绛栫暐闂撮殧鏄剧ず鏍囩锛涘彲浠ヨ缃垚0寮哄埗鏄剧ず鎵�鏈夋爣绛撅紱濡傛灉璁剧疆涓�1锛岃〃绀恒�庨殧涓�涓爣绛炬樉绀轰竴涓爣绛俱�忥紝濡傛灉鍊间负2锛岃〃绀洪殧涓や釜鏍囩鏄剧ず涓�涓爣绛撅紝浠ユ绫绘帹銆� // rotate: this.barChartData.length >= 5 ? -30 : 0, // 鍒诲害鏍囩鏃嬭浆鐨勮搴︼紝鍦ㄧ被鐩酱鐨勭被鐩爣绛炬樉绀轰笉涓嬬殑鏃跺�欏彲浠ラ�氳繃鏃嬭浆闃叉鏍囩涔嬮棿閲嶅彔锛涙棆杞殑瑙掑害浠�-90搴﹀埌90搴� inside: false, // 鍒诲害鏍囩鏄惁鏈濆唴锛岄粯璁ゆ湞澶� - margin: 6 // 鍒诲害鏍囩涓庤酱绾夸箣闂寸殑璺濈 + margin: 6, // 鍒诲害鏍囩涓庤酱绾夸箣闂寸殑璺濈 + fontSize: 14 }, axisTick: { show: true, @@ -1043,12 +1144,14 @@ yAxis: [ { name: '%', - // nameLocation: 'middle', - // nameGap: 30, // x杞磏ame涓庢í鍧愭爣杞寸嚎鐨勯棿璺� + min: 0, + max: yAxisMax, + interval: yAxisInterval, position: 'left', axisLabel: { formatter: '{value}', - color: '#fff' + color: '#fff', + fontSize: 14 }, axisTick: { show: true @@ -1079,10 +1182,13 @@ series: [{ type: 'bar', data: this.barChartData, - barWidth: '25%', + barWidth: this.barChartData.length > 5 ? '40%' : 30, itemStyle: { - color: '#17C1F0', - barBorderRadius: [10, 10, 10, 10] + color: function(params) { + let num = colorArray.length + return colorArray[params.dataIndex % num] + }, + barBorderRadius: 100 }, label: { show: false, @@ -1096,8 +1202,20 @@ color: '#fff', fontSize: 18 } - } - }], + }, + zlevel: 1 + }, + { + name: '鑳屾櫙', + type: 'bar', + barWidth: this.barChartData.length > 5 ? '40%' : 30, + barGap: '-100%', + data: defaultData, + itemStyle: { + color: '#11294d', + barBorderRadius: 100 + } + }], dataZoom: { show: false, startValue: 0, // 浠庡ご寮�濮嬨�� @@ -1121,6 +1239,7 @@ this.barChartCarouselTime = setInterval(() => { this.barChartData.push(this.barChartData.shift()) xAisData.push(xAisData.shift()) + colorArray.push(colorArray.shift()) this.$nextTick(() => { this.barChart.setOption(option, true) }) @@ -1147,16 +1266,47 @@ }, /** + * 鐐瑰嚮涓変繚灞曠ず鏍忓悗鎵撳紑寮圭獥 + * @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() + }) + }, + + /** * 绐楀彛灏哄鍙樺寲鏃惰Е鍙� * 璋冩暣鍥捐〃灏哄浠ラ�傚簲鍒嗚鲸鐜� */ 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.gaugeChart1) this.gaugeChart1.resize() - if (this.gaugeChart2) this.gaugeChart2.resize() - if (this.gaugeChart3) this.gaugeChart3.resize() - if (this.gaugeChart4) this.gaugeChart4.resize() if (this.barChart) this.barChart.resize() + if (this.doubleBarChart) this.doubleBarChart.resize() } } } @@ -1192,6 +1342,7 @@ width: 30%; padding: 5px 10px; margin-bottom: 10px; + cursor: pointer; .plan-value-container { display: flex; -- Gitblit v1.9.3