store+统计分析+用户管理

This commit is contained in:
ym1026
2025-09-05 09:26:14 +08:00
parent 1cc916c53c
commit 013a2245f5
15 changed files with 911 additions and 278 deletions

View File

@@ -41,7 +41,7 @@ export default {
showCtrModal: false,
testVal: {
name: '场站211',
id: '124563'
id: '2'
},
changeStationId:''
}

View File

@@ -9,7 +9,7 @@
</div>
<component
:is="item.componentId"
:props-total="modalInfo.allTotal"
:props-total="item.infoKey=='prefab'? modalInfo.prefabTotal: modalInfo.allTotal"
:props-info="modalInfo[item.infoKey]"
></component>
</div>
@@ -59,7 +59,7 @@ export default {
title: '预制舱信息',
class: '',
componentId: PrefabCabin,
infoKey: ''
infoKey: 'prefab'
},
{
title: '储能充放电量',
@@ -114,6 +114,7 @@ export default {
async mounted() {
await Promise.all([
this.getStatTotalList(),
this.queryStationInfo(),
this.getStatDayList(1),
])
},
@@ -128,7 +129,7 @@ export default {
// category:类别1:储能设备,2:充电设备,3:光伏设备,为0或不传查询所有类别总计
const query = {
date: getDateDaysAgo(0),
stationId: this.stationId,
station_id: this.stationId,
category: 0
}
const res = await getReq('/api/queryStatTotal', query)
@@ -144,6 +145,24 @@ export default {
this.modalInfo.allTotal = {}
}
},
// 查询场站信息
async queryStationInfo() {
try {
// station_id场站ID
const query = {
station_id: this.stationId,
}
const res = await getReq('/api//queryStationInfo', query)
if (res.errcode === 0) {
this.modalInfo.prefabTotal = res.data
} else {
throw res
}
} catch (error) {
this.modalInfo.allTotal = {}
}
},
// 查询场站日统计信息
async getStatDayList(category) {
try {
@@ -152,7 +171,7 @@ export default {
// start_date开始日期格式yyyy-mm-dd
// end_date结束日期格式yyyy-mm-dd
const query = {
stationId: this.stationId,
station_id: this.stationId,
category,
start_date: getDateDaysAgo(7 - 1),
end_date: getDateDaysAgo(0)

View File

@@ -44,42 +44,68 @@ export default {
curStatus: '充电',
list: [
{
key: 'tianshu',
key: 'batttey_type',
value: '磷酸铁锂电池',
d: '',
label: '电池类型',
class: 'item-1'
},
{
key: 'shouyi',
key: 'cooling_type',
value: '风冷',
d: '',
label: '冷却方式',
class: 'item-2'
},
{
key: 'shuliang',
key: 'voltage_rated',
value: 20,
d: 'V',
label: '电池额定总电压',
class: 'item-3'
},
{
key: 'shuliang',
key: 'work_mode',
value: '最优经济化运行模式',
d: '',
label: '运行模式',
class: 'item-4'
class: 'item-4',
list:[
{
label:'手动',
value:0
},
{
label:'峰谷套利',
value:1
},
{
label:'增网配容',
value:2
},
{
label:'应急供电',
value:3
},
{
label:'并网保电',
value:4
},
{
label:'自定时段',
value:5
},
]
},
{
key: 'fadianliang',
key: 'capacity',
value: 20,
d: 'Wh',
label: '电池储能容量',
class: 'item-5'
},
{
key: 'rongliang',
key: 'power_rated',
value: 100,
d: 'Kw',
label: 'PCS额定功率',
@@ -100,8 +126,15 @@ export default {
propsTotal: {
handler(newVal, oldVal) {
if (newVal !== oldVal) {
// 0正常 1故障
this.curStatus=['正常','故障'][this.propsTotal.status]
this.list.forEach((item) => {
item.value = this.propsTotal[item.key]
if(item.key=='work_mode'){
item.value =item.list.map((item)=>this.propsTotal[item.key]==item.value)[0].label
}else {
item.value = this.propsTotal[item.key]
}
})
}
}

View File

@@ -1,5 +1,5 @@
<template>
<div class="onLine">
<div class="statistical">
<div class="content">
<div v-for="item in list" :key="item.key" :class="`item ${item.class}`">
<span>{{ item.value ? item.value : 0 }} {{ item.d }}</span>
@@ -96,7 +96,7 @@ export default {
</script>
<style lang="scss" scoped>
.onLine {
.statistical {
height: calc(100% - 45px);
display: flex;
justify-content: center;