mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-28 03:09:24 +08:00
store+统计分析+用户管理
This commit is contained in:
@@ -1,12 +1,7 @@
|
||||
<template>
|
||||
<div class="Home">
|
||||
<div class="content-left">
|
||||
<div
|
||||
v-for="item in leftList"
|
||||
:key="item.componentId"
|
||||
:class="`grid-item ${item.class}`"
|
||||
|
||||
>
|
||||
<div v-for="item in leftList" :key="item.componentId" :class="`grid-item ${item.class}`">
|
||||
<div class="tool">
|
||||
<div class="title">
|
||||
<i class="iconfont icon-hebing linear-text"></i>
|
||||
@@ -26,12 +21,7 @@
|
||||
<Map @changeStation="getCurrentStation"></Map>
|
||||
</div>
|
||||
<div class="content-right">
|
||||
<div
|
||||
v-for="item in rightList"
|
||||
:key="item.componentId"
|
||||
:class="`grid-item ${item.class}`"
|
||||
|
||||
>
|
||||
<div v-for="item in rightList" :key="item.componentId" :class="`grid-item ${item.class}`">
|
||||
<div class="tool">
|
||||
<div class="title">
|
||||
<i class="iconfont icon-hebing linear-text"></i>
|
||||
@@ -57,7 +47,7 @@ import Pv from '@/components/Home/Pv.vue'
|
||||
import Alarm from '@/components/Home/Alarm.vue'
|
||||
import Map from '@/components/Home/Map.vue'
|
||||
import { getReq, postReq } from '@/request/api'
|
||||
import {getRunDays,getDateDaysAgo} from '@/utils/dealWithData'
|
||||
import { getRunDays, getDateDaysAgo } from '@/utils/dealWithData'
|
||||
|
||||
export default {
|
||||
name: 'Home',
|
||||
@@ -122,220 +112,6 @@ export default {
|
||||
},
|
||||
async mounted() {
|
||||
await Promise.all([
|
||||
// (this.deviceInfo = {
|
||||
// alarm: [
|
||||
// {
|
||||
// date: '2025-08-30',
|
||||
// key1: 10,
|
||||
// key2: 0,
|
||||
// key3: 15,
|
||||
// key4: 5
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-29',
|
||||
// key1: 8,
|
||||
// key2: 5,
|
||||
// key3: 5,
|
||||
// key4: 7
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-28',
|
||||
// key1: 0,
|
||||
// key2: 10,
|
||||
// key3: 20,
|
||||
// key4: 4
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-27',
|
||||
// key1: 10,
|
||||
// key2: 0,
|
||||
// key3: 15,
|
||||
// key4: 5
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-26',
|
||||
// key1: 10,
|
||||
// key2: 0,
|
||||
// key3: 15,
|
||||
// key4: 5
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-25',
|
||||
// key1: 10,
|
||||
// key2: 0,
|
||||
// key3: 15,
|
||||
// key4: 5
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-24',
|
||||
// key1: 10,
|
||||
// key2: 0,
|
||||
// key3: 15,
|
||||
// key4: 5
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-23',
|
||||
// key1: 10,
|
||||
// key2: 0,
|
||||
// key3: 15,
|
||||
// key4: 5
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-22',
|
||||
// key1: 10,
|
||||
// key2: 0,
|
||||
// key3: 15,
|
||||
// key4: 5
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-21',
|
||||
// key1: 10,
|
||||
// key2: 0,
|
||||
// key3: 15,
|
||||
// key4: 5
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-20',
|
||||
// key1: 10,
|
||||
// key2: 0,
|
||||
// key3: 15,
|
||||
// key4: 5
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-19',
|
||||
// key1: 10,
|
||||
// key2: 0,
|
||||
// key3: 15,
|
||||
// key4: 5
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-18',
|
||||
// key1: 10,
|
||||
// key2: 0,
|
||||
// key3: 15,
|
||||
// key4: 5
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-17',
|
||||
// key1: 10,
|
||||
// key2: 0,
|
||||
// key3: 15,
|
||||
// key4: 5
|
||||
// }
|
||||
// ],
|
||||
// energy: [
|
||||
// {
|
||||
// date: '2025-08-30',
|
||||
// key1: '2',
|
||||
// key2: '2'
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-29',
|
||||
// key1: '2',
|
||||
// key2: '2'
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-28',
|
||||
// key1: '2',
|
||||
// key2: '2'
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-27',
|
||||
// key1: '2',
|
||||
// key2: '2'
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-26',
|
||||
// key1: '2',
|
||||
// key2: '2'
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-25',
|
||||
// key1: '2',
|
||||
// key2: '2'
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-24',
|
||||
// key1: '2',
|
||||
// key2: '2'
|
||||
// }
|
||||
// ],
|
||||
// charge: [
|
||||
// {
|
||||
// date: '2025-08-30',
|
||||
// key1: '2',
|
||||
// key2: '2'
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-29',
|
||||
// key1: '2',
|
||||
// key2: '2'
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-28',
|
||||
// key1: '2',
|
||||
// key2: '2'
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-27',
|
||||
// key1: '2',
|
||||
// key2: '2'
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-26',
|
||||
// key1: '2',
|
||||
// key2: '2'
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-25',
|
||||
// key1: '2',
|
||||
// key2: '2'
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-24',
|
||||
// key1: '2',
|
||||
// key2: '2'
|
||||
// }
|
||||
// ],
|
||||
// pv: [
|
||||
// {
|
||||
// date: '2025-08-30',
|
||||
// key1: '2',
|
||||
// key2: '2'
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-29',
|
||||
// key1: '2',
|
||||
// key2: '2'
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-28',
|
||||
// key1: '2',
|
||||
// key2: '2'
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-27',
|
||||
// key1: '2',
|
||||
// key2: '2'
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-26',
|
||||
// key1: '2',
|
||||
// key2: '2'
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-25',
|
||||
// key1: '2',
|
||||
// key2: '2'
|
||||
// },
|
||||
// {
|
||||
// date: '2025-08-24',
|
||||
// key1: '2',
|
||||
// key2: '2'
|
||||
// }
|
||||
// ],
|
||||
// allTotal: {}
|
||||
// }),
|
||||
this.getOnLineList(),
|
||||
this.getStatTotalList(),
|
||||
this.getStatDayList(1),
|
||||
@@ -409,7 +185,6 @@ export default {
|
||||
this.deviceInfo.allTotal.incomeCharge + this.deviceInfo.allTotal.incomeElect
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// 示例:获取7天前的日期
|
||||
// 查询场站日统计信息
|
||||
@@ -430,6 +205,18 @@ export default {
|
||||
if (res.errcode === 0) {
|
||||
this.list.forEach((item) => {
|
||||
this.deviceInfo[arr[category]] = res.data
|
||||
if (
|
||||
this.deviceInfo.energy.length &&
|
||||
this.deviceInfo.charge.length &&
|
||||
this.deviceInfo.pv.length
|
||||
) {
|
||||
const newArr = this.mergedArray(
|
||||
this.deviceInfo.energy,
|
||||
this.deviceInfo.charge,
|
||||
this.deviceInfo.pv
|
||||
)
|
||||
this.deviceInfo.alarm = newArr
|
||||
}
|
||||
})
|
||||
} else {
|
||||
throw res
|
||||
@@ -437,6 +224,24 @@ export default {
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
},
|
||||
// 整合三个数组
|
||||
mergedArray(arr1, arr2, arr3) {
|
||||
const newArr = []
|
||||
arr1.forEach((item1, index) => {
|
||||
// 获取对应索引的 arr2 和 arr3 的对象
|
||||
const item2 = arr2[index] || {}
|
||||
const item3 = arr3[index] || {}
|
||||
|
||||
// 返回整合后的对象
|
||||
newArr.push({
|
||||
storage_num_err: item1.storage_num_err || '',
|
||||
solar_num_err: item2.solar_num_err || '',
|
||||
charge_num_err: item3.charge_num_err || '',
|
||||
dt: item1.dt
|
||||
})
|
||||
})
|
||||
return newArr
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user