|
@@ -1,38 +1,59 @@
|
|
<template>
|
|
<template>
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
<el-tabs v-model="queryParams.areaCode" @tab-click="handleQuery">
|
|
<el-tabs v-model="queryParams.areaCode" @tab-click="handleQuery">
|
|
- <el-tab-pane
|
|
|
|
- v-for="item in areaOptions"
|
|
|
|
- :key="item.areaCode"
|
|
|
|
- :label="item.shortName"
|
|
|
|
- :name="item.areaCode" >
|
|
|
|
|
|
+ <el-tab-pane v-for="item in areaOptions" :key="item.areaCode" :label="item.shortName" :name="item.areaCode">
|
|
</el-tab-pane>
|
|
</el-tab-pane>
|
|
</el-tabs>
|
|
</el-tabs>
|
|
-
|
|
|
|
-
|
|
|
|
- <BaseChart width="100%" height="300px" :option="elecOptions" />
|
|
|
|
- <el-table v-loading="loading" :data="elecStoreHList" max-height="400px">
|
|
|
|
- <el-table-column label="设施名称" align="center" prop="facsName" />
|
|
|
|
- <el-table-column label="日期" align="center" prop="date" width="180">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="时间" align="center" prop="time">
|
|
|
|
- </el-table-column>
|
|
|
|
- <el-table-column label="充电电量(kW-h)" align="center" prop="chargeElecQuantity" />
|
|
|
|
- <el-table-column label="放电电量(kW-h)" align="center" prop="dischargeElecQuantity" />
|
|
|
|
- </el-table>
|
|
|
|
|
|
+ <template v-if="queryParams.areaCode == 'all'">
|
|
|
|
+ <div class="chartGroup">
|
|
|
|
+ <Block title="当日充电量(单位:kw·h)">
|
|
|
|
+ <div class="block-area" slot="main">
|
|
|
|
+ <div class="center-label">
|
|
|
|
+ <div>总充电量</div>
|
|
|
|
+ <div>{{daySum.chargeElecQuantity}}kw·h</div>
|
|
|
|
+ </div>
|
|
|
|
+ <BaseChart width="100%" height="500px" :option="chargePieOptions" />
|
|
|
|
+ </div>
|
|
|
|
+ </Block>
|
|
|
|
+ <Block title="当日放电量(单位:kw·h)">
|
|
|
|
+ <div class="block-area" slot="main">
|
|
|
|
+ <div class="center-label">
|
|
|
|
+ <div>总放电量</div>
|
|
|
|
+ <div>{{daySum.dischargeElecQuantity}}kw·h</div>
|
|
|
|
+ </div>
|
|
|
|
+ <BaseChart width="100%" height="500px" :option="disChargePieOptions" />
|
|
|
|
+ </div>
|
|
|
|
+ </Block>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ <template v-else>
|
|
|
|
+ <BaseChart width="100%" height="300px" :option="elecOptions" />
|
|
|
|
+ <el-table v-loading="loading" :data="elecStoreHList" max-height="400px">
|
|
|
|
+ <el-table-column label="设施名称" align="center" prop="facsName" />
|
|
|
|
+ <el-table-column label="日期" align="center" prop="date" width="180">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="时间" align="center" prop="time">
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="充电电量(kW-h)" align="center" prop="chargeElecQuantity" />
|
|
|
|
+ <el-table-column label="放电电量(kW-h)" align="center" prop="dischargeElecQuantity" />
|
|
|
|
+ </el-table>
|
|
|
|
+ </template>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { listElecStoreH } from '@/api/mgr/elecStoreH'
|
|
|
|
-import { areaWithFacsCategory } from '@/api/basecfg/area'
|
|
|
|
|
|
+import {listElecStoreH, dayStatistics} from '@/api/mgr/elecStoreH'
|
|
|
|
+import {areaWithFacsCategory} from '@/api/basecfg/area'
|
|
import BaseChart from '@/components/BaseChart'
|
|
import BaseChart from '@/components/BaseChart'
|
|
|
|
+import Block from '@/components/Block/block.vue';
|
|
|
|
+import {dateFormat} from '@/utils/index.js'
|
|
export default {
|
|
export default {
|
|
name: 'ElecStoreH',
|
|
name: 'ElecStoreH',
|
|
components: {
|
|
components: {
|
|
- BaseChart
|
|
|
|
|
|
+ BaseChart,
|
|
|
|
+ Block
|
|
},
|
|
},
|
|
- data() {
|
|
|
|
|
|
+ data () {
|
|
return {
|
|
return {
|
|
// 遮罩层
|
|
// 遮罩层
|
|
loading: true,
|
|
loading: true,
|
|
@@ -45,11 +66,13 @@ export default {
|
|
areaCode: null
|
|
areaCode: null
|
|
},
|
|
},
|
|
// 表单参数
|
|
// 表单参数
|
|
- areaOptions: []
|
|
|
|
|
|
+ areaOptions: [],
|
|
|
|
+ hourSum: [],
|
|
|
|
+ daySum: {}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
- elecOptions() {
|
|
|
|
|
|
+ elecOptions () {
|
|
const xData = this.elecStoreHList.map(item => item.time)
|
|
const xData = this.elecStoreHList.map(item => item.time)
|
|
const chargeQuantity = this.elecStoreHList.map(item => item.chargeElecQuantity)
|
|
const chargeQuantity = this.elecStoreHList.map(item => item.chargeElecQuantity)
|
|
const dischargeQuantity = this.elecStoreHList.map(item => item.dischargeElecQuantity)
|
|
const dischargeQuantity = this.elecStoreHList.map(item => item.dischargeElecQuantity)
|
|
@@ -84,7 +107,7 @@ export default {
|
|
name: '充电电量',
|
|
name: '充电电量',
|
|
type: 'bar',
|
|
type: 'bar',
|
|
data: chargeQuantity,
|
|
data: chargeQuantity,
|
|
- barWidth: 30,
|
|
|
|
|
|
+ barWidth: 20,
|
|
itemStyle: {
|
|
itemStyle: {
|
|
normal: {
|
|
normal: {
|
|
color: '#6395FA'
|
|
color: '#6395FA'
|
|
@@ -95,7 +118,7 @@ export default {
|
|
name: '放电电量',
|
|
name: '放电电量',
|
|
type: 'bar',
|
|
type: 'bar',
|
|
data: dischargeQuantity,
|
|
data: dischargeQuantity,
|
|
- barWidth: 30,
|
|
|
|
|
|
+ barWidth: 20,
|
|
itemStyle: {
|
|
itemStyle: {
|
|
normal: {
|
|
normal: {
|
|
color: '#8CDF6C'
|
|
color: '#8CDF6C'
|
|
@@ -105,34 +128,121 @@ export default {
|
|
]
|
|
]
|
|
}
|
|
}
|
|
return option
|
|
return option
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ chargePieOptions () {
|
|
|
|
+ return {
|
|
|
|
+ series: [
|
|
|
|
+ {
|
|
|
|
+ name: 'Nightingale Chart',
|
|
|
|
+ type: 'pie',
|
|
|
|
+ radius: [50, 150],
|
|
|
|
+ center: ['50%', '50%'],
|
|
|
|
+ roseType: 'area',
|
|
|
|
+ itemStyle: {
|
|
|
|
+ borderRadius: 8
|
|
|
|
+ },
|
|
|
|
+ data:
|
|
|
|
+ this.hourSum.map(item => ({
|
|
|
|
+ name: item.time,
|
|
|
|
+ value: item.chargeElecQuantity
|
|
|
|
+ }))
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ disChargePieOptions () {
|
|
|
|
+ return {
|
|
|
|
+ series: [
|
|
|
|
+ {
|
|
|
|
+ name: 'Nightingale Chart',
|
|
|
|
+ type: 'pie',
|
|
|
|
+ radius: [50, 150],
|
|
|
|
+ center: ['50%', '50%'],
|
|
|
|
+ roseType: 'area',
|
|
|
|
+ itemStyle: {
|
|
|
|
+ borderRadius: 8
|
|
|
|
+ },
|
|
|
|
+ data: this.hourSum.map(item => ({
|
|
|
|
+ name: item.time,
|
|
|
|
+ value: item.dischargeElecQuantity
|
|
|
|
+ }))
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+
|
|
},
|
|
},
|
|
- async created() {
|
|
|
|
|
|
+ async created () {
|
|
this.facsCategory = 'C'
|
|
this.facsCategory = 'C'
|
|
await this.getAreaList()
|
|
await this.getAreaList()
|
|
- this.getList()
|
|
|
|
|
|
+ this.handleQuery()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// 查询区域列表
|
|
// 查询区域列表
|
|
- async getAreaList() {
|
|
|
|
|
|
+ async getAreaList () {
|
|
await areaWithFacsCategory(this.facsCategory, this.facsSubCategory).then(response => {
|
|
await areaWithFacsCategory(this.facsCategory, this.facsSubCategory).then(response => {
|
|
|
|
+ response.data.unshift({areaCode: 'all', shortName: '总览'})
|
|
this.areaOptions = response.data
|
|
this.areaOptions = response.data
|
|
this.queryParams.areaCode = this.areaOptions[0].areaCode
|
|
this.queryParams.areaCode = this.areaOptions[0].areaCode
|
|
})
|
|
})
|
|
},
|
|
},
|
|
/** 查询储能计量-小时列表 */
|
|
/** 查询储能计量-小时列表 */
|
|
- getList() {
|
|
|
|
|
|
+ getList () {
|
|
this.loading = true
|
|
this.loading = true
|
|
- listElecStoreH(this.queryParams).then(response => {
|
|
|
|
|
|
+ const {areaCode} = this.queryParams
|
|
|
|
+ const nowDay = dateFormat(new Date(), 'yyyy-MM-dd')
|
|
|
|
+ listElecStoreH({
|
|
|
|
+ areaCode,
|
|
|
|
+ pageNum: 1,
|
|
|
|
+ pageSize: 999,
|
|
|
|
+ startRecTime: `${nowDay} 00:00:00`,
|
|
|
|
+ endRecTime: `${nowDay} 23:59:59`
|
|
|
|
+ }).then(response => {
|
|
this.elecStoreHList = response.rows
|
|
this.elecStoreHList = response.rows
|
|
this.total = response.total
|
|
this.total = response.total
|
|
this.loading = false
|
|
this.loading = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ getSummary () {
|
|
|
|
+ dayStatistics({date: dateFormat(new Date(), 'yyyy-MM-dd')}).then(({code, data}) => {
|
|
|
|
+ if (code === 200) {
|
|
|
|
+ this.hourSum = data.hourSum || []
|
|
|
|
+ this.daySum = data.daySum || {}
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
- handleQuery() {
|
|
|
|
- this.getList()
|
|
|
|
|
|
+ handleQuery () {
|
|
|
|
+ if (this.queryParams.areaCode == 'all') {
|
|
|
|
+ this.getSummary()
|
|
|
|
+ } else {
|
|
|
|
+ this.getList()
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+.chartGroup {
|
|
|
|
+ display: flex;
|
|
|
|
+
|
|
|
|
+ >div {
|
|
|
|
+ flex: 1;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ .block-area{
|
|
|
|
+ position: relative;
|
|
|
|
+ width: 100%;
|
|
|
|
+ }
|
|
|
|
+ .center-label {
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 50%;
|
|
|
|
+ left: 50%;
|
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ align-items: center;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|