设备监控-点位清单

This commit is contained in:
白菜
2025-11-25 17:56:12 +08:00
parent 0b2e7d9b86
commit 1378947a9e
14 changed files with 169 additions and 80 deletions

View File

@ -32,10 +32,10 @@
</el-form-item>
<el-form-item label="modbus ip">
<el-input
v-model="form.ipAddress"
clearable
placeholder="请输入ip"
style="width: 150px"
v-model="form.ipAddress"
clearable
placeholder="请输入ip"
style="width: 150px"
></el-input>
</el-form-item>
<el-form-item label="最小值">
@ -56,10 +56,10 @@
</el-form-item>
<el-form-item label="modbus 端口">
<el-input
v-model="form.ipPort"
clearable
placeholder="请输入端口"
style="width: 150px"
v-model="form.ipPort"
clearable
placeholder="请输入端口"
style="width: 150px"
></el-input>
</el-form-item>
<el-form-item style="margin-left: 20px">
@ -77,12 +77,15 @@
@sort-change="handleSortChange"
>
<el-table-column label="数据点位" prop="dataPoint"> </el-table-column>
<el-table-column label="数据点位名称" prop="pointName"></el-table-column>
<el-table-column
label="modbus地址"
>
label="数据点位名称"
prop="pointName"
></el-table-column>
<el-table-column label="modbus地址">
<template slot-scope="scope">
<span>{{`${scope.row.ipAddress || ''} ${scope.row.ipPort || ''}`}}</span>
<span>{{
`${scope.row.ipAddress || ""} ${scope.row.ipPort || ""}`
}}</span>
</template>
</el-table-column>
<el-table-column
@ -92,19 +95,18 @@
sortable="custom"
>
<template slot-scope="scope">
<span
class="pointer"
@click="
showChart(
scope.row
)
"
>{{ scope.row.pointValue }}</span
>
<span class="pointer" @click="showChart(scope.row)">{{
scope.row.pointValue
}}</span>
</template>
</el-table-column>
<el-table-column label="单位" prop="dataUnit"></el-table-column>
<el-table-column label="更新时间" min-width="160px" prop="updateTime" sortable="custom">
<el-table-column
label="更新时间"
min-width="160px"
prop="updateTime"
sortable="custom"
>
</el-table-column>
</el-table>
<el-pagination
@ -137,29 +139,29 @@ export default {
if (!val) {
this.tableData = [];
this.deviceId = "";
this.parentId='';
this.parentId = "";
this.siteId = "";
this.pageSize = 10;
this.pageNum = 1;
this.totalSize = 0;
this.form = {
sortMethod: "desc", //升序不传或者asc、降序desc
sortData:this.defaultSort.prop,
sortData: this.defaultSort.prop,
dataPointName: "", //点位名称
dataPoint: "", //点位名称
lower: "", //
upper: "", //
ipAddress:'',
ipPort:''
ipAddress: "",
ipPort: "",
};
this.loading = false;
}
},
},
computed:{
isDtdc(){
return this.deviceCategory === 'BATTERY'
}
computed: {
isDtdc() {
return this.deviceCategory === "BATTERY";
},
},
data() {
return {
@ -174,12 +176,12 @@ export default {
dataPoint: "", //点位名称
lower: "", //
upper: "", //
ipAddress:'',
ipPort:''
ipAddress: "",
ipPort: "",
},
deviceCategory: "",
deviceId: "",
parentId:'',
parentId: "",
siteId: "",
tableData: [],
pageSize: 10, //分页栏当前每个数据总数
@ -188,15 +190,26 @@ export default {
};
},
methods: {
showChart({pointName}) {
if(pointName){
const {deviceCategory,deviceId}=this
if(this.isDtdc) this.$refs.pointChart.showChart({ pointName, deviceCategory, deviceId:this.parentId,child:[deviceId] });
else this.$refs.pointChart.showChart({ pointName, deviceCategory, deviceId });
showChart({ pointName }) {
if (pointName) {
const { deviceCategory, deviceId } = this;
if (this.isDtdc)
this.$refs.pointChart.showChart({
pointName,
deviceCategory,
deviceId: this.parentId,
child: [deviceId],
});
else
this.$refs.pointChart.showChart({
pointName,
deviceCategory,
deviceId,
});
}
},
handleSortChange(column) {
this.form.sortData = column.prop
this.form.sortData = column.prop;
this.form.sortMethod = column.order === "descending" ? "desc" : "asc";
console.log("切换排序方式", column, this.form);
this.getData();
@ -205,11 +218,11 @@ export default {
this.pageNum = 1;
this.getData();
},
showTable({ deviceCategory, siteId, deviceId ,parentId=''}) {
showTable({ deviceCategory, siteId, deviceId, parentId = "" }) {
this.deviceCategory = deviceCategory;
this.siteId = siteId;
this.deviceId = deviceId;
this.parentId=deviceCategory === 'BATTERY' ? parentId : ''//只有单体电池需要这个值
this.parentId = deviceCategory === "BATTERY" ? parentId : ""; //只有单体电池需要这个值
this.show = true;
this.getData();
},
@ -230,7 +243,7 @@ export default {
lower,
upper,
ipAddress,
ipPort
ipPort,
},
} = this;
getDevicePointList({
@ -247,7 +260,7 @@ export default {
lower,
upper,
ipAddress,
ipPort
ipPort,
})
.then((response) => {
this.tableData = response?.rows || [];