|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="scene-box">
|
|
|
+ <div class="scene-box" v-if="isRefresh">
|
|
|
<!-- <div class="top-header">智能通风管理系统</div> -->
|
|
|
<div class="select-node" :class="{ 'node-select-show': !treeShow, 'node-select-hide': treeShow, }"
|
|
|
@click="showTree('treeShow', true)">
|
|
@@ -70,40 +70,8 @@
|
|
|
<a-tabs class="tabs-box" v-model:activeKey="activeKey" @change="tabChange" id="tabsBox">
|
|
|
<a-tab-pane key="1" tab="实时监测">
|
|
|
<template v-if="(deviceType.startsWith('fanlocal') || deviceType.startsWith('fanmain')) && activeKey == '1'">
|
|
|
- <a-spin :spinning="isRefresh" >
|
|
|
- <GroupMonitorTable ref="MonitorDataTable" :dataSource="dataSource" :columnsType="`${deviceType}_monitor`" :scroll="scroll" :isAction="true" :isShowSelect="false">
|
|
|
- <template #action="{ record }">
|
|
|
- <TableAction :actions="haveDetailArr.find((item) => deviceType.startsWith(item)) ? [
|
|
|
- {
|
|
|
- label: '详情',
|
|
|
- onClick: goDetail.bind(null, record),
|
|
|
- },
|
|
|
- {
|
|
|
- label: '定位',
|
|
|
- onClick: goLocation.bind(null, record),
|
|
|
- },
|
|
|
- ] : [
|
|
|
- {
|
|
|
- label: '定位',
|
|
|
- onClick: goLocation.bind(null, record),
|
|
|
- },
|
|
|
- ]" />
|
|
|
- </template>
|
|
|
- </GroupMonitorTable>
|
|
|
- </a-spin>
|
|
|
- </template>
|
|
|
- <template v-else-if="deviceType == 'majorpath' && activeKey == '1'">
|
|
|
- <a-spin :spinning="isRefresh">
|
|
|
- <a-table :columns="majorColumns" :data-source="dataSource" bordered :scroll="scroll" :pagination="false">
|
|
|
- </a-table>
|
|
|
- </a-spin>
|
|
|
- </template>
|
|
|
- <template v-else-if="deviceType.startsWith('safetymonitor') && activeKey == '1'">
|
|
|
- <a-spin :spinning="isRefresh">
|
|
|
- <MonitorTable ref="monitorTable" :columnsType="`${deviceType}_monitor`" :dataSource="dataSource"
|
|
|
- design-scope="device_monitor" :isShowActionColumn="true" :isShowSelect="false" title="设备监测"
|
|
|
- :form-config="formConfig" :scroll="{ y: scroll.y - 110 }">
|
|
|
- <template #action="{ record }">
|
|
|
+ <GroupMonitorTable ref="MonitorDataTable" :dataSource="dataSource" :columnsType="`${deviceType}_monitor`" :scroll="scroll" :isAction="true" :isShowSelect="false">
|
|
|
+ <template #action="{ record }">
|
|
|
<TableAction :actions="haveDetailArr.find((item) => deviceType.startsWith(item)) ? [
|
|
|
{
|
|
|
label: '详情',
|
|
@@ -120,140 +88,163 @@
|
|
|
},
|
|
|
]" />
|
|
|
</template>
|
|
|
- <template #filterCell="{ column, record }">
|
|
|
- <div v-if="!record.devicename && column.dataIndex === 'devicename'">-</div>
|
|
|
- <div v-if="!record.V && column.dataIndex === 'V'">-</div>
|
|
|
- <div v-if="!record.PointUnit && column.dataIndex === 'PointUnit'">-</div>
|
|
|
- <div v-if="!record.highRange && column.dataIndex === 'highRange'">-</div>
|
|
|
- <div v-if="!record.lowRange && column.dataIndex === 'lowRange'">-</div>
|
|
|
- <div v-if="!record.dataTypeName && column.dataIndex === 'dataTypeName'">-</div>
|
|
|
- <a-tag v-if="column.dataIndex === 'netStatus'" :color="record.netStatus == 0 ? 'default' : 'green'">{{
|
|
|
- record.netStatus == 0 ? '断开' : '连接'
|
|
|
- }}</a-tag>
|
|
|
- </template>
|
|
|
- </MonitorTable>
|
|
|
- </a-spin>
|
|
|
+ </GroupMonitorTable>
|
|
|
+ </template>
|
|
|
+ <template v-else-if="deviceType == 'majorpath' && activeKey == '1'">
|
|
|
+ <a-table :columns="majorColumns" :data-source="dataSource" bordered :scroll="scroll" :pagination="false"></a-table>
|
|
|
+ </template>
|
|
|
+ <template v-else-if="deviceType.startsWith('safetymonitor') && activeKey == '1'">
|
|
|
+ <MonitorTable ref="monitorTable" :columnsType="`${deviceType}_monitor`" :dataSource="dataSource"
|
|
|
+ design-scope="device_monitor" :isShowActionColumn="true" :isShowSelect="false" title="设备监测"
|
|
|
+ :form-config="formConfig" :scroll="{ y: scroll.y - 110 }">
|
|
|
+ <template #action="{ record }">
|
|
|
+ <TableAction :actions="haveDetailArr.find((item) => deviceType.startsWith(item)) ? [
|
|
|
+ {
|
|
|
+ label: '详情',
|
|
|
+ onClick: goDetail.bind(null, record),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '定位',
|
|
|
+ onClick: goLocation.bind(null, record),
|
|
|
+ },
|
|
|
+ ] : [
|
|
|
+ {
|
|
|
+ label: '定位',
|
|
|
+ onClick: goLocation.bind(null, record),
|
|
|
+ },
|
|
|
+ ]" />
|
|
|
+ </template>
|
|
|
+ <template #filterCell="{ column, record }">
|
|
|
+ <div v-if="!record.devicename && column.dataIndex === 'devicename'">-</div>
|
|
|
+ <div v-if="!record.V && column.dataIndex === 'V'">-</div>
|
|
|
+ <div v-if="!record.PointUnit && column.dataIndex === 'PointUnit'">-</div>
|
|
|
+ <div v-if="!record.highRange && column.dataIndex === 'highRange'">-</div>
|
|
|
+ <div v-if="!record.lowRange && column.dataIndex === 'lowRange'">-</div>
|
|
|
+ <div v-if="!record.dataTypeName && column.dataIndex === 'dataTypeName'">-</div>
|
|
|
+ <a-tag v-if="column.dataIndex === 'netStatus'" :color="record.netStatus == 0 ? 'default' : 'green'">{{
|
|
|
+ record.netStatus == 0 ? '断开' : '连接'
|
|
|
+ }}</a-tag>
|
|
|
+ </template>
|
|
|
+ </MonitorTable>
|
|
|
</template>
|
|
|
<template v-else>
|
|
|
<!-- 工作面echarts图标 -->
|
|
|
- <a-spin :spinning="isRefresh">
|
|
|
- <BarAndLine
|
|
|
- v-if="activeKey == '1' && deviceType == 'surface_history'"
|
|
|
- class="echarts-line"
|
|
|
- xAxisPropType="time"
|
|
|
- :dataSource="surfaceEchartsData"
|
|
|
- height="300px"
|
|
|
- :chartsColumns="surfaceChartsColumns"
|
|
|
- :option="echatsOption"
|
|
|
- chartsType="listMonitor" />
|
|
|
- <MonitorTable v-else-if="activeKey == '1'" ref="monitorTable" :columnsType="`${deviceType}_monitor`" :dataSource="dataSource"
|
|
|
- design-scope="device_monitor" :isShowActionColumn="true" :isShowSelect="false" title="设备监测"
|
|
|
- :scroll="{ y: scroll.y - 30 }">
|
|
|
- <template #action="{ record }">
|
|
|
- <TableAction :actions="haveDetailArr.find((item) => deviceType.startsWith(item)) ? [
|
|
|
- {
|
|
|
- label: '详情',
|
|
|
- onClick: goDetail.bind(null, record),
|
|
|
- },
|
|
|
- {
|
|
|
- label: '定位',
|
|
|
- onClick: goLocation.bind(null, record),
|
|
|
- },
|
|
|
- ] : [
|
|
|
- {
|
|
|
- label: '定位',
|
|
|
- onClick: goLocation.bind(null, record),
|
|
|
- },
|
|
|
- ]" />
|
|
|
-
|
|
|
- </template>
|
|
|
- <template #filterCell="{ column, record }">
|
|
|
- <template v-if="deviceType.startsWith('gate')">
|
|
|
- <template v-if="record.frontGateOpenCtrl == 1 || record.frontGateOpenCtrl === true">
|
|
|
- <a-tag
|
|
|
- v-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 0"
|
|
|
- color="red">正在打开</a-tag>
|
|
|
- <a-tag v-else-if="column.dataIndex === 'frontGateOpen'" color="processing">打开</a-tag>
|
|
|
- </template>
|
|
|
- <template v-else-if="record.frontGateOpenCtrl == 0 || record.frontGateOpenCtrl === false">
|
|
|
- <a-tag
|
|
|
- v-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 0"
|
|
|
- color="red">正在关闭</a-tag>
|
|
|
- <a-tag
|
|
|
- v-else-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 1"
|
|
|
- color="default">关闭</a-tag>
|
|
|
- <a-tag
|
|
|
- v-else-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 1 && record.frontGateClose == 0"
|
|
|
- color="default">打开</a-tag>
|
|
|
- </template>
|
|
|
- <template v-if="record.rearGateOpenCtrl == 1 || record.rearGateOpenCtrl === true">
|
|
|
- <a-tag
|
|
|
- v-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 0 && record.rearGateClose == 0"
|
|
|
- color="red">正在打开</a-tag>
|
|
|
- <a-tag v-else-if="column.dataIndex === 'rearGateOpen'" color="processing">打开</a-tag>
|
|
|
- </template>
|
|
|
- <template v-else-if="record.rearGateOpenCtrl == 0 || record.rearGateOpenCtrl === false">
|
|
|
- <a-tag
|
|
|
- v-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 0 && record.rearGateClose == 0"
|
|
|
- color="red">正在关闭</a-tag>
|
|
|
- <a-tag
|
|
|
- v-else-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 0 && record.rearGateClose == 1"
|
|
|
- color="default">关闭</a-tag>
|
|
|
- <a-tag
|
|
|
- v-else-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 1 && record.rearGateClose == 0"
|
|
|
- color="default">打开</a-tag>
|
|
|
- </template>
|
|
|
- <template v-if="column.dataIndex === 'ndoortype'">
|
|
|
- <span
|
|
|
- v-if="record.ndoortype == 0"
|
|
|
- color="red">行车风门</span>
|
|
|
- <span
|
|
|
- v-else
|
|
|
- color="default">行人风门</span>
|
|
|
- </template>
|
|
|
+ <BarAndLine
|
|
|
+ v-if="activeKey == '1' && deviceType == 'surface_history'"
|
|
|
+ class="echarts-line"
|
|
|
+ xAxisPropType="time"
|
|
|
+ :dataSource="surfaceEchartsData"
|
|
|
+ height="300px"
|
|
|
+ :chartsColumns="surfaceChartsColumns"
|
|
|
+ :option="echatsOption"
|
|
|
+ chartsType="listMonitor" />
|
|
|
+ <MonitorTable v-else-if="activeKey == '1'" ref="monitorTable" :columnsType="`${deviceType}_monitor`" :dataSource="dataSource"
|
|
|
+ design-scope="device_monitor" :isShowActionColumn="true" :isShowSelect="false" title="设备监测"
|
|
|
+ :scroll="{ y: scroll.y - 30 }">
|
|
|
+ <template #action="{ record }">
|
|
|
+ <TableAction :actions="haveDetailArr.find((item) => deviceType.startsWith(item)) ? [
|
|
|
+ {
|
|
|
+ label: '详情',
|
|
|
+ onClick: goDetail.bind(null, record),
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '定位',
|
|
|
+ onClick: goLocation.bind(null, record),
|
|
|
+ },
|
|
|
+ ] : [
|
|
|
+ {
|
|
|
+ label: '定位',
|
|
|
+ onClick: goLocation.bind(null, record),
|
|
|
+ },
|
|
|
+ ]" />
|
|
|
+
|
|
|
+ </template>
|
|
|
+ <template #filterCell="{ column, record }">
|
|
|
+ <template v-if="deviceType.startsWith('gate')">
|
|
|
+ <template v-if="record.frontGateOpenCtrl == 1 || record.frontGateOpenCtrl === true">
|
|
|
+ <a-tag
|
|
|
+ v-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 0"
|
|
|
+ color="red">正在打开</a-tag>
|
|
|
+ <a-tag v-else-if="column.dataIndex === 'frontGateOpen'" color="processing">打开</a-tag>
|
|
|
</template>
|
|
|
- <template v-else-if="deviceType.startsWith('windrect')">
|
|
|
- <a-tag v-if="column.dataIndex === 'sign'"
|
|
|
- :color="record.sign == 0 ? '#95CF65' : record.sign == 1 ? '#4590EA' : '#9876AA'"> {{
|
|
|
- record.sign == 0 ? '高位' : record.sign == 1 ? '中位' : '低位'
|
|
|
- }}</a-tag>
|
|
|
- <template v-if="record && column && column.dataIndex === 'isRun' && record.isRun">
|
|
|
- <a-tag v-if="record.isRun == -2 || record.isRun == -1"
|
|
|
- :color="record.isRun == -2 ? '#95CF65' : '#ED5700'">{{
|
|
|
- record.isRun == -2 ? '空闲' : '等待'
|
|
|
- }}</a-tag>
|
|
|
- <a-tag v-else-if="record.isRun == 100" color="#4693FF">完成</a-tag>
|
|
|
- <Progress v-else :percent="Number(record.isRun)" size="small" status="active" />
|
|
|
- </template>
|
|
|
+ <template v-else-if="record.frontGateOpenCtrl == 0 || record.frontGateOpenCtrl === false">
|
|
|
+ <a-tag
|
|
|
+ v-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 0"
|
|
|
+ color="red">正在关闭</a-tag>
|
|
|
+ <a-tag
|
|
|
+ v-else-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 1"
|
|
|
+ color="default">关闭</a-tag>
|
|
|
+ <a-tag
|
|
|
+ v-else-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 1 && record.frontGateClose == 0"
|
|
|
+ color="default">打开</a-tag>
|
|
|
+ </template>
|
|
|
+ <template v-if="record.rearGateOpenCtrl == 1 || record.rearGateOpenCtrl === true">
|
|
|
+ <a-tag
|
|
|
+ v-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 0 && record.rearGateClose == 0"
|
|
|
+ color="red">正在打开</a-tag>
|
|
|
+ <a-tag v-else-if="column.dataIndex === 'rearGateOpen'" color="processing">打开</a-tag>
|
|
|
+ </template>
|
|
|
+ <template v-else-if="record.rearGateOpenCtrl == 0 || record.rearGateOpenCtrl === false">
|
|
|
+ <a-tag
|
|
|
+ v-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 0 && record.rearGateClose == 0"
|
|
|
+ color="red">正在关闭</a-tag>
|
|
|
+ <a-tag
|
|
|
+ v-else-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 0 && record.rearGateClose == 1"
|
|
|
+ color="default">关闭</a-tag>
|
|
|
+ <a-tag
|
|
|
+ v-else-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 1 && record.rearGateClose == 0"
|
|
|
+ color="default">打开</a-tag>
|
|
|
</template>
|
|
|
- <template v-else-if="deviceType.startsWith('safetymonitor')">
|
|
|
- <div v-if="!record.devicename && column.dataIndex === 'devicename'">-</div>
|
|
|
- <div v-if="!record.V && column.dataIndex === 'V'">-</div>
|
|
|
- <div v-if="!record.PointUnit && column.dataIndex === 'PointUnit'">-</div>
|
|
|
- <div v-if="!record.highRange && column.dataIndex === 'highRange'">-</div>
|
|
|
- <div v-if="!record.lowRange && column.dataIndex === 'lowRange'">-</div>
|
|
|
- <div v-if="!record.dataTypeName && column.dataIndex === 'dataTypeName'">-</div>
|
|
|
+ <template v-if="column.dataIndex === 'ndoortype'">
|
|
|
+ <span
|
|
|
+ v-if="record.ndoortype == 0"
|
|
|
+ color="red">行车风门</span>
|
|
|
+ <span
|
|
|
+ v-else
|
|
|
+ color="default">行人风门</span>
|
|
|
</template>
|
|
|
- <a-tag v-if="column.dataIndex === 'warnFlag'"
|
|
|
- :color="record.warnFlag == 0 ? 'green' : record.warnFlag == 1 ? '#FF5812' : 'gray'"> {{
|
|
|
- record.warnFlag == 0 ? '正常' : record.warnFlag == 1 ? '报警' : record.warnFlag == 2 ? '断开' : '未监测'
|
|
|
+ </template>
|
|
|
+ <template v-else-if="deviceType.startsWith('windrect')">
|
|
|
+ <a-tag v-if="column.dataIndex === 'sign'"
|
|
|
+ :color="record.sign == 0 ? '#95CF65' : record.sign == 1 ? '#4590EA' : '#9876AA'"> {{
|
|
|
+ record.sign == 0 ? '高位' : record.sign == 1 ? '中位' : '低位'
|
|
|
}}</a-tag>
|
|
|
- <template v-else-if="column.dataIndex === 'warnLevel'">
|
|
|
- <a-tag v-if="record.warnLevel == '101'" color="green">蓝色预警</a-tag>
|
|
|
- <a-tag v-else-if="record.warnLevel == '102'" color="#FF5812">黄色预警</a-tag>
|
|
|
- <a-tag v-else-if="record.warnLevel == '103'" color="#FF5812">橙色预警</a-tag>
|
|
|
- <a-tag v-else-if="record.warnLevel == '104'" color="#FF5812">红色预警</a-tag>
|
|
|
- <a-tag v-else-if="record.warnLevel == '201'" color="#FF0000">报警</a-tag>
|
|
|
- <a-tag v-else-if="record.warnLevel == '10000'" color="#FF5812">数据超限</a-tag>
|
|
|
- <a-tag v-else-if="record.warnLevel == '1001'" color="default">网络中断</a-tag>
|
|
|
- <a-tag v-else color="green">正常</a-tag>
|
|
|
+ <template v-if="record && column && column.dataIndex === 'isRun' && record.isRun">
|
|
|
+ <a-tag v-if="record.isRun == -2 || record.isRun == -1"
|
|
|
+ :color="record.isRun == -2 ? '#95CF65' : '#ED5700'">{{
|
|
|
+ record.isRun == -2 ? '空闲' : '等待'
|
|
|
+ }}</a-tag>
|
|
|
+ <a-tag v-else-if="record.isRun == 100" color="#4693FF">完成</a-tag>
|
|
|
+ <Progress v-else :percent="Number(record.isRun)" size="small" status="active" />
|
|
|
</template>
|
|
|
- <a-tag v-if="column.dataIndex === 'netStatus'" :color="record.netStatus == 0 ? 'default' : 'green'">{{
|
|
|
- record.netStatus == 0 ? '断开' : '连接'
|
|
|
+ </template>
|
|
|
+ <template v-else-if="deviceType.startsWith('safetymonitor')">
|
|
|
+ <div v-if="!record.devicename && column.dataIndex === 'devicename'">-</div>
|
|
|
+ <div v-if="!record.V && column.dataIndex === 'V'">-</div>
|
|
|
+ <div v-if="!record.PointUnit && column.dataIndex === 'PointUnit'">-</div>
|
|
|
+ <div v-if="!record.highRange && column.dataIndex === 'highRange'">-</div>
|
|
|
+ <div v-if="!record.lowRange && column.dataIndex === 'lowRange'">-</div>
|
|
|
+ <div v-if="!record.dataTypeName && column.dataIndex === 'dataTypeName'">-</div>
|
|
|
+ </template>
|
|
|
+ <a-tag v-if="column.dataIndex === 'warnFlag'"
|
|
|
+ :color="record.warnFlag == 0 ? 'green' : record.warnFlag == 1 ? '#FF5812' : 'gray'"> {{
|
|
|
+ record.warnFlag == 0 ? '正常' : record.warnFlag == 1 ? '报警' : record.warnFlag == 2 ? '断开' : '未监测'
|
|
|
}}</a-tag>
|
|
|
+ <template v-else-if="column.dataIndex === 'warnLevel'">
|
|
|
+ <a-tag v-if="record.warnLevel == '101'" color="green">蓝色预警</a-tag>
|
|
|
+ <a-tag v-else-if="record.warnLevel == '102'" color="#FF5812">黄色预警</a-tag>
|
|
|
+ <a-tag v-else-if="record.warnLevel == '103'" color="#FF5812">橙色预警</a-tag>
|
|
|
+ <a-tag v-else-if="record.warnLevel == '104'" color="#FF5812">红色预警</a-tag>
|
|
|
+ <a-tag v-else-if="record.warnLevel == '201'" color="#FF0000">报警</a-tag>
|
|
|
+ <a-tag v-else-if="record.warnLevel == '10000'" color="#FF5812">数据超限</a-tag>
|
|
|
+ <a-tag v-else-if="record.warnLevel == '1001'" color="default">网络中断</a-tag>
|
|
|
+ <a-tag v-else color="green">正常</a-tag>
|
|
|
</template>
|
|
|
- </MonitorTable>
|
|
|
- </a-spin>
|
|
|
+ <a-tag v-if="column.dataIndex === 'netStatus'" :color="record.netStatus == 0 ? 'default' : 'green'">{{
|
|
|
+ record.netStatus == 0 ? '断开' : '连接'
|
|
|
+ }}</a-tag>
|
|
|
+ </template>
|
|
|
+ </MonitorTable>
|
|
|
</template>
|
|
|
</a-tab-pane>
|
|
|
<a-tab-pane key="2" tab="历史数据" v-if="!(noHistoryArr()).find((item) => deviceType.startsWith(item))">
|
|
@@ -291,7 +282,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { ref, onMounted, onUnmounted, ComponentOptions, shallowRef, reactive, defineProps } from 'vue'
|
|
|
+import { ref, onMounted, onUnmounted, ComponentOptions, shallowRef, reactive, defineProps, watch } from 'vue'
|
|
|
import { SendOutlined } from '@ant-design/icons-vue';
|
|
|
import { list, getDeviceList, getDeviceTypeList } from './device.api'
|
|
|
import AlarmHistoryTable from '../../../comment/AlarmHistoryTable.vue';
|
|
@@ -313,6 +304,7 @@ import mainPath from './modal/mainPath.vue'
|
|
|
import { formConfig } from '../../../safetyMonitor/safety.data'
|
|
|
import { getDictItemsByCode } from '/@/utils/dict';
|
|
|
import BarAndLine from '/@/components/chart/BarAndLine.vue';
|
|
|
+import { nextTick } from 'vue';
|
|
|
// import { BorderBox8 as DvBorderBox8 } from '@kjgl77/datav-vue3';
|
|
|
|
|
|
|
|
@@ -347,7 +339,7 @@ const alarmHistoryTable = ref()
|
|
|
const handlerHistoryTable = ref()
|
|
|
|
|
|
// const routerParam = ref('home') // 默认进来时首页
|
|
|
-const isRefresh = ref(false)
|
|
|
+const isRefresh = ref(true)
|
|
|
// 模态框
|
|
|
const currentModal = shallowRef<Nullable<ComponentOptions>>(null); //模态框
|
|
|
const modalVisible = ref<Boolean>(false); // 模态框是否可见
|
|
@@ -398,10 +390,7 @@ const onSelect: TreeProps['onSelect'] = (keys, e) => {
|
|
|
clearTimeout(timer)
|
|
|
timer = undefined
|
|
|
}
|
|
|
-
|
|
|
- isRefresh.value = true
|
|
|
setTimeout(() => {
|
|
|
- isRefresh.value = false
|
|
|
selectedKeys.value = keys
|
|
|
treeNodeTitle.value = e.node.title
|
|
|
dataSource.value = []
|
|
@@ -749,6 +738,18 @@ function setLocation() {
|
|
|
}, 600)
|
|
|
}
|
|
|
|
|
|
+watch(() => props.pageData, (pageObj) => {
|
|
|
+ isRefresh.value = false
|
|
|
+ nextTick(() => {
|
|
|
+ isRefresh.value = true
|
|
|
+ if (pageObj.deviceid) {
|
|
|
+ findTreeDataValue({ deviceid: pageObj.deviceid })
|
|
|
+ } else if (pageObj.pageType) {
|
|
|
+ findTreeDataValue({ deviceType: pageObj.pageType })
|
|
|
+ }
|
|
|
+ })
|
|
|
+})
|
|
|
+
|
|
|
onMounted(async () => {
|
|
|
await getDeviceType()
|
|
|
const pageObj = props.pageData
|