Compare commits
2 Commits
7a68b93079
...
525c9b0572
Author | SHA1 | Date |
---|---|---|
“yu” | 525c9b0572 | |
“yu” | 56a74df38e |
|
@ -16,17 +16,17 @@ export function handleUnit(data) {
|
||||||
// 处理echarts数据
|
// 处理echarts数据
|
||||||
export function handleEchartsData(data, value) {
|
export function handleEchartsData(data, value) {
|
||||||
// 间隔可以设置成动态的
|
// 间隔可以设置成动态的
|
||||||
let timeArray = [];
|
let timeArray_1 = [];
|
||||||
for (let hour = 0; hour < 24; hour++) {
|
for (let hour = 0; hour < 24; hour++) {
|
||||||
for (let minute = 0; minute < 60; minute += value) {
|
for (let minute = 0; minute < 60; minute += value) {
|
||||||
let timeString = (hour < 10 ? '0' + hour : hour) + ':' + (minute < 10 ? '0' + minute : minute);
|
let timeString = (hour < 10 ? '0' + hour : hour) + ':' + (minute < 10 ? '0' + minute : minute);
|
||||||
timeArray.push(
|
timeArray_1.push(
|
||||||
{ datetime: timeString, measValue: '-' }
|
{ datetime: timeString, measValue: '-' }
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(timeArray)
|
console.log(timeArray_1)
|
||||||
timeArray.forEach(item => {
|
timeArray_1.forEach(item => {
|
||||||
data.forEach(ite => {
|
data.forEach(ite => {
|
||||||
let iteTime = ite.datetime.split(' ')[1].split(':')[0] + ':' + ite.datetime.split(' ')[1].split(':')[1]
|
let iteTime = ite.datetime.split(' ')[1].split(':')[0] + ':' + ite.datetime.split(' ')[1].split(':')[1]
|
||||||
if (iteTime === item.datetime) {
|
if (iteTime === item.datetime) {
|
||||||
|
@ -37,3 +37,49 @@ export function handleEchartsData(data, value) {
|
||||||
|
|
||||||
return timeArray
|
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
|
@ -265,7 +265,7 @@ import load_info_echart from './load_info_echart.vue'
|
||||||
import cdz_echart from './cdz_echart.vue'
|
import cdz_echart from './cdz_echart.vue'
|
||||||
import carTree from '@/views/commonPage/carTree.vue'
|
import carTree from '@/views/commonPage/carTree.vue'
|
||||||
import { powerCurve_api, transformerOverloadCount_api, running_api } from '@/api/carPage/index'
|
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(() => {
|
onMounted(() => {
|
||||||
// 获取右侧数据
|
// 获取右侧数据
|
||||||
|
@ -428,7 +428,9 @@ let getPowerCurve_api = () => {
|
||||||
res?.data.forEach((item: any) => {
|
res?.data.forEach((item: any) => {
|
||||||
item.datetime = item.dateTime
|
item.datetime = item.dateTime
|
||||||
})
|
})
|
||||||
|
|
||||||
let result = handleEchartsData(res.data, 60)
|
let result = handleEchartsData(res.data, 60)
|
||||||
|
|
||||||
carRightData.echartsData = result
|
carRightData.echartsData = result
|
||||||
console.log(result, 'resresres')
|
console.log(result, 'resresres')
|
||||||
})
|
})
|
||||||
|
|
|
@ -393,7 +393,7 @@
|
||||||
</div>
|
</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="run_detail" v-if="true">
|
||||||
<div class="tip">
|
<div class="tip">
|
||||||
<img src="@/assets/images/mainPage/icon_alert_pv.png" alt="" />
|
<img src="@/assets/images/mainPage/icon_alert_pv.png" alt="" />
|
||||||
|
@ -416,7 +416,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
<!-- 通知消息 -->
|
<!-- 通知消息 -->
|
||||||
<!-- <div class="content_center_alert" v-if="true">
|
<!-- <div class="content_center_alert" v-if="true">
|
||||||
<div class="run_detail" v-if="true">
|
<div class="run_detail" v-if="true">
|
||||||
|
|
|
@ -101,7 +101,7 @@ const drawOneLine = (arr: any) => {
|
||||||
// },
|
// },
|
||||||
},
|
},
|
||||||
// data: ["03:00", "06:00", "09:00", "12:00", "15:00", "18:00", "24:00"],
|
// 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: {
|
yAxis: {
|
||||||
splitLine: {
|
splitLine: {
|
||||||
|
|
Loading…
Reference in New Issue