develop_cloud #1
@ -64,9 +64,9 @@ export function getDeviceList(siteId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//获取设备点位table
|
//获取设备点位table
|
||||||
export function getDevicePointList({siteId,deviceId,deviceCategory,pageNum,pageSize}) {
|
export function getDevicePointList({siteId,deviceId,deviceCategory,pageNum,pageSize,dataPointName=''}) {
|
||||||
return request({
|
return request({
|
||||||
url: `/ems/siteConfig/getDevicePointList?siteId=${siteId}&deviceId=${deviceId}&pageNum=${pageNum}&pageSize=${pageSize}&deviceCategory=${deviceCategory}`,
|
url: `/ems/siteConfig/getDevicePointList?siteId=${siteId}&deviceId=${deviceId}&pageNum=${pageNum}&pageSize=${pageSize}&deviceCategory=${deviceCategory}&dataPointName=${dataPointName}`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -12,6 +12,18 @@
|
|||||||
title="点位列表"
|
title="点位列表"
|
||||||
width="800px"
|
width="800px"
|
||||||
>
|
>
|
||||||
|
<div style="margin-bottom: 20px">
|
||||||
|
<el-input v-model="pointName" placeholder="请输入点位" clearable style="width: 200px"></el-input>
|
||||||
|
<!-- <el-autocomplete-->
|
||||||
|
<!-- v-model="pointName"-->
|
||||||
|
<!-- placeholder="请输入点位"-->
|
||||||
|
<!-- clearable-->
|
||||||
|
<!-- :fetch-suggestions="querySearchAsync"-->
|
||||||
|
<!-- @select="handleSelect"-->
|
||||||
|
<!-- ></el-autocomplete>-->
|
||||||
|
|
||||||
|
<el-button type="primary" style="margin-left: 20px" @click="pointNameSearch">搜索</el-button>
|
||||||
|
</div>
|
||||||
<el-table
|
<el-table
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
class="common-table"
|
class="common-table"
|
||||||
@ -54,6 +66,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import {getDevicePointList} from "@/api/ems/site";
|
import {getDevicePointList} from "@/api/ems/site";
|
||||||
|
import {pointFuzzyQuery} from "@/api/ems/search";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
watch:{
|
watch:{
|
||||||
@ -61,10 +74,12 @@ export default {
|
|||||||
if(!val){
|
if(!val){
|
||||||
this.tableData=[]
|
this.tableData=[]
|
||||||
this.deviceId=''
|
this.deviceId=''
|
||||||
|
this.deviceName=''
|
||||||
this.siteId=''
|
this.siteId=''
|
||||||
this.pageSize=10
|
this.pageSize=10
|
||||||
this.pageNum=1
|
this.pageNum=1
|
||||||
this.totalSize=0
|
this.totalSize=0
|
||||||
|
this.pointName=''
|
||||||
this.loading =false
|
this.loading =false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -73,7 +88,10 @@ export default {
|
|||||||
return{
|
return{
|
||||||
show:false,
|
show:false,
|
||||||
loading:false,
|
loading:false,
|
||||||
|
pointName:'',//点位名称
|
||||||
deviceCategory:'',
|
deviceCategory:'',
|
||||||
|
deviceName:'',
|
||||||
|
deviceId:'',
|
||||||
siteId:'',
|
siteId:'',
|
||||||
tableData:[],
|
tableData:[],
|
||||||
pageSize:10,//分页栏当前每个数据总数
|
pageSize:10,//分页栏当前每个数据总数
|
||||||
@ -82,21 +100,22 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
showTable({deviceCategory,siteId,deviceId}){
|
pointNameSearch(){
|
||||||
|
this.pageNum=1
|
||||||
|
this.getData()
|
||||||
|
},
|
||||||
|
showTable({deviceCategory,siteId,deviceId,deviceName}){
|
||||||
this.deviceCategory =deviceCategory
|
this.deviceCategory =deviceCategory
|
||||||
this.siteId=siteId
|
this.siteId=siteId
|
||||||
this.deviceId=deviceId
|
this.deviceId=deviceId
|
||||||
this.tableData=[]
|
this.deviceName=deviceName
|
||||||
this.pageSize=10//分页栏当前每个数据总数
|
|
||||||
this.pageNum=1//分页栏当前页数
|
|
||||||
this.totalSize=0//table表格数据总数
|
|
||||||
this.show=true
|
this.show=true
|
||||||
this.getData()
|
this.getData()
|
||||||
},
|
},
|
||||||
getData(){
|
getData(){
|
||||||
this.loading=true
|
this.loading=true
|
||||||
const {siteId,deviceId,deviceCategory,pageNum,pageSize} =this
|
const {siteId,deviceId,deviceCategory,pageNum,pageSize,pointName} =this
|
||||||
getDevicePointList({siteId,deviceId,deviceCategory,pageNum,pageSize}).then(response => {
|
getDevicePointList({siteId,deviceId,deviceCategory,pageNum,pageSize,dataPointName:pointName}).then(response => {
|
||||||
this.tableData=response?.rows || [];
|
this.tableData=response?.rows || [];
|
||||||
this.totalSize = response?.total || 0
|
this.totalSize = response?.total || 0
|
||||||
}).finally(() => {this.loading=false})
|
}).finally(() => {this.loading=false})
|
||||||
@ -114,6 +133,23 @@ export default {
|
|||||||
this.getData()
|
this.getData()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
//点位
|
||||||
|
handleSelect(data){
|
||||||
|
this.pointName = data.value
|
||||||
|
},
|
||||||
|
querySearchAsync(query,cb){
|
||||||
|
console.log('查询数据',query)
|
||||||
|
pointFuzzyQuery({
|
||||||
|
siteIds:[this.siteId],
|
||||||
|
categoryName:this.deviceName,
|
||||||
|
pointName:query,
|
||||||
|
}).then(response => {
|
||||||
|
const data = response?.data || []
|
||||||
|
cb(data.map(item => {
|
||||||
|
return {name: item, value: item}
|
||||||
|
}))
|
||||||
|
})
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -152,7 +152,7 @@ export default {
|
|||||||
methods:{
|
methods:{
|
||||||
// 查看设备电位表格
|
// 查看设备电位表格
|
||||||
pointDetail(row){
|
pointDetail(row){
|
||||||
this.$refs.pointTable.showTable({deviceCategory:row.deviceCategory,siteId:row.siteId,deviceId:row.deviceId})
|
this.$refs.pointTable.showTable(row)
|
||||||
},
|
},
|
||||||
clearEditDeviceData(){
|
clearEditDeviceData(){
|
||||||
this.mode = '';
|
this.mode = '';
|
||||||
|
|||||||
Reference in New Issue
Block a user