点位、报警点位

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,19 +1,19 @@
<template>
<div>
<el-table
class="common-table"
:data="tableData"
stripe
style="width: 100%; margin-top: 25px"
class="common-table"
:data="tableData"
stripe
style="width: 100%; margin-top: 25px"
>
<el-table-column prop="deviceId" label="单体编号"> </el-table-column>
<el-table-column prop="clusterDeviceId" label="簇号"> </el-table-column>
<el-table-column prop="deviceId" label="单体编号"></el-table-column>
<el-table-column prop="clusterDeviceId" label="簇号"></el-table-column>
<el-table-column prop="voltage" label="电压 (V)">
<template slot-scope="scope">
<el-button
@click="chartDetail(scope.row, '电压 (V)')"
type="text"
size="small"
@click="chartDetail(scope.row, '电压 (V)')"
type="text"
size="small"
>
{{ scope.row.voltage }}
</el-button>
@ -22,9 +22,9 @@
<el-table-column prop="temperature" label="温度 (℃)">
<template slot-scope="scope">
<el-button
@click="chartDetail(scope.row, '温度 (℃)')"
type="text"
size="small"
@click="chartDetail(scope.row, '温度 (℃)')"
type="text"
size="small"
>
{{ scope.row.temperature }}
</el-button>
@ -33,9 +33,9 @@
<el-table-column prop="soc" label="SOC (%)">
<template slot-scope="scope">
<el-button
@click="chartDetail(scope.row, 'SOC (%)')"
type="text"
size="small"
@click="chartDetail(scope.row, 'SOC (%)')"
type="text"
size="small"
>
{{ scope.row.soc }}
</el-button>
@ -44,15 +44,15 @@
<el-table-column prop="soh" label="SOH (%)">
<template slot-scope="scope">
<el-button
@click="chartDetail(scope.row, 'SOH (%)')"
type="text"
size="small"
@click="chartDetail(scope.row, 'SOH (%)')"
type="text"
size="small"
>
{{ scope.row.soh }}
</el-button>
</template>
</el-table-column>
<el-table-column label="操作">
<el-table-column label="操作" width="160">
<template slot-scope="scope">
<el-button @click="$emit('pointDetail',scope.row,'point')" type="text" size="small">
详细
@ -118,7 +118,7 @@ export default {
methods: {
//查看表格行图表
chartDetail(row, dataType = "") {
this.$emit("chart", { ...row, dataType });
this.$emit("chart", {...row, dataType});
},
},
};

View File

@ -2,140 +2,140 @@
<template>
<div>
<el-dialog
v-loading="loading"
:close-on-click-modal="false"
:visible.sync="show"
append-to-body
class="ems-dialog"
destroy-on-close
lock-scroll
show-close
:title="dataType === 'point' ? '点位清单' : '报警点位'"
width="950px"
v-loading="loading"
:close-on-click-modal="false"
:visible.sync="show"
append-to-body
class="ems-dialog"
destroy-on-close
lock-scroll
show-close
:title="dataType === 'point' ? '点位清单' : '报警点位'"
width="950px"
>
<el-form :inline="true" label-width="100px">
<el-form-item label="点位名称">
<el-input
v-model="form.dataPointName"
clearable
placeholder="请输入点位名称"
style="width: 150px"
v-model="form.dataPointName"
clearable
placeholder="请输入点位名称"
style="width: 150px"
></el-input>
</el-form-item>
<el-form-item label="点位">
<el-input
v-model="form.dataPoint"
clearable
placeholder="请输入点位"
style="width: 150px"
v-model="form.dataPoint"
clearable
placeholder="请输入点位"
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"
clearable
placeholder="请输入最小值"
style="width: 150px"
v-model="form.lower"
clearable
placeholder="请输入最小值"
style="width: 150px"
></el-input>
</el-form-item>
<el-form-item label="最大值">
<el-input
v-model="form.upper"
clearable
placeholder="请输入最大值"
style="width: 150px"
v-model="form.upper"
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 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>
</el-form>
<el-table
:data="tableData"
class="common-table"
max-height="400px"
stripe
style="width: 100%"
:default-sort="defaultSort"
@sort-change="handleSortChange"
:data="tableData"
class="common-table"
max-height="400px"
stripe
style="width: 100%"
:default-sort="defaultSort"
@sort-change="handleSortChange"
>
<el-table-column label="数据点位" prop="dataPoint"> </el-table-column>
<el-table-column label="数据点位" prop="dataPoint"></el-table-column>
<el-table-column
label="数据点位名称"
prop="pointName"
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"
align="right"
sortable="custom"
label="最新值"
prop="pointValue"
align="right"
sortable="custom"
>
<template slot-scope="scope">
<span class="pointer" @click="showChart(scope.row)">{{
scope.row.pointValue
}}</span>
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"
label="更新时间"
min-width="160px"
prop="updateTime"
sortable="custom"
>
</el-table-column>
</el-table>
<el-pagination
v-show="tableData.length > 0"
:current-page="pageNum"
:page-size="pageSize"
:page-sizes="[10, 20, 30, 40]"
:pager-count="5"
:total="totalSize"
background
layout="total, sizes, prev, pager, next, jumper"
small
style="margin-top: 15px; text-align: center"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
v-show="tableData.length > 0"
:current-page="pageNum"
:page-size="pageSize"
:page-sizes="[10, 20, 30, 40]"
:pager-count="5"
:total="totalSize"
background
layout="total, sizes, prev, pager, next, jumper"
small
style="margin-top: 15px; text-align: center"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
>
</el-pagination>
</el-dialog>
<point-chart ref="pointChart" :site-id="siteId" />
<point-chart ref="pointChart" :site-id="siteId"/>
</div>
</template>
<script>
import { getDevicePointList } from "@/api/ems/site";
import {getDevicePointList} from "@/api/ems/site";
import pointChart from "@/views/ems/dzjk/sbjk/PointChart.vue";
export default {
components: { pointChart },
components: {pointChart},
watch: {
show(val) {
if (!val) {
@ -169,10 +169,10 @@ export default {
data() {
return {
// 默认排序
defaultSort: { prop: "updateTime", order: "descending" },
defaultSort: {prop: "updateTime", order: "descending"},
show: false,
loading: false,
dataType:'',//展示的数据类型 point点位/alarmPoint报警点位
dataType: '',//展示的数据类型 point点位/alarmPoint报警点位
form: {
sortData: "updateTime", //最新值升序不传或者asc、降序desc
sortMethod: "desc", //升序不传或者asc、降序desc
@ -194,9 +194,9 @@ export default {
};
},
methods: {
showChart({ pointName }) {
showChart({pointName}) {
if (pointName) {
const { deviceCategory, deviceId } = this;
const {deviceCategory, deviceId} = this;
if (this.isDtdc)
this.$refs.pointChart.showChart({
pointName,
@ -235,7 +235,7 @@ export default {
this.getData()
});
},
showTable({ deviceCategory, siteId, deviceId, parentId = "" },dataType) {
showTable({deviceCategory, siteId, deviceId, parentId = ""}, dataType) {
this.dataType = dataType;
this.deviceCategory = deviceCategory;
this.siteId = siteId;
@ -244,28 +244,6 @@ export default {
this.show = true;
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() {
const {
siteId,
@ -298,10 +276,19 @@ export default {
dataPoint,
lower,
upper,
ipAddress:'',
ipPort:'',
// ipAddress: '',
// 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;
});
},
},
};