diff --git a/src/views/board/board1/index.vue b/src/views/board/board1/index.vue index 01e26c8..db3fbdd 100644 --- a/src/views/board/board1/index.vue +++ b/src/views/board/board1/index.vue @@ -54,19 +54,19 @@
未开机
{{ timeData[i.DEVICECODE] || '0' }} - min + h
{{ timeData[i.DEVICECODE] || '0' }} - min + h
{{ timeData[i.DEVICECODE] || '0' }} - min + h
{{ timeData[i.DEVICECODE] || '0' }} - min + h
待机时长
@@ -239,7 +239,7 @@ export default { this.getData() timer = setInterval(() => { this.getData() - }, 1000 * 30) + }, 1000 * 60 * 10) }, methods: { getData() { @@ -254,7 +254,7 @@ export default { setTimeout(() => { getDeviceStartTimeList().then(res => { res.data.forEach(e => { - this.timeData[e.DEVICECODE] = ((e.STARTTIME / 60) || 0).toFixed(1) + this.timeData[e.DEVICECODE] = ((e.STARTTIME / 60 / 60) || 0).toFixed(1) }) }) }, 1000 * 2) diff --git a/src/views/board/board4/index.vue b/src/views/board/board4/index.vue index 6d3a7a1..8594738 100644 --- a/src/views/board/board4/index.vue +++ b/src/views/board/board4/index.vue @@ -2,98 +2,110 @@
数字化注塑车间管控中心
-
今日计划数: {{ form.text1 }} +
今日计划数: {{ form.isSimulate ? form.text1 : orderStatisticsData.planCount }}
今日完成数: {{ - form.text2 + form.isSimulate ? form.text2 : orderStatisticsData.completeCount }}
-
今日差异数: {{ form.text3 }} +
今日差异数: {{ form.isSimulate ? form.text3 : orderStatisticsData.diffCount }}
-
今日完成率: {{ form.text4 }}% +
今日完成率: {{ form.isSimulate ? form.text4 : orderStatisticsData.completeRate }}%
-
今日用水(t):
-
今日用电(kwh):
-
今日用气(m³):
-
正常: {{ form.text8 }}
-
告警: {{ form.text9 }} +
日累计产量
+
月累计产量
+
年累计产量
+
正常: {{ form.isSimulate ? form.text8 : deviceStatusData.normalCount }}
+
告警: {{ form.isSimulate ? form.text9 : deviceStatusData.alarmCount }}
-
停机: {{ form.text10 }} +
停机: {{ form.isSimulate ? form.text10 : deviceStatusData.stopCount }}
{{ - (form.text5 || '').padStart(5, '0').split('')[0] + ((form.isSimulate ? form.text5 : (''+productionTotalData.dayTotal)) || '').padStart(5, '0').split('')[0] }}
{{ - (form.text5 || '').padStart(5, '0').split('')[1] + ((form.isSimulate ? form.text5 : (''+productionTotalData.dayTotal)) || '').padStart(5, '0').split('')[1] }}
{{ - (form.text5 || '').padStart(5, '0').split('')[2] + ((form.isSimulate ? form.text5 : (''+productionTotalData.dayTotal)) || '').padStart(5, '0').split('')[2] }}
{{ - (form.text5 || '').padStart(5, '0').split('')[3] + ((form.isSimulate ? form.text5 : (''+productionTotalData.dayTotal)) || '').padStart(5, '0').split('')[3] }}
{{ - (form.text5 || '').padStart(5, '0').split('')[4] + ((form.isSimulate ? form.text5 : (''+productionTotalData.dayTotal)) || '').padStart(5, '0').split('')[4] }}
{{ - (form.text6 || '').padStart(5, '0').split('')[0] + ((form.isSimulate ? form.text6 : (''+productionTotalData.monthTotal)) || '').padStart(5, '0').split('')[0] }}
{{ - (form.text6 || '').padStart(5, '0').split('')[1] + ((form.isSimulate ? form.text6 : (''+productionTotalData.monthTotal)) || '').padStart(5, '0').split('')[1] }}
{{ - (form.text6 || '').padStart(5, '0').split('')[2] + ((form.isSimulate ? form.text6 : (''+productionTotalData.monthTotal)) || '').padStart(5, '0').split('')[2] }}
{{ - (form.text6 || '').padStart(5, '0').split('')[3] + ((form.isSimulate ? form.text6 : (''+productionTotalData.monthTotal)) || '').padStart(5, '0').split('')[3] }}
{{ - (form.text6 || '').padStart(5, '0').split('')[4] + ((form.isSimulate ? form.text6 : (''+productionTotalData.monthTotal)) || '').padStart(5, '0').split('')[4] }}
{{ - (form.text7 || '').padStart(5, '0').split('')[0] + ((form.isSimulate ? form.text7 : (''+productionTotalData.yearTotal)) || '').padStart(5, '0').split('')[0] }}
{{ - (form.text7 || '').padStart(5, '0').split('')[1] + ((form.isSimulate ? form.text7 : (''+productionTotalData.yearTotal)) || '').padStart(5, '0').split('')[1] }}
{{ - (form.text7 || '').padStart(5, '0').split('')[2] + ((form.isSimulate ? form.text7 : (''+productionTotalData.yearTotal)) || '').padStart(5, '0').split('')[2] }}
{{ - (form.text7 || '').padStart(5, '0').split('')[3] + ((form.isSimulate ? form.text7 : (''+productionTotalData.yearTotal)) || '').padStart(5, '0').split('')[3] }}
{{ - (form.text7 || '').padStart(5, '0').split('')[4] + ((form.isSimulate ? form.text7 : (''+productionTotalData.yearTotal)) || '').padStart(5, '0').split('')[4] }}
-
设备总数: {{ form.text11 }} +
设备总数: {{ + form.isSimulate ? form.text11 : deviceStatusData.totalCount + }}
-
总维修次数: {{ form.text12 }} +
总维修次数: {{ + form.isSimulate ? form.text12 : deviceStatusData.repairCount + }}
工单进度
维修分析
质量追溯
设备分析
告警趋势
-
+
-
{{ form.info1.text1 }}
-
{{ form.info1.text2 }}
-
{{ form.info1.text3 }}
+
{{ form.isSimulate ? form.info1.text1 : alarmInfoData.deviceName }}
+
+ {{ form.isSimulate ? form.info1.text2 : alarmInfoData.alarmReason }} +
+
{{ form.isSimulate ? form.info1.text3 : alarmInfoData.alarmTime }}
@@ -116,48 +128,48 @@
- {{ item.text1 }} + {{ form.isSimulate ? item.text1 : item.materialName }}
- {{ item.text2 }} + {{ form.isSimulate ? item.text2 : item.planCount }}
- {{ item.text3 }} + {{ form.isSimulate ? item.text3 : item.completeCount }}
- {{ item.text4 }} + {{ form.isSimulate ? item.text4 : item.diffCount }}
- {{ item.text5 }} + {{ form.isSimulate ? item.text5 : item.progress }}
-
+
{{ k + 1 }}
-
{{ i.text1 }}
+
{{ form.isSimulate ? i.text1 : i.deviceName }}
-
+
-
{{ i.text3 }}次
+
{{ form.isSimulate ? i.text3 : i.repairCount }}次
@@ -183,6 +195,13 @@ :visible.sync="configDialogVisible" width="70%"> + + + + @@ -445,6 +464,13 @@ import {getSimulateData} from "@/api/board/getData"; import {updateCustomData} from "@/api/base/customData"; import {Message} from "element-ui"; import {getDeviceStatusStatistics} from "@/api/baseDeviceParamVal/val"; +import { + getAlarmInfo, getDeviceProductionList, + getDeviceStatus, + getOrderProgressList, + getOrderStatistics, + getProductionTotal, getQualityStatistics, getQualityTraceList, getRepairAnalysisList, getRepairTrendList +} from "@/api/board/board4"; const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100 export default { @@ -527,10 +553,20 @@ export default { waitTime: 0, }, isData: false, - row: {} + row: {}, + productionTotalData: {}, + orderStatisticsData: {}, + orderProgressList: [], + deviceStatusData: {}, + alarmInfoData: {}, + repairAnalysisList: [], + repairTrendList: [], + qualityStatisticsData: {}, + qualityTraceList: [], + deviceProductionList:[] } }, - mounted() { + async mounted() { getSimulateData({customCode: 'board-1' || '', customType: 1}).then(val => { this.row = val.rows[0] this.form = JSON.parse(val.rows[0].customData); @@ -539,14 +575,51 @@ export default { this.chartInit() }) }) + await this.getData() + setInterval(async () => { + await this.getData() + }, 1000 * 60 * 10) }, methods: { + async getData(){ + getProductionTotal().then(val => { + this.productionTotalData = val.data + }) + getOrderStatistics().then(val => { + this.orderStatisticsData = val.data + }) + getOrderProgressList().then(val => { + this.orderProgressList = val.data + }) + getDeviceStatus().then(val => { + this.deviceStatusData = val.data + }) + getAlarmInfo().then(val => { + this.alarmInfoData = val.data + }) + getRepairAnalysisList().then(val => { + this.repairAnalysisList = val.data + }) + await getRepairTrendList().then(val => { + this.repairTrendList = val.data + }) + await getQualityStatistics().then(val => { + this.qualityStatisticsData = val.data + }) + await getQualityTraceList().then(val => { + this.qualityTraceList = val.data + }) + await getDeviceProductionList().then(val => { + this.deviceProductionList = val.data + }) + this.chartInit() + }, chartInit() { this.$refs.chart1.setData({ title: { y: 'center', left: '60%', - text: `{dot1|●} {name|合格数} :{value|${this.form.chart1.value1}}\n\n\n{dot2|●} {name|不合格数} :{value|${this.form.chart1.value2}}`, + text: `{dot1|●} {name|合格数} :{value|${this.form.isSimulate ? this.form.chart1.value1 : this.qualityStatisticsData.qualifiedCount}}\n\n\n{dot2|●} {name|不合格数} :{value|${this.form.isSimulate ? this.form.chart1.value2 : this.qualityStatisticsData.unqualifiedCount}}`, textStyle: { color: '#ffffff', rich: { @@ -599,7 +672,7 @@ export default { }, data: [ { - value: this.form.chart1.value2, + value: this.form.isSimulate ? this.form.chart1.value2 : this.qualityStatisticsData.unqualifiedCount, name: '不合格数', itemStyle: { color: '#4E97FF', @@ -608,7 +681,7 @@ export default { }, }, { - value: this.form.chart1.value1, + value: this.form.isSimulate ? this.form.chart1.value1 : this.qualityStatisticsData.qualifiedCount, name: '合格数', itemStyle: { color: '#0000', @@ -643,9 +716,12 @@ export default { fontSize: 8, color: '#ddd', }, - indicator: this.form.chart4.map(e => { + indicator: this.form.isSimulate ? this.form.chart4.map(e => { return {name: e.value1, max: e.value3} - }) + }) : this.qualityTraceList.map(e => { + return {name: e.materialName, max: e.passLimit} + }), + }, series: [ { @@ -661,8 +737,10 @@ export default { }, data: [ { - value: this.form.chart4.map(e => { + value: this.form.isSimulate ? this.form.chart4.map(e => { return e.value2 + }) : this.qualityTraceList.map(e => { + return e.passRate }), name: 'Allocated Budget', areaStyle: { @@ -684,7 +762,7 @@ export default { }) this.$refs.chart2.setData({ xAxis: { - data: this.form.chart2.map(e => e.value1), + data: this.form.isSimulate ? this.form.chart2.map(e => e.value1) : this.deviceProductionList.map(e => e.deviceName), axisLine: { lineStyle: { color: '#377097', @@ -770,7 +848,7 @@ export default { color: '#66C7FA', position: 'top', }, - data: this.form.chart2.map(e => e.value2), + data: this.form.isSimulate ? this.form.chart2.map(e => e.value2) : this.deviceProductionList.map(e => e.production), }, { type: 'pictorialBar', @@ -785,13 +863,13 @@ export default { itemStyle: { color: '#0D2DD7' }, - data: this.form.chart2.map(e => e.value2), + data: this.form.isSimulate ? this.form.chart2.map(e => e.value2) : this.deviceProductionList.map(e => e.production), } ], }) this.$refs.chart3.setData({ xAxis: { - data: this.form.chart3.map(e => e.value1), + data: this.form.isSimulate ? this.form.chart3.map(e => e.value1) : this.repairTrendList?.map(e => e.timeHour), boundaryGap: false, axisLine: { lineStyle: { @@ -868,7 +946,7 @@ export default { label: { show: false, }, - data: this.form.chart3.map(e => e.value2), + data: this.form.isSimulate ? this.form.chart3.map(e => e.value2) : this.repairTrendList.map(e => e.repairCount), }, ], }) diff --git a/src/views/board/board5/index.vue b/src/views/board/board5/index.vue index e346896..b3987a8 100644 --- a/src/views/board/board5/index.vue +++ b/src/views/board/board5/index.vue @@ -3,63 +3,89 @@
数字化注塑车间管控中心
工单总数: - {{ form.text1 }} + {{ + form.isSimulate ? form.text1 : orderWorkStatisticsData.totalCount + }}
已完成: - {{ form.text2 }} + {{ + form.isSimulate ? form.text2 : orderWorkStatisticsData.completeCount + }}
完成率: - {{ form.text3 }} + {{ + form.isSimulate ? form.text3 : orderWorkStatisticsData.completeRate + }} %
停机工单: - {{ form.text4 }} + {{ + form.isSimulate ? form.text4 : orderWorkStatisticsData.stopCount + }}
平均响应时间: - {{ form.text5 }} + {{ + form.isSimulate ? form.text5 : (parseFloat(repairTimeStatisticsData.avgResponseTime) > 1000 ? '无响应' : repairTimeStatisticsData.avgResponseTime) + }} min
平均维修时间: - {{ form.text6 }} + {{ + form.isSimulate ? form.text6 : repairTimeStatisticsData.avgRepairTime + }} H
设备保养执行情况
设备巡检执行情况
故障原因统计TOP5
故障数量曲线
-
备件消耗费用TOP5
+
机台产量TOP5
计划保养
已保养
待保养
保养中
待验证
-
{{ form.text7 }}单
-
{{ form.text8 }}单
-
{{ form.text9 }}% / {{ - form.text10 +
+ {{ form.isSimulate ? form.text7 : maintStatisticsData.planCount }}单 +
+
+ {{ form.isSimulate ? form.text8 : maintStatisticsData.completeCount }}单 +
+
+ {{ form.isSimulate ? form.text9 : maintStatisticsData.waitingCount }}% / {{ + form.isSimulate ? form.text10 : maintStatisticsData.waitingRate }}单
-
{{ form.text11 }}% / {{ form.text12 }}单
-
{{ form.text13 }}% / {{ form.text14 }}单
+
{{ + form.isSimulate ? form.text11 : maintStatisticsData.doingCount + }}% / {{ form.isSimulate ? form.text12 : maintStatisticsData.doingRate }}单
+
+ {{ form.isSimulate ? form.text13 : maintStatisticsData.verifyCount }}% / {{ form.isSimulate ? form.text14 : maintStatisticsData.verifyRate }}单
-
{{ form.text15 }}%
+
{{ + form.isSimulate ? form.text15 : maintStatisticsData.completeRate + }}% +
完成率
应检设备{{ - form.text16 + form.isSimulate ? form.text16 : inspectStatisticsData.deviceCount }}台
-
{{ form.text17 }}%
+
{{ + form.isSimulate ? form.text17 : inspectStatisticsData.completeRate + }}% +
完成率
@@ -76,13 +102,13 @@
-
+
{{ k + 1 }}
-
{{ i.value1 }}
+
{{ form.isSimulate ? i.value1 : i.deviceName }}
-
+
-
{{ i.value3 }}次
+
{{ form.isSimulate ? i.value3 : i.production }}个
@@ -94,6 +120,13 @@ :visible.sync="configDialogVisible" width="70%"> + + + + @@ -251,6 +284,14 @@ import {getSimulateData} from "@/api/board/getData"; import {updateCustomData} from "@/api/base/customData"; import {Message} from "element-ui"; import {getDeviceStatusStatistics} from "@/api/baseDeviceParamVal/val"; +import { + getDeviceStatusDistribution, getFaultSourceDistribution, getFaultTrendList, + getInspectStatistics, + getMaintStatistics, + getOrderWorkStatistics, getProductionTop5, + getRepairTimeStatistics +} from "@/api/board/board5"; +import Log from "@/views/monitor/job/log.vue"; const vw = (document.documentElement.clientWidth || document.body.clientWidth) / 100 export default { @@ -303,24 +344,60 @@ export default { configDialogVisible: false, toggle: false, isData: false, - row: {} + row: {}, + orderWorkStatisticsData: {}, + repairTimeStatisticsData: {}, + maintStatisticsData: {}, + inspectStatisticsData: {}, + deviceStatusDistributionData: {}, + faultSourceDistributionData: {}, + faultTrendList: [], + productionTop5Data: [] } }, - mounted() { + async mounted() { getSimulateData({customCode: 'board-2' || '', customType: 1}).then(val => { this.row = val.rows[0] this.form = JSON.parse(val.rows[0].customData); this.isData = true - this.$nextTick(() => { - this.chartInit() - }) }) + await this.getData() + setInterval(async () => { + await this.getData() + }, 1000 * 60 * 10) }, methods: { + async getData() { + await getOrderWorkStatistics().then(res => { + this.orderWorkStatisticsData = res.data + }) + await getRepairTimeStatistics().then(res => { + this.repairTimeStatisticsData = res.data + }) + await getMaintStatistics().then(res => { + this.maintStatisticsData = res.data + }) + await getInspectStatistics().then(res => { + this.inspectStatisticsData = res.data + }) + await getDeviceStatusDistribution().then(res => { + this.deviceStatusDistributionData = res.data + }) + await getFaultSourceDistribution().then(res => { + this.faultSourceDistributionData = res.data + }) + await getFaultTrendList().then(res => { + this.faultTrendList = res.data + }) + await getProductionTop5().then(res => { + this.productionTop5Data = res.data + }) + this.chartInit() + }, chartInit() { let data = [ { - value: this.form.value1, + value: this.form.isSimulate ? this.form.value1 : this.deviceStatusDistributionData.experimentPercent, name: '实验设备', index: 0, itemStyle: { @@ -330,7 +407,7 @@ export default { }, }, { - value: this.form.value2, + value: this.form.isSimulate ? this.form.value2 : this.deviceStatusDistributionData.uncheckedPercent, name: '未检设备', index: 1, itemStyle: { @@ -340,7 +417,7 @@ export default { }, }, { - value: this.form.value3, + value: this.form.isSimulate ? this.form.value3 : this.deviceStatusDistributionData.normalPercent, name: '正常设备', index: 2, itemStyle: { @@ -350,7 +427,7 @@ export default { }, }, { - value: this.form.value4, + value: this.form.isSimulate ? this.form.value4 : this.deviceStatusDistributionData.abnormalPercent, index: 3, name: '异常设备', itemStyle: { @@ -362,7 +439,7 @@ export default { ] let chartData = [ { - value: this.form.value5, + value: this.form.isSimulate ? this.form.value5 : this.faultSourceDistributionData.maintainPercent, name: '维护故障', index: 0, itemStyle: { @@ -372,7 +449,7 @@ export default { }, }, { - value: this.form.value6, + value: this.form.isSimulate ? this.form.value6 : this.faultSourceDistributionData.runningPercent, name: '运行故障', index: 1, itemStyle: { @@ -382,7 +459,7 @@ export default { }, }, { - value: this.form.value7, + value: this.form.isSimulate ? this.form.value7 : this.faultSourceDistributionData.naturalPercent, name: '自然故障', index: 2, itemStyle: { @@ -407,15 +484,15 @@ export default { }, data: [ { - value: Math.min(parseFloat(this.form.text15), 100), - name: '不合格数', + value: Math.min(parseFloat(this.form.isSimulate ? this.form.text15 : (this.maintStatisticsData.completeCount)), 100), + name: '合格数', itemStyle: { color: '#00AFFF' }, }, { - value: Math.max((100 - parseFloat(this.form.text15)), 0), - name: '合格数', + value: Math.max((100 - parseFloat((this.form.isSimulate ? this.form.text15 : this.maintStatisticsData.completeCount))), 0), + name: '不合格数', itemStyle: { color: '#0000' }, @@ -554,7 +631,7 @@ export default { this.$refs.chart4.setData({ xAxis: { - data: this.form.chart1.map(e => e.value1), + data: this.form.isSimulate ? this.form.chart1.map(e => e.value1) : this.faultTrendList.map(e => e.dateValue), boundaryGap: false, axisLine: { lineStyle: { @@ -630,7 +707,7 @@ export default { label: { show: false, }, - data: this.form.chart1.map(e => e.value2), + data: this.form.isSimulate ? this.form.chart1.map(e => e.value2) : this.faultTrendList.map(e => e.faultCount), }, ] }) @@ -709,9 +786,9 @@ export default { .title { position: absolute; - bottom: 51%; + top: 51%; left: 50%; - transform: translateX(-50%); + transform: translate(-50%, calc(-100% - 0.4vw)); color: #55BCFE; font-size: 1.1vw; letter-spacing: 0.2vw; @@ -746,9 +823,9 @@ export default { .title { position: absolute; - bottom: 51%; + top: 51%; left: 23%; - transform: translateX(-50%); + transform: translate(-50%, calc(-100% - 0.4vw)); color: #55BCFE; font-size: 1.1vw; letter-spacing: 0.2vw;