|
@@ -50,10 +50,10 @@
|
|
|
<!-- <dv-border-box8 :dur="5" :style="`padding: 5px; height: ${scroll.y + 100}px`" > -->
|
|
|
<div :style="`padding: 5px; height: ${scroll.y + 100}px`">
|
|
|
<div class="to-small" @click="toHome"></div>
|
|
|
- <div class="device-button-group" v-if="deviceList.length > 0 && haveSysDetailArr.find((item) => deviceType.startsWith(item))">
|
|
|
- <div class="device-button" :class="{ 'device-active': deviceActive == device.deviceType }"
|
|
|
+ <div class="device-button-group" v-if="deviceList.length > 0">
|
|
|
+ <div class="device-button" :class="{ 'device-active': deviceActive == device.deviceType }"
|
|
|
v-for="(device, index) in deviceList" :key="index" @click="monitorChange(index)">{{ device.deviceName }}</div>
|
|
|
- <div class="enter-detail" @click="goDetail()">
|
|
|
+ <div v-if="haveSysDetailArr.find((item) => deviceType.startsWith(item))" class="enter-detail" @click="goDetail()">
|
|
|
<send-outlined />
|
|
|
{{ treeNodeTitle }}详情
|
|
|
</div>
|
|
@@ -67,11 +67,43 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div style="color: #fff;">{{ deviceType }}</div>
|
|
|
- <a-tabs class="tabs-box" v-model:activeKey="activeKey" @change="tabChange" id="tabsBox" v-if="isRefresh">
|
|
|
+ <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'">
|
|
|
- <GroupMonitorTable ref="MonitorDataTable" :dataSource="dataSource" :columnsType="`${deviceType}_monitor`" :scroll="scroll" :isAction="true" :isShowSelect="false">
|
|
|
- <template #action="{ record }">
|
|
|
+ <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 }">
|
|
|
<TableAction :actions="haveDetailArr.find((item) => deviceType.startsWith(item)) ? [
|
|
|
{
|
|
|
label: '详情',
|
|
@@ -88,151 +120,138 @@
|
|
|
},
|
|
|
]" />
|
|
|
</template>
|
|
|
- </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="deviceType.startsWith('safetymonitor') ? formConfig : undefined"
|
|
|
- :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>
|
|
|
- <MonitorTable v-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>
|
|
|
- <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>
|
|
|
- <template v-else-if="deviceType.startsWith('safetymonitor')">
|
|
|
+ <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>
|
|
|
- <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 ? '断开' : '未监测'
|
|
|
+ </MonitorTable>
|
|
|
+ </a-spin>
|
|
|
+ </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>
|
|
|
+ <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>
|
|
|
+ <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>
|
|
|
+ <a-tag v-if="column.dataIndex === 'netStatus'" :color="record.netStatus == 0 ? 'default' : 'green'">{{
|
|
|
+ record.netStatus == 0 ? '断开' : '连接'
|
|
|
}}</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>
|
|
|
- <a-tag v-if="column.dataIndex === 'netStatus'" :color="record.netStatus == 0 ? 'default' : 'green'">{{
|
|
|
- record.netStatus == 0 ? '断开' : '连接'
|
|
|
- }}</a-tag>
|
|
|
- </template>
|
|
|
- </MonitorTable>
|
|
|
+ </MonitorTable>
|
|
|
+ </a-spin>
|
|
|
</template>
|
|
|
</a-tab-pane>
|
|
|
- <a-tab-pane key="2" tab="历史数据">
|
|
|
- <div class="tab-item">
|
|
|
- <HistoryTable ref="historyTable" v-if="activeKey == '2'" :sysId="systemID" :columns-type="`${deviceType}`"
|
|
|
+ <a-tab-pane key="2" tab="历史数据" v-if="!(noHistoryArr()).find((item) => deviceType.startsWith(item))">
|
|
|
+ <div class="tab-item" :sysId="systemID" :columns-type="`${deviceType}`">
|
|
|
+ <HistoryTable ref="historyTable" v-if="activeKey == '2'"
|
|
|
:device-type="deviceType"
|
|
|
:device-list-api="getDeviceList.bind(null, { devicekind: deviceType, sysId: systemID })"
|
|
|
designScope="device-history" :scroll="scroll" />
|
|
@@ -282,10 +301,11 @@ import { SvgIcon } from '/@/components/Icon';
|
|
|
import { getActions } from '/@/qiankun/state';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
import { setDivHeight } from '/@/utils/event';
|
|
|
-import { majorColumns, haveSysDetailArr, haveDetailArr, haveHandlerArr, noWarningArr } from './device.data'
|
|
|
+import { majorColumns, haveSysDetailArr, haveDetailArr, haveHandlerArr, noWarningArr, surfaceChartsColumns, noHistoryArr } from './device.data'
|
|
|
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 { BorderBox8 as DvBorderBox8 } from '@kjgl77/datav-vue3';
|
|
|
|
|
|
|
|
@@ -297,7 +317,18 @@ const props = defineProps({
|
|
|
default: () => { }
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
+const echatsOption = {
|
|
|
+ grid: {
|
|
|
+ top: '35',
|
|
|
+ left: '30',
|
|
|
+ right: '45',
|
|
|
+ bottom: '25',
|
|
|
+ containLabel: true
|
|
|
+ },
|
|
|
+ toolbox: {
|
|
|
+ feature: {}
|
|
|
+ },
|
|
|
+}
|
|
|
const router = useRouter()
|
|
|
|
|
|
const actions = getActions();
|
|
@@ -309,7 +340,7 @@ const alarmHistoryTable = ref()
|
|
|
const handlerHistoryTable = ref()
|
|
|
|
|
|
// const routerParam = ref('home') // 默认进来时首页
|
|
|
-const isRefresh = ref(true)
|
|
|
+const isRefresh = ref(false)
|
|
|
// 模态框
|
|
|
const currentModal = shallowRef<Nullable<ComponentOptions>>(null); //模态框
|
|
|
const modalVisible = ref<Boolean>(false); // 模态框是否可见
|
|
@@ -324,7 +355,8 @@ const deviceList = ref<DeviceType[]>([]) //关联设备列表
|
|
|
const deviceActive = ref('')
|
|
|
const activeKey = ref('1'); // tab key
|
|
|
const dataSource = shallowRef([]) // 实时监测数据
|
|
|
-const majorPathEchartsData = ref({})
|
|
|
+const majorPathEchartsData = ref({}) // 关键路线echarts数据
|
|
|
+const surfaceEchartsData = ref<any[]>() // 工作面历史记录,echarts数据
|
|
|
const activeID = ref('') // 打开详情modal时监测的设备id
|
|
|
const deviceType = ref('') // 监测设备类型
|
|
|
const systemType = ref('')
|
|
@@ -352,10 +384,24 @@ const onSelect: TreeProps['onSelect'] = (keys, e) => {
|
|
|
deviceType.value = e.node.type
|
|
|
actions.setGlobalState({ locationObj: { pageType: deviceType.value }, pageObj: null });
|
|
|
}
|
|
|
- selectedKeys.value = keys
|
|
|
- treeNodeTitle.value = e.node.title
|
|
|
- dataSource.value = []
|
|
|
- activeKey.value = '1'
|
|
|
+ if(timer == null){
|
|
|
+ timer = undefined
|
|
|
+ }
|
|
|
+ if(timer){
|
|
|
+ clearTimeout(timer)
|
|
|
+ timer = undefined
|
|
|
+ }
|
|
|
+
|
|
|
+ isRefresh.value = true
|
|
|
+ setTimeout(() => {
|
|
|
+ isRefresh.value = false
|
|
|
+ selectedKeys.value = keys
|
|
|
+ treeNodeTitle.value = e.node.title
|
|
|
+ dataSource.value = []
|
|
|
+ activeKey.value = '1'
|
|
|
+ timer = null
|
|
|
+ getMonitor()
|
|
|
+ }, 200)
|
|
|
};
|
|
|
|
|
|
function tabChange(activeKeyVal) {
|
|
@@ -431,7 +477,10 @@ async function getDataSource() {
|
|
|
if(item.type === 'majorpath'){
|
|
|
deviceArr.unshift({ deviceType: item.type, deviceName: item['typeName'], datalist: item['datalist'][0]['paths'] })
|
|
|
majorPathEchartsData.value = item['datalist'][0]
|
|
|
- }else {
|
|
|
+ }else if(item.type.startsWith('surface_history')) {
|
|
|
+ surfaceEchartsData.value = item['datalist'][0]
|
|
|
+ deviceArr.unshift({ deviceType: item.type, deviceName: item['typeName'] ? item['typeName'] : item['datalist'][0]['typeName'], datalist: data })
|
|
|
+ } else{
|
|
|
deviceArr.unshift({ deviceType: item.type, deviceName: item['typeName'] ? item['typeName'] : item['datalist'][0]['typeName'], datalist: data })
|
|
|
}
|
|
|
}
|
|
@@ -452,6 +501,7 @@ async function getDataSource() {
|
|
|
} else {
|
|
|
let res = null
|
|
|
if(systemID.value){
|
|
|
+
|
|
|
res = await list({ devicetype: 'sys', types: deviceType.value, systemID: systemID.value })
|
|
|
if (res && res.msgTxt) {
|
|
|
const result = res.msgTxt;
|
|
@@ -465,16 +515,22 @@ async function getDataSource() {
|
|
|
dataSource.value = item['datalist'][0]['paths']
|
|
|
majorPathEchartsData.value = item['datalist'][0]
|
|
|
return
|
|
|
- } else if(item.type == deviceType.value) {
|
|
|
- dataSource.value = data
|
|
|
- console.log('关联设备数据--------------->', data)
|
|
|
+ }else if(item.type == deviceType.value) {
|
|
|
+ if( item.type == 'surface_history') { // 工作面图标数据
|
|
|
+ surfaceEchartsData.value = item['datalist'][0]
|
|
|
+ }else{
|
|
|
+ dataSource.value = data
|
|
|
+ console.log('关联设备数据--------------->', data)
|
|
|
+ }
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
}else{
|
|
|
- res = await list({ devicetype: deviceType.value, pagetype: 'normal' })
|
|
|
+ const formData = monitorTable.value.getForm()
|
|
|
+ const searchForm = formData.getFieldsValue()
|
|
|
+ res = await list({ devicetype: deviceType.value, pagetype: 'normal', filterParams: { ...searchForm } })
|
|
|
if (res && res.msgTxt) {
|
|
|
const result = res.msgTxt[0];
|
|
|
if(result){
|
|
@@ -485,9 +541,8 @@ async function getDataSource() {
|
|
|
if (deviceType.value.startsWith('safetymonitor')) {
|
|
|
const resultData = <any[]>[]
|
|
|
// 如果是安全监控的数据时需要过滤常见设备数据,根据设定的常用安全监控字典去匹配
|
|
|
- const formData = monitorTable.value.getForm()
|
|
|
const dictCodes = getDictItemsByCode('safetynormal')
|
|
|
- const searchForm = formData.getFieldsValue()
|
|
|
+
|
|
|
if (!searchForm['dataTypeName'] && dictCodes && dictCodes.length) {
|
|
|
for (let i = 0; i < dictCodes.length; i++) {
|
|
|
const dict = dictCodes[i]
|
|
@@ -607,6 +662,7 @@ function toHome() {
|
|
|
}
|
|
|
|
|
|
async function findTreeDataValue(obj) {
|
|
|
+ debugger
|
|
|
const findDeviceType = (data: [], obj) => {
|
|
|
let type = ''
|
|
|
if (obj.deviceid) {
|