点位、报警点位

This commit is contained in:
白菜
2025-12-05 09:46:31 +08:00
parent cd8871d45a
commit 7f3d02b8fb
3 changed files with 240 additions and 243 deletions

View File

@ -1,4 +1,5 @@
import request from '@/utils/request' import request from '@/utils/request'
// 站点列表 // 站点列表
export function getSiteInfoList({siteName, startTime, endTime, pageSize, pageNum}) { export function getSiteInfoList({siteName, startTime, endTime, pageSize, pageNum}) {
return request({ return request({
@ -39,6 +40,7 @@ export function addDevice(data) {
data data
}) })
} }
// 编辑设备 // 编辑设备
export function updateDevice(data) { export function updateDevice(data) {
return request({ return request({
@ -47,6 +49,7 @@ export function updateDevice(data) {
data data
}) })
} }
// 删除设备 // 删除设备
export function deleteService(id) { export function deleteService(id) {
return request({ return request({
@ -54,6 +57,7 @@ export function deleteService(id) {
method: 'delete', method: 'delete',
}) })
} }
// 获取上级设备id列表 // 获取上级设备id列表
export function getParentDeviceId({siteId, deviceCategory}) { export function getParentDeviceId({siteId, deviceCategory}) {
return request({ return request({
@ -61,6 +65,7 @@ export function getParentDeviceId({siteId,deviceCategory}) {
method: 'get', method: 'get',
}) })
} }
//获取所有设备 //获取所有设备
export function getDeviceList(siteId) { export function getDeviceList(siteId) {
return request({ return request({
@ -70,10 +75,11 @@ export function getDeviceList(siteId) {
} }
//获取设备点位table //获取设备点位table
export function getDevicePointList({siteId,deviceId,deviceCategory,parentId,pageNum,pageSize,dataPointName='',sortMethod,sortData,dataPoint,lower,upper,ipAddress,ipPort}) { export function getDevicePointList(data) {
return request({ return request({
url: `/ems/siteConfig/getDevicePointList?siteId=${siteId}&deviceId=${deviceId}&pageNum=${pageNum}&pageSize=${pageSize}&deviceCategory=${deviceCategory}&dataPointName=${dataPointName}&parentId=${parentId}&dataPoint=${dataPoint}&lower=${lower}&upper=${upper}&pageNum=${pageNum}&sortMethod=${sortMethod}&sortData=${sortData}&ipAddress=${ipAddress}&ipPort=${ipPort}`, url: `/ems/siteConfig/getDevicePointList`,
method: 'get', method: 'get',
params: data
}) })
} }
@ -137,6 +143,7 @@ export function exportPointList(data) {
data data
}) })
} }
// 点位导入 // 点位导入
export function importPointList(data) { export function importPointList(data) {
return request({ return request({
@ -147,7 +154,6 @@ export function importPointList(data) {
} }
//mqtt //mqtt
export function getMqttList({pageSize, pageNum, mqttTopic, topicName, siteId}) { export function getMqttList({pageSize, pageNum, mqttTopic, topicName, siteId}) {
return request({ return request({
@ -155,12 +161,14 @@ export function getMqttList({pageSize,pageNum,mqttTopic,topicName,siteId}) {
method: 'get', method: 'get',
}) })
} }
export function getMqttDetail(id) { export function getMqttDetail(id) {
return request({ return request({
url: `/ems/mqttConfig/${id}`, url: `/ems/mqttConfig/${id}`,
method: 'get', method: 'get',
}) })
} }
export function addMqtt(data) { export function addMqtt(data) {
return request({ return request({
url: `/ems/mqttConfig`, url: `/ems/mqttConfig`,
@ -168,6 +176,7 @@ export function addMqtt(data) {
data data
}) })
} }
export function editMqtt(data) { export function editMqtt(data) {
return request({ return request({
url: `/ems/mqttConfig`, url: `/ems/mqttConfig`,
@ -175,6 +184,7 @@ export function editMqtt(data) {
data data
}) })
} }
export function deleteMqtt(id) { export function deleteMqtt(id) {
return request({ return request({
url: `/ems/mqttConfig/${id}`, url: `/ems/mqttConfig/${id}`,

View File

@ -52,7 +52,7 @@
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button @click="$emit('pointDetail',scope.row,'point')" type="text" size="small"> <el-button @click="$emit('pointDetail',scope.row,'point')" type="text" size="small">
详细 详细

View File

@ -244,28 +244,6 @@ export default {
this.show = true; this.show = true;
this.getData() this.getData()
}, },
getAlarmPointData(param){
this.loading = true;
getDevicePointList(param)
.then((response) => {
this.tableData = response?.rows || [];
this.totalSize = response?.total || 0;
})
.finally(() => {
this.loading = false;
});
},
getPointData(param){
this.loading = true;
getDevicePointList(param)
.then((response) => {
this.tableData = response?.rows || [];
this.totalSize = response?.total || 0;
})
.finally(() => {
this.loading = false;
});
},
getData() { getData() {
const { const {
siteId, siteId,
@ -298,10 +276,19 @@ export default {
dataPoint, dataPoint,
lower, lower,
upper, upper,
ipAddress:'', // ipAddress: '',
ipPort:'', // ipPort: '',
} }
this.dataType === 'point' ? this.getPointData(params) : this.getAlarmPointData(params) params.isAlarm = this.dataType === 'point' ? 0 : 1
this.loading = true;
getDevicePointList(params)
.then((response) => {
this.tableData = response?.rows || [];
this.totalSize = response?.total || 0;
})
.finally(() => {
this.loading = false;
});
}, },
}, },
}; };