From 7c38e9cf9fd161a0e296a047e904eeaf65d96f9f Mon Sep 17 00:00:00 2001 From: qushaowei <qushaowei@163.com> Date: 星期二, 16 四月 2024 09:25:05 +0800 Subject: [PATCH] 校验修改 --- src/views/dashboard/WorkshopSectionSignage.vue | 300 +++++++++++++++++++++++++++++++++++------------------------- 1 files changed, 175 insertions(+), 125 deletions(-) diff --git a/src/views/dashboard/WorkshopSectionSignage.vue b/src/views/dashboard/WorkshopSectionSignage.vue index e010ce2..3a76eb1 100644 --- a/src/views/dashboard/WorkshopSectionSignage.vue +++ b/src/views/dashboard/WorkshopSectionSignage.vue @@ -5,13 +5,14 @@ <div class="back-nav" @click="$emit('backToLastSignage','BranchFactory')" v-if="userType>=3"> <dv-decoration-7>涓婁竴绾�</dv-decoration-7> </div> - <dv-border-box-9 style="padding: 15px"> + + <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 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> + <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> @@ -30,21 +31,21 @@ <div class="support-plan-item" style="background:#FCAA29"> <div>寤舵湡</div> <div class="plan-value-container"> - <div class="plan-value">{{nextMonthMaintenancePlanNum}}</div> + <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">{{nextNextMonthMaintenancePlanNum}}</div> + <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">{{nextNextMonthMaintenancePlanNum}}</div> + <div class="plan-value">{{nextMonthMaintenancePlanNum}}</div> <div>鍙�</div> </div> </div> @@ -58,8 +59,12 @@ </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> @@ -136,61 +141,24 @@ ], thisMonthMaintenancePlanNum: 0, thisMonthMaintenanceRealNum: 0, + maintenanceExtensionNum: 0, + maintenanceOverdueNum: 0, nextMonthMaintenancePlanNum: 0, nextNextMonthMaintenancePlanNum: 0, lineChart: '', - lineChartData: [], + lineChartData: {}, gaugeChart1: '', gaugeChart2: '', gaugeChart3: '', gaugeChart4: '', - gaugeChartData1: [], - gaugeChartData2: [], - gaugeChartData3: [], - gaugeChartData4: [], + gaugeChartData: { + utilizationRate: 0, + startRate: 0, + openRate: 0, + overallEquipmentEfficiency: 0 + }, barChart: '', - barChartData: [ - { - name: '2640221', - value: 20 - }, - { - name: '2640222', - value: 40 - }, - { - name: '2640223', - value: 70 - }, - { - name: '2640224', - value: 30 - }, - { - name: '2640225', - value: 35 - }, - { - name: '2640226', - value: 80 - }, - { - name: '2640227', - value: 40 - }, - { - name: '12640220', - value: 60 - }, - { - name: '12640221', - value: 40 - }, - { - name: '12640222', - value: 35 - } - ], + barChartData: [], equipmentId: '' } }, @@ -202,6 +170,7 @@ beforeDestroy() { window.removeEventListener('resize', this.handleWindowResize) if (this.barChartCarouselTime) clearInterval(this.barChartCarouselTime) + if (this.lineChartCarouselTime) clearInterval(this.lineChartCarouselTime) }, methods: { getChartDataByApi() { @@ -209,6 +178,9 @@ this.getWarrantyMalfunctionDataByApi() this.getRunningStateDataByApi() this.getMonthMaintenanceNumByApi() + this.getLineChartDataByApi() + this.getGaugeChartDataByApi() + this.getBarChartDataByApi() }, /* 璋冪敤鎺ュ彛鑾峰彇鎶�鏈姸鎬� */ @@ -241,15 +213,6 @@ }) }, - /* 璋冪敤鎺ュ彛鑾峰彇璁惧杩愯鐘舵�� */ - getRunningStateDataByApi() { - signageApi.getEquipmentStatusStatisticsApi(this.productionCode) - .then(res => { - if (res.success) this.runningStateData = res.result.list - this.drawRunningStateChart(res.result.producitonId) - }) - }, - /* 璋冪敤鎺ュ彛鑾峰彇涓変繚璁″垝 */ getMonthMaintenanceNumByApi() { signageApi.getThisMonthMaintenanceListApi(this.productionCode) @@ -270,12 +233,55 @@ }) }, + /* 璋冪敤鎺ュ彛鑾峰彇璁惧杩愯鐘舵�� */ + getRunningStateDataByApi() { + signageApi.getEquipmentStatusStatisticsApi(this.productionCode) + .then(res => { + if (res.success) this.runningStateData = res.result.list + this.drawRunningStateChart(res.result.producitonId) + }) + }, + + /* 璋冪敤鎺ュ彛鑾峰彇鍓�7澶╁埄鐢ㄧ巼 */ + getLineChartDataByApi() { + signageApi.getEquipmentDayUtilizationStatisticsApi(this.productionCode) + .then(res => { + if (res.success) this.lineChartData = res.result + this.drawLineChart() + }) + }, + + /* 璋冪敤鎺ュ彛鑾峰彇璁惧鏁堢巼缁熻 */ + getGaugeChartDataByApi() { + signageApi.getEquipmentEfficiencyStatisticsApi(this.productionCode) + .then(res => { + console.log('res=', res) + if (res.success) this.gaugeChartData = res.result + this.drawGaugeChart(res.result.productionId) + }) + }, + + /* 璋冪敤鎺ュ彛鑾峰彇涓婃湀OEE */ + getBarChartDataByApi() { + signageApi.getEquipmentOEEMonthStatisticsApi(this.productionCode) + .then(res => { + if (res.success) { + this.barChartData = res.result.map(item => { + return { + name: item.equipmentId, + value: item.overallEquipmentEfficiency + } + }) + } + this.drawBarChart() + }) + }, + /* 缁樺埗鍥捐〃姹囨�绘柟娉� */ drawCharts() { this.drawRunningStateChart() this.drawTechConditionChart() this.drawWarrantyMalfunctionChart() - this.drawLineChart() this.drawGaugeChart() this.drawBarChart() }, @@ -288,7 +294,7 @@ 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, @@ -481,7 +487,7 @@ series: [ { type: 'pie', - // roseType: 'angle', // 鐜懓鍥� + roseType: 'angle', // 鐜懓鍥� // selectedMode: "single", radius: ['35%', '55%'], center: ['50%', '50%'], @@ -526,20 +532,32 @@ /* 缁樺埗鎶樼嚎鍥� */ 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)) { + const equipmentIdObj = { + equipmentId: item, + openRate: 0, + startRate: 0, + utilizationRate: 0 + } + this.lineChartData.dataList.push(equipmentIdObj) + } + }) + const equipmentIdList = this.lineChartData.dataList.map(item => item.equipmentId) const newData = { - xAxis: ['3鏈�19鏃�', '3鏈�20鏃�', '3鏈�21鏃�', '3鏈�22鏃�', '3鏈�23鏃�', '3鏈�24鏃�', '3鏈�25鏃�'], + xAxis: equipmentIdList, yAxis: [ { name: '鍒╃敤鐜�', - value: [200, 600, 550, 360, 520, 520, 630] + value: this.lineChartData.dataList.map(item => item.utilizationRate) }, { name: '寮�鍔ㄧ巼', - value: [230, 630, 440, 400, 740, 800, 600] + value: this.lineChartData.dataList.map(item => item.startRate) }, { name: '寮�鏈虹巼', - value: [900, 700, 400, 700, 800, 605, 730] + value: this.lineChartData.dataList.map(item => item.openRate) } ], yAxisName: '鍓�7澶╁埄鐢ㄧ巼(%)' @@ -672,23 +690,23 @@ } } ], - series: seriesData - // dataZoom: { - // show: false, - // startValue: 0, // 浠庡ご寮�濮嬨�� - // endValue: 5 // 涓�娆℃�у睍绀哄嚑涓� - // } + series: seriesData, + dataZoom: { + show: false, + startValue: 0, // 浠庡ご寮�濮嬨�� + endValue: 6 // 涓�娆℃�у睍绀哄嚑涓� + } } this.lineChart.setOption(option, true) - // if (newData.xAxis.length <= 6) return - // this.lineChartCarouselTime = setInterval(() => { - // this.barChartData.push(this.barChartData.shift()) - // newData.xAxis.push(newData.xAxis.shift()) - // newData.yAxis.forEach(item => item.value.push(item.value.shift())) - // this.$nextTick(() => { - // this.lineChart.setOption(option, true) - // }) - // }, 3000) + + if (this.lineChartData.equipmentIdList.length <= 7) return + this.lineChartCarouselTime = setInterval(() => { + newData.xAxis.push(newData.xAxis.shift()) + newData.yAxis.forEach(item => item.value.push(item.value.shift())) + this.$nextTick(() => { + this.lineChart.setOption(option, true) + }) + }, 3000) }, /* 缁樺埗浠〃鐩樺浘琛� */ @@ -708,6 +726,7 @@ } }, tooltip: { + trigger: 'item', formatter: params => { return params.seriesName + '锛�' + params.value + '%' } @@ -787,40 +806,96 @@ drawGaugeChart1(opt) { this.gaugeChart1 = this.$echarts.init(document.getElementById('gauge_chart1')) const option = Object.assign({}, opt) - option.title.text = '鍒╃敤鐜�' + option.title.text = moment().subtract(1, 'days').format('M鏈圖鏃�') + `鍒╃敤鐜嘸 option.series[0].name = '鍒╃敤鐜�' - option.series[0].data = [52] + option.series[0].data = [this.gaugeChartData.utilizationRate] this.gaugeChart1.setOption(option, true) + + 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) { this.gaugeChart2 = this.$echarts.init(document.getElementById('gauge_chart2')) const option = Object.assign({}, opt) - option.title.text = '寮�鍔ㄧ巼' + option.title.text = moment().subtract(1, 'days').format('M鏈圖鏃�') + '寮�鍔ㄧ巼' option.series[0].name = '寮�鍔ㄧ巼' - option.series[0].data = [21] + option.series[0].data = [this.gaugeChartData.startRate] this.gaugeChart2.setOption(option, true) + + 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) { this.gaugeChart3 = this.$echarts.init(document.getElementById('gauge_chart3')) const option = Object.assign({}, opt) - option.title.text = '寮�鏈虹巼' + option.title.text = moment().subtract(1, 'days').format('M鏈圖鏃�') + '寮�鏈虹巼' option.series[0].name = '寮�鏈虹巼' - option.series[0].data = [74] + option.series[0].data = [this.gaugeChartData.openRate] this.gaugeChart3.setOption(option, true) + + 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) { this.gaugeChart4 = this.$echarts.init(document.getElementById('gauge_chart4')) const option = Object.assign({}, opt) - option.title.text = 'OEE' + option.title.text = moment().subtract(1, 'months').format('M鏈�') + `OEE` option.series[0].name = 'OEE' - option.series[0].data = [88] + option.series[0].data = [this.gaugeChartData.overallEquipmentEfficiency] this.gaugeChart4.setOption(option, true) + + 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 + } + }) + } + }) }, /* 缁樺埗鍗曟煴鍥� */ @@ -831,7 +906,7 @@ height: 260, title: { show: true, // 鏄惁鏄剧ず鏍囬锛岄粯璁や负true - text: '涓婁釜鏈圤EE', // 涓绘爣棰樻枃鏈� + text: '', // 涓绘爣棰樻枃鏈� x: 'center', // 鏍囬姘村钩瀹夋斁浣嶇疆锛屽彲閫夊�间负'left'銆�'center'銆�'right'鎴栧叿浣撶殑姘村钩鍧愭爣鍊� y: 'top', // 鏍囬鍨傜洿瀹夋斁浣嶇疆锛屽彲閫夊�间负'top'銆�'bottom'銆�'center'鎴栧叿浣撶殑鍨傜洿鍧愭爣鍊� textStyle: { @@ -949,6 +1024,7 @@ } option.title.text = `${moment().subtract(1, 'months').format('M')}鏈圤EE` this.barChart.setOption(option, true) + if (this.barChartData.length <= 6) return this.barChartCarouselTime = setInterval(() => { this.barChartData.push(this.barChartData.shift()) @@ -987,12 +1063,6 @@ color: #fff; margin-bottom: 10px; - .workshop-nav { - width: 120px; - height: 40px; - font-size: 12px; - cursor: pointer; - } } .content-container { @@ -1001,28 +1071,17 @@ justify-content: space-between; .left-col { - .back-nav { - width: 100px; - height: 30px; - color: #fff; - position: absolute; - top: 50px; - left: 10px; - cursor: pointer; - z-index: 9999 - } - .support-plan-container { width: 100%; display: flex; 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; @@ -1038,15 +1097,6 @@ } } } - } - } - - .middle-col { - .first-title { - color: #00A8AC; - font-size: 20px; - text-align: center; - font-weight: bold; } } -- Gitblit v1.9.3