2 Commits

Author SHA1 Message Date
b122ab35ab Merge branch 'develop' into single-develop
# Conflicts:
#	src/router/ems.js
2026-01-16 15:59:17 +08:00
11111d035b 优化 2026-01-13 16:38:21 +08:00
7 changed files with 172 additions and 58 deletions

View File

@ -4,49 +4,53 @@
v-loading="loading"
>
<el-row style="background: #fff" class="row-container" :gutter="15">
<el-col v-if="tableData.length > 0" :xs="24" :sm="24" :lg="24">
<alarm-table :tableData="tableData" />
</el-col>
<el-col :xs="24" :sm="24" :lg="6">
<el-col :xs="24" :sm="24" :lg="8">
<el-card
shadow="always"
class="common-card-container common-card-container-body-no-padding"
shadow="always"
class="common-card-container common-card-container-body-no-padding"
>
<div slot="header">
<span class="card-title">站点信息</span>
<div class="alarm-msg" v-if="tableData.length > 0" @click="toAlarm">
<i class="el-icon-message-solid"></i>
</div>
</div>
<div
style="box-sizing: border-box; height: 250px; padding: 20px 15px"
style="box-sizing: border-box; height: 250px; padding: 20px 15px"
>
<el-descriptions class="home-normal-info" :column="1">
<el-descriptions-item
size="mini"
v-for="(item, index) in singleZdInfo"
:key="index + 'singleZdInfo'"
:label="item.title"
>{{ info[item.attr] | formatNumber }}</el-descriptions-item
size="mini"
v-for="(item, index) in singleZdInfo"
:key="index + 'singleZdInfo'"
:label="item.title"
>{{ info[item.attr] | formatNumber }}
</el-descriptions-item
>
</el-descriptions>
</div>
</el-card>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<el-col :xs="24" :sm="24" :lg="16">
<cl-info :info="runningInfo.strategyTempInfo"/>
</el-col>
<el-col :xs="24" :sm="24" :lg="12">
<el-card
shadow="always"
class="common-card-container common-card-container-body-no-padding"
shadow="always"
class="common-card-container common-card-container-body-no-padding"
>
<div slot="header">
<span class="card-title">总累计运行数据</span>
</div>
<div
style="box-sizing: border-box; height: 250px; padding: 20px 15px"
style="box-sizing: border-box; height: 250px; padding: 20px 15px"
>
<el-row :gutter="20">
<el-col
:span="12"
v-for="(item, index) in sjglData"
:key="index + 'sjglData'"
class="sjgl-data"
:span="12"
v-for="(item, index) in sjglData"
:key="index + 'sjglData'"
class="sjgl-data"
>
<div class="sjgl-title">{{ item.title }}</div>
<div class="sjgl-value">
@ -57,31 +61,57 @@
</div>
</el-card>
</el-col>
<el-col :xs="24" :sm="24" :lg="10">
<cl-info :info="runningInfo.strategyTempInfo" />
<el-col :xs="24" :sm="24" :lg="12">
<el-card
shadow="always"
class="common-card-container common-card-container-body-no-padding"
>
<div slot="header">
<span class="card-title">收入对比数据</span>
</div>
<div
style="box-sizing: border-box; height: 250px; padding: 20px 15px"
>
<el-row :gutter="20">
<el-col
v-for="(item, index) in revenueData"
:key="index + 'revenueData'"
:span="index === 2 ? 24 : 12"
class="sjgl-data"
:style="{marginTop:index === 2 ? '40px' : 0}"
>
<div class="sjgl-title">{{ item.title }}</div>
<div class="sjgl-value">
{{ runningInfo[item.attr] | formatNumber }}
</div>
</el-col>
</el-row>
</div>
</el-card>
</el-col>
<el-col :xs="24" :sm="24" :lg="24">
<week-chart ref="weekChart" />
<week-chart ref="weekChart"/>
</el-col>
<el-col :xs="24" :sm="24" :lg="24">
<active-chart ref="activeChart" />
<active-chart ref="activeChart"/>
</el-col>
</el-row>
</div>
</template>
<script>
import { getSingleSiteBaseInfo } from "@/api/ems/zddt";
import { getDzjkHomeView } from "@/api/ems/dzjk";
import {getSingleSiteBaseInfo} from "@/api/ems/zddt";
import {getDzjkHomeView} from "@/api/ems/dzjk";
import WeekChart from "./WeekChart.vue";
import ActiveChart from "./ActiveChart.vue";
import AlarmTable from "./AlarmTable.vue";
import ClInfo from "./ClInfo.vue";
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
import intervalUpdate from "@/mixins/ems/intervalUpdate";
export default {
name: "DzjkSbjkHome",
components: { WeekChart, ActiveChart, AlarmTable, ClInfo },
components: {WeekChart, ActiveChart, AlarmTable, ClInfo},
mixins: [getQuerySiteId, intervalUpdate],
data() {
return {
@ -113,6 +143,14 @@ export default {
title: "今日放电量kWh",
attr: "dayDisChargedCap",
},
{
title: "昨日充电量kWh",
attr: "todo",
},
{
title: "昨日放电量kWh",
attr: "todo",
},
{
title: "总充电量kWh",
attr: "totalChargedCap",
@ -121,14 +159,20 @@ export default {
title: "总放电量kWh",
attr: "totalDischargedCap",
},
{
title: "总收入(元)",
attr: "totalRevenue",
},
],
revenueData: [
{
title: "当日实时收入(元)",
attr: "dayRevenue",
},
{
title: "昨日实时收入(元)",
attr: "todo",
},
{
title: "总收入(元)",
attr: "totalRevenue",
},
],
info: {}, //基本信息
runningInfo: {}, //总累计运行数据+报警表格
@ -137,13 +181,16 @@ export default {
computed: {
tableData() {
console.log(
"this.runningInfo?.siteMonitorHomeAlarmVo ",
this.runningInfo?.siteMonitorHomeAlarmVo
"this.runningInfo?.siteMonitorHomeAlarmVo ",
this.runningInfo?.siteMonitorHomeAlarmVo
);
return this.runningInfo?.siteMonitorHomeAlarmVo || [];
},
},
methods: {
toAlarm() {
this.$router.push({path: "/dzjk/gzgj", query: this.$route.query});
},
getBaseInfo() {
return getSingleSiteBaseInfo(this.siteId).then((response) => {
this.info = response?.data || {};
@ -173,6 +220,21 @@ export default {
</script>
<style scoped lang="scss">
.alarm-msg {
background: #ffcec6;
width: 32px;
border-radius: 17px;
text-align: center;
font-size: 22px;
line-height: 30px;
cursor: pointer;
color: #ff4949;
position: absolute;
right: 20px;
top: 50%;
transform: translateY(-50%);
}
.row-container {
& > .el-col {
margin-bottom: 20px;
@ -182,16 +244,19 @@ export default {
//数据概览
.sjgl-data {
text-align: center;
&:nth-child(1),
&:nth-child(2),
&:nth-child(3),
&:nth-child(4) {
margin-bottom: 25px;
}
.sjgl-title {
color: #666666;
line-height: 14px;
}
.sjgl-value {
color: rgba(51, 51, 51, 1);
font-size: 26px;
@ -206,10 +271,12 @@ export default {
<style lang="scss">
.home-normal-info {
font-size: 12px;
.el-descriptions-item__container {
.el-descriptions-item__label {
color: #666666;
}
.el-descriptions-item__content {
color: #333333;
}

View File

@ -38,7 +38,7 @@
<el-col v-for="(tempDataItem,tempDataIndex) in deviceIdTypeMsg[item.deviceId]" :key="tempDataIndex+'dbTempData'"
:span="8" class="device-info-col">
<span class="pointer" @click="showChart(tempDataItem.pointName,item.deviceId)">
<span class="left">{{ tempDataItem.name }}</span> <span class="right">{{ item[tempDataItem.attr] }}<span
<span class="left">{{ tempDataItem.name }}</span> <span class="right">{{ item[tempDataItem.attr] || '-' }}<span
v-html="tempDataItem.unit"></span></span>
</span>
</el-col>

View File

@ -26,7 +26,8 @@
<el-col v-for="(tempDataItem,tempDataIndex) in tempData" :key="tempDataIndex+'hdTempData'" :span="12"
class="device-info-col">
<span class="pointer" @click="showChart(tempDataItem.title,item.deviceId)">
<span class="left">{{ tempDataItem.title }}</span> <span class="right">{{ item[tempDataItem.attr] }}<span
<span class="left">{{ tempDataItem.title }}</span> <span
class="right">{{ item[tempDataItem.attr] || '-' }}<span
v-html="tempDataItem.unit"></span></span>
</span>
</el-col>

View File

@ -209,10 +209,10 @@ export default {
pcsList: [],
infoData: [
{
label: "总交流有功率",
label: "总交流有功率",
attr: "totalActivePower",
unit: "kW",
pointName: "总交流有功率",
pointName: "总交流有功率",
},
{
label: "当天交流充电量",
@ -228,10 +228,10 @@ export default {
pointName: "A相电流",
},
{
label: "总交流无功率",
label: "总交流无功率",
attr: "totalReactivePower",
unit: "kVar",
pointName: "总交流无功率",
pointName: "总交流无功率",
},
{
label: "当天交流放电量",

View File

@ -37,8 +37,10 @@
<el-col v-for="(tempDataItem,tempDataIndex) in tempData" :key="tempDataIndex+'hdTempData'" :span="12"
class="device-info-col">
<span class="pointer" @click="showChart(tempDataItem.title,item.deviceId)">
<span class="left">{{ tempDataItem.title }}</span> <span class="right">{{ item[tempDataItem.attr] || '' }}<span
v-html="tempDataItem.unit"></span></span>
<span class="left">{{ tempDataItem.title }}</span> <span class="right">{{
item[tempDataItem.attr] || '-'
}}<span
v-html="tempDataItem.unit"></span></span>
</span>
</el-col>
</el-row>

View File

@ -26,7 +26,8 @@
<el-col v-for="(tempDataItem,tempDataIndex) in tempData" :key="tempDataIndex+'ylTempData'" :span="8"
class="device-info-col">
<span class="pointer" @click="showChart(tempDataItem.title,item.deviceId)">
<span class="left">{{ tempDataItem.title }}</span> <span class="right">{{ item[tempDataItem.attr] }}<span
<span class="left">{{ tempDataItem.title }}</span> <span
class="right">{{ item[tempDataItem.attr] || '-' }}<span
v-html="tempDataItem.unit"></span></span>
</span>
</el-col>

View File

@ -26,14 +26,16 @@
<el-table
class="common-table"
:data="tableData"
show-summary
:summary-method="getSummaries"
stripe
style="width: 100%;margin-top:25px;">
<!-- 汇总列-->
<el-table-column label="汇总">
<el-table-column label="汇总" min-width="180px" align="center">
<el-table-column
prop="dataTime"
label="日期"
width="120">
min-width="180px" align="center">
</el-table-column>
</el-table-column>
<!--充电量列-->
@ -92,13 +94,6 @@
label="总">
</el-table-column>
</el-table-column>
<!-- 效率-->
<!-- <el-table-column label="效率(%)" align="center">-->
<!-- <el-table-column-->
<!-- align="center"-->
<!-- prop="effect">-->
<!-- </el-table-column>-->
<!-- </el-table-column>-->
</el-table>
<el-pagination
v-show="tableData.length>0"
@ -142,6 +137,46 @@ export default {
}
},
methods: {
//表格汇总
getSummaries(param) {
const {columns, data} = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
const activeTotal = data.map(item => item.activeTotalPrice).reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
const reActiveTotal = data.map(item => item.reActiveTotalPrice).reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index] = '价差收入 : ' + (reActiveTotal - activeTotal);
return
}
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
}
})
return sums
},
// 搜索
onSearch() {
this.pageNum = 1//每次搜索从1开始搜索
@ -171,7 +206,6 @@ export default {
this.loading = true
const {siteId, pageNum, pageSize} = this
const [startTime = '', endTime = ''] = (this.dateRange || [])
//http://localhost:8089/ems/statsReport/getAmmeterRevenueData?siteId=021_DDS_01&startTime=2025-10-14&endTime=2025-10-15&pageSize=10&pageNum=1
getAmmeterRevenueData({siteId: siteId, startTime, endTime, pageSize, pageNum}).then(response => {
this.tableData = response?.rows || [];
this.totalSize = response?.total || 0
@ -185,10 +219,9 @@ export default {
this.totalSize = 0
this.pageSize = 10
this.pageNum = 1
const now = new Date().getTime();
const lastMonth = new Date(now - 30 * 24 * 60 * 60 * 1000).getTime();
this.defaultDateRange = [formatDate(lastMonth), formatDate(now)];
this.dateRange = [formatDate(lastMonth), formatDate(now)];
let now = new Date(), lastDay = now.getTime(), firstDay = new Date(now.setDate(1)).getTime();
this.defaultDateRange = [formatDate(firstDay), formatDate(lastDay)];
this.dateRange = [formatDate(firstDay), formatDate(lastDay)];
this.getData()
},
},
@ -197,9 +230,19 @@ export default {
<style scoped lang="scss">
::v-deep {
.common-table.el-table .el-table__header-wrapper th, .common-table.el-table .el-table__fixed-header-wrapper th {
border-bottom: 1px solid #dfe6ec;
.common-table.el-table {
.el-table__header-wrapper th, .common-table.el-table .el-table__fixed-header-wrapper th {
border-bottom: 1px solid #dfe6ec;
}
.el-table__footer-wrapper {
tbody td.el-table__cell {
color: #000;
font-weight: bolder;
}
}
}
}
</style>