电表、单体电池接口联调
This commit is contained in:
@ -53,7 +53,13 @@ export function getClusterNameList(stackDeviceId) {
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
//单体电池表格数据
|
||||
export function getClusterDataInfoList(siteId,stackDeviceId,clusterDeviceId) {
|
||||
return request({
|
||||
url: `/ems/siteMonitor/getClusterDataInfoList?siteId=${siteId}&stackDeviceId=${stackDeviceId}&clusterDeviceId=${clusterDeviceId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
//获取液冷列表数据
|
||||
export function getCoolingDataList(siteId) {
|
||||
return request({
|
||||
|
@ -1,17 +1,17 @@
|
||||
|
||||
<template>
|
||||
<div v-loading="loading">
|
||||
<el-card shadow="always" class="common-card-container" :class="info.emsCommunicationStatus === '0' ? 'cnb-common-card-container' : 'zb-common-card-container'">
|
||||
<el-card shadow="always" class="common-card-container" :class="zbInfo.emsCommunicationStatus === '0' ? 'cnb-common-card-container' : 'zb-common-card-container'">
|
||||
<div slot="header">
|
||||
<span class="large-title">1#总表</span>
|
||||
<div class="status">
|
||||
<div>{{$store.state.ems.communicationStatusOptions[info.emsCommunicationStatus]}}</div>
|
||||
<div>数据更新时间:{{info.dataUpdateTime}}</div>
|
||||
<div>{{$store.state.ems.communicationStatusOptions[zbInfo.emsCommunicationStatus]}}</div>
|
||||
<div>数据更新时间:{{zbInfo.dataUpdateTime}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
class="common-table"
|
||||
:data="info.ammeterDataDetailInfos"
|
||||
:data="zbInfo.ammeterDataDetailInfos"
|
||||
stripe
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
@ -41,43 +41,42 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
<!-- 储能表返回值待定-->
|
||||
<el-card shadow="always" class="common-card-container cnb-common-card-container">
|
||||
<el-card shadow="always" class="common-card-container" :class="cnbInfo.emsCommunicationStatus === '0' ? 'cnb-common-card-container' : 'zb-common-card-container'">
|
||||
<div slot="header">
|
||||
<span class="large-title">2#储能表</span>
|
||||
<div class="status">
|
||||
<div>通信正常</div>
|
||||
<div>数据更新时间:2024-10-11 12:00:00</div>
|
||||
<div>{{$store.state.ems.communicationStatusOptions[cnbInfo.emsCommunicationStatus]}}</div>
|
||||
<div>数据更新时间:{{cnbInfo.dataUpdateTime}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
class="common-table"
|
||||
:data="cnbTableData"
|
||||
:data="cnbInfo.ammeterDataDetailInfos"
|
||||
stripe
|
||||
style="width: 100%;">
|
||||
<el-table-column
|
||||
prop="name"
|
||||
prop="category"
|
||||
label="类别">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="zong"
|
||||
prop="totalKwh"
|
||||
label="总/kWh"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="jian"
|
||||
prop="sharpKwh"
|
||||
label="尖/kWh">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="feng"
|
||||
prop="peakKwh"
|
||||
label="峰/kWh">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="ping"
|
||||
prop="flatKwh"
|
||||
label="平/kWh">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="gu"
|
||||
prop="valleyKwh"
|
||||
label="谷/kWh">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -95,21 +94,16 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
loading:false,
|
||||
info:{},
|
||||
cnbTableData:[
|
||||
{name:'累计充电量',zong:1000,jian:2000,feng:1500,ping:500,gu:40},
|
||||
{name:'累计放电量',zong:1000,jian:2000,feng:1500,ping:500,gu:40},
|
||||
{name:'日充电量',zong:1000,jian:2000,feng:1500,ping:500,gu:40},
|
||||
{name:'日放电量',zong:1000,jian:2000,feng:1500,ping:500,gu:40},
|
||||
],
|
||||
zbInfo:{},
|
||||
cnbInfo:{},
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
init(){
|
||||
this.loading = true
|
||||
getAmmeterDataList(this.siteId).then(response => {
|
||||
// todo 返回数据等待确认,是数组吗?
|
||||
this.info =JSON.parse(JSON.stringify(response?.data[0] || {}));
|
||||
this.zbInfo =JSON.parse(JSON.stringify(response?.data[0] || {}));
|
||||
this.cnbInfo =JSON.parse(JSON.stringify(response?.data[1] || {}));
|
||||
}).finally(() => {this.loading = false})
|
||||
}
|
||||
},
|
||||
|
@ -41,12 +41,12 @@
|
||||
label="单体编号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="dianya"
|
||||
prop="voltage"
|
||||
label="电压(V)"
|
||||
>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="wendu"
|
||||
prop="voltage"
|
||||
label="温度(℃)">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@ -59,22 +59,25 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
v-show="tableData.length>0"
|
||||
background
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pageNum"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="totalSize">
|
||||
layout=" prev, pager, next"
|
||||
style="margin-top:15px;text-align: center"
|
||||
>
|
||||
</el-pagination>
|
||||
|
||||
<!-- :total="totalSize" :page-sizes="[10, 20, 30, 40]" layout="total, sizes, prev, pager, next, jumper" -->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import BarChart from './BarChart'
|
||||
import {getStackNameList,getClusterNameList} from '@/api/ems/dzjk'
|
||||
import {getStackNameList, getClusterNameList, getClusterDataInfoList} from '@/api/ems/dzjk'
|
||||
import getQuerySiteId from "@/mixins/ems/getQuerySiteId";
|
||||
export default {
|
||||
name:'DzjkSbjkDtdc',
|
||||
@ -88,7 +91,6 @@ export default {
|
||||
stackOptions:[],//{id:'',deviceName:''}
|
||||
clusterOptions:[],//{id:'',deviceName:''}
|
||||
tableData:[],
|
||||
currentPage:1,
|
||||
pageSize:10,//分页栏当前每个数据总数
|
||||
pageNum:1,//分页栏当前页数
|
||||
totalSize:1000,//table表格数据总数
|
||||
@ -99,18 +101,18 @@ export default {
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val;
|
||||
this.$nextTick(()=>{
|
||||
this.init(false)
|
||||
this.getTableData()
|
||||
})
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageNum = val
|
||||
this.$nextTick(()=>{
|
||||
this.init(false)
|
||||
this.getTableData()
|
||||
})
|
||||
},
|
||||
// 搜索
|
||||
onSearch(){
|
||||
this.init(false)
|
||||
this.getTableData()
|
||||
},
|
||||
// 重置
|
||||
// 清空搜索栏选中数据
|
||||
@ -118,7 +120,7 @@ export default {
|
||||
onReset(){
|
||||
this.search={stackId:'',clusterId:''}
|
||||
this.clusterOptions=[]
|
||||
this.init(false)
|
||||
this.getTableData()
|
||||
},
|
||||
changeStackId(val){
|
||||
if(val){
|
||||
@ -127,6 +129,15 @@ export default {
|
||||
this.getClusterList()
|
||||
}
|
||||
},
|
||||
//表格数据
|
||||
getTableData(){
|
||||
this.loading=true;
|
||||
getClusterDataInfoList(this.search.stackId,this.search.clusterId,this.pageNum).then(response => {
|
||||
this.tableData=response?.data || [];
|
||||
}).finally(()=>{
|
||||
this.loading=false;
|
||||
})
|
||||
},
|
||||
getStackList(){
|
||||
getStackNameList(this.siteId).then(response => {
|
||||
this.stackOptions = JSON.parse(JSON.stringify(response?.data || []))
|
||||
@ -138,17 +149,11 @@ export default {
|
||||
this.clusterOptions = JSON.parse(JSON.stringify(response?.data || []))
|
||||
}).finally(() => {this.clusterloading =false})
|
||||
},
|
||||
init(mounted = true){
|
||||
this.loading=true;
|
||||
// todo 获取单体电池数据
|
||||
this.loading=false;
|
||||
// this.$refs.barChart.setOption()
|
||||
init(){
|
||||
// 只有页面初次加载或切换站点的时候调用电池堆列表,其他情况不需要
|
||||
if(mounted){
|
||||
this.search={stackId:'',clusterId:''}//保证切换站点时,清空选择项
|
||||
this.getStackList()
|
||||
}
|
||||
|
||||
this.getTableData()
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
|
Reference in New Issue
Block a user