From 56a74df38edba815f78251af4c89e3c0798ea231 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cyu=E2=80=9D?= <“winebunny@163.com”> Date: Tue, 16 Jul 2024 00:16:30 +0800 Subject: [PATCH] u --- src/hooks/handleFun.ts | 54 +- src/views/pages/OpticalStoragePage/index.vue | 1889 ++++++++++-------- src/views/pages/carPage/index.vue | 4 +- src/views/pages/homePage/runListenPage.vue | 4 +- src/views/pages/pvPage/powerLine.vue | 2 +- 5 files changed, 1111 insertions(+), 842 deletions(-) diff --git a/src/hooks/handleFun.ts b/src/hooks/handleFun.ts index 3f48e35..16e6742 100644 --- a/src/hooks/handleFun.ts +++ b/src/hooks/handleFun.ts @@ -16,17 +16,17 @@ export function handleUnit(data) { // 处理echarts数据 export function handleEchartsData(data, value) { // 间隔可以设置成动态的 - let timeArray = []; + let timeArray_1 = []; for (let hour = 0; hour < 24; hour++) { for (let minute = 0; minute < 60; minute += value) { let timeString = (hour < 10 ? '0' + hour : hour) + ':' + (minute < 10 ? '0' + minute : minute); - timeArray.push( + timeArray_1.push( { datetime: timeString, measValue: '-' } ); } } - console.log(timeArray) - timeArray.forEach(item => { + console.log(timeArray_1) + timeArray_1.forEach(item => { data.forEach(ite => { let iteTime = ite.datetime.split(' ')[1].split(':')[0] + ':' + ite.datetime.split(' ')[1].split(':')[1] if (iteTime === item.datetime) { @@ -36,4 +36,50 @@ export function handleEchartsData(data, value) { }) return timeArray +} +export function handleEchartsData_datatime_measValue(data, value) { + // 间隔可以设置成动态的 + let timeArray_1 = []; + for (let hour = 0; hour < 24; hour++) { + for (let minute = 0; minute < 60; minute += value) { + let timeString = (hour < 10 ? '0' + hour : hour) + ':' + (minute < 10 ? '0' + minute : minute); + timeArray_1.push( + { datetime: timeString, measValue: '-' } + ); + } + } + console.log(timeArray_1) + timeArray_1.forEach(item => { + data.forEach(ite => { + let iteTime = ite.datetime.split(' ')[1].split(':')[0] + ':' + ite.datetime.split(' ')[1].split(':')[1] + if (iteTime === item.datetime) { + item.measValue =ite.measValue + } + }) + }) + + return timeArray +} +export function handleEchartsData_timeStamp_p(data, value) { + // 间隔可以设置成动态的 + let timeArray_1 = []; + for (let hour = 0; hour < 24; hour++) { + for (let minute = 0; minute < 60; minute += value) { + let timeString = (hour < 10 ? '0' + hour : hour) + ':' + (minute < 10 ? '0' + minute : minute); + timeArray_1.push( + { timeStamp: timeString, p: '-' } + ); + } + } + console.log(timeArray_1) + timeArray_1.forEach(item => { + data.forEach(ite => { + let iteTime = ite.timeStamp.split(' ')[1].split(':')[0] + ':' + ite.timeStamp.split(' ')[1].split(':')[1] + if (iteTime === item.timeStamp) { + item.p =ite.p + } + }) + }) + + return timeArray_1 } \ No newline at end of file diff --git a/src/views/pages/OpticalStoragePage/index.vue b/src/views/pages/OpticalStoragePage/index.vue index 5fa9633..dff2f4e 100644 --- a/src/views/pages/OpticalStoragePage/index.vue +++ b/src/views/pages/OpticalStoragePage/index.vue @@ -3,19 +3,33 @@