|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="safetyList">
|
|
|
- <customHeader>安全监控分站管理</customHeader>
|
|
|
+ <customHeader>监控分站管理</customHeader>
|
|
|
<div class="content">
|
|
|
<div class="left-box">
|
|
|
<div class="left-title">
|
|
@@ -44,7 +44,7 @@
|
|
|
</div>
|
|
|
<div class="right-box">
|
|
|
<div class="right-title">详细信息:</div>
|
|
|
- <a-table size="small" :scroll="{ y: 680 }" :columns="columns" :data-source="tableData" :pagination="pagination"
|
|
|
+ <a-table size="small" :scroll="{ y: 710 }" :columns="columns" :data-source="tableData" :pagination="pagination"
|
|
|
@change="pageChange">
|
|
|
<template #action="{ record }">
|
|
|
<a v-show="record.linkId == '0'" class="table-action-link" @click="handlerunDeviceMonitor(record)">启动</a>
|
|
@@ -53,10 +53,10 @@
|
|
|
<template v-if="column.dataIndex === 'valueJc' && text">
|
|
|
<div v-for="item in text.split(',')" :key="item">
|
|
|
<span v-if="item.substring(item.indexOf(':') + 1)"
|
|
|
- style="display: inline-block;width: 50%;text-align: right; color:rgb(0, 242, 255);margin-right:5px">{{
|
|
|
+ style="display: inline-block;width: 48%;text-align: right; color:rgb(0, 242, 255);margin-right:5px">{{
|
|
|
item.substring(0, item.indexOf(':') + 1) }}</span>
|
|
|
<span v-if="item.substring(item.indexOf(':') + 1)"
|
|
|
- style="display: inline-block; width:45%;text-align: left; color:#fff">{{
|
|
|
+ style="display: inline-block; width:47%;text-align: left; color:#fff">{{
|
|
|
item.substring(item.indexOf(':') + 1) }} </span>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -68,7 +68,7 @@
|
|
|
@cancel="handleCancel">
|
|
|
<a-form :model="startupData" labelAlign="right" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }">
|
|
|
<a-form-item label="安装位置">
|
|
|
- <a-input v-model:value="startupData.address" placeholder="请输入" style="width: 260px" />
|
|
|
+ <a-input v-model:value="startupData.address" maxlength="8" placeholder="请输入" style="width: 260px" />
|
|
|
</a-form-item>
|
|
|
</a-form>
|
|
|
</a-modal>
|
|
@@ -78,12 +78,11 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { ref, nextTick, reactive, onMounted } from 'vue';
|
|
|
+import { ref, nextTick, reactive, onMounted, onUnmounted } from 'vue';
|
|
|
import customHeader from '/@/components/vent/customHeader.vue';
|
|
|
import { subStationList, getList, getEdit, runDeviceMonitor } from './safetyList.api';
|
|
|
import { columns } from './safetyList.data'
|
|
|
|
|
|
-let value = ref('12111111')
|
|
|
let isShow = ref(false)
|
|
|
let stationName = ref('')
|
|
|
let stationStatus = ref(null)
|
|
@@ -113,9 +112,23 @@ let startupData = reactive({
|
|
|
address: '',
|
|
|
})
|
|
|
let devId = ref('')
|
|
|
-let devName = ref('')
|
|
|
|
|
|
|
|
|
+// https获取监测数据
|
|
|
+let timer: null | NodeJS.Timeout = null;
|
|
|
+function getMonitor(flag = false) {
|
|
|
+ timer = setTimeout(
|
|
|
+ async () => {
|
|
|
+ // await getSubStationList()
|
|
|
+ await getStationList()
|
|
|
+ if (timer) {
|
|
|
+ timer = null;
|
|
|
+ }
|
|
|
+ getMonitor();
|
|
|
+ },
|
|
|
+ flag ? 0 : 5000
|
|
|
+ );
|
|
|
+}
|
|
|
//获取分站信息
|
|
|
async function getSubStationList() {
|
|
|
let res = await subStationList({ strtype: "modbus" })
|
|
@@ -165,7 +178,7 @@ async function getStationList() {
|
|
|
v.linkstatus = v.netStatus
|
|
|
v.linkstatusC = v.linkstatus ? '连接' : '未连接'
|
|
|
v.updateTime = v.time
|
|
|
- v.valueJc = `密度:${v.density || ''},气压:${v.pa || ''},温度:${v.temperature || ''},湿度:${v.humidity || ''},风速:${v.windSpeed || ''},压差:${v.difPress || ''}`
|
|
|
+ v.valueJc = `风量:${v.m3 || ''},风速:${v.va || ''},气压:${v.pa || ''},温度:${v.temperature || ''},湿度:${v.humidity || ''},风速:${v.windSpeed || ''},压差:${v.difPress || ''}`
|
|
|
|
|
|
})
|
|
|
})
|
|
@@ -197,8 +210,14 @@ function handleCancel() {
|
|
|
|
|
|
onMounted(() => {
|
|
|
getSubStationList()
|
|
|
- getStationList()
|
|
|
+ getMonitor(true);
|
|
|
})
|
|
|
+onUnmounted(() => {
|
|
|
+ if (timer) {
|
|
|
+ clearTimeout(timer);
|
|
|
+ timer = undefined;
|
|
|
+ }
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|