2025-09-13 22:41:41 +08:00
|
|
|
|
<!--电位展示图表-->
|
|
|
|
|
|
<template>
|
2025-10-12 23:10:15 +08:00
|
|
|
|
<div>
|
|
|
|
|
|
<el-dialog
|
2025-09-13 22:41:41 +08:00
|
|
|
|
v-loading="loading"
|
|
|
|
|
|
:close-on-click-modal="false"
|
2025-09-18 10:07:41 +08:00
|
|
|
|
:visible.sync="show"
|
|
|
|
|
|
append-to-body
|
|
|
|
|
|
class="ems-dialog"
|
2025-09-13 22:41:41 +08:00
|
|
|
|
destroy-on-close
|
|
|
|
|
|
lock-scroll
|
2025-09-18 10:07:41 +08:00
|
|
|
|
show-close
|
2025-09-25 17:30:16 +08:00
|
|
|
|
title="点位清单"
|
2025-09-17 17:53:21 +08:00
|
|
|
|
width="800px"
|
2025-10-12 23:10:15 +08:00
|
|
|
|
>
|
|
|
|
|
|
<el-form :inline="true" label-width="85px">
|
|
|
|
|
|
<el-form-item label="点位名称">
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
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"
|
|
|
|
|
|
></el-input>
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
<br />
|
|
|
|
|
|
<el-form-item label="最小值">
|
|
|
|
|
|
<el-input
|
|
|
|
|
|
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"
|
|
|
|
|
|
></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>
|
2025-09-25 17:30:16 +08:00
|
|
|
|
|
2025-10-12 23:10:15 +08:00
|
|
|
|
<el-table
|
2025-09-13 22:41:41 +08:00
|
|
|
|
:data="tableData"
|
2025-09-18 10:07:41 +08:00
|
|
|
|
class="common-table"
|
2025-09-17 17:53:21 +08:00
|
|
|
|
max-height="400px"
|
2025-09-18 10:07:41 +08:00
|
|
|
|
stripe
|
2025-10-12 23:10:15 +08:00
|
|
|
|
style="width: 100%"
|
2025-10-15 14:26:06 +08:00
|
|
|
|
:default-sort="defaultSort"
|
|
|
|
|
|
@sort-change="handleSortChange"
|
2025-10-12 23:10:15 +08:00
|
|
|
|
>
|
|
|
|
|
|
<el-table-column label="数据点位" prop="dataPoint"> </el-table-column>
|
|
|
|
|
|
<el-table-column label="数据点位名称" prop="pointName">
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column
|
2025-09-18 10:07:41 +08:00
|
|
|
|
label="最新值"
|
2025-10-12 23:10:15 +08:00
|
|
|
|
prop="pointValue"
|
|
|
|
|
|
align="right"
|
2025-09-25 17:30:16 +08:00
|
|
|
|
sortable="custom"
|
2025-10-12 23:10:15 +08:00
|
|
|
|
>
|
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
|
<span
|
|
|
|
|
|
class="pointer"
|
|
|
|
|
|
@click="
|
|
|
|
|
|
showChart(
|
|
|
|
|
|
scope.row.pointName,
|
|
|
|
|
|
scope.row.deviceName,
|
|
|
|
|
|
scope.row.deviceId
|
|
|
|
|
|
)
|
|
|
|
|
|
"
|
|
|
|
|
|
>{{ scope.row.pointValue }}</span
|
|
|
|
|
|
>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
</el-table-column>
|
2025-10-15 14:26:06 +08:00
|
|
|
|
<el-table-column label="单位" prop="dataUnit"></el-table-column>
|
2025-10-12 23:10:15 +08:00
|
|
|
|
<el-table-column label="更新时间" prop="updateTime" sortable="custom">
|
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
</el-table>
|
|
|
|
|
|
<el-pagination
|
|
|
|
|
|
v-show="tableData.length > 0"
|
2025-09-13 22:41:41 +08:00
|
|
|
|
:current-page="pageNum"
|
|
|
|
|
|
:page-size="pageSize"
|
|
|
|
|
|
:page-sizes="[10, 20, 30, 40]"
|
2025-09-18 10:07:41 +08:00
|
|
|
|
:pager-count="5"
|
2025-09-13 22:41:41 +08:00
|
|
|
|
:total="totalSize"
|
2025-09-18 10:07:41 +08:00
|
|
|
|
background
|
|
|
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
|
|
small
|
2025-10-12 23:10:15 +08:00
|
|
|
|
style="margin-top: 15px; text-align: center"
|
2025-09-18 10:07:41 +08:00
|
|
|
|
@size-change="handleSizeChange"
|
|
|
|
|
|
@current-change="handleCurrentChange"
|
2025-10-12 23:10:15 +08:00
|
|
|
|
>
|
|
|
|
|
|
</el-pagination>
|
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
<point-chart ref="pointChart" :site-id="siteId" />
|
|
|
|
|
|
</div>
|
2025-09-13 22:41:41 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
<script>
|
2025-10-12 23:10:15 +08:00
|
|
|
|
import { getDevicePointList } from "@/api/ems/site";
|
|
|
|
|
|
import pointChart from "@/views/ems/dzjk/sbjk/PointChart.vue";
|
2025-09-13 22:41:41 +08:00
|
|
|
|
|
|
|
|
|
|
export default {
|
2025-10-12 23:10:15 +08:00
|
|
|
|
components: { pointChart },
|
2025-09-25 17:30:16 +08:00
|
|
|
|
watch: {
|
2025-09-13 22:41:41 +08:00
|
|
|
|
show(val) {
|
2025-09-25 17:30:16 +08:00
|
|
|
|
if (!val) {
|
2025-10-12 23:10:15 +08:00
|
|
|
|
this.tableData = [];
|
|
|
|
|
|
this.deviceId = "";
|
|
|
|
|
|
this.deviceName = "";
|
|
|
|
|
|
this.siteId = "";
|
|
|
|
|
|
this.pageSize = 10;
|
|
|
|
|
|
this.pageNum = 1;
|
|
|
|
|
|
this.totalSize = 0;
|
2025-09-25 17:30:16 +08:00
|
|
|
|
this.form = {
|
2025-10-12 23:10:15 +08:00
|
|
|
|
sortMethod: "desc", //升序不传或者asc、降序desc)
|
2025-10-15 14:26:06 +08:00
|
|
|
|
sortData:this.defaultSort.prop,
|
2025-10-12 23:10:15 +08:00
|
|
|
|
dataPointName: "", //点位名称
|
|
|
|
|
|
dataPoint: "", //点位名称
|
|
|
|
|
|
lower: "", //
|
|
|
|
|
|
upper: "", //
|
|
|
|
|
|
};
|
|
|
|
|
|
this.loading = false;
|
2025-09-13 22:41:41 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
2025-09-25 17:30:16 +08:00
|
|
|
|
data() {
|
|
|
|
|
|
return {
|
2025-10-15 14:26:06 +08:00
|
|
|
|
// 默认排序
|
|
|
|
|
|
defaultSort: { prop: "updateTime", order: "descending" },
|
2025-09-25 17:30:16 +08:00
|
|
|
|
show: false,
|
|
|
|
|
|
loading: false,
|
|
|
|
|
|
form: {
|
2025-10-15 14:26:06 +08:00
|
|
|
|
sortData: "updateTime", //最新值升序不传或者asc、降序desc)
|
2025-10-12 23:10:15 +08:00
|
|
|
|
sortMethod: "desc", //升序不传或者asc、降序desc)
|
|
|
|
|
|
dataPointName: "", //点位名称
|
|
|
|
|
|
dataPoint: "", //点位名称
|
|
|
|
|
|
lower: "", //
|
|
|
|
|
|
upper: "", //
|
2025-09-25 17:30:16 +08:00
|
|
|
|
},
|
2025-10-12 23:10:15 +08:00
|
|
|
|
deviceCategory: "",
|
|
|
|
|
|
deviceName: "",
|
|
|
|
|
|
deviceId: "",
|
|
|
|
|
|
siteId: "",
|
2025-09-25 17:30:16 +08:00
|
|
|
|
tableData: [],
|
2025-10-12 23:10:15 +08:00
|
|
|
|
pageSize: 10, //分页栏当前每个数据总数
|
|
|
|
|
|
pageNum: 1, //分页栏当前页数
|
|
|
|
|
|
totalSize: 0, //table表格数据总数
|
|
|
|
|
|
};
|
2025-09-13 22:41:41 +08:00
|
|
|
|
},
|
2025-09-25 17:30:16 +08:00
|
|
|
|
methods: {
|
2025-10-12 23:10:15 +08:00
|
|
|
|
showChart(pointName, deviceName, deviceId) {
|
|
|
|
|
|
console.log("点击查询图表", pointName, deviceName, deviceId);
|
|
|
|
|
|
pointName &&
|
|
|
|
|
|
this.$refs.pointChart.showChart({ pointName, deviceName, deviceId });
|
|
|
|
|
|
},
|
2025-10-15 14:26:06 +08:00
|
|
|
|
handleSortChange(column) {
|
|
|
|
|
|
this.form.sortData = column.prop
|
|
|
|
|
|
this.form.sortMethod = column.order === "descending" ? "desc" : "asc";
|
|
|
|
|
|
console.log("切换排序方式", column, this.form);
|
|
|
|
|
|
this.getData();
|
2025-09-25 17:30:16 +08:00
|
|
|
|
},
|
|
|
|
|
|
search() {
|
2025-10-12 23:10:15 +08:00
|
|
|
|
this.pageNum = 1;
|
|
|
|
|
|
this.getData();
|
2025-09-22 10:16:21 +08:00
|
|
|
|
},
|
2025-10-12 23:10:15 +08:00
|
|
|
|
showTable({ deviceCategory, siteId, deviceId, deviceName }) {
|
|
|
|
|
|
this.deviceCategory = deviceCategory;
|
|
|
|
|
|
this.siteId = siteId;
|
|
|
|
|
|
this.deviceId = deviceId;
|
|
|
|
|
|
this.deviceName = deviceName;
|
|
|
|
|
|
this.show = true;
|
|
|
|
|
|
this.getData();
|
2025-09-13 22:41:41 +08:00
|
|
|
|
},
|
2025-09-25 17:30:16 +08:00
|
|
|
|
getData() {
|
2025-10-12 23:10:15 +08:00
|
|
|
|
this.loading = true;
|
2025-09-25 17:30:16 +08:00
|
|
|
|
const {
|
|
|
|
|
|
siteId,
|
|
|
|
|
|
deviceId,
|
|
|
|
|
|
deviceCategory,
|
|
|
|
|
|
pageNum,
|
|
|
|
|
|
pageSize,
|
2025-10-12 23:10:15 +08:00
|
|
|
|
form: {
|
2025-10-15 14:26:06 +08:00
|
|
|
|
sortData,
|
2025-10-12 23:10:15 +08:00
|
|
|
|
sortMethod,
|
|
|
|
|
|
dataPointName,
|
|
|
|
|
|
dataPoint,
|
|
|
|
|
|
lower,
|
|
|
|
|
|
upper,
|
|
|
|
|
|
},
|
|
|
|
|
|
} = this;
|
2025-09-25 17:30:16 +08:00
|
|
|
|
getDevicePointList({
|
|
|
|
|
|
siteId,
|
|
|
|
|
|
deviceId,
|
|
|
|
|
|
deviceCategory,
|
|
|
|
|
|
pageNum,
|
|
|
|
|
|
pageSize,
|
2025-10-15 14:26:06 +08:00
|
|
|
|
sortData,
|
2025-10-12 23:10:15 +08:00
|
|
|
|
sortMethod,
|
|
|
|
|
|
dataPointName,
|
|
|
|
|
|
dataPoint,
|
|
|
|
|
|
lower,
|
|
|
|
|
|
upper,
|
2025-09-25 17:30:16 +08:00
|
|
|
|
})
|
2025-10-12 23:10:15 +08:00
|
|
|
|
.then((response) => {
|
|
|
|
|
|
this.tableData = response?.rows || [];
|
|
|
|
|
|
this.totalSize = response?.total || 0;
|
|
|
|
|
|
})
|
|
|
|
|
|
.finally(() => {
|
|
|
|
|
|
this.loading = false;
|
|
|
|
|
|
});
|
2025-09-13 22:41:41 +08:00
|
|
|
|
},
|
|
|
|
|
|
// 分页
|
|
|
|
|
|
handleSizeChange(val) {
|
|
|
|
|
|
this.pageSize = val;
|
2025-09-25 17:30:16 +08:00
|
|
|
|
this.$nextTick(() => {
|
2025-10-12 23:10:15 +08:00
|
|
|
|
this.getData();
|
|
|
|
|
|
});
|
2025-09-13 22:41:41 +08:00
|
|
|
|
},
|
|
|
|
|
|
handleCurrentChange(val) {
|
2025-10-12 23:10:15 +08:00
|
|
|
|
this.pageNum = val;
|
2025-09-25 17:30:16 +08:00
|
|
|
|
this.$nextTick(() => {
|
2025-10-12 23:10:15 +08:00
|
|
|
|
this.getData();
|
|
|
|
|
|
});
|
2025-09-13 22:41:41 +08:00
|
|
|
|
},
|
2025-10-12 23:10:15 +08:00
|
|
|
|
},
|
|
|
|
|
|
};
|
2025-09-13 22:41:41 +08:00
|
|
|
|
</script>
|
2025-09-18 10:07:41 +08:00
|
|
|
|
<style lang="scss" scoped>
|
2025-09-13 22:41:41 +08:00
|
|
|
|
::v-deep {
|
2025-09-25 17:30:16 +08:00
|
|
|
|
.card-title .el-radio {
|
2025-09-13 22:41:41 +08:00
|
|
|
|
line-height: 40px;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-10-12 23:10:15 +08:00
|
|
|
|
</style>
|