设备列表查看电位表格

This commit is contained in:
白菜
2025-09-13 22:41:41 +08:00
parent 4c31eeb837
commit 98e2c4c3be
3 changed files with 136 additions and 2 deletions

View File

@ -62,3 +62,11 @@ export function getDeviceList(siteId) {
method: 'get',
})
}
//获取设备点位table
export function getDevicePointList({siteId,deviceCategory,pageNum,pageSize}) {
return request({
url: `/ems/siteConfig/getDevicePointList?siteId=${siteId}&pageNum=${pageNum}&pageSize=${pageSize}&deviceCategory=${deviceCategory}`,
method: 'get',
})
}

View File

@ -0,0 +1,114 @@
<!--电位展示图表-->
<template>
<el-dialog
v-loading="loading"
:visible.sync="show"
title="点位列表"
:close-on-click-modal="false"
show-close
destroy-on-close
lock-scroll
append-to-body
width="600px"
class="ems-dialog"
>
<el-table
class="common-table"
:data="tableData"
stripe
max-height="600px"
style="width: 100%;">
<el-table-column
prop="dataPoint"
label="数据点位">
</el-table-column>
<el-table-column
prop="dataPointName"
label="数据点位名称">
</el-table-column>
</el-table>
<el-pagination
v-show="tableData.length>0"
small
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:pager-count="5"
:current-page="pageNum"
:page-size="pageSize"
:page-sizes="[10, 20, 30, 40]"
layout="total, sizes, prev, pager, next, jumper"
:total="totalSize"
style="margin-top:15px;text-align: center"
>
</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:{
showTable({deviceCategory,siteId}){
this.deviceCategory =deviceCategory
this.siteId=siteId
this.show=true
this.getData()
},
getData(){
this.loading=true
const {siteId,deviceCategory,pageNum,pageSize} =this
getDevicePointList({siteId,deviceCategory,pageNum,pageSize}).then(response => {
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>
<style scoped lang="scss">
::v-deep {
.card-title .el-radio{
line-height: 40px;
}
}
</style>

View File

@ -50,7 +50,7 @@
<el-table-column
fixed="right"
label="操作"
width="150">
width="260">
<template slot-scope="scope">
<!-- <el-button-->
<!-- @click="toDetail(scope.row.id)"-->
@ -58,6 +58,12 @@
<!-- size="mini">-->
<!-- 查看详情-->
<!-- </el-button>-->
<el-button
@click="pointDetail(scope.row)"
type="primary"
size="mini">
电位列表
</el-button>
<el-button
@click="editDevice(scope.row)"
type="warning"
@ -94,6 +100,7 @@
</div>
</el-dialog>
<add-device ref="addDevice" :mode="mode" :id="editDeviceId" @update="getData" @clear="clearEditDeviceData"/>
<point-table ref="pointTable"/>
</div>
</template>
@ -101,10 +108,11 @@
import {getDeviceInfoList,getDeviceDetailInfo,deleteService} from'@/api/ems/site'
import {getAllSites} from '@/api/ems/zddt'
import {formatNumber} from "@/filters/ems";
import PointTable from './PointTable.vue'
import AddDevice from "./AddDevice.vue";
export default {
name: "Sblb",
components:{AddDevice},
components:{AddDevice,PointTable},
data() {
return {
loading:false,
@ -142,6 +150,10 @@ export default {
}
},
methods:{
// 查看设备电位表格
pointDetail(row){
this.$refs.pointTable.showTable({deviceCategory:row.deviceCategory,siteId:row.siteId})
},
clearEditDeviceData(){
this.mode = '';
this.editDeviceId=''