From 2a2ef5ab5c92746b8b3e7ee88702abf95612d868 Mon Sep 17 00:00:00 2001 From: lb Date: Tue, 8 Aug 2023 13:23:01 +0800 Subject: [PATCH] update recent 24 --- .../monitoring/qualityRecentHours/index.vue | 130 +++++++++++++++++- 1 file changed, 127 insertions(+), 3 deletions(-) diff --git a/src/views/quality/monitoring/qualityRecentHours/index.vue b/src/views/quality/monitoring/qualityRecentHours/index.vue index 71409c2c..b5780016 100644 --- a/src/views/quality/monitoring/qualityRecentHours/index.vue +++ b/src/views/quality/monitoring/qualityRecentHours/index.vue @@ -8,7 +8,13 @@ @@ -19,7 +25,99 @@ export default { props: {}, data() { return { - list: [], + queryParams: { + 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', + }, + ], + tableProps: [ + { + prop: 'inspectionContent', + label: '检测内容', + align: 'center', + }, + // 动态插入 + // mock + { + 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', + }, + ], + }, + ], }; }, computed: {}, @@ -33,7 +131,33 @@ export default { method: 'get', }); console.log(response); - this.list = JSON.stringify(response, null, 2); + this.jsondemo = JSON.stringify(response, null, 2); + }, + filterNameData(nameData) { + const ndSet = new Set(); + nameData.forEach((nd) => { + ndSet.add(nd.name); + }); + return Array.from(ndSet.values()) + .sort() + .map((name) => ({ + prop: name, + label: name, + })); + }, + filterData(data) { + return data.map((item) => { + const { data: innerData } = item; + const keyValuePairs = {}; + innerData.map((d) => { + keyValuePairs[d.dynamicName] = d.dynamicValue; + }); + return { + inspectionContent: item.inspectionContent, + ...keyValuePairs, + sumInput: item.sumInput, + }; + }); }, }, };