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

@@ -53,8 +53,8 @@
<div class="pagination" v-if="data.newTableOpt.page">
<a-pagination
v-model:current="data.newPageOption.current"
:total="data.newPageOption.total"
v-model:current="data.newPageOption.page"
:total="data.newPageOption.count"
:page-size="data.newPageOption.pageSize"
@change="onChange"
show-size-changer
@@ -64,9 +64,9 @@
</a-pagination>
<div style="color: #7f8fa4; height: 30px; line-height: 30px; margin: 0 10px">
<span style="color: aqua; font-size: 18px; margin: 0 2px">{{
data.newPageOption.total
data.newPageOption.count
}}</span
>
>
</div>
</div>
</div>
@@ -107,9 +107,9 @@ const props = defineProps({
type: Object,
default: () => {
return {
current: 1,
count: 1,
pageSize: 10,
total: 1
page: 1
}
}
},
@@ -206,7 +206,7 @@ function rowClassName(record, index) {
}
function expandIcon(props) {}
function onChange(page, pageSize) {
data.newPageOption.current = page
data.newPageOption.page = page
data.newPageOption.pageSize = pageSize
emit('handlePagesizeChange', data.newPageOption)
}

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;

View File

@@ -0,0 +1,107 @@
<template>
<div class="operate">
<template v-if="operateList.length < 4">
<a-button
v-for="item in operateList"
:key="item.type"
type="primary"
style="margin-right: 5px"
:class="['operateCol', item.type]"
:disabled="item.disabled"
@click="munuClick(item.type)"
>{{ item.label }}
</a-button>
</template>
</div>
</template>
<script>
export default {
name: 'OperateCom',
components: { },
props: {
operateList: {
type: Array,
default: () => {
return []
}
},
record: {
type: Object,
default:()=>{}
},
flag: {
type: String,
default:''
}
},
data() {
return {}
},
watch: {
operateList: {
handler(n, o) {},
deep: true,
immediate: true
}
},
mounted() {},
methods: {
munuClick(type) {
this.$emit('operateForm', type, { ...this.record })
}
}
}
</script>
<style lang="scss" scoped>
.moreIcon{
color:#fff !important
}
:deep(.ant-btn) {
padding: 0px 7px !important;
height: 24px !important;
font-size: 13px !important;
letter-spacing: -1px;
border-radius: 4px;
& > span + .anticon {
margin-inline-start: 4px;
}
}
:deep(.ant-btn-primary) {
box-shadow: none !important;
background: var(--theme-btn3);
}
:deep(.ant-btn,.ant-btn-primary){
&:hover{
opacity: 0.9;
}
&:disabled{
color: rgba(255,255,255,0.5);
}
}
.operate{
display: flex;
justify-content: center;
}
.operateCol {
background: var(--theme-btn3);
&.more {
background: var(--theme-btn1);
}
&.del {
background: var(--theme-btn2);
}
}
.ant-dropdown .ant-dropdown-menu{
background-color:var(--theme-opert-bg)!important;
}
</style>