|  | @@ -50,7 +50,7 @@
 | 
	
		
			
				|  |  |        <!-- <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">
 | 
	
		
			
				|  |  | +        <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 }"
 | 
	
		
			
				|  |  |              v-for="(device, index) in deviceList" :key="index" @click="monitorChange(index)">{{ device.deviceName }}</div>
 | 
	
		
			
				|  |  |            <div class="enter-detail" @click="goDetail()">
 | 
	
	
		
			
				|  | @@ -92,21 +92,13 @@
 | 
	
		
			
				|  |  |              </template>
 | 
	
		
			
				|  |  |              <template v-else-if="deviceType == 'majorpath' && activeKey == '1'">
 | 
	
		
			
				|  |  |                <a-table :columns="majorColumns" :data-source="dataSource" bordered :scroll="scroll" :pagination="false">
 | 
	
		
			
				|  |  | -                <template #bodyCell="{ column, record }">
 | 
	
		
			
				|  |  | -                  <!-- <template v-if="column.dataIndex === 'operation'">
 | 
	
		
			
				|  |  | -                    <a class="action-link" @click="handleOpen(record)">编辑</a>
 | 
	
		
			
				|  |  | -                    <a class="action-link vent-margin-l-10" @click="handleDelete(record)">删除</a>
 | 
	
		
			
				|  |  | -                  </template>
 | 
	
		
			
				|  |  | -                  <template v-if="column.dataIndex === 'operation1'">
 | 
	
		
			
				|  |  | -                    <a class="action-link" @click="handleOpen()">新增</a>
 | 
	
		
			
				|  |  | -                  </template> -->
 | 
	
		
			
				|  |  | -                </template>
 | 
	
		
			
				|  |  |                </a-table>
 | 
	
		
			
				|  |  |              </template>
 | 
	
		
			
				|  |  | -            <template v-else="activeKey == '1'">
 | 
	
		
			
				|  |  | +            <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="设备监测"
 | 
	
		
			
				|  |  | -                :scroll="{y: scroll.y - 30}">
 | 
	
		
			
				|  |  | +                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)) ? [
 | 
	
		
			
				|  |  |                      {
 | 
	
	
		
			
				|  | @@ -124,6 +116,40 @@
 | 
	
		
			
				|  |  |                      },
 | 
	
		
			
				|  |  |                    ] " />
 | 
	
		
			
				|  |  |                  </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">
 | 
	
	
		
			
				|  | @@ -161,7 +187,7 @@
 | 
	
		
			
				|  |  |                          color="default">打开</a-tag>
 | 
	
		
			
				|  |  |                      </template>
 | 
	
		
			
				|  |  |                    </template>
 | 
	
		
			
				|  |  | -                  <template v-if="deviceType.startsWith('windrect')">
 | 
	
		
			
				|  |  | +                  <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 ? '中位' : '低位'
 | 
	
	
		
			
				|  | @@ -175,11 +201,19 @@
 | 
	
		
			
				|  |  |                        <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-if="column.dataIndex === 'warnLevel'">
 | 
	
		
			
				|  |  | +                  <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>
 | 
	
	
		
			
				|  | @@ -187,7 +221,7 @@
 | 
	
		
			
				|  |  |                      <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="record.warnLevel == '1001'" color="green">正常</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 ? '断开' : '连接'
 | 
	
	
		
			
				|  | @@ -248,8 +282,10 @@ import { SvgIcon } from '/@/components/Icon';
 | 
	
		
			
				|  |  |  import { getActions } from '/@/qiankun/state';
 | 
	
		
			
				|  |  |  import { useRouter } from 'vue-router';
 | 
	
		
			
				|  |  |  import { setDivHeight } from '/@/utils/event';
 | 
	
		
			
				|  |  | -import { majorColumns, noDetailArr, haveDetailArr, haveHandlerArr, noWarningArr } from  './device.data'
 | 
	
		
			
				|  |  | +import { majorColumns, haveSysDetailArr, haveDetailArr, haveHandlerArr, noWarningArr } from  './device.data'
 | 
	
		
			
				|  |  |  import mainPath from './modal/mainPath.vue'
 | 
	
		
			
				|  |  | +import { formConfig } from '../../../safetyMonitor/safety.data'
 | 
	
		
			
				|  |  | +import { getDictItemsByCode } from '/@/utils/dict';
 | 
	
		
			
				|  |  |  // import { BorderBox8 as DvBorderBox8 } from '@kjgl77/datav-vue3';
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -302,7 +338,6 @@ const treeData = ref<TreeProps['treeData']>([]);
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  //树形菜单选择事件
 | 
	
		
			
				|  |  |  const onSelect: TreeProps['onSelect'] = (keys, e) => {
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |    deviceType.value = ''
 | 
	
		
			
				|  |  |    systemID.value = ''
 | 
	
		
			
				|  |  |    deviceList.value = []
 | 
	
	
		
			
				|  | @@ -320,6 +355,7 @@ const onSelect: TreeProps['onSelect'] = (keys, e) => {
 | 
	
		
			
				|  |  |    selectedKeys.value = keys
 | 
	
		
			
				|  |  |    treeNodeTitle.value = e.node.title
 | 
	
		
			
				|  |  |    dataSource.value = []
 | 
	
		
			
				|  |  | +  activeKey.value = '1'
 | 
	
		
			
				|  |  |  };
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  function tabChange(activeKeyVal) {
 | 
	
	
		
			
				|  | @@ -446,8 +482,33 @@ async function getDataSource() {
 | 
	
		
			
				|  |  |              const readData = data.readData;
 | 
	
		
			
				|  |  |              return Object.assign(data, readData);
 | 
	
		
			
				|  |  |            })
 | 
	
		
			
				|  |  | -          dataSource.value = data
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | +          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]
 | 
	
		
			
				|  |  | +                data.forEach((item) => {
 | 
	
		
			
				|  |  | +                  if (dict['value'] == item['dataTypeName']) {
 | 
	
		
			
				|  |  | +                    resultData.push(item)
 | 
	
		
			
				|  |  | +                  }
 | 
	
		
			
				|  |  | +                })
 | 
	
		
			
				|  |  | +              }
 | 
	
		
			
				|  |  | +              dataSource.value = resultData
 | 
	
		
			
				|  |  | +            } else {
 | 
	
		
			
				|  |  | +              dataSource.value = data
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +          } else {
 | 
	
		
			
				|  |  | +            dataSource.value = data
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        }else{
 | 
	
		
			
				|  |  | +          dataSource.value = []
 | 
	
		
			
				|  |  | +        }      
 | 
	
		
			
				|  |  | +      }else{
 | 
	
		
			
				|  |  | +        dataSource.value = []
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      
 | 
	
	
		
			
				|  | @@ -500,6 +561,9 @@ function goDetail(record?) {
 | 
	
		
			
				|  |  |      } else if (deviceType.value.indexOf("pump") != -1) {
 | 
	
		
			
				|  |  |        const newPage = router.resolve({ path: '/monitorChannel/gasPump-home', query: { id: activeID.value } })
 | 
	
		
			
				|  |  |        window.open(newPage.href, '_blank')
 | 
	
		
			
				|  |  | +    } else if (systemType.value.indexOf("nitrogen") != -1) {
 | 
	
		
			
				|  |  | +      const newPage = router.resolve({ path: '/nitrogen-home', query: { id: systemID.value } })
 | 
	
		
			
				|  |  | +      window.open(newPage.href, '_blank')
 | 
	
		
			
				|  |  |      } else {
 | 
	
		
			
				|  |  |        message.info('待开发。。。')
 | 
	
		
			
				|  |  |      }
 | 
	
	
		
			
				|  | @@ -568,6 +632,15 @@ async function findTreeDataValue(obj) {
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    findDeviceType(treeData.value, obj)
 | 
	
		
			
				|  |  | +  
 | 
	
		
			
				|  |  | +  // 无类型时
 | 
	
		
			
				|  |  | +  if (!treeNodeTitle.value && treeData.value && treeData.value[0] && treeData.value[0]['children']) {
 | 
	
		
			
				|  |  | +    const defaultData = treeData.value[0]['children'][0]
 | 
	
		
			
				|  |  | +    deviceType.value = defaultData.type
 | 
	
		
			
				|  |  | +    selectedKeys.value = [(defaultData.key as string)]
 | 
	
		
			
				|  |  | +    expandedKeys.value = [(defaultData.key as string)]
 | 
	
		
			
				|  |  | +    treeNodeTitle.value = defaultData.title
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |    if (timer === undefined) {
 | 
	
		
			
				|  |  |      timer = null
 | 
	
	
		
			
				|  | @@ -610,11 +683,8 @@ function setLocation() {
 | 
	
		
			
				|  |  |    }, 600)
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  onMounted(async () => {
 | 
	
		
			
				|  |  |    await getDeviceType()
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |    const pageObj = props.pageData
 | 
	
		
			
				|  |  |    if(!pageObj) return 
 | 
	
		
			
				|  |  |    if (pageObj.deviceid) {
 |