Files
emsfront/src/views/ems/site/sblb/PointTable.vue

127 lines
3.0 KiB
Vue
Raw Normal View History

2025-09-13 22:41:41 +08:00
<!--电位展示图表-->
<template>
<el-dialog
v-loading="loading"
:close-on-click-modal="false"
2025-09-18 10:07:41 +08:00
:visible.sync="show"
append-to-body
class="ems-dialog"
2025-09-13 22:41:41 +08:00
destroy-on-close
lock-scroll
2025-09-18 10:07:41 +08:00
show-close
title="点位列表"
2025-09-17 17:53:21 +08:00
width="800px"
2025-09-13 22:41:41 +08:00
>
<el-table
:data="tableData"
2025-09-18 10:07:41 +08:00
class="common-table"
2025-09-17 17:53:21 +08:00
max-height="400px"
2025-09-18 10:07:41 +08:00
stripe
2025-09-13 22:41:41 +08:00
style="width: 100%;">
<el-table-column
2025-09-18 10:07:41 +08:00
label="数据点位"
prop="dataPoint">
2025-09-13 22:41:41 +08:00
</el-table-column>
<el-table-column
2025-09-18 10:07:41 +08:00
label="数据点位名称"
prop="dataPointName">
2025-09-13 22:41:41 +08:00
</el-table-column>
2025-09-17 17:53:21 +08:00
<el-table-column
2025-09-18 10:07:41 +08:00
label="最新值"
prop="pointValue">
2025-09-17 17:53:21 +08:00
</el-table-column>
<el-table-column
2025-09-18 10:07:41 +08:00
label="更新时间"
prop="updateTime">
2025-09-17 17:53:21 +08:00
</el-table-column>
2025-09-13 22:41:41 +08:00
</el-table>
<el-pagination
v-show="tableData.length>0"
:current-page="pageNum"
:page-size="pageSize"
:page-sizes="[10, 20, 30, 40]"
2025-09-18 10:07:41 +08:00
:pager-count="5"
2025-09-13 22:41:41 +08:00
:total="totalSize"
2025-09-18 10:07:41 +08:00
background
layout="total, sizes, prev, pager, next, jumper"
small
2025-09-13 22:41:41 +08:00
style="margin-top:15px;text-align: center"
2025-09-18 10:07:41 +08:00
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
2025-09-13 22:41:41 +08:00
>
</el-pagination>
</el-dialog>
</template>
<script>
import {getDevicePointList} from "@/api/ems/site";
export default {
watch:{
show(val) {
if(!val){
this.tableData=[]
this.deviceId=''
this.siteId=''
this.pageSize=10
this.pageNum=1
this.totalSize=0
this.loading =false
}
},
},
data(){
return{
show:false,
loading:false,
deviceCategory:'',
siteId:'',
tableData:[],
pageSize:10,//分页栏当前每个数据总数
pageNum:1,//分页栏当前页数
totalSize:0,//table表格数据总数
}
},
methods:{
2025-09-18 10:07:41 +08:00
showTable({deviceCategory,siteId,deviceId}){
2025-09-13 22:41:41 +08:00
this.deviceCategory =deviceCategory
this.siteId=siteId
2025-09-18 10:07:41 +08:00
this.deviceId=deviceId
this.tableData=[]
this.pageSize=10//分页栏当前每个数据总数
this.pageNum=1//分页栏当前页数
this.totalSize=0//table表格数据总数
2025-09-13 22:41:41 +08:00
this.show=true
this.getData()
},
getData(){
this.loading=true
2025-09-18 10:07:41 +08:00
const {siteId,deviceId,deviceCategory,pageNum,pageSize} =this
getDevicePointList({siteId,deviceId,deviceCategory,pageNum,pageSize}).then(response => {
2025-09-13 22:41:41 +08:00
this.tableData=response?.rows || [];
this.totalSize = response?.total || 0
}).finally(() => {this.loading=false})
},
// 分页
handleSizeChange(val) {
this.pageSize = val;
this.$nextTick(()=>{
this.getData()
})
},
handleCurrentChange(val) {
this.pageNum = val
this.$nextTick(()=>{
this.getData()
})
},
}
}
</script>
2025-09-18 10:07:41 +08:00
<style lang="scss" scoped>
2025-09-13 22:41:41 +08:00
::v-deep {
.card-title .el-radio{
line-height: 40px;
}
}
</style>