From 9f49493d837d561bf09d45aff0b1c160c0ac3501 Mon Sep 17 00:00:00 2001 From: zhaoqiang <2117596534@qq.com> Date: Sun, 14 Jul 2024 15:15:17 +0800 Subject: [PATCH] update --- src/hooks/handleFun.ts | 33 +- src/views/pages/homePage/runListenPage.vue | 43 +- src/views/pages/homePage/threeLine_Line.vue | 443 ++++++++++---------- 3 files changed, 292 insertions(+), 227 deletions(-) diff --git a/src/hooks/handleFun.ts b/src/hooks/handleFun.ts index d4f5d4e..d427ff7 100644 --- a/src/hooks/handleFun.ts +++ b/src/hooks/handleFun.ts @@ -1,10 +1,39 @@ // 处理一些常用的方法 + // 处理单位换算 export function handleUnit(data) { - if(Number(data) > 10000) { + if (Number(data) > 10000) { return (data / 1000).toFixed(2) - }else{ + } else { return data } +} + + + + +// 处理echarts数据 +export function handleEchartsData(data) { + // 间隔可以设置成动态的 + let timeArray = []; + for (let hour = 0; hour < 24; hour++) { + for (let minute = 0; minute < 60; minute += 5) { + let timeString = (hour < 10 ? '0' + hour : hour) + ':' + (minute < 10 ? '0' + minute : minute); + timeArray.push( + { datetime: timeString, measValue: '-' } + ); + } + } + + timeArray.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 } \ No newline at end of file diff --git a/src/views/pages/homePage/runListenPage.vue b/src/views/pages/homePage/runListenPage.vue index 333fafe..99eae71 100644 --- a/src/views/pages/homePage/runListenPage.vue +++ b/src/views/pages/homePage/runListenPage.vue @@ -20,17 +20,17 @@
+ ]" v-for="(item,index) in sourceEchart" @click="sourcehandleTabDate(item)" :key="index"> {{ item.name }}
- +
@@ -164,7 +164,7 @@
 线路重过载 : 
-
 2
+
 {{networkSonData.lineData.length|| 0}}
@@ -174,7 +174,7 @@
 台区重过载 : 
-
 3
+
 {{networkSonData.zoneAreaData.length|| 0}}
@@ -192,9 +192,9 @@
- + - +