Compare commits

..

2 Commits

Author SHA1 Message Date
“yu” 525c9b0572 u 2024-07-16 00:17:58 +08:00
“yu” 56a74df38e u 2024-07-16 00:16:30 +08:00
5 changed files with 1113 additions and 844 deletions

View File

@ -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
}

File diff suppressed because it is too large Load Diff

View File

@ -265,7 +265,7 @@ import load_info_echart from './load_info_echart.vue'
import cdz_echart from './cdz_echart.vue'
import carTree from '@/views/commonPage/carTree.vue'
import { powerCurve_api, transformerOverloadCount_api, running_api } from '@/api/carPage/index'
import { handleEchartsData } from '@/hooks/handleFun'
import { handleEchartsData ,handleEchartsData_timeStamp_p} from '@/hooks/handleFun'
onMounted(() => {
//
@ -428,7 +428,9 @@ let getPowerCurve_api = () => {
res?.data.forEach((item: any) => {
item.datetime = item.dateTime
})
let result = handleEchartsData(res.data, 60)
carRightData.echartsData = result
console.log(result, 'resresres')
})

View File

@ -393,7 +393,7 @@
</div>
<!-- 告警消息 -->
<div class="content_center_alert1" v-if="true">
<!-- <div class="content_center_alert1" v-if="true">
<div class="run_detail" v-if="true">
<div class="tip">
<img src="@/assets/images/mainPage/icon_alert_pv.png" alt="" />
@ -416,7 +416,7 @@
</div>
</div>
</div>
</div>
</div> -->
<!-- 通知消息 -->
<!-- <div class="content_center_alert" v-if="true">
<div class="run_detail" v-if="true">

View File

@ -101,7 +101,7 @@ const drawOneLine = (arr: any) => {
// },
},
// data: ["03:00", "06:00", "09:00", "12:00", "15:00", "18:00", "24:00"],
data: arr.map((rtime) => rtime?.timeStamp.slice(-5)),
data: arr.map((rtime) => rtime?.timeStamp),
},
yAxis: {
splitLine: {