|
@@ -45,15 +45,23 @@
|
|
|
<div class="right-box">
|
|
|
<div class="right-title">详细信息:</div>
|
|
|
<a-table size="small" :scroll="{ y: 680 }" :columns="columns" :data-source="tableData" :pagination="pagination"
|
|
|
- @change="pageChange" >
|
|
|
+ @change="pageChange">
|
|
|
+ <template #action="{ record }">
|
|
|
+ <a v-show="record.linkId == '0'" class="table-action-link" @click="handlerunDeviceMonitor(record)">启动</a>
|
|
|
+ </template>
|
|
|
<template #bodyCell="{ column, text }">
|
|
|
- <template v-if="column.dataIndex === 'valueJc' && text ">
|
|
|
- <div v-for="item in text.split(',')" :key="item" >
|
|
|
- <span style="display: inline-block;width: 50%;text-align: right; color:rgb(0, 242, 255);margin-right:5px" >{{ item.substring(0,item.indexOf(':')+1) }}</span>
|
|
|
- <span style="display: inline-block; width:45%;text-align: left; color:#fff">{{ item.substring(item.indexOf(':')+1) }} </span>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </template>
|
|
|
+ <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">{{
|
|
|
+ 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">{{
|
|
|
+ item.substring(item.indexOf(':') + 1) }} </span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ </template>
|
|
|
</a-table>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -63,7 +71,7 @@
|
|
|
<script setup lang="ts">
|
|
|
import { ref, nextTick, reactive, onMounted } from 'vue';
|
|
|
import customHeader from '/@/components/vent/customHeader.vue';
|
|
|
-import { subStationList, getList, getEdit } from './safetyList.api';
|
|
|
+import { subStationList, getList, getEdit, runDeviceMonitor } from './safetyList.api';
|
|
|
import { columns } from './safetyList.data'
|
|
|
|
|
|
let isShow = ref(false)
|
|
@@ -93,7 +101,7 @@ let tableData = ref<any[]>([])
|
|
|
|
|
|
//获取分站信息
|
|
|
async function getSubStationList() {
|
|
|
- let res = await subStationList({strtype:"modbus"})
|
|
|
+ let res = await subStationList({ strtype: "modbus" })
|
|
|
console.log(res, '分站-----------')
|
|
|
if (res.length != 0) {
|
|
|
cardList.value = res
|
|
@@ -130,17 +138,17 @@ async function getChangeStation() {
|
|
|
async function getStationList() {
|
|
|
let res = await getList({ pageNo: pagination.current, pageSize: pagination.pageSize, })
|
|
|
console.log(res, '详细信息列表--------')
|
|
|
-
|
|
|
+
|
|
|
res.forEach(el => {
|
|
|
- el.key=el.id
|
|
|
+ el.key = el.id
|
|
|
el.linkstatusC = el.linkstatus ? '连接' : '未连接'
|
|
|
el.children = el.devInfoList
|
|
|
el.children.forEach(v => {
|
|
|
- v.key=v.id
|
|
|
+ v.key = v.deviceID
|
|
|
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.density || ''},气压:${v.pa || ''},温度:${v.temperature || ''},湿度:${v.humidity || ''},风速:${v.windSpeed || ''},压差:${v.difPress || ''}`
|
|
|
|
|
|
})
|
|
|
})
|
|
@@ -153,6 +161,12 @@ function pageChange(val) {
|
|
|
pagination.pageSize = val.pageSize;
|
|
|
getStationList();
|
|
|
}
|
|
|
+//启动新设备
|
|
|
+async function handlerunDeviceMonitor(record) {
|
|
|
+ let res = await runDeviceMonitor({ devId: record.deviceID })
|
|
|
+ console.log(res,'新设备启动---')
|
|
|
+ getStationList();
|
|
|
+}
|
|
|
|
|
|
onMounted(() => {
|
|
|
getSubStationList()
|