udpate
commit
4a7dd980bd
|
@ -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
|
@ -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')
|
||||
})
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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: {
|
||||
|
|
Loading…
Reference in New Issue