From ee98c6a4b16e023033b9539858eafa0b49eef959 Mon Sep 17 00:00:00 2001 From: Lius <Lius2225@163.com> Date: 星期三, 24 四月 2024 14:25:09 +0800 Subject: [PATCH] update --- src/views/dashboard/WorkshopSectionSignage.vue | 609 ++++++++++++++++++++++++++++++++++++------------------- 1 files changed, 399 insertions(+), 210 deletions(-) diff --git a/src/views/dashboard/WorkshopSectionSignage.vue b/src/views/dashboard/WorkshopSectionSignage.vue index 8c9094f..2931790 100644 --- a/src/views/dashboard/WorkshopSectionSignage.vue +++ b/src/views/dashboard/WorkshopSectionSignage.vue @@ -5,15 +5,16 @@ <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:#67C23A"> + <div class="support-plan-item" style="background:#5FE0AF"> <div>涓変繚鏈湀璁″垝</div> <div class="plan-value-container"> <div class="plan-value">{{thisMonthMaintenancePlanNum}}</div> @@ -27,24 +28,24 @@ <div>鍙�</div> </div> </div> - <div class="support-plan-item" style="background:#E6A23C"> + <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:#719D8E"> + <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> @@ -68,27 +73,30 @@ <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%"> + + <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 })"> + <a-form layout="inline" + @keyup.enter.native="switchToEquipmentSignage"> <a-form-item label="璁惧缂栧彿"> - <!--<a-input v-model="equipmentId" size="large"></a-input>--> <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> </a-form> <div style="display: flex;flex-wrap: wrap"> - <div id="gauge_chart1" style="width:50%;height: 200px;"></div> - <div id="gauge_chart2" style="width:50%;height: 200px;"></div> - <div id="gauge_chart3" style="width:50%;height: 200px;"></div> - <div id="gauge_chart4" style="width:50%;height: 200px;"></div> + <div id="gauge_chart1" class="gauge-chart"></div> + <div id="gauge_chart2" class="gauge-chart"></div> + <div id="gauge_chart3" class="gauge-chart"></div> + <div id="gauge_chart4" class="gauge-chart"></div> </div> <div id="bar_chart" style="width:100%;height: 330px;"></div> </dv-border-box-9> @@ -135,91 +143,63 @@ ], thisMonthMaintenancePlanNum: 0, thisMonthMaintenanceRealNum: 0, + maintenanceExtensionNum: 0, + maintenanceOverdueNum: 0, nextMonthMaintenancePlanNum: 0, nextNextMonthMaintenancePlanNum: 0, - lineChart: '', - lineChartData: [], + first7DaysEfficiencyChart: '', + first7DaysEfficiencyData: { + dataList: [], + mdcEquipmentList: [] + }, 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: '' } }, mounted() { window.addEventListener('resize', this.handleWindowResize) - this.drawCharts() this.getChartDataByApi() - }, - activated() { - console.log('瑙﹀彂activated') - this.handleWindowResize() - if (this.barChartCarouselTime) clearInterval(this.barChartCarouselTime) }, beforeDestroy() { window.removeEventListener('resize', this.handleWindowResize) if (this.barChartCarouselTime) clearInterval(this.barChartCarouselTime) + if (this.first7DaysEfficiencyChartCarouselTime) clearInterval(this.first7DaysEfficiencyChartCarouselTime) }, methods: { + /* 璋冪敤鎺ュ彛鑾峰彇鍥捐〃鏁版嵁姹囨�绘柟娉� */ getChartDataByApi() { this.getTechConditionDataByApi() this.getWarrantyMalfunctionDataByApi() this.getRunningStateDataByApi() this.getMonthMaintenanceNumByApi() + this.getFirst7DaysEfficiencyDataByApi() + this.getGaugeChartDataByApi() + this.getBarChartDataByApi() }, /* 璋冪敤鎺ュ彛鑾峰彇鎶�鏈姸鎬� */ getTechConditionDataByApi() { + this.techConditionChart = this.$echarts.init(document.getElementById('tech_condition_chart')) + this.techConditionChart.showLoading({ + text: '鏁版嵁鍔犺浇涓� ...', + color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊 + textColor: '#fff', + maskColor: 'rgba(1, 25, 75, 0.2)' // 閬僵灞� + }) signageApi.getEquipmentTechnologyStatusListApi(this.productionCode) .then(res => { - if (res.success) { + if (res.success && res.result) { this.techConditionData = [ { value: res.result[0].qualifiedCount, name: '鍚堟牸' }, { value: res.result[0].disabledCount, name: '绂佺敤' }, @@ -232,9 +212,16 @@ /* 璋冪敤鎺ュ彛鑾峰彇璁惧鎶ヤ慨鏁呴殰 */ getWarrantyMalfunctionDataByApi() { + this.warrantyMalfunctionChart = this.$echarts.init(document.getElementById('warranty_malfunction_chart')) + this.warrantyMalfunctionChart.showLoading({ + text: '鏁版嵁鍔犺浇涓� ...', + color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊 + textColor: '#fff', + maskColor: 'rgba(1, 25, 75, 0.2)' // 閬僵灞� + }) signageApi.getReportRepairEquipmentListApi(this.productionCode) .then(res => { - if (res.success) { + if (res.success && res.result) { this.warrantyMalfunctionData = [ { value: res.result[0].failurTotalCount, name: '鎶ヤ慨' }, { value: res.result[0].stopCount, name: '鍋滄満' }, @@ -242,15 +229,6 @@ ] } this.drawWarrantyMalfunctionChart() - }) - }, - - /* 璋冪敤鎺ュ彛鑾峰彇璁惧杩愯鐘舵�� */ - getRunningStateDataByApi() { - signageApi.getEquipmentStatusStatisticsApi(this.productionCode) - .then(res => { - if (res.success) this.runningStateData = res.result - this.drawRunningStateChart() }) }, @@ -274,38 +252,118 @@ }) }, - /* 缁樺埗鍥捐〃姹囨�绘柟娉� */ - drawCharts() { - this.drawRunningStateChart() - this.drawTechConditionChart() - this.drawWarrantyMalfunctionChart() - this.drawLineChart() - this.drawGaugeChart() - this.drawBarChart() + /* 璋冪敤鎺ュ彛鑾峰彇璁惧杩愯鐘舵�� */ + getRunningStateDataByApi() { + this.runningStateChart = this.$echarts.init(document.getElementById('running_state_chart')) + this.runningStateChart.showLoading({ + text: '鏁版嵁鍔犺浇涓� ...', + color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊 + textColor: '#fff', + maskColor: 'rgba(1, 25, 75, 0.2)' // 閬僵灞� + }) + signageApi.getEquipmentStatusStatisticsApi(this.productionCode) + .then(res => { + if (res.success) this.runningStateData = res.result.list + this.drawRunningStateChart(res.result.productionId) + }) + }, + + /* 璋冪敤鎺ュ彛鑾峰彇鍓�7澶╁埄鐢ㄧ巼 */ + getFirst7DaysEfficiencyDataByApi() { + this.first7DaysEfficiencyChart = this.$echarts.init(document.getElementById('first7DaysEfficiency_chart')) + this.first7DaysEfficiencyChart.showLoading({ + text: '鏁版嵁鍔犺浇涓� ...', + color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊 + textColor: '#fff', + maskColor: 'rgba(1, 25, 75, 0.2)' // 閬僵灞� + }) + signageApi.getEquipmentDayUtilizationStatisticsApi(this.productionCode) + .then(res => { + if (res.success) this.first7DaysEfficiencyData = res.result + this.drawFirst7DaysEfficiencyDataChart() + }) + }, + + /* 璋冪敤鎺ュ彛鑾峰彇璁惧鏁堢巼缁熻 */ + getGaugeChartDataByApi() { + this.gaugeChart1 = this.$echarts.init(document.getElementById('gauge_chart1')) + this.gaugeChart2 = this.$echarts.init(document.getElementById('gauge_chart2')) + this.gaugeChart3 = this.$echarts.init(document.getElementById('gauge_chart3')) + this.gaugeChart4 = this.$echarts.init(document.getElementById('gauge_chart4')) + this.gaugeChart1.showLoading({ + text: '鏁版嵁鍔犺浇涓� ...', + color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊 + textColor: '#fff', + maskColor: 'rgba(1, 25, 75, 0.2)' // 閬僵灞� + }) + this.gaugeChart2.showLoading({ + text: '鏁版嵁鍔犺浇涓� ...', + color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊 + textColor: '#fff', + maskColor: 'rgba(1, 25, 75, 0.2)' // 閬僵灞� + }) + this.gaugeChart3.showLoading({ + text: '鏁版嵁鍔犺浇涓� ...', + color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊 + textColor: '#fff', + maskColor: 'rgba(1, 25, 75, 0.2)' // 閬僵灞� + }) + this.gaugeChart4.showLoading({ + text: '鏁版嵁鍔犺浇涓� ...', + color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊 + textColor: '#fff', + maskColor: 'rgba(1, 25, 75, 0.2)' // 閬僵灞� + }) + signageApi.getEquipmentEfficiencyStatisticsApi(this.productionCode) + .then(res => { + if (res.success) this.gaugeChartData = res.result + this.drawGaugeChart() + }) + }, + + /* 璋冪敤鎺ュ彛鑾峰彇涓婃湀OEE */ + getBarChartDataByApi() { + this.barChart = this.$echarts.init(document.getElementById('bar_chart')) + this.barChart.showLoading({ + text: '鏁版嵁鍔犺浇涓� ...', + color: '#0696e1', // 鍔犺浇鍔ㄧ敾棰滆壊 + textColor: '#fff', + maskColor: 'rgba(1, 25, 75, 0.2)' // 閬僵灞� + }) + signageApi.getEquipmentOEEMonthStatisticsApi(this.productionCode) + .then(res => { + if (res.success) { + this.barChartData = res.result.map(item => { + return { + name: item.equipmentId, + value: item.overallEquipmentEfficiency + } + }) + } + this.drawBarChart() + }) }, /* 缁樺埗鎶�鏈姸鎬侀ゼ鍥� */ drawTechConditionChart() { - this.techConditionChart = this.$echarts.init(document.getElementById('tech_condition_chart')) const option = { title: { show: true, // 鏄惁鏄剧ず鏍囬锛岄粯璁や负true text: '鎶�鏈姸鎬�', // 涓绘爣棰樻枃鏈� x: 'left', // 鏍囬姘村钩瀹夋斁浣嶇疆锛屽彲閫夊�间负'left'銆�'center'銆�'right'鎴栧叿浣撶殑姘村钩鍧愭爣鍊� - y: 'top', // 鏍囬鍨傜洿瀹夋斁浣嶇疆锛屽彲閫夊�间负'top'銆�'bottom'銆�'center'鎴栧叿浣撶殑鍨傜洿鍧愭爣鍊� + y: this.userType >= 3 ? '25' : 'top', // 鏍囬鍨傜洿瀹夋斁浣嶇疆锛屽彲閫夊�间负'top'銆�'bottom'銆�'center'鎴栧叿浣撶殑鍨傜洿鍧愭爣鍊� textStyle: { // 涓绘爣棰樻枃鏈牱寮� fontSize: 18, fontWeight: 'normal', - color: '#00A8AC' + color: '#1AD8DE' } }, tooltip: { trigger: 'item', formatter: function(params) { - if (params.name !== '') { - return `${params.name}:${params.value}(${params.percent}%)` - } + return '<span style="font-weight:bolder;">' + params.name + '</span><br/>' + + '<span style="display:inline-block; width:10px; height:10px; border-radius:100px; margin-right:5px; background:' + params.color + '"></span>' + `${params.value}锛�${params.percent}%锛塦 } }, legend: { @@ -334,9 +392,9 @@ radius: ['40%', '60%'], center: ['50%', '50%'], color: [ - '#0AA012', - '#237E48', - '#757160' + '#0FC61A', + '#0DAF15', + '#8B8B8B' ], label: { position: 'outside', @@ -361,11 +419,11 @@ ] } this.techConditionChart.setOption(option, true) + this.techConditionChart.hideLoading() }, /* 缁樺埗璁惧鎶ヤ慨鏁呴殰楗煎浘 */ drawWarrantyMalfunctionChart() { - this.warrantyMalfunctionChart = this.$echarts.init(document.getElementById('warranty_malfunction_chart')) const option = { title: { show: true, // 鏄惁鏄剧ず鏍囬锛岄粯璁や负true @@ -376,15 +434,14 @@ // 涓绘爣棰樻枃鏈牱寮� fontSize: 18, fontWeight: 'normal', - color: '#00A8AC' + color: '#1AD8DE' } }, tooltip: { trigger: 'item', formatter: function(params) { - if (params.name !== '') { - return `${params.name}:${params.value}(${params.percent}%)` - } + return '<span style="font-weight:bolder;">' + params.name + '</span><br/>' + + '<span style="display:inline-block; width:10px; height:10px; border-radius:100px; margin-right:5px; background:' + params.color + '"></span>' + `${params.value}锛�${params.percent}%锛塦 } }, legend: { @@ -413,9 +470,9 @@ radius: ['40%', '60%'], center: ['50%', '50%'], color: [ - '#00CED1', - '#B85B38', - '#A8985D' + '#24F2F5', + '#F56436', + '#FFFF40' ], label: { position: 'outside', @@ -440,11 +497,11 @@ ] } this.warrantyMalfunctionChart.setOption(option, true) + this.warrantyMalfunctionChart.hideLoading() }, /* 缁樺埗璁惧杩愯鐘舵�佺帿鐟伴ゼ鍥� */ - drawRunningStateChart() { - this.runningStateChart = this.$echarts.init(document.getElementById('running_state_chart')) + drawRunningStateChart(productionId) { const option = { title: { show: true, // 鏄惁鏄剧ず鏍囬锛岄粯璁や负true @@ -455,15 +512,14 @@ // 涓绘爣棰樻枃鏈牱寮� fontSize: 18, fontWeight: 'normal', - color: '#00A8AC' + color: '#1AD8DE' } }, tooltip: { trigger: 'item', formatter: function(params) { - if (params.name !== '') { - return `${params.name}:${params.value}(${params.percent}%)` - } + return '<span style="font-weight:bolder;">' + params.name + '</span><br/>' + + '<span style="display:inline-block; width:10px; height:10px; border-radius:100px; margin-right:5px; background:' + params.color + '"></span>' + `${params.value}锛�${params.percent}%锛塦 } }, legend: { @@ -488,15 +544,15 @@ series: [ { type: 'pie', - // roseType: 'angle', // 鐜懓鍥� + roseType: 'angle', // 鐜懓鍥� // selectedMode: "single", radius: ['35%', '55%'], center: ['50%', '50%'], color: [ - '#686869', - '#AA6349', - '#968A5E', - '#5D975D' + '#8B8B8B', + '#F56436', + '#FFFF40', + '#0FC61A' ], label: { position: 'outside', @@ -521,28 +577,48 @@ ] } this.runningStateChart.setOption(option, true) + this.runningStateChart.hideLoading() + + this.runningStateChart.on('click', params => { + this.$router.push({ + name: 'mdc-base-DeviceBaseInfo', + params: { signageData: params.data, productionId } + }) + }) }, - /* 缁樺埗鎶樼嚎鍥� */ - drawLineChart() { - this.lineChart = this.$echarts.init(document.getElementById('line_chart')) + /* 缁樺埗鍓�7澶╁埄鐢ㄧ巼鏌卞浘 */ + drawFirst7DaysEfficiencyDataChart() { + this.first7DaysEfficiencyData.mdcEquipmentList.forEach(item => { + if (!this.first7DaysEfficiencyData.dataList.map(item => item.equipmentId).includes(item)) { + const equipmentIdObj = { + equipmentId: item.equipmentId, + equipmentName: item.equipmentName, + openRate: 0, + startRate: 0, + utilizationRate: 0 + } + this.first7DaysEfficiencyData.dataList.push(equipmentIdObj) + } + }) + const equipmentIdList = this.first7DaysEfficiencyData.dataList.map(item => item.equipmentId) const newData = { - xAxis: ['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, 780, 230, 420, 650, 700] + value: this.first7DaysEfficiencyData.dataList.map(item => item.utilizationRate) }, { name: '寮�鍔ㄧ巼', - value: [230, 630, 440, 400, 740, 800, 600, 900, 700, 400, 700, 400] + value: this.first7DaysEfficiencyData.dataList.map(item => item.startRate) }, { name: '寮�鏈虹巼', - value: [900, 700, 400, 700, 800, 605, 730, 600, 700, 900, 400, 605] + value: this.first7DaysEfficiencyData.dataList.map(item => item.openRate) } ], - yAxisName: '鍓�7澶╁埄鐢ㄧ巼' + yAxisName: '鍓�7澶╁埄鐢ㄧ巼(%)' } let legendData = [] let seriesData = [] @@ -551,7 +627,7 @@ seriesData = newData.yAxis.map((item1, index1) => { return { name: item1.name, - type: 'line', + type: 'bar', symbol: 'circle', symbolSize: 8, itemStyle: { @@ -559,6 +635,9 @@ }, lineStyle: { width: 2 + }, + markPoint: { + show: true }, yAxisIndex: 1, data: item1.value // 鎶樼嚎鍥剧殑鏁版嵁 @@ -576,6 +655,17 @@ trigger: 'axis', axisPointer: { type: 'shadow' + }, + formatter: function(params) { + let result = '' + params.forEach((item, index) => { + let dom = `<span style="display:inline-block;width:10px;height:10px;border-radius:100px;margin-right:5px;background:${item.color}"></span>${item.seriesName}锛�${item.value}%` + if (index === 0) { + result = `<span style="font-weight:bolder;">${item.name}</span>` + } + result += '<br />' + dom + }) + return result } }, legend: { @@ -585,23 +675,22 @@ itemGap: 10, textStyle: { fontSize: 14, - color: '#ccc' + color: '#fff' } }, xAxis: { - triggerEvent: true, data: newData.xAxis || [], axisLabel: { interval: 0, show: true, fontSize: 12, - color: '#50729A' + color: '#fff' // rotate: -30, }, axisLine: { show: true, lineStyle: { - color: '#50729A' + color: '#fff' } }, axisTick: { @@ -613,9 +702,9 @@ { name: newData.yAxisName, nameTextStyle: { - color: '#00A8AC', + color: '#1AD8DE', fontSize: 18, - padding: [0, 0, 0, 80] + padding: [0, 0, 0, 110] }, nameGap: 30, type: 'value', @@ -623,7 +712,7 @@ axisLine: { show: true, lineStyle: { - color: '#50729A' + color: '#fff' } }, axisTick: { @@ -632,7 +721,7 @@ splitLine: { show: false, lineStyle: { - color: '#3E4A82' + color: '#fff' } } }, @@ -640,14 +729,15 @@ type: 'value', position: 'right', splitNumber: 5, + max: 100, axisLabel: { show: true, - color: '#50729A' + color: '#fff' }, axisLine: { show: true, lineStyle: { - color: '#50729A' + color: '#fff' } }, axisTick: { @@ -656,28 +746,51 @@ splitLine: { show: false, lineStyle: { - color: '#3E4A82' + color: '#fff' } } } ], series: seriesData, - // dataZoom: { - // show: false, - // startValue: 0, // 浠庡ご寮�濮嬨�� - // endValue: 5 // 涓�娆℃�у睍绀哄嚑涓� + dataZoom: { + show: false, + startValue: 0, // 浠庡ご寮�濮嬨�� + endValue: 6 // 涓�娆℃�у睍绀哄嚑涓� + } + // toolbox: { + // show: true, + // feature: { + // mark: { show: true }, + // magicType: { show: true, type: ['line', 'bar'] }, + // restore: { show: true }, + // saveAsImage: { show: true, name: '鍓�7澶╁埄鐢ㄧ巼缁熻鍥�', pixelRatio: 1 } + // } // } } - this.lineChart.setOption(option, true) - // 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) + this.first7DaysEfficiencyChart.setOption(option, true) + this.first7DaysEfficiencyChart.hideLoading() + + this.first7DaysEfficiencyChart.on('click', params => { + this.$router.push({ + name: 'mdc-base-StatisticsChart', + params: { + isEquipment: true, + productionId: params.name, + tierName: this.first7DaysEfficiencyData.dataList.find(item => item.equipmentId === params.name).equipmentName + } + }) + }) + + + // 璁惧鍒楄〃澶т簬7涓椂寮�鍚嚜鍔ㄨ疆鎾� + if (this.first7DaysEfficiencyData.mdcEquipmentList.length <= 7) return + this.first7DaysEfficiencyChartCarouselTime = setInterval(() => { + newData.xAxis.push(newData.xAxis.shift()) + newData.yAxis.forEach(item => item.value.push(item.value.shift())) + this.$nextTick(() => { + this.first7DaysEfficiencyChart.setOption(option, true) + }) + }, 30000) }, /* 缁樺埗浠〃鐩樺浘琛� */ @@ -692,12 +805,15 @@ // 涓绘爣棰樻枃鏈牱寮� fontSize: 18, fontWeight: 'normal', - color: '#00A8AC', + color: '#1AD8DE', fontWeight: 'bold' } }, tooltip: { - formatter: '{a} <br/>{b} : {c}%' + trigger: 'item', + formatter: params => { + return params.seriesName + '锛�' + params.value + '%' + } }, grid: { left: '1%', @@ -707,7 +823,7 @@ }, series: [ { - name: '鍒╃敤鐜�', + name: '', type: 'gauge', radius: '80%', center: ['50%', '60%'], // 榛樿鍏ㄥ眬灞呬腑 @@ -743,9 +859,9 @@ axisLine: { lineStyle: { // 灞炴�ineStyle鎺у埗绾挎潯鏍峰紡 color: [ //琛ㄧ洏棰滆壊 - [0.3, '#E7781E'],//0-30%澶勭殑棰滆壊 - [0.7, '#C5C039'],//30%-60%澶勭殑棰滆壊 - [1, '#21C77F']//90%-100%澶勭殑棰滆壊 + [0.3, '#F56436'],//0-30%澶勭殑棰滆壊 + [0.7, '#FFFF40'],//30%-60%澶勭殑棰滆壊 + [1, '#0FC61A']//90%-100%澶勭殑棰滆壊 ], width: 15//琛ㄧ洏瀹藉害 } @@ -760,7 +876,7 @@ } } }, - data: [{ value: 100 }] + data: [] } ] } @@ -772,52 +888,114 @@ /* 缁樺埗鍒╃敤鐜囦华琛ㄧ洏鍥捐〃 */ 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 = [this.gaugeChartData.utilizationRate] this.gaugeChart1.setOption(option, true) + this.gaugeChart1.hideLoading() + + this.gaugeChart1.getZr().on('click', params => { + // 浠呮湁鐐瑰嚮琛ㄧ洏鍖哄煙鎵嶄細鏈変互涓嬪睘鎬э紝topTarget琛ㄧず瑙﹀彂浜嬩欢瀵硅薄锛宻hape琛ㄧず瑙﹀彂浜嬩欢瀵硅薄鐨勫浘鍍忓睘鎬э紝clockwise琛ㄧず琛ㄧ洏鏄惁浠ラ『鏃堕拡鎺掑垪锛岄粯璁や负true + if (params.topTarget && params.topTarget.shape && params.topTarget.shape.clockwise !== undefined) { + this.$router.push({ + name: 'mdc-base-StatisticsChart', + params: { + isEquipment: false, + productionId: this.gaugeChartData.productionId, + tierName: this.gaugeChartData.productionName + } + }) + } + }) }, /* 缁樺埗寮�鍔ㄧ巼浠〃鐩樺浘琛� */ drawGaugeChart2(opt) { 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 = [this.gaugeChartData.startRate] this.gaugeChart2.setOption(option, true) + this.gaugeChart2.hideLoading() + + this.gaugeChart2.getZr().on('click', params => { + // 浠呮湁鐐瑰嚮琛ㄧ洏鍖哄煙鎵嶄細鏈変互涓嬪睘鎬э紝topTarget琛ㄧず瑙﹀彂浜嬩欢瀵硅薄锛宻hape琛ㄧず瑙﹀彂浜嬩欢瀵硅薄鐨勫浘鍍忓睘鎬э紝clockwise琛ㄧず琛ㄧ洏鏄惁浠ラ『鏃堕拡鎺掑垪锛岄粯璁や负true + if (params.topTarget && params.topTarget.shape && params.topTarget.shape.clockwise !== undefined) { + this.$router.push({ + name: 'mdc-base-StatisticsChart', + params: { + isEquipment: false, + productionId: this.gaugeChartData.productionId, + tierName: this.gaugeChartData.productionName + } + }) + } + }) }, /* 缁樺埗寮�鏈虹巼浠〃鐩樺浘琛� */ drawGaugeChart3(opt) { 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 = [this.gaugeChartData.openRate] this.gaugeChart3.setOption(option, true) + this.gaugeChart3.hideLoading() + + this.gaugeChart3.getZr().on('click', params => { + // 浠呮湁鐐瑰嚮琛ㄧ洏鍖哄煙鎵嶄細鏈変互涓嬪睘鎬э紝topTarget琛ㄧず瑙﹀彂浜嬩欢瀵硅薄锛宻hape琛ㄧず瑙﹀彂浜嬩欢瀵硅薄鐨勫浘鍍忓睘鎬э紝clockwise琛ㄧず琛ㄧ洏鏄惁浠ラ『鏃堕拡鎺掑垪锛岄粯璁や负true + if (params.topTarget && params.topTarget.shape && params.topTarget.shape.clockwise !== undefined) { + this.$router.push({ + name: 'mdc-base-StatisticsChart', + params: { + isEquipment: false, + productionId: this.gaugeChartData.productionId, + tierName: this.gaugeChartData.productionName + } + }) + } + }) }, /* 缁樺埗OEE浠〃鐩樺浘琛� */ drawGaugeChart4(opt) { 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 = [this.gaugeChartData.overallEquipmentEfficiency] this.gaugeChart4.setOption(option, true) + this.gaugeChart4.hideLoading() + + this.gaugeChart4.getZr().on('click', params => { + // 浠呮湁鐐瑰嚮琛ㄧ洏鍖哄煙鎵嶄細鏈変互涓嬪睘鎬э紝topTarget琛ㄧず瑙﹀彂浜嬩欢瀵硅薄锛宻hape琛ㄧず瑙﹀彂浜嬩欢瀵硅薄鐨勫浘鍍忓睘鎬э紝clockwise琛ㄧず琛ㄧ洏鏄惁浠ラ『鏃堕拡鎺掑垪锛岄粯璁や负true + if (params.topTarget && params.topTarget.shape && params.topTarget.shape.clockwise !== undefined) { + this.$router.push({ + name: 'mdc-base-OEEAnalysis', + params: { isEquipment: false, productionId: this.gaugeChartData.productionId } + }) + } + }) }, /* 缁樺埗鍗曟煴鍥� */ drawBarChart() { - this.barChart = this.$echarts.init(document.getElementById('bar_chart')) const xAisData = this.barChartData.map(item => item.name) const option = { height: 260, title: { show: true, // 鏄惁鏄剧ず鏍囬锛岄粯璁や负true - text: '涓婁釜鏈圤EE', // 涓绘爣棰樻枃鏈� + text: '', // 涓绘爣棰樻枃鏈� x: 'center', // 鏍囬姘村钩瀹夋斁浣嶇疆锛屽彲閫夊�间负'left'銆�'center'銆�'right'鎴栧叿浣撶殑姘村钩鍧愭爣鍊� y: 'top', // 鏍囬鍨傜洿瀹夋斁浣嶇疆锛屽彲閫夊�间负'top'銆�'bottom'銆�'center'鎴栧叿浣撶殑鍨傜洿鍧愭爣鍊� textStyle: { // 涓绘爣棰樻枃鏈牱寮� fontSize: 18, fontWeight: 'normal', - color: '#00A8AC', + color: '#1AD8DE', fontWeight: 'bold' } }, @@ -847,7 +1025,7 @@ data: xAisData, axisLine: { lineStyle: { - color: '#50729A' + color: '#fff' } }, axisLabel: { @@ -864,21 +1042,21 @@ }], yAxis: [ { - // name: '鏁伴噺', + name: '%', // nameLocation: 'middle', // nameGap: 30, // x杞磏ame涓庢í鍧愭爣杞寸嚎鐨勯棿璺� position: 'left', axisLabel: { formatter: '{value}', - color: '#50729A' + color: '#fff' }, axisTick: { - show: false + show: true }, axisLine: { show: true, lineStyle: { - color: '#50729A' + color: '#fff' } }, splitLine: { @@ -893,7 +1071,7 @@ axisLine: { show: true, lineStyle: { - color: '#50729A' + color: '#fff' } } } @@ -903,7 +1081,7 @@ data: this.barChartData, barWidth: '25%', itemStyle: { - color: '#129FC6', + color: '#17C1F0', barBorderRadius: [10, 10, 10, 10] }, label: { @@ -915,7 +1093,7 @@ }, position: 'inside', textStyle: { - color: '#50729A', + color: '#fff', fontSize: 18 } } @@ -928,6 +1106,17 @@ } 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()) @@ -938,15 +1127,31 @@ }, 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 + }) + } + }, + /** * 绐楀彛灏哄鍙樺寲鏃惰Е鍙� * 璋冩暣鍥捐〃灏哄浠ラ�傚簲鍒嗚鲸鐜� */ handleWindowResize() { - 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.first7DaysEfficiencyChart) this.first7DaysEfficiencyChart.resize() if (this.gaugeChart1) this.gaugeChart1.resize() if (this.gaugeChart2) this.gaugeChart2.resize() if (this.gaugeChart3) this.gaugeChart3.resize() @@ -966,12 +1171,6 @@ color: #fff; margin-bottom: 10px; - .workshop-nav { - width: 120px; - height: 40px; - font-size: 12px; - cursor: pointer; - } } .content-container { @@ -980,28 +1179,17 @@ justify-content: space-between; .left-col { - .back-nav { - width: 100px; - height: 30px; - color: #eee; - 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; @@ -1020,14 +1208,11 @@ } } - .middle-col { - .first-title { - color: #00A8AC; - font-size: 20px; - text-align: center; - font-weight: bold; + .right-col { + .gauge-chart { + width: 50%; + height: 200px; } - } } } @@ -1051,6 +1236,10 @@ color: #fff; } + /deep/ .ant-select { + color: #fff; + } + /deep/ .ant-input { border: 1px solid #689ACA; color: #fff; -- Gitblit v1.9.3