From 383f98e1d95b802ab323f5acc3477f7c593bfe69 Mon Sep 17 00:00:00 2001 From: lb Date: Tue, 29 Aug 2023 09:56:27 +0800 Subject: [PATCH 01/14] =?UTF-8?q?add=20=E8=AE=BE=E5=A4=87=E7=9B=91?= =?UTF-8?q?=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/monitoring/equipmentAlarmLog.js | 54 ++++ src/api/monitoring/equipmentAlarmRealtime.js | 54 ++++ .../monitoring/equipmentAlarmLog/index.vue | 226 +++++++++++++++++ .../equipmentAlarmRealtime/index.vue | 233 ++++++++++++++++++ 4 files changed, 567 insertions(+) create mode 100644 src/api/monitoring/equipmentAlarmLog.js create mode 100644 src/api/monitoring/equipmentAlarmRealtime.js create mode 100644 src/views/monitoring/equipmentAlarmLog/index.vue create mode 100644 src/views/monitoring/equipmentAlarmRealtime/index.vue diff --git a/src/api/monitoring/equipmentAlarmLog.js b/src/api/monitoring/equipmentAlarmLog.js new file mode 100644 index 00000000..fd74cb33 --- /dev/null +++ b/src/api/monitoring/equipmentAlarmLog.js @@ -0,0 +1,54 @@ +import request from '@/utils/request' + +// 创建设备报警日志 +export function createEquipmentAlarmLog(data) { + return request({ + url: '/monitoring/equipment-alarm-log/create', + method: 'post', + data: data + }) +} + +// 更新设备报警日志 +export function updateEquipmentAlarmLog(data) { + return request({ + url: '/monitoring/equipment-alarm-log/update', + method: 'put', + data: data + }) +} + +// 删除设备报警日志 +export function deleteEquipmentAlarmLog(id) { + return request({ + url: '/monitoring/equipment-alarm-log/delete?id=' + id, + method: 'delete' + }) +} + +// 获得设备报警日志 +export function getEquipmentAlarmLog(id) { + return request({ + url: '/monitoring/equipment-alarm-log/get?id=' + id, + method: 'get' + }) +} + +// 获得设备报警日志分页 +export function getEquipmentAlarmLogPage(query) { + return request({ + url: '/monitoring/equipment-alarm-log/page', + method: 'get', + params: query + }) +} + +// 导出设备报警日志 Excel +export function exportEquipmentAlarmLogExcel(query) { + return request({ + url: '/monitoring/equipment-alarm-log/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/src/api/monitoring/equipmentAlarmRealtime.js b/src/api/monitoring/equipmentAlarmRealtime.js new file mode 100644 index 00000000..00523a24 --- /dev/null +++ b/src/api/monitoring/equipmentAlarmRealtime.js @@ -0,0 +1,54 @@ +import request from '@/utils/request' + +// 创建设备报警实时信息 +export function createEquipmentAlarmRealtime(data) { + return request({ + url: '/monitoring/equipment-alarm-realtime/create', + method: 'post', + data: data + }) +} + +// 更新设备报警实时信息 +export function updateEquipmentAlarmRealtime(data) { + return request({ + url: '/monitoring/equipment-alarm-realtime/update', + method: 'put', + data: data + }) +} + +// 删除设备报警实时信息 +export function deleteEquipmentAlarmRealtime(id) { + return request({ + url: '/monitoring/equipment-alarm-realtime/delete?id=' + id, + method: 'delete' + }) +} + +// 获得设备报警实时信息 +export function getEquipmentAlarmRealtime(id) { + return request({ + url: '/monitoring/equipment-alarm-realtime/get?id=' + id, + method: 'get' + }) +} + +// 获得设备报警实时信息分页 +export function getEquipmentAlarmRealtimePage(query) { + return request({ + url: '/monitoring/equipment-alarm-realtime/page', + method: 'get', + params: query + }) +} + +// 导出设备报警实时信息 Excel +export function exportEquipmentAlarmRealtimeExcel(query) { + return request({ + url: '/monitoring/equipment-alarm-realtime/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/src/views/monitoring/equipmentAlarmLog/index.vue b/src/views/monitoring/equipmentAlarmLog/index.vue new file mode 100644 index 00000000..d7fd3808 --- /dev/null +++ b/src/views/monitoring/equipmentAlarmLog/index.vue @@ -0,0 +1,226 @@ + + + diff --git a/src/views/monitoring/equipmentAlarmRealtime/index.vue b/src/views/monitoring/equipmentAlarmRealtime/index.vue new file mode 100644 index 00000000..778dbc36 --- /dev/null +++ b/src/views/monitoring/equipmentAlarmRealtime/index.vue @@ -0,0 +1,233 @@ + + + From 84ed13d58ff44cd587b1ac7f0deb121b27006a7e Mon Sep 17 00:00:00 2001 From: lb Date: Tue, 29 Aug 2023 10:17:27 +0800 Subject: [PATCH 02/14] done equipmentAlarmLog --- .../monitoring/equipmentAlarmLog/index.vue | 487 ++++++++++-------- 1 file changed, 273 insertions(+), 214 deletions(-) diff --git a/src/views/monitoring/equipmentAlarmLog/index.vue b/src/views/monitoring/equipmentAlarmLog/index.vue index d7fd3808..697cbf10 100644 --- a/src/views/monitoring/equipmentAlarmLog/index.vue +++ b/src/views/monitoring/equipmentAlarmLog/index.vue @@ -1,226 +1,285 @@ From e37bb3f2ceb1d457cce4e9c029d517242ce188fa Mon Sep 17 00:00:00 2001 From: lb Date: Tue, 29 Aug 2023 14:47:32 +0800 Subject: [PATCH 03/14] =?UTF-8?q?add=20=E8=AE=BE=E5=A4=87=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=97=B6=E5=BA=8F=E5=9B=BE=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SequenceGraph/index.vue | 41 ++ .../SequenceGraph/sequenceGraphItem.vue | 49 ++ .../equipmentAlarmRealtime/index.vue | 535 ++++++++++-------- 3 files changed, 404 insertions(+), 221 deletions(-) create mode 100644 src/components/SequenceGraph/index.vue create mode 100644 src/components/SequenceGraph/sequenceGraphItem.vue diff --git a/src/components/SequenceGraph/index.vue b/src/components/SequenceGraph/index.vue new file mode 100644 index 00000000..3547f147 --- /dev/null +++ b/src/components/SequenceGraph/index.vue @@ -0,0 +1,41 @@ + + + + + + + diff --git a/src/components/SequenceGraph/sequenceGraphItem.vue b/src/components/SequenceGraph/sequenceGraphItem.vue new file mode 100644 index 00000000..87433a2c --- /dev/null +++ b/src/components/SequenceGraph/sequenceGraphItem.vue @@ -0,0 +1,49 @@ + + + + + + + diff --git a/src/views/monitoring/equipmentAlarmRealtime/index.vue b/src/views/monitoring/equipmentAlarmRealtime/index.vue index 778dbc36..b5e7080b 100644 --- a/src/views/monitoring/equipmentAlarmRealtime/index.vue +++ b/src/views/monitoring/equipmentAlarmRealtime/index.vue @@ -1,233 +1,326 @@ From 0f5e4b8368f3efe9a7387bc2e29316e99a7c052a Mon Sep 17 00:00:00 2001 From: lb Date: Wed, 30 Aug 2023 10:27:49 +0800 Subject: [PATCH 04/14] =?UTF-8?q?update=20=E8=AE=BE=E5=A4=8724=E5=B0=8F?= =?UTF-8?q?=E6=97=B6=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitoring/equipmentRecentHours/index.vue | 455 ++++++++++++++++++ .../equipmentRecentHours/props.json | 80 +++ .../equipmentRecentHours/response.json | 176 +++++++ 3 files changed, 711 insertions(+) create mode 100644 src/views/monitoring/equipmentRecentHours/index.vue create mode 100644 src/views/monitoring/equipmentRecentHours/props.json create mode 100644 src/views/monitoring/equipmentRecentHours/response.json diff --git a/src/views/monitoring/equipmentRecentHours/index.vue b/src/views/monitoring/equipmentRecentHours/index.vue new file mode 100644 index 00000000..d6df828b --- /dev/null +++ b/src/views/monitoring/equipmentRecentHours/index.vue @@ -0,0 +1,455 @@ + + + + + + + diff --git a/src/views/monitoring/equipmentRecentHours/props.json b/src/views/monitoring/equipmentRecentHours/props.json new file mode 100644 index 00000000..a8976b08 --- /dev/null +++ b/src/views/monitoring/equipmentRecentHours/props.json @@ -0,0 +1,80 @@ +{ + "tableProps": [ + { + "prop": "inspectionContent", + "label": "检测内容", + "align": "center" + }, + { + "prop": "2023-03-18T00:00:00", + "label": "2023-03-18T00:00:00", + "align": "center", + "children": [ + { + "prop": "2023-03-18T00:00:00-产线1", + "label": "产线1", + "align": "center" + }, + { + "prop": "2023-03-18T00:00:00-产线2", + "label": "产线2", + "align": "center" + }, + { + "prop": "2023-03-18T00:00:00-产线3", + "label": "产线3", + "align": "center" + }, + { + "prop": "2023-03-18T00:00:00-产线4", + "label": "产线4", + "align": "center" + }, + { + "prop": "2023-03-18T00:00:00-产线5", + "label": "产线5", + "align": "center" + } + ] + }, + { + "prop": "2023-03-18T01:00:00", + "label": "2023-03-18T01:00:00", + "align": "center", + "children": [ + { + "prop": "2023-03-18T01:00:00-产线1", + "label": "产线1", + "align": "center" + }, + { + "prop": "2023-03-18T01:00:00-产线2", + "label": "产线2", + "align": "center" + }, + { + "prop": "2023-03-18T01:00:00-产线3", + "label": "产线3", + "align": "center" + } + ] + }, + { + "prop": "2023-03-18T02:00:00", + "label": "2023-03-18T02:00:00", + "align": "center", + "children": [ + { + "prop": "2023-03-18T02:00:00-产线1", + "label": "产线1", + "align": "center" + }, + { + "prop": "2023-03-18T02:00:00-产线2", + "label": "产线2", + "align": "center" + } + ] + } + ] +} diff --git a/src/views/monitoring/equipmentRecentHours/response.json b/src/views/monitoring/equipmentRecentHours/response.json new file mode 100644 index 00000000..9524dfb4 --- /dev/null +++ b/src/views/monitoring/equipmentRecentHours/response.json @@ -0,0 +1,176 @@ +{ + "code": 0, + "data": { + "data": [ + { + "data": [ + { + "id": "测试222023-08-09T02:00", + "parentId": "测试22", + "dynamicName": "2023-08-09T02:00", + "dynamicValue": 1691517600000, + "children": [ + { + "id": "1672847052717821953", + "parentId": "测试222023-08-09T02:00", + "dynamicName": "产线1", + "dynamicValue": 1 + } + ] + }, + { + "id": "测试222023-08-09T08:00", + "parentId": "测试22", + "dynamicName": "2023-08-09T08:00", + "dynamicValue": 1691539200000, + "children": [ + { + "id": "1672847052717821953", + "parentId": "测试222023-08-09T08:00", + "dynamicName": "产线1", + "dynamicValue": 1 + } + ] + }, + { + "id": "测试222023-08-09T11:00", + "parentId": "测试22", + "dynamicName": "2023-08-09T11:00", + "dynamicValue": 1691550000000, + "children": [ + { + "id": "1672847052717821953", + "parentId": "测试222023-08-09T11:00", + "dynamicName": "产线1", + "dynamicValue": 1 + } + ] + } + ], + "inspectionDetContent": "测试22" + }, + { + "data": [ + { + "id": "测试112023-08-09T02:00", + "parentId": "测试11", + "dynamicName": "2023-08-09T02:00", + "dynamicValue": 1691517600000, + "children": [ + { + "id": "1672847052717821954", + "parentId": "测试112023-08-09T02:00", + "dynamicName": "产线22", + "dynamicValue": 1 + } + ] + }, + { + "id": "测试112023-08-09T08:00", + "parentId": "测试11", + "dynamicName": "2023-08-09T08:00", + "dynamicValue": 1691539200000, + "children": [ + { + "id": "1672847052717821953", + "parentId": "测试112023-08-09T08:00", + "dynamicName": "产线1", + "dynamicValue": 1 + } + ] + }, + { + "id": "测试112023-08-09T09:00", + "parentId": "测试11", + "dynamicName": "2023-08-09T09:00", + "dynamicValue": 1691542800000, + "children": [ + { + "id": "1672847052717821954", + "parentId": "测试112023-08-09T09:00", + "dynamicName": "产线22", + "dynamicValue": 2 + } + ] + } + ], + "inspectionDetContent": "测试11" + } + ], + "nameData": [ + { + "name": "2023-08-09T02:00", + "tree": 1, + "id": "测试222023-08-09T02:00", + "parentId": "测试22" + }, + { + "name": "产线1", + "tree": 2, + "id": "1672847052717821953", + "parentId": "测试222023-08-09T02:00" + }, + { + "name": "2023-08-09T08:00", + "tree": 1, + "id": "测试222023-08-09T08:00", + "parentId": "测试22" + }, + { + "name": "产线1", + "tree": 2, + "id": "1672847052717821953", + "parentId": "测试222023-08-09T08:00" + }, + { + "name": "2023-08-09T11:00", + "tree": 1, + "id": "测试222023-08-09T11:00", + "parentId": "测试22" + }, + { + "name": "产线1", + "tree": 2, + "id": "1672847052717821953", + "parentId": "测试222023-08-09T11:00" + }, + { + "name": "2023-08-09T02:00", + "tree": 1, + "id": "测试112023-08-09T02:00", + "parentId": "测试11" + }, + { + "name": "产线22", + "tree": 2, + "id": "1672847052717821954", + "parentId": "测试112023-08-09T02:00" + }, + { + "name": "2023-08-09T08:00", + "tree": 1, + "id": "测试112023-08-09T08:00", + "parentId": "测试11" + }, + { + "name": "产线1", + "tree": 2, + "id": "1672847052717821953", + "parentId": "测试112023-08-09T08:00" + }, + { + "name": "2023-08-09T09:00", + "tree": 1, + "id": "测试112023-08-09T09:00", + "parentId": "测试11" + }, + { + "name": "产线22", + "tree": 2, + "id": "1672847052717821954", + "parentId": "测试112023-08-09T09:00" + } + ] + }, + "msg": "" +} From bf52db3b6ac01862eff13ac4e333efc7c73a4823 Mon Sep 17 00:00:00 2001 From: lb Date: Wed, 30 Aug 2023 11:37:11 +0800 Subject: [PATCH 05/14] =?UTF-8?q?update=20more=20=E8=AE=BE=E5=A4=8724?= =?UTF-8?q?=E5=B0=8F=E6=97=B6=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitoring/equipmentRecentHours/index.vue | 355 +++++++++++++----- 1 file changed, 252 insertions(+), 103 deletions(-) diff --git a/src/views/monitoring/equipmentRecentHours/index.vue b/src/views/monitoring/equipmentRecentHours/index.vue index d6df828b..45ac1e59 100644 --- a/src/views/monitoring/equipmentRecentHours/index.vue +++ b/src/views/monitoring/equipmentRecentHours/index.vue @@ -44,14 +44,7 @@ export default { pageNo: 1, pageSize: 10, }, - // jsondemo: '', list: [ - // { - // inspectionContent: '检测内容1', - // '2023-03-18T00:00:00-产线1': '产线1-asdf', - // '2023-03-18T01:00:00-产线2': '产线2-kldf', - // '2023-03-18T02:00:00-产线1': '产线1-vasdkj', - // }, { productLine: '产线1', specification: ['80*11', '100*10'].join(','), @@ -192,7 +185,6 @@ export default { { prop: 'equipmentName', label: '设备', align: 'center' }, { prop: 'totalQuantity', label: '生产总数', align: 'center' }, { - prop: 'l-1', label: 'l-1', align: 'center', children: [ @@ -203,7 +195,6 @@ export default { ], }, { - prop: 'l-2', label: 'l-2', align: 'center', children: [ @@ -214,7 +205,6 @@ export default { ], }, { - prop: 'l-3', label: 'l-3', align: 'center', children: [ @@ -224,76 +214,18 @@ export default { { prop: 'l-3__ratio', label: '报废率', align: 'center' }, ], }, + { + label: 'l-4', + align: 'center', + children: [ + { prop: 'l-4__in', label: '进数据', align: 'center' }, + { prop: 'l-4__out', label: '出数据', align: 'center' }, + { prop: 'l-4__nok', label: '报废数据', align: 'center' }, + { prop: 'l-4__ratio', label: '报废率', align: 'center' }, + ], + }, ], - equipments: [ - { id: 1, name: '上片机' }, - { id: 2, name: '打磨机' }, - { id: 3, name: '清洗机' }, - { id: 4, name: '打孔机' }, - ], - - products: [ - { id: 'p1', name: '产品1', spec: '100*80' }, - { id: 'p2', name: '产品2', spec: '99*99' }, - { id: 'p3', name: '产品3', spec: '1*100' }, - ], - - res: { - code: 0, - msg: '', - data: [ - { - equipmentId: 1, - equipmentName: '上片机', - lineId: 'mock-line-id-1', - lineName: '产线1', - sectionId: 'mock-section-id-1', - sectionName: '工段1', - inQuantity: 100, - outQuantity: 99, - okQuantity: 99, - nokQuantity: 1, - scrapRation: 0.01, - passRate: 99, - recordTime: 1675180800000, - productIds: ['p1', 'p2'], - }, - { - equipmentId: 2, - equipmentName: '打磨机', - lineId: 'mock-line-id-1', - lineName: '产线1', - sectionId: 'mock-section-id-1', - sectionName: '工段1', - inQuantity: 100, - outQuantity: 99, - okQuantity: 99, - nokQuantity: 1, - scrapRation: 0.01, - passRate: 99, - recordTime: 1675180800000, - productIds: ['p3', 'p2'], - }, - { - equipmentId: 3, - equipmentName: '清洗机', - lineId: 'mock-line-id-1', - lineName: '产线1', - sectionId: 'mock-section-id-1', - sectionName: '工段1', - inQuantity: 100, - outQuantity: 99, - okQuantity: 99, - nokQuantity: 1, - scrapRation: 0.01, - passRate: 99, - recordTime: 1675180800000, - productIds: ['p1', 'p3'], - }, - ], - }, - HTTPResponse: { code: 0, msg: 'success', @@ -358,6 +290,170 @@ export default { }, ], }, + + res: { + code: 0, + msg: 'success', + data: [ + { + productLine: '产线22', + specification: ['1000*29*1', '898'], + data: [ + { + equipmentName: '下片机', + totalQuantity: 15, + hourData: { + '2023-08-29T09:24:09.878': { + inQuantity: 0, + nokQuantity: 0, + outQuantity: 0, + scrapRatio: 0.0, + }, + '2023-08-29T10:24:09.878': { + inQuantity: 0, + nokQuantity: 0, + outQuantity: 0, + scrapRatio: 0.0, + }, + '2023-08-29T11:24:09.878': { + inQuantity: 0, + nokQuantity: 0, + outQuantity: 0, + scrapRatio: 0.0, + }, + '2023-08-29T12:24:09.878': { + inQuantity: 0, + nokQuantity: 0, + outQuantity: 0, + scrapRatio: 0.0, + }, + '2023-08-29T13:24:09.878': { + inQuantity: 0, + nokQuantity: 0, + outQuantity: 0, + scrapRatio: 0.0, + }, + '2023-08-29T14:24:09.878': { + inQuantity: 0, + nokQuantity: 0, + outQuantity: 0, + scrapRatio: 0.0, + }, + '2023-08-29T15:24:09.878': { + inQuantity: 9, + nokQuantity: 6, + outQuantity: 8, + scrapRatio: 0.46153846, + }, + '2023-08-29T16:24:09.878': { + inQuantity: 0, + nokQuantity: 0, + outQuantity: 0, + scrapRatio: 0.0, + }, + '2023-08-29T17:24:09.878': { + inQuantity: 1, + nokQuantity: 1, + outQuantity: 1, + scrapRatio: 0.5, + }, + '2023-08-29T18:24:09.878': { + inQuantity: 0, + nokQuantity: 0, + outQuantity: 0, + scrapRatio: 0.0, + }, + '2023-08-29T19:24:09.878': { + inQuantity: 0, + nokQuantity: 0, + outQuantity: 0, + scrapRatio: 0.0, + }, + '2023-08-29T20:24:09.878': { + inQuantity: 0, + nokQuantity: 0, + outQuantity: 0, + scrapRatio: 0.0, + }, + '2023-08-29T21:24:09.878': { + inQuantity: 0, + nokQuantity: 0, + outQuantity: 0, + scrapRatio: 0.0, + }, + '2023-08-29T22:24:09.878': { + inQuantity: 0, + nokQuantity: 0, + outQuantity: 0, + scrapRatio: 0.0, + }, + '2023-08-29T23:24:09.878': { + inQuantity: 0, + nokQuantity: 0, + outQuantity: 0, + scrapRatio: 0.0, + }, + '2023-08-30T00:24:09.878': { + inQuantity: 0, + nokQuantity: 0, + outQuantity: 0, + scrapRatio: 0.0, + }, + '2023-08-30T01:24:09.878': { + inQuantity: 0, + nokQuantity: 0, + outQuantity: 0, + scrapRatio: 0.0, + }, + '2023-08-30T02:24:09.878': { + inQuantity: 0, + nokQuantity: 0, + outQuantity: 0, + scrapRatio: 0.0, + }, + '2023-08-30T03:24:09.878': { + inQuantity: 0, + nokQuantity: 0, + outQuantity: 0, + scrapRatio: 0.0, + }, + '2023-08-30T04:24:09.878': { + inQuantity: 0, + nokQuantity: 0, + outQuantity: 0, + scrapRatio: 0.0, + }, + '2023-08-30T05:24:09.878': { + inQuantity: 0, + nokQuantity: 0, + outQuantity: 0, + scrapRatio: 0.0, + }, + '2023-08-30T06:24:09.878': { + inQuantity: 0, + nokQuantity: 0, + outQuantity: 0, + scrapRatio: 0.0, + }, + '2023-08-30T07:24:09.878': { + inQuantity: 0, + nokQuantity: 0, + outQuantity: 0, + scrapRatio: 0.0, + }, + '2023-08-30T08:24:09.878': { + inQuantity: 0, + nokQuantity: 0, + outQuantity: 0, + scrapRatio: 0.0, + }, + }, + }, + ], + }, + ], + }, + spanInfo: {}, }; }, @@ -368,46 +464,99 @@ export default { methods: { /** 构建tableProps - 依据第一个元素所提供的信息 */ buildProps(item) { - const { data, productLine, specification } = item; - const props = [{ prop: 'productLine', label: '产线', align: 'center' }]; + const { + data: [{ hourData }], + } = item; + + const props = [ + { prop: 'productLine', label: '产线', align: 'center' }, + { prop: 'specification', label: '规格', align: 'center' }, + { prop: 'equipmentName', label: '设备', align: 'center' }, + { prop: 'totalQuantity', label: '生产总数', align: 'center' }, + ]; + + for (const key of Object.keys(hourData).sort()) { + const subprop = { + label: key, + align: 'center', + children: [ + { prop: key + '__in', label: '进数据', align: 'center' }, + { prop: key + '__out', label: '出数据', align: 'center' }, + { prop: key + '__nok', label: '报废数据', align: 'center' }, + { prop: key + '__ratio', label: '报废率', align: 'center' }, + ], + }; + props.push(subprop); + } this.tableProps = props; }, /** 把 list 里的数据转换成 tableProps 对应的格式 */ - convertList() { - const row = 0; // 记录处理到的行号,并在恰当的时候加入到 this.spanInfo 中 + convertList(list) { + this.list.splice(0); + let row = {}; + let rowIndex = 0; + for (const line of list) { + const { productLine, specification, data } = line; + + // 设置span的行数 + this.spanInfo[rowIndex] = data.length; + for (const equipment of data) { + rowIndex+=1 + for (const [key, hourData] of Object.entries(equipment.hourData)) { + const { equipmentName, totalQuantity } = equipment; + const { inQuantity, outQuantity, nokQuantity, scrapRatio } = + hourData; + row = { + productLine, + specification: specification.join('、'), + equipmentName, + totalQuantity, + }; + row[key + '__in'] = inQuantity; + row[key + '__out'] = outQuantity; + row[key + '__nok'] = nokQuantity; + row[key + '__ratio'] = scrapRatio; + console.log('row', row); + return; + this.list.push(row); + } + return; + } + } + }, + + buildData(data) { + this.convertList(data); }, /** 合并table列的规则 */ mergeColumnHandler({ row, column, rowIndex, columnIndex }) { - console.log('handle merge column', row, column, rowIndex, columnIndex); + // console.log('handle merge column', row, column, rowIndex, columnIndex); if (columnIndex == 0 || columnIndex == 1 || columnIndex == 3) { - return [ - this.spanInfo[rowIndex], // row span - 1, // col span - ]; + if (rowIndex % 3 == 0) { + return [ + 3, // this.spanInfo[rowIndex], // row span + 1, // col span + ]; + } else { + return [0, 0]; + } } - return { rowspan: 3, colspan: 1 }; + // return { rowspan: 3, colspan: 1 }; }, async getList() { - const { data } = await this.$axios({ - url: '/monitoring/equipment-monitor/recent-24-hours', - method: 'get', - }); - console.log('recent-24', data); - // const { - // // data: { nameData }, - // code, - // } = response; - // this.jsondemo = hljs.highlight( - // 'json', - // JSON.stringify(response, null, 2), - // true - // ).value; + // const { data } = await this.$axios({ + // url: '/monitoring/equipment-monitor/recent-24-hours', + // method: 'get', + // }); - // this.buildProps(data[0]); + const data = this.res.data; + console.log('recent-24', data); + this.buildProps(data[0]); + this.buildData(data); // this.initing = true; // const dynamicProps = handleNameData(nameData); From 100d28fd681d10896a54a52c2d2462d4cfd1a745 Mon Sep 17 00:00:00 2001 From: lb Date: Wed, 30 Aug 2023 14:11:24 +0800 Subject: [PATCH 06/14] =?UTF-8?q?add=20=E8=AE=BE=E5=A4=87=E5=8A=A0?= =?UTF-8?q?=E5=B7=A5=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../equipmentProcessAmount/index.vue | 182 ++++++++++++++++++ .../monitoring/equipmentRecentHours/index.vue | 6 +- 2 files changed, 184 insertions(+), 4 deletions(-) create mode 100644 src/views/monitoring/equipmentProcessAmount/index.vue diff --git a/src/views/monitoring/equipmentProcessAmount/index.vue b/src/views/monitoring/equipmentProcessAmount/index.vue new file mode 100644 index 00000000..b183e91b --- /dev/null +++ b/src/views/monitoring/equipmentProcessAmount/index.vue @@ -0,0 +1,182 @@ + + + + + + + diff --git a/src/views/monitoring/equipmentRecentHours/index.vue b/src/views/monitoring/equipmentRecentHours/index.vue index 45ac1e59..402d24c7 100644 --- a/src/views/monitoring/equipmentRecentHours/index.vue +++ b/src/views/monitoring/equipmentRecentHours/index.vue @@ -503,7 +503,7 @@ export default { // 设置span的行数 this.spanInfo[rowIndex] = data.length; for (const equipment of data) { - rowIndex+=1 + rowIndex += 1; for (const [key, hourData] of Object.entries(equipment.hourData)) { const { equipmentName, totalQuantity } = equipment; const { inQuantity, outQuantity, nokQuantity, scrapRatio } = @@ -518,12 +518,10 @@ export default { row[key + '__out'] = outQuantity; row[key + '__nok'] = nokQuantity; row[key + '__ratio'] = scrapRatio; - console.log('row', row); - return; this.list.push(row); } - return; } + console.log('list:', this.list, 'spanInfo:', this.spanInfo); } }, From 0f6418fcf9945de7fad658bd5b5d8fbd637942c1 Mon Sep 17 00:00:00 2001 From: lb Date: Wed, 30 Aug 2023 14:30:08 +0800 Subject: [PATCH 07/14] =?UTF-8?q?update=20=E5=9F=BA=E6=9C=AC=E5=AE=8C?= =?UTF-8?q?=E6=88=90=E8=AE=BE=E5=A4=87=E8=BF=9124=E5=B0=8F=E6=97=B6?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitoring/equipmentRecentHours/index.vue | 685 +++++++++++++----- 1 file changed, 491 insertions(+), 194 deletions(-) diff --git a/src/views/monitoring/equipmentRecentHours/index.vue b/src/views/monitoring/equipmentRecentHours/index.vue index 402d24c7..dacce04e 100644 --- a/src/views/monitoring/equipmentRecentHours/index.vue +++ b/src/views/monitoring/equipmentRecentHours/index.vue @@ -291,168 +291,468 @@ export default { ], }, - res: { - code: 0, - msg: 'success', - data: [ - { - productLine: '产线22', - specification: ['1000*29*1', '898'], - data: [ - { - equipmentName: '下片机', - totalQuantity: 15, - hourData: { - '2023-08-29T09:24:09.878': { - inQuantity: 0, - nokQuantity: 0, - outQuantity: 0, - scrapRatio: 0.0, - }, - '2023-08-29T10:24:09.878': { - inQuantity: 0, - nokQuantity: 0, - outQuantity: 0, - scrapRatio: 0.0, - }, - '2023-08-29T11:24:09.878': { - inQuantity: 0, - nokQuantity: 0, - outQuantity: 0, - scrapRatio: 0.0, - }, - '2023-08-29T12:24:09.878': { - inQuantity: 0, - nokQuantity: 0, - outQuantity: 0, - scrapRatio: 0.0, - }, - '2023-08-29T13:24:09.878': { - inQuantity: 0, - nokQuantity: 0, - outQuantity: 0, - scrapRatio: 0.0, - }, - '2023-08-29T14:24:09.878': { - inQuantity: 0, - nokQuantity: 0, - outQuantity: 0, - scrapRatio: 0.0, - }, - '2023-08-29T15:24:09.878': { - inQuantity: 9, - nokQuantity: 6, - outQuantity: 8, - scrapRatio: 0.46153846, - }, - '2023-08-29T16:24:09.878': { - inQuantity: 0, - nokQuantity: 0, - outQuantity: 0, - scrapRatio: 0.0, - }, - '2023-08-29T17:24:09.878': { - inQuantity: 1, - nokQuantity: 1, - outQuantity: 1, - scrapRatio: 0.5, - }, - '2023-08-29T18:24:09.878': { - inQuantity: 0, - nokQuantity: 0, - outQuantity: 0, - scrapRatio: 0.0, - }, - '2023-08-29T19:24:09.878': { - inQuantity: 0, - nokQuantity: 0, - outQuantity: 0, - scrapRatio: 0.0, - }, - '2023-08-29T20:24:09.878': { - inQuantity: 0, - nokQuantity: 0, - outQuantity: 0, - scrapRatio: 0.0, - }, - '2023-08-29T21:24:09.878': { - inQuantity: 0, - nokQuantity: 0, - outQuantity: 0, - scrapRatio: 0.0, - }, - '2023-08-29T22:24:09.878': { - inQuantity: 0, - nokQuantity: 0, - outQuantity: 0, - scrapRatio: 0.0, - }, - '2023-08-29T23:24:09.878': { - inQuantity: 0, - nokQuantity: 0, - outQuantity: 0, - scrapRatio: 0.0, - }, - '2023-08-30T00:24:09.878': { - inQuantity: 0, - nokQuantity: 0, - outQuantity: 0, - scrapRatio: 0.0, - }, - '2023-08-30T01:24:09.878': { - inQuantity: 0, - nokQuantity: 0, - outQuantity: 0, - scrapRatio: 0.0, - }, - '2023-08-30T02:24:09.878': { - inQuantity: 0, - nokQuantity: 0, - outQuantity: 0, - scrapRatio: 0.0, - }, - '2023-08-30T03:24:09.878': { - inQuantity: 0, - nokQuantity: 0, - outQuantity: 0, - scrapRatio: 0.0, - }, - '2023-08-30T04:24:09.878': { - inQuantity: 0, - nokQuantity: 0, - outQuantity: 0, - scrapRatio: 0.0, - }, - '2023-08-30T05:24:09.878': { - inQuantity: 0, - nokQuantity: 0, - outQuantity: 0, - scrapRatio: 0.0, - }, - '2023-08-30T06:24:09.878': { - inQuantity: 0, - nokQuantity: 0, - outQuantity: 0, - scrapRatio: 0.0, - }, - '2023-08-30T07:24:09.878': { - inQuantity: 0, - nokQuantity: 0, - outQuantity: 0, - scrapRatio: 0.0, - }, - '2023-08-30T08:24:09.878': { - inQuantity: 0, - nokQuantity: 0, - outQuantity: 0, - scrapRatio: 0.0, - }, - }, - }, - ], - }, - ], - }, + // res: { + // code: 0, + // msg: 'success', + // data: [ + // { + // productLine: '产线22', + // specification: ['1000*29*1', '898'], + // data: [ + // { + // equipmentName: '下片机', + // totalQuantity: 15, + // hourData: { + // '2023-08-29T09:24:09.878': { + // inQuantity: 1, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T10:24:09.878': { + // inQuantity: 0, + // nokQuantity: 2, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T11:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 3, + // scrapRatio: 0.0, + // }, + // '2023-08-29T12:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 4.0, + // }, + // '2023-08-29T13:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T14:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T15:24:09.878': { + // inQuantity: 9, + // nokQuantity: 6, + // outQuantity: 8, + // scrapRatio: 0.46153846, + // }, + // '2023-08-29T16:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T17:24:09.878': { + // inQuantity: 1, + // nokQuantity: 1, + // outQuantity: 1, + // scrapRatio: 0.5, + // }, + // '2023-08-29T18:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T19:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T20:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T21:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T22:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T23:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T00:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T01:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T02:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T03:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T04:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T05:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T06:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T07:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T08:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // }, + // }, + // { + // equipmentName: '磨边机', + // totalQuantity: 100, + // hourData: { + // '2023-08-29T09:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T10:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T11:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T12:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T13:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T14:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T15:24:09.878': { + // inQuantity: 9, + // nokQuantity: 6, + // outQuantity: 8, + // scrapRatio: 0.46153846, + // }, + // '2023-08-29T16:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T17:24:09.878': { + // inQuantity: 1, + // nokQuantity: 1, + // outQuantity: 1, + // scrapRatio: 0.5, + // }, + // '2023-08-29T18:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T19:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T20:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T21:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T22:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T23:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T00:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T01:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T02:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T03:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T04:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T05:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T06:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T07:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T08:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // }, + // }, + // { + // equipmentName: '清洗机', + // totalQuantity: 88, + // hourData: { + // '2023-08-29T09:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T10:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T11:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T12:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T13:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T14:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T15:24:09.878': { + // inQuantity: 9, + // nokQuantity: 6, + // outQuantity: 8, + // scrapRatio: 0.46153846, + // }, + // '2023-08-29T16:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T17:24:09.878': { + // inQuantity: 1, + // nokQuantity: 1, + // outQuantity: 1, + // scrapRatio: 0.5, + // }, + // '2023-08-29T18:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T19:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T20:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T21:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T22:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-29T23:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T00:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T01:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T02:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T03:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T04:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T05:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T06:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T07:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // '2023-08-30T08:24:09.878': { + // inQuantity: 0, + // nokQuantity: 0, + // outQuantity: 0, + // scrapRatio: 0.0, + // }, + // }, + // }, + // ], + // }, + // ], + // }, spanInfo: {}, }; @@ -483,7 +783,12 @@ export default { { prop: key + '__in', label: '进数据', align: 'center' }, { prop: key + '__out', label: '出数据', align: 'center' }, { prop: key + '__nok', label: '报废数据', align: 'center' }, - { prop: key + '__ratio', label: '报废率', align: 'center' }, + { + prop: key + '__ratio', + label: '报废率', + align: 'center', + filter: (val) => (val != null ? val + ' %' : '-'), + }, ], }; props.push(subprop); @@ -495,7 +800,6 @@ export default { /** 把 list 里的数据转换成 tableProps 对应的格式 */ convertList(list) { this.list.splice(0); - let row = {}; let rowIndex = 0; for (const line of list) { const { productLine, specification, data } = line; @@ -503,25 +807,24 @@ export default { // 设置span的行数 this.spanInfo[rowIndex] = data.length; for (const equipment of data) { + const { equipmentName, totalQuantity } = equipment; + let row = { + productLine, + specification: specification.join('、'), + equipmentName, + totalQuantity, + }; rowIndex += 1; for (const [key, hourData] of Object.entries(equipment.hourData)) { - const { equipmentName, totalQuantity } = equipment; const { inQuantity, outQuantity, nokQuantity, scrapRatio } = hourData; - row = { - productLine, - specification: specification.join('、'), - equipmentName, - totalQuantity, - }; row[key + '__in'] = inQuantity; row[key + '__out'] = outQuantity; row[key + '__nok'] = nokQuantity; row[key + '__ratio'] = scrapRatio; - this.list.push(row); } + this.list.push(row); } - console.log('list:', this.list, 'spanInfo:', this.spanInfo); } }, @@ -531,41 +834,35 @@ export default { /** 合并table列的规则 */ mergeColumnHandler({ row, column, rowIndex, columnIndex }) { - // console.log('handle merge column', row, column, rowIndex, columnIndex); - if (columnIndex == 0 || columnIndex == 1 || columnIndex == 3) { - if (rowIndex % 3 == 0) { + if (columnIndex == 0 || columnIndex == 1) { + if (this.spanInfo[rowIndex]) { return [ - 3, // this.spanInfo[rowIndex], // row span + this.spanInfo[rowIndex], // row span 1, // col span ]; } else { return [0, 0]; } } - // return { rowspan: 3, colspan: 1 }; }, async getList() { - // const { data } = await this.$axios({ - // url: '/monitoring/equipment-monitor/recent-24-hours', - // method: 'get', - // }); + const { data } = await this.$axios({ + url: '/monitoring/equipment-monitor/recent-24-hours', + method: 'get', + }); - const data = this.res.data; - console.log('recent-24', data); + // const data = this.res.data; + // console.log('recent-24', data); + + this.initing = true; this.buildProps(data[0]); this.buildData(data); + this.queryParams.pageSize = this.list.length; - // this.initing = true; - // const dynamicProps = handleNameData(nameData); - // this.tableProps.push(...dynamicProps); - // const dataList = handleDynamicData(dyanmicData); - // this.list = dataList; - // this.queryParams.pageSize = dataList.length; - - // setTimeout(() => { - // this.initing = false; - // }, 1000); + setTimeout(() => { + this.initing = false; + }, 1000); }, handleEmitFun(payload) { From 14eb83932e9e70742987ac3031fa0f275ce66119 Mon Sep 17 00:00:00 2001 From: lb Date: Wed, 30 Aug 2023 14:32:05 +0800 Subject: [PATCH 08/14] =?UTF-8?q?done=20=E8=AE=BE=E5=A4=8724=E5=B0=8F?= =?UTF-8?q?=E6=97=B6=E7=94=9F=E4=BA=A7=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitoring/equipmentRecentHours/index.vue | 726 +----------------- .../equipmentRecentHours/props.json | 80 -- .../equipmentRecentHours/response.json | 176 ----- 3 files changed, 4 insertions(+), 978 deletions(-) delete mode 100644 src/views/monitoring/equipmentRecentHours/props.json delete mode 100644 src/views/monitoring/equipmentRecentHours/response.json diff --git a/src/views/monitoring/equipmentRecentHours/index.vue b/src/views/monitoring/equipmentRecentHours/index.vue index dacce04e..c4cf6b6b 100644 --- a/src/views/monitoring/equipmentRecentHours/index.vue +++ b/src/views/monitoring/equipmentRecentHours/index.vue @@ -2,16 +2,14 @@ filename: index.vue author: liubin date: 2023-08-04 14:44:58 - description: 设备生产24小时记录 + description: 设备24小时生产记录 --> From 0e6c01e578ab512e4ae7f37e21278bd93ec5cb33 Mon Sep 17 00:00:00 2001 From: lb Date: Thu, 31 Aug 2023 15:12:34 +0800 Subject: [PATCH 12/14] =?UTF-8?q?update=20=E8=AE=BE=E5=A4=87=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E5=92=8C=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../equipmentStatusAndParams/index.vue | 166 ++++++------------ 1 file changed, 56 insertions(+), 110 deletions(-) diff --git a/src/views/monitoring/equipmentStatusAndParams/index.vue b/src/views/monitoring/equipmentStatusAndParams/index.vue index dd6f739a..2cacd5b6 100644 --- a/src/views/monitoring/equipmentStatusAndParams/index.vue +++ b/src/views/monitoring/equipmentStatusAndParams/index.vue @@ -84,9 +84,28 @@ export default { }, { width: 128, prop: 'inQuantity', label: '投入数', align: 'center' }, { width: 128, prop: 'outQuantity', label: '产出数', align: 'center' }, - { width: 128, prop: 'run', label: '是否运行', align: 'center' }, - { width: 128, prop: 'status', label: '状态', align: 'center' }, - { width: 128, prop: 'error', label: '是否故障', align: 'center' }, + { + width: 128, + prop: 'run', + label: '是否运行', + align: 'center', + filter: (val) => (val != null ? (val ? '是' : '否') : '-'), + }, + { + width: 128, + prop: 'status', + label: '状态', + align: 'center', + filter: (val) => + val != null ? ['正常', '计划停机', '故障'][val] : '-', + }, + { + width: 128, + prop: 'error', + label: '是否故障', + align: 'center', + filter: (val) => (val != null ? (val ? '是' : '否') : '-'), + }, { prop: 'quantityRecordTime', label: '生产量记录时间', @@ -174,6 +193,7 @@ export default { productionLineId: null, equipmentId: null, }, + total: 0, // 表单参数 form: {}, // 表单校验 @@ -210,6 +230,11 @@ export default { /** 监听 search bar 的产线下拉框改变 */ async handleSearchBarItemChange({ param, value: id }) { if (param == 'productionLineId') { + if (id == '') { + // 清除设备选框里的选项 + this.searchBarFormConfig[1].selectOptions = []; + return; + } const list = await this.getEquipmentList(id); this.searchBarFormConfig[1].selectOptions = list.map((eq) => ({ name: eq.name, @@ -218,119 +243,40 @@ export default { } }, - /** 重写 basicPageMixin 里的 handleSearchBarBtnClick */ handleSearchBarBtnClick(btn) { - // 仅查询一种情况 - this.queryParams.createTime = btn.createTime; - this.handleQuery(); - }, - /** 查询列表 */ - getList() { - this.loading = true; - // 执行查询 - // getEquipmentAlarmLogPage(this.queryParams).then((response) => { - // this.list = response.data.list; - // this.total = response.data.total; - // this.loading = false; - // }); - }, - /** 取消按钮 */ - cancel() { - this.open = false; - this.reset(); - }, - /** 表单重置 */ - reset() { - this.form = { - id: undefined, - alarmId: undefined, - alarmContent: undefined, - alarmValue: undefined, - alarmEquipmentId: undefined, - remark: undefined, - }; - this.resetForm('form'); - }, - /** 搜索按钮操作 */ - handleQuery() { - this.queryParams.pageNo = 1; + const { equipmentId, productionLineId } = btn; + if (equipmentId) this.queryParams.equipmentId = equipmentId; + else this.queryParams.equipmentId = null; + if (productionLineId) + this.queryParams.productionLineId = productionLineId; + else this.queryParams.productionLineId = null; this.getList(); }, - /** 重置按钮操作 */ - resetQuery() { - this.resetForm('queryForm'); - this.handleQuery(); - }, - /** 新增按钮操作 */ - handleAdd() { - this.reset(); - this.open = true; - this.title = '添加设备报警日志'; - }, - /** 修改按钮操作 */ - handleUpdate(row) { - this.reset(); - const id = row.id; - getEquipmentAlarmLog(id).then((response) => { - this.form = response.data; - this.open = true; - this.title = '修改设备报警日志'; + + /** 查询列表 */ + async getList() { + this.loading = true; + const { data } = await this.$axios({ + url: '/monitoring/equipment-monitor/realtime-page', + method: 'get', + params: this.queryParams, }); + this.list = data.list; + this.total = data.total; }, - /** 提交按钮 */ - submitForm() { - this.$refs['form'].validate((valid) => { - if (!valid) { - return; - } - // 修改的提交 - if (this.form.id != null) { - updateEquipmentAlarmLog(this.form).then((response) => { - this.$modal.msgSuccess('修改成功'); - this.open = false; - this.getList(); - }); - return; - } - // 添加的提交 - createEquipmentAlarmLog(this.form).then((response) => { - this.$modal.msgSuccess('新增成功'); - this.open = false; - this.getList(); + + handleEmitFun({ action, value }) { + if (action == 'params-monitor') { + const { equipmentId, equipmentName, equipmentCode } = value; + this.$router.push({ + name: 'equipmentFullParams', + params: { + equipmentId, + equipmentCode, + equipmentName, + }, }); - }); - }, - /** 删除按钮操作 */ - handleDelete(row) { - const id = row.id; - this.$modal - .confirm('是否确认删除设备报警日志编号为"' + id + '"的数据项?') - .then(function () { - return deleteEquipmentAlarmLog(id); - }) - .then(() => { - this.getList(); - this.$modal.msgSuccess('删除成功'); - }) - .catch(() => {}); - }, - /** 导出按钮操作 */ - handleExport() { - // 处理查询参数 - let params = { ...this.queryParams }; - params.pageNo = undefined; - params.pageSize = undefined; - this.$modal - .confirm('是否确认导出所有设备报警日志数据项?') - .then(() => { - this.exportLoading = true; - return exportEquipmentAlarmLogExcel(params); - }) - .then((response) => { - this.$download.excel(response, '设备报警日志.xls'); - this.exportLoading = false; - }) - .catch(() => {}); + } }, }, }; From 62256b57a5492f20dbd0122f8c4e79ba6789f792 Mon Sep 17 00:00:00 2001 From: lb Date: Thu, 31 Aug 2023 16:11:41 +0800 Subject: [PATCH 13/14] =?UTF-8?q?update=20=E8=AE=BE=E5=A4=87=E5=85=A8?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitoring/equipmentFullParams/index.vue | 404 +++++++++++++++++- 1 file changed, 387 insertions(+), 17 deletions(-) diff --git a/src/views/monitoring/equipmentFullParams/index.vue b/src/views/monitoring/equipmentFullParams/index.vue index 38324b7a..cfae88c8 100644 --- a/src/views/monitoring/equipmentFullParams/index.vue +++ b/src/views/monitoring/equipmentFullParams/index.vue @@ -6,14 +6,64 @@ --> @@ -49,6 +91,10 @@ export default { components: {}, props: {}, data() { + const now = new Date(); + const [y, m, d] = [now.getFullYear(), now.getMonth(), now.getDate()]; + const today = new Date(y, m, d, 0, 0, 0, 0).getTime(); + const aWeekAgo = today - 3600 * 1000 * 24 * 7; return { tableList: [], searchBarFormConfig: [ @@ -57,18 +103,20 @@ export default { label: '设备名称', placeholder: '请输入设备名称', param: 'name', + disabled: true, }, { type: 'input', label: '设备编码', placeholder: '请输入设备编码', - param: 'codes', + param: 'code', + disabled: true, }, { type: 'datePicker', label: '时间段', dateType: 'daterange', // datetimerange - format: 'yyyy-MM-dd', + format: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss', rangeSeparator: '-', startPlaceholder: '开始时间', @@ -76,6 +124,7 @@ export default { defaultTime: ['00:00:00', '23:59:59'], param: 'timeVal', width: 350, + defaultSelect: [new Date(aWeekAgo), new Date(today)], }, { type: 'button', @@ -84,14 +133,315 @@ export default { color: 'primary', }, ], + queryParams: { + id: null, + time: [new Date(aWeekAgo), new Date(today)], + }, + + table1: { + tableProps: [ + { + prop: 'time', + label: '时间', + }, + { + prop: 'plcCode', + label: 'PLC编码', + }, + { + prop: 'val1', + label: '数值1', + }, + { + prop: 'bol1', + label: '布尔1', + }, + { + prop: 'val2', + label: '数值2', + }, + { + prop: 'bol2', + label: '布尔2', + }, + { + prop: 'val3', + label: '数值3', + }, + { + prop: 'bol3', + label: '布尔3', + }, + { + prop: 'val4', + label: '数值4', + }, + { + prop: 'bol4', + label: '布尔4', + }, + ], + data: [ + { + time: 1111111111111111, + plcCode: 2, + val1: 3, + bol1: 4, + val2: 5, + bol2: 6, + }, + { + time: 1, + plcCode: 22222222222222, + val1: 3, + bol1: 4, + val2: 5, + bol2: 6, + }, + { + time: 1, + plcCode: 2, + val1: 33333333333333, + bol1: 4, + val2: 5, + bol2: 6, + }, + { + time: 1, + plcCode: 2, + val1: 3, + bol1: 44444444444444, + val2: 5, + bol2: 6, + }, + { + time: 1, + plcCode: 2, + val1: 3, + bol1: 4, + val2: 5555555555555, + bol2: 6, + }, + { + time: 1, + plcCode: 2, + val1: 3, + bol1: 4, + val2: 5, + bol2: 6666666666666666666, + }, + { time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 }, + { time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 }, + { time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 }, + { time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 }, + { time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 }, + { time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 }, + { time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 }, + { time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 }, + { time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 }, + { time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 }, + { time: 1, plcCode: 2, val1: 3, bol1: 4, val2: 5, bol2: 6 }, + ], + }, + table2: { + tableProps: [ + { + prop: 'time', + label: '时间', + }, + { + prop: 'plcCode', + label: 'PLC编码', + }, + { + prop: 'val1', + label: '数值1', + }, + { + prop: 'bol1', + label: '布尔1', + }, + { + prop: 'val2', + label: '数值2', + }, + { + prop: 'bol2', + label: '布尔2', + }, + ], + data: [], + }, + table3: { + tableProps: [ + { + prop: 'time', + label: '时间', + }, + { + prop: 'plcCode', + label: 'PLC编码', + }, + { + prop: 'val1', + label: '数值1', + }, + { + prop: 'bol1', + label: '布尔1', + }, + { + prop: 'val2', + label: '数值2', + }, + { + prop: 'bol2', + label: '布尔2', + }, + ], + data: [], + }, + table4: { + tableProps: [ + { + prop: 'time', + label: '时间', + }, + { + prop: 'plcCode', + label: 'PLC编码', + }, + { + prop: 'val1', + label: '数值1', + }, + { + prop: 'bol1', + label: '布尔1', + }, + { + prop: 'val2', + label: '数值2', + }, + { + prop: 'bol2', + label: '布尔2', + }, + ], + data: [], + }, + table5: { + tableProps: [ + { + prop: 'time', + label: '时间', + }, + { + prop: 'plcCode', + label: 'PLC编码', + }, + { + prop: 'val1', + label: '数值1', + }, + { + prop: 'bol1', + label: '布尔1', + }, + { + prop: 'val2', + label: '数值2', + }, + { + prop: 'bol2', + label: '布尔2', + }, + ], + data: [], + }, + table6: { + tableProps: [ + { + prop: 'time', + label: '时间', + }, + { + prop: 'plcCode', + label: 'PLC编码', + }, + { + prop: 'val1', + label: '数值1', + }, + { + prop: 'bol1', + label: '布尔1', + }, + { + prop: 'val2', + label: '数值2', + }, + { + prop: 'bol2', + label: '布尔2', + }, + ], + data: [], + }, + table7: { + tableProps: [ + { + prop: 'time', + label: '时间', + }, + { + prop: 'plcCode', + label: 'PLC编码', + }, + { + prop: 'val1', + label: '数值1', + }, + { + prop: 'bol1', + label: '布尔1', + }, + { + prop: 'val2', + label: '数值2', + }, + { + prop: 'bol2', + label: '布尔2', + }, + ], + data: [], + }, }; }, - mounted() {}, + computed: { + id() { + return this.$route.params.equipmentId; + }, + code() { + return this.$route.params.equipmentCode; + }, + name() { + return this.$route.params.equipmentName; + }, + }, + mounted() { + if (this.id) this.$set(this.queryParams, 'id', this.id); + if (this.code) + this.$set(this.searchBarFormConfig[0], 'defaultSelect', this.code); + if (this.name) + this.$set(this.searchBarFormConfig[1], 'defaultSelect', this.name); + }, methods: { /** 查询 */ - handleQuery() {}, + handleQuery() {}, - handleSearchBarBtnClick() {}, + handleSearchBarBtnClick() {}, handleEmitFun(table, val) { console.log('table val', table, val); @@ -115,4 +465,24 @@ export default { }; - + From 0158a11644824af33be6cba035e8d56336dd0d0d Mon Sep 17 00:00:00 2001 From: lb Date: Thu, 31 Aug 2023 16:58:17 +0800 Subject: [PATCH 14/14] =?UTF-8?q?update=20=E8=AE=BE=E5=A4=87=E5=88=86?= =?UTF-8?q?=E6=9E=90-=E7=8A=B6=E6=80=81=E6=97=B6=E5=BA=8F=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SequenceGraph/index.vue | 52 ++++++++++++++++++- .../SequenceGraph/sequenceGraphItem.vue | 2 + .../monitoring/equipmentFullParams/index.vue | 31 +++++++---- 3 files changed, 72 insertions(+), 13 deletions(-) diff --git a/src/components/SequenceGraph/index.vue b/src/components/SequenceGraph/index.vue index 3547f147..34da2137 100644 --- a/src/components/SequenceGraph/index.vue +++ b/src/components/SequenceGraph/index.vue @@ -7,7 +7,7 @@ @@ -23,7 +23,55 @@ export default { }, }, data() { - return {}; + return { + list: { + 打孔机: { + equipmentId: 1, + equipmentName: 'EQ1', + status: '', + startTime: '', + duration: '', + startPos: '', + relativeDuring: '', + }, + 磨边机: { + equipmentId: 12, + equipmentName: 'EQ2', + status: '', + startTime: '', + duration: '', + startPos: '', + relativeDuring: '', + }, + 清洗机: { + equipmentId: 13, + equipmentName: 'EQ3', + status: '', + startTime: '', + duration: '', + startPos: '', + relativeDuring: '', + }, + 窑炉: { + equipmentId: 14, + equipmentName: 'EQ4', + status: '', + startTime: '', + duration: '', + startPos: '', + relativeDuring: '', + }, + AGV: { + equipmentId: 15, + equipmentName: 'EQ5', + status: '', + startTime: '', + duration: '', + startPos: '', + relativeDuring: '', + }, + }, + }; }, computed: {}, methods: {}, diff --git a/src/components/SequenceGraph/sequenceGraphItem.vue b/src/components/SequenceGraph/sequenceGraphItem.vue index 87433a2c..de882b0c 100644 --- a/src/components/SequenceGraph/sequenceGraphItem.vue +++ b/src/components/SequenceGraph/sequenceGraphItem.vue @@ -42,6 +42,8 @@ export default {