电表、单体电池接口联调
This commit is contained in:
@ -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.search={stackId:'',clusterId:''}//保证切换站点时,清空选择项
|
||||
this.getStackList()
|
||||
this.getTableData()
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
|
Reference in New Issue
Block a user