2025-11-20紧急优化内容
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
destroy-on-close
|
||||
lock-scroll
|
||||
show-close
|
||||
title="点位清单"
|
||||
:title="dataType === 'point' ? '点位清单' : '报警点位'"
|
||||
width="950px"
|
||||
>
|
||||
<el-form :inline="true" label-width="100px">
|
||||
@ -30,14 +30,15 @@
|
||||
style="width: 150px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="modbus ip">
|
||||
<el-input
|
||||
v-model="form.ipAddress"
|
||||
clearable
|
||||
placeholder="请输入ip"
|
||||
style="width: 150px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="modbus ip">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="form.ipAddress"-->
|
||||
<!-- clearable-->
|
||||
<!-- placeholder="请输入ip"-->
|
||||
<!-- style="width: 150px"-->
|
||||
<!-- ></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<br>
|
||||
<el-form-item label="最小值">
|
||||
<el-input
|
||||
v-model="form.lower"
|
||||
@ -54,14 +55,14 @@
|
||||
style="width: 150px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="modbus 端口">
|
||||
<el-input
|
||||
v-model="form.ipPort"
|
||||
clearable
|
||||
placeholder="请输入端口"
|
||||
style="width: 150px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="modbus 端口">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="form.ipPort"-->
|
||||
<!-- clearable-->
|
||||
<!-- placeholder="请输入端口"-->
|
||||
<!-- style="width: 150px"-->
|
||||
<!-- ></el-input>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item style="margin-left: 20px">
|
||||
<el-button type="primary" @click="search">搜索</el-button>
|
||||
</el-form-item>
|
||||
@ -81,13 +82,14 @@
|
||||
label="数据点位名称"
|
||||
prop="pointName"
|
||||
></el-table-column>
|
||||
<el-table-column label="modbus地址">
|
||||
<template slot-scope="scope">
|
||||
<span>{{
|
||||
`${scope.row.ipAddress || ""} ${scope.row.ipPort || ""}`
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="modbus地址">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <span>{{-->
|
||||
<!-- `${scope.row.ipAddress || ""} ${scope.row.ipPort || ""}`-->
|
||||
<!-- }}</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="寄存器地址" prop="寄存器地址"></el-table-column>
|
||||
<el-table-column
|
||||
label="最新值"
|
||||
prop="pointValue"
|
||||
@ -144,6 +146,7 @@ export default {
|
||||
this.pageSize = 10;
|
||||
this.pageNum = 1;
|
||||
this.totalSize = 0;
|
||||
this.dataType = '';
|
||||
this.form = {
|
||||
sortMethod: "desc", //升序不传或者asc、降序desc)
|
||||
sortData: this.defaultSort.prop,
|
||||
@ -151,8 +154,8 @@ export default {
|
||||
dataPoint: "", //点位名称
|
||||
lower: "", //
|
||||
upper: "", //
|
||||
ipAddress: "",
|
||||
ipPort: "",
|
||||
// ipAddress: "",
|
||||
// ipPort: "",
|
||||
};
|
||||
this.loading = false;
|
||||
}
|
||||
@ -169,6 +172,7 @@ export default {
|
||||
defaultSort: { prop: "updateTime", order: "descending" },
|
||||
show: false,
|
||||
loading: false,
|
||||
dataType:'',//展示的数据类型 point点位/alarmPoint报警点位
|
||||
form: {
|
||||
sortData: "updateTime", //最新值升序不传或者asc、降序desc)
|
||||
sortMethod: "desc", //升序不传或者asc、降序desc)
|
||||
@ -176,8 +180,8 @@ export default {
|
||||
dataPoint: "", //点位名称
|
||||
lower: "", //
|
||||
upper: "", //
|
||||
ipAddress: "",
|
||||
ipPort: "",
|
||||
// ipAddress: "",
|
||||
// ipPort: "",
|
||||
},
|
||||
deviceCategory: "",
|
||||
deviceId: "",
|
||||
@ -212,22 +216,57 @@ export default {
|
||||
this.form.sortData = column.prop;
|
||||
this.form.sortMethod = column.order === "descending" ? "desc" : "asc";
|
||||
console.log("切换排序方式", column, this.form);
|
||||
this.getData();
|
||||
this.getData()
|
||||
},
|
||||
search() {
|
||||
this.pageNum = 1;
|
||||
this.getData();
|
||||
this.getData()
|
||||
},
|
||||
showTable({ deviceCategory, siteId, deviceId, parentId = "" }) {
|
||||
// 分页
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val;
|
||||
this.$nextTick(() => {
|
||||
this.getData()
|
||||
});
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageNum = val;
|
||||
this.$nextTick(() => {
|
||||
this.getData()
|
||||
});
|
||||
},
|
||||
showTable({ deviceCategory, siteId, deviceId, parentId = "" },dataType) {
|
||||
this.dataType = dataType;
|
||||
this.deviceCategory = deviceCategory;
|
||||
this.siteId = siteId;
|
||||
this.deviceId = deviceId;
|
||||
this.parentId = deviceCategory === "BATTERY" ? parentId : ""; //只有单体电池需要这个值
|
||||
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() {
|
||||
this.loading = true;
|
||||
const {
|
||||
siteId,
|
||||
deviceId,
|
||||
@ -242,11 +281,11 @@ export default {
|
||||
dataPoint,
|
||||
lower,
|
||||
upper,
|
||||
ipAddress,
|
||||
ipPort,
|
||||
// ipAddress,
|
||||
// ipPort,
|
||||
},
|
||||
} = this;
|
||||
getDevicePointList({
|
||||
const params = {
|
||||
siteId,
|
||||
deviceId,
|
||||
deviceCategory,
|
||||
@ -259,29 +298,10 @@ export default {
|
||||
dataPoint,
|
||||
lower,
|
||||
upper,
|
||||
ipAddress,
|
||||
ipPort,
|
||||
})
|
||||
.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();
|
||||
});
|
||||
ipAddress:'',
|
||||
ipPort:'',
|
||||
}
|
||||
this.dataType === 'point' ? this.getPointData(params) : this.getAlarmPointData(params)
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user