Parcourir la source

注氮流量echarts、束管echarts、局部风机电子屏

hongrunxia il y a 1 an
Parent
commit
7193a65869
30 fichiers modifiés avec 460 ajouts et 236 suppressions
  1. 13 5
      src/App.vue
  2. 2 0
      src/components/chart/BarAndLine.vue
  3. 1 1
      src/hooks/web/useECharts.ts
  4. 6 0
      src/layouts/default/sider/bottomSideder.vue
  5. 3 3
      src/layouts/page/index.vue
  6. 1 0
      src/utils/threejs/util.ts
  7. 12 1
      src/utils/ventutil.ts
  8. 3 4
      src/views/vent/deviceManager/equipManager/component/DeviceModal.vue
  9. 2 5
      src/views/vent/home/colliery/index.vue
  10. 11 11
      src/views/vent/monitorManager/alarmMonitor/index.vue
  11. 0 1
      src/views/vent/monitorManager/camera/index.vue
  12. 3 4
      src/views/vent/monitorManager/comment/HistoryTable.vue
  13. 84 25
      src/views/vent/monitorManager/compressor/components/nitrogenHome1.vue
  14. 43 43
      src/views/vent/monitorManager/compressor/nitrogen.data.ts
  15. 17 4
      src/views/vent/monitorManager/deviceMonitor/components/device/device.data.ts
  16. 93 23
      src/views/vent/monitorManager/deviceMonitor/components/device/index.vue
  17. 47 44
      src/views/vent/monitorManager/deviceMonitor/components/device/modal/bundle.modal.vue
  18. 17 16
      src/views/vent/monitorManager/deviceMonitor/components/device/modal/dust.modal.vue
  19. 7 7
      src/views/vent/monitorManager/fanLocalMonitor/fanLocal.three.ts
  20. 29 10
      src/views/vent/monitorManager/fanLocalMonitor/index.vue
  21. 7 2
      src/views/vent/monitorManager/gasPumpMonitor/components/DetailModal.vue
  22. 9 4
      src/views/vent/monitorManager/gasPumpMonitor/components/gasPumpHome.vue
  23. 9 7
      src/views/vent/monitorManager/gasPumpMonitor/gasPump.threejs.under.ts
  24. 14 7
      src/views/vent/monitorManager/gateMonitor/index.vue
  25. 10 2
      src/views/vent/monitorManager/obfurage1Monitor/index.vue
  26. 2 2
      src/views/vent/monitorManager/windowMonitor/dandaoFc.threejs.ts
  27. 7 2
      src/views/vent/monitorManager/windowMonitor/index.vue
  28. 2 2
      src/views/vent/monitorManager/windowMonitor/shuangdaoFc.threejs.ts
  29. 1 0
      src/views/vent/monitorManager/windowMonitor/window.threejs.ts
  30. 5 1
      src/views/vent/monitorManager/windrectMonitor/index.vue

+ 13 - 5
src/App.vue

@@ -2,14 +2,14 @@
   <AdaptiveContainer :options="{ width: width, height: height }" style="overflow-y: hidden">
     <ConfigProvider :locale="getAntdLocale" prefixCls="zxm">
       <AppProvider>
-        <RouterView />
+        <RouterView v-if="!isReload"/>
       </AppProvider>
     </ConfigProvider>
   </AdaptiveContainer>
 </template>
 
 <script lang="ts" setup>
-  import { ref, watch, onUnmounted } from 'vue';
+  import { ref, watch, onUnmounted, nextTick, provide } from 'vue';
   import { ConfigProvider } from 'ant-design-vue';
   import { AppProvider } from '/@/components/Application';
   import { useTitle } from '/@/hooks/web/useTitle';
@@ -19,7 +19,7 @@
 
   // 解决日期时间国际化问题
   import 'dayjs/locale/zh-cn';
-
+  const isReload = ref(false)
   const appStore = useAppStore();
   // support Multi-language
   const { getAntdLocale } = useLocale();
@@ -31,17 +31,25 @@
     height.value = 1080;
   }
 
+  const reloadRouter = () => {
+    debugger
+    isReload.value = true
+    nextTick(() => {
+      isReload.value = false
+    })
+  }
+
   watch([()=> appStore.getWidthScale, () => appStore.getHeightScale], () => {
     const popoverDomList = document.getElementsByClassName('zxm-popover')
     Array.prototype.map.call(popoverDomList, dom => {
-      console.log('弹窗节点------>',dom,);
+      console.log('弹窗节点------>',dom,);  
       
     })
   })
 
   useTitle();
 
-
+  provide('reloadRouter', reloadRouter)
   onUnmounted(() => {
     window['renderer']?.dispose()
     window['renderer']?.forceContextLoss()

+ 2 - 0
src/components/chart/BarAndLine.vue

@@ -84,6 +84,7 @@
       });
 
       watch([() => props.chartsType, () => props.chartsColumns], ([newChartsType, newChartsColumns]) => {
+        debugger
         spinning.value = true;
         chartsColumns = newChartsColumns;
         optionUtil.initChartOption(newChartsType, newChartsColumns);
@@ -99,6 +100,7 @@
       initChartsOption();
 
       function initCharts(isRefresh = false) {
+        debugger
         //轴数据
         if (option.series && option.series.length === chartsColumns.length) {
           let xAxisData = props.dataSource.map((item) => item[props.xAxisPropType]);

+ 1 - 1
src/hooks/web/useECharts.ts

@@ -40,7 +40,7 @@ export function useECharts(elRef: Ref<HTMLDivElement>, theme: 'light' | 'dark' |
       return;
     }
 
-    chartInstance = echarts.init(el, t, { renderer: 'svg' });
+    chartInstance = echarts.init(el, t, );
     const { removeEvent } = useEventListener({
       el: window,
       name: 'resize',

+ 6 - 0
src/layouts/default/sider/bottomSideder.vue

@@ -100,9 +100,15 @@
         if (route.path.startsWith('/micro-')) { 
           if (route.path.startsWith(glob.homePath || PageEnum.BASE_HOME)){
             if (!path.path.startsWith(glob.homePath || PageEnum.BASE_HOME)) {
+              // router.replace(path.path)
               go(path.path);
             } else {
               go(path.path);
+              const { query } = router.resolve(path.path)
+              const { type, deviceType } = query
+              if (type && deviceType) {
+                actions.setGlobalState({ pageObj: { pageType: type, deviceType } });
+              }
             }
           }else {
             go(path.path);

+ 3 - 3
src/layouts/page/index.vue

@@ -41,7 +41,6 @@
   import { useTransitionSetting } from '/@/hooks/setting/useTransitionSetting';
   import { useMultipleTabSetting } from '/@/hooks/setting/useMultipleTabSetting';
   import { getTransitionName } from './transition';
-
   import { useMultipleTabStore } from '/@/store/modules/multipleTab';
 
   export default defineComponent({
@@ -54,8 +53,9 @@
       const { getOpenKeepAlive, getCanEmbedIFramePage } = useRootSetting();
 
       const { getBasicTransition, getEnableTransition } = useTransitionSetting();
-
-      const openCache = computed(() => unref(getOpenKeepAlive) && unref(getShowMultipleTab));
+      const openCache = computed(() => {
+        return unref(getOpenKeepAlive) && unref(getShowMultipleTab)
+      });
 
       const getCaches = computed((): string[] => {
         if (!unref(getOpenKeepAlive)) {

+ 1 - 0
src/utils/threejs/util.ts

@@ -273,6 +273,7 @@ export const setOutline = (model, group) => {
 /* 渲染视频 */
 export const renderVideo = (group, player, playerMeshName) => {
   //加载视频贴图;
+  THREE.ImageUtils['crossOrigin'] = '';
   const texture = new THREE.VideoTexture(player);
   console.log('视频贴图------------>', texture);
   if (texture && texture['data'] && !texture['data'].currentSrc) {

+ 12 - 1
src/utils/ventutil.ts

@@ -51,6 +51,7 @@ export function cameraInit(dom, rtspUrl) {
 
 // 模型监测加载视频
 export function deviceCameraInit(cameraAddrs, player: HTMLElement, webRtcServerList: any[] = []) {
+  debugger;
   const playerDoms: (HTMLVideoElement | undefined | null)[] = [];
   const webRtcServer: any[] = [];
   let livePlayerDiv: HTMLElement | null = document.getElementById('LivePlayerBox');
@@ -104,7 +105,14 @@ export function deviceCameraInit(cameraAddrs, player: HTMLElement, webRtcServerL
                 cameraNameDom.setAttribute('class', 'video-name');
                 cameraNameDom.innerText = cameraUrl.name;
                 videoParentDom.appendChild(cameraNameDom);
+                videoParentDom.addEventListener('dblclick', () => {
+                  if (videoDom.requestFullscreen) {
+                    videoDom.requestFullscreen();
+                    videoDom.play();
+                  }
+                });
                 videoParentDomList.push(videoParentDom);
+
                 try {
                   const server = new window['WebRtcStreamer'](videoDom, location.protocol + VUE_APP_URL.webRtcUrl);
                   webRtcServer.unshift(server);
@@ -120,7 +128,10 @@ export function deviceCameraInit(cameraAddrs, player: HTMLElement, webRtcServerL
               }
             } else {
               try {
-                fetch(cameraUrl.addr)
+                fetch(cameraUrl.addr, {
+                  method: 'get',
+                  mode: 'no-cors',
+                })
                   .then(() => {
                     videoParentDomList.push(['player', cameraUrl]);
                     childResolve(null);

+ 3 - 4
src/views/vent/deviceManager/equipManager/component/DeviceModal.vue

@@ -13,15 +13,14 @@
       <a-tab-pane key="1" tab="基本信息" force-render>
         <FormModal  v-if="activeKey == '1'" :record="record" :formSchema="formSchema" @saveOrUpdate="saveOrUpdate" />
       </a-tab-pane>
-      <a-tab-pane key="1" tab="密码设置" force-render>
-        <FormModal v-if="activeKey == '1'" :record="passwordRecord" :formSchema="passwordFormSchema" @saveOrUpdate="savePassword" />
+      <a-tab-pane key="2" tab="密码设置" force-render>
+        <FormModal v-if="activeKey == '2'" :record="passwordRecord" :formSchema="passwordFormSchema" @saveOrUpdate="savePassword" />
       </a-tab-pane>
     </a-tabs>
     <FormModal v-else :record="record"  :formSchema="formSchema" @saveOrUpdate="saveOrUpdate" />
   </BasicModal>
 </template>
 
-
 <script lang="ts" setup>
   import { ref, onMounted, reactive } from 'vue';
   import { BasicModal, useModalInner } from '/@/components/Modal';
@@ -30,7 +29,7 @@
   import { passwordList, editPassword } from '../equip.api.ts'
 
   // 声明Emits
-  const emit = defineEmits(['saveOrUpdate', 'register']);  
+  const emit = defineEmits(['saveOrUpdate', 'register']);
   const title = ref('')
   const record = ref({})
   const passwordRecord = ref({})

+ 2 - 5
src/views/vent/home/colliery/index.vue

@@ -78,7 +78,7 @@
   </div>
 </template>
 <script lang="ts" setup>
-import { reactive, onMounted, ref, nextTick, computed, onUnmounted,onBeforeUnmount } from 'vue';
+import { reactive, onMounted, ref, nextTick, computed, inject ,onBeforeUnmount } from 'vue';
 import fanMonitor from './components/fan-monitor.vue';
 import mainMonitor from './components/main-monitor.vue';
 import windDevice from './components/wind-device.vue';
@@ -94,9 +94,6 @@ import { useRouter } from 'vue-router';
 // import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
 import moment from 'moment';
 import { getActions } from '/@/qiankun/state';
-import { useGo } from '/@/hooks/web/usePage';
-
-const go = useGo();
 const actions = getActions();
 let timer: NodeJS.Timeout | null = null;
 let fanLocalList = reactive<any[]>([]); //局部风机数据
@@ -251,7 +248,7 @@ let timeDate = computed(() => {
 
 function goModalDetail() {
   history.pushState({}, '', '/micro-vent-3dModal/dashboard/analysis?deviceType=model3D');
-  // router.push('/micro-vent-3dModal/dashboard/analysis?deviceType=model3D')
+  location.reload()
 }
 
 onMounted(() => {

+ 11 - 11
src/views/vent/monitorManager/alarmMonitor/index.vue

@@ -4,7 +4,7 @@
     <div class="lr left-box">
       <ventBox1>
         <template #title>
-          <div class="monitor-title" @click="showModal('vent')">通风监测</div>
+          <div class="monitor-title" @click="showModal('vent')">通风预警监测</div>
         </template>
         <template #container>
           <!-- <div ref="alarmCounts" style="height: 160px" id="alarmCounts"></div> -->
@@ -150,7 +150,7 @@
               <div class="icon"></div>
             </div>
             <div class="item-monitor-box">
-              <span class="title">火灾监测</span>
+              <span class="title">火灾预警监测</span>
               <span :class="centerData.fire == '正常' ? 'value' : 'value1'">{{ centerData.fire }}</span>
             </div>
           </div>
@@ -159,7 +159,7 @@
               <div class="icon"></div>
             </div>
             <div class="item-monitor-box">
-              <span class="title">设备监测</span>
+              <span class="title">设备预警监测</span>
               <span :class="centerData.sb == '正常' ? 'value' : 'value1'">{{ centerData.sb }}</span>
             </div>
           </div>
@@ -168,7 +168,7 @@
               <div class="icon"></div>
             </div>
             <div class="item-monitor-box">
-              <span class="title">瓦斯监测</span>
+              <span class="title">瓦斯预警监测</span>
               <span :class="centerData.ws == '正常' ? 'value' : 'value1'">{{ centerData.ws }}</span>
               <div class="">
                 <span class="title">矿井瓦斯鉴定等级监测</span>
@@ -181,7 +181,7 @@
               <div class="icon"></div>
             </div>
             <div class="item-monitor-box">
-              <span class="title">粉尘监测</span>
+              <span class="title">粉尘预警监测</span>
               <span :class="centerData.fc == '正常' ? 'value' : 'value1'">{{ centerData.fc }}</span>
             </div>
           </div>
@@ -190,14 +190,14 @@
               <div class="icon"></div>
             </div>
             <div class="item-monitor-box">
-              <span class="title">通风监测</span>
+              <span class="title">通风预警监测</span>
               <span :class="centerData.tf == '正常' ? 'value' : 'value1'">{{ centerData.tf }}</span>
             </div>
           </div>
         </div>
       </div>
       <div class="fire-monitor">
-        <div class="monitor-title top" @click="showModal('fire')">火灾监测</div>
+        <div class="monitor-title top" @click="showModal('fire')">火灾预警监测</div>
         <div class="container">
 
           <div class="item item1">
@@ -211,7 +211,7 @@
                 'value5': item.level == 104,
                 'value6': item.level == 201,
                 'value': item.level != 0 && item.level != 101 && item.level != 102 && item.level != 103 && item.level != 104 && item.level != 201,
-              }">{{ item.value }} </div>
+              }">{{ item.value ? item.value : '-' }} </div>
               <div class="title">{{ item.title }}</div>
             </div>
           </div>
@@ -226,7 +226,7 @@
                 'value5': item.level == 104,
                 'value6': item.level == 201,
                 'value': item.level != 0 && item.level != 101 && item.level != 102 && item.level != 103 && item.level != 104 && item.level != 201,
-              }"> {{ item.value }} </div>
+              }"> {{ item.value ? item.value : '-' }} </div>
               <div class="title">{{ item.title }}</div>
             </div>
           </div>
@@ -237,7 +237,7 @@
     <div class="lr right-box">
       <ventBox1>
         <template #title>
-          <div class="monitor-title" @click="showModal('dust')">粉尘监测</div>
+          <div class="monitor-title" @click="showModal('dust')">粉尘预警监测</div>
         </template>
         <template #container>
 
@@ -255,7 +255,7 @@
 
       <ventBox1 class="vent-margin-t-10">
         <template #title>
-          <div class="monitor-title" @click="showModal('gas')">瓦斯监测</div>
+          <div class="monitor-title" @click="showModal('gas')">瓦斯预警监测</div>
         </template>
         <template #container>
           <div class="gas-box">

+ 0 - 1
src/views/vent/monitorManager/camera/index.vue

@@ -19,7 +19,6 @@
   import {onMounted, onUnmounted, ref } from 'vue';
   import { list } from './camera.api'
   import LivePlayer from '@liveqing/liveplayer-v3';
-  import { Icon } from '/@/components/Icon';
 
   const webRtcServerList = <any[]>[]
   let addrList = ref<{ name: string, addr: string }[]>([])

+ 3 - 4
src/views/vent/monitorManager/comment/HistoryTable.vue

@@ -124,7 +124,7 @@ import { onMounted } from 'vue';
     if(result){
       deviceOptions = []
       deviceOptions = result.map((item) => {
-        return {label: item['strname'], value: item['id'], strtype: item['strtype'], devicekind: item['devicekind'] }
+        return {label: item['strinstallpos'], value: item['id'], strtype: item['strtype'], strinstallpos: item['strinstallpos'],  devicekind: item['devicekind'] }
         // return { label: item['strname'], value: item['id']}
       })
       
@@ -208,8 +208,7 @@ import { onMounted } from 'vue';
                 // labelField: 'strinstallpos',
                 // valueField: 'id',
                 onChange: (e, option) => {
-                  debugger
-                  if (option && (option['strtype'] || option['devicekind'])) historyType.value = option['strtype'] || option['devicekind']
+                  if (option && (option['strinstallpos'] || option['strtype'] || option['devicekind'])) historyType.value = option['strinstallpos'] || option['strtype'] || option['devicekind']
                 },
               },
               colProps: {
@@ -338,7 +337,7 @@ import { onMounted } from 'vue';
               // valueField: 'id',
               // numberToString: true,
               onChange: (e, option) => {
-                if(option && (option['strtype'] || option['devicekind'])) historyType.value = option['strtype'] || option['devicekind']
+                if (option && (option['strinstallpos'] || option['strtype'] || option['devicekind'])) historyType.value = option['strinstallpos'] || option['strtype'] || option['devicekind']
               },
             },
             // componentProps: ({ formModel }) => {

+ 84 - 25
src/views/vent/monitorManager/compressor/components/nitrogenHome1.vue

@@ -163,13 +163,16 @@
               <div>设备实时监测曲线</div>
             </template>
             <template #container>
-              <BarAndLineCustom
+              <BarAndLine
+                v-if="chartsColumns.length > 0"
                 xAxisPropType="readTime"
-                :chartData="echartData"
-                height="240px"
-                :propTypeArr="['FluxTotal1', 'InputFlux']"
-                :option="zhudanOption"
+                :dataSource="echartData"
+                height="340px"
+                :chartsColumns="chartsColumns"
+                chartsType="listMonitor"
+                :option="echatsOption"
               />
+                        <!-- :option="zhudanOption" -->
             </template>
           </ventBox1>
         </div>
@@ -179,18 +182,22 @@
   <HandleModal :modal-is-show="modalIsShow" :modal-title="modalTitle" :modal-type="modalType" @handle-ok="handleOK" @handle-cancel="handleCancel" />
 </template>
 <script lang="ts" setup name="nitrogenHome">
-  import { onMounted, onUnmounted, ref, watch, reactive, defineProps, nextTick } from 'vue';
+  import { onMounted, onUnmounted, ref, watch, reactive, defineProps, nextTick, inject } from 'vue';
   import ventBox1 from '/@/components/vent/ventBox1.vue';
   import fourBorderBg from '../../../comment/components/fourBorderBg.vue';
   import { mountedThree, destroy, setModelType } from '../nitrogen.threejs';
   import { getDevice } from '../nitrogen.api';
   import { SvgIcon } from '/@/components/Icon';
-  import BarAndLineCustom from '/@/components/chart/BarAndLineCustom.vue';
+  import BarAndLine from '/@/components/chart/BarAndLine.vue';
   import { zhudanOption } from '../nitrogen.data.ts';
   import HandleModal from './modal.vue';
   import { deviceControlApi } from '/@/api/vent/index';
   import { message } from 'ant-design-vue';
+  import { computed } from 'vue';
+  import lodash from 'lodash';
 
+  const globalConfig = inject('globalConfig');
+  
   const props = defineProps({
     deviceId: {
       type: String,
@@ -209,13 +216,26 @@
     data: {},
     isFw:null,
   });
+
   // const kyjs = ['1号空压机', '1号空压机', '1号空压机', '1号空压机'];
 
   const flvURL1 = () => {
     // return `https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv`;
     return '';
   };
-
+  const colors = ['#FDB146', '#EE6666', '#9BCB75', '#03C2EC', '#DA3914', '#9C83D9']
+  const echatsOption = {
+    grid: {
+      top: '35%',
+      left: '-25px',
+      right: '10px',
+      bottom: '3%',
+      containLabel: true
+    },
+    toolbox: {
+      feature: {}
+    }
+  }
   const monitorDataGroupNum = ref(0);
 
   let airCompressorState = reactive<any[]>([]);
@@ -240,6 +260,36 @@
       AirCompressor_LoadTime: '加载时间(h)',
     },
   ];
+  const propTypeArr = ref([])
+  const chartsColumns = ref([])
+  watch(monitorDataGroupNum, () => {
+    
+    const arr = <any[]>[]
+    const item = {
+      legend: '瞬时流量',
+      seriesName: '(m³/h)',
+      ymax: 5,
+      yname: 'm³/h',
+      linetype: 'line',
+      yaxispos: 'left',
+      color: '#FDB146',
+      sort: 1,
+      xRotate: 0,
+      dataIndex: 'InputFlux',
+    }
+    const propTypeList = []
+    for (let i = 1; i <= monitorDataGroupNum.value; i++) {
+      const lineType = lodash.cloneDeep(item)
+      lineType.legend = `制氮机${i}瞬时流量`;
+      lineType.dataIndex = `InputFlux${i}`
+      lineType.color = colors[i-1]
+      arr.push(lineType)
+    }
+    chartsColumns.value = arr
+
+  })
+
+
 
   const monitorData = ref(
     new Array(3).fill({
@@ -264,7 +314,7 @@
   );
 
   //图表数据
-  let echartData = reactive<any>([]);
+  let echartData = ref<any>([]);
 
   // https获取监测数据
   let timer: null | NodeJS.Timeout = null;
@@ -294,26 +344,31 @@
       if (!result || result.msgTxt.length < 1) return;
       result.msgTxt.forEach((item) => {
         if (item.type && item.type.startsWith('nitrogen')) {
+          airCompressorState.length = 0;
           monitorData.value = item['datalist'].filter((data) => {
-            const item = data.readData;
-            return Object.assign(data, item);
+            const readData = data.readData;
+            airCompressorState.push({
+              id: data.deviceID,
+              deviceType: data.deviceType,
+              HMIReset: readData.HMIReset,
+              HMIStartStop: readData.HMIStartStop
+            });
+            return Object.assign(data, readData);
           });
+          const airCompressor = {readTime: monitorData.value[0]['readTime'].substring(11) }
+          const dataArr = lodash.cloneDeep(echartData.value)
           //图表数据
-          if (echartData.length <= 5) {
-            monitorData.value.forEach((el) => {
-              echartData.push(el);
+          if (dataArr.length <= 5) {
+            monitorData.value.forEach((el, index) => {
+              airCompressor[`InputFlux${index+1}`] = el['InputFlux'] || 0
             });
+            dataArr.push(airCompressor)
+          }else{
+            dataArr.shift()
+            dataArr.push(airCompressor)
           }
-
-          airCompressorState.length = 0;
-          item['datalist'].forEach((v) => {
-            airCompressorState.push({
-              id: v.deviceID,
-              deviceType:v.deviceType,
-              HMIReset:v.readData.HMIReset,
-              HMIStartStop:v.readData.HMIStartStop
-            });
-          });
+          echartData.value = dataArr
+          
         }
       });
       monitorDataGroupNum.value = monitorData.value.length;
@@ -366,7 +421,11 @@
       if (res.success) {
         modalIsShow.value = false;
         getDataSource(props.deviceId);
-        message.success('指令下发成功!')
+        if(globalConfig.History_Type == 'remote'){
+          message.success('指令已下发至生产管控平台成功!')
+        }else{
+          message.success('指令已下发成功!')
+        }
       }
     });
   }

+ 43 - 43
src/views/vent/monitorManager/compressor/nitrogen.data.ts

@@ -63,7 +63,7 @@ export const zhudanOption = reactive({
   legend: {
     top: '0',
     icon: 'rect',
-    data: ['累计流量', '瞬时流量'],
+    data: ['瞬时流量'],
     right: '10px',
     textStyle: { fontSize: 12, color: '#fff' },
   },
@@ -111,18 +111,18 @@ export const zhudanOption = reactive({
     data: [],
   },
   yAxis: [
-    {
-      type: 'value',
-      name: 'm³/h',
-      max: 6000,
-      axisTick: {
-        show: false,
-      },
-      position: 'left',
-      axisLine: { lineStyle: { show: true, color: '#57617B' } },
-      axisLabel: { margin: 10, fontSize: 12, color: '#ffffffcc' },
-      splitLine: { show: true, lineStyle: { color: '#57617B22', type: 'dashed' } },
-    },
+    // {
+    //   type: 'value',
+    //   name: 'm³/h',
+    //   max: 6000,
+    //   axisTick: {
+    //     show: false,
+    //   },
+    //   position: 'left',
+    //   axisLine: { lineStyle: { show: true, color: '#57617B' } },
+    //   axisLabel: { margin: 10, fontSize: 12, color: '#ffffffcc' },
+    //   splitLine: { show: true, lineStyle: { color: '#57617B22', type: 'dashed' } },
+    // },
     {
       type: 'value',
       name: 'm³/h',
@@ -137,36 +137,36 @@ export const zhudanOption = reactive({
     },
   ],
   series: [
-    {
-      name: '累计流量',
-      type: 'line',
-      smooth: true,
-      lineStyle: { width: 2 },
-      yAxisIndex: 0,
-      areaStyle: {
-        color: new echarts.graphic.LinearGradient(
-          0,
-          0,
-          0,
-          1,
-          [
-            {
-              offset: 0,
-              color: 'rgba(185,150,248,0.3)',
-            },
-            {
-              offset: 0.8,
-              color: 'rgba(185,150,248,0)',
-            },
-          ],
-          false
-        ),
-        shadowColor: 'rgba(0, 0, 0, 0.1)',
-        shadowBlur: 10,
-      },
-      itemStyle: { color: '#B996F8' },
-      data: [],
-    },
+    // {
+    //   name: '累计流量',
+    //   type: 'line',
+    //   smooth: true,
+    //   lineStyle: { width: 2 },
+    //   yAxisIndex: 0,
+    //   areaStyle: {
+    //     color: new echarts.graphic.LinearGradient(
+    //       0,
+    //       0,
+    //       0,
+    //       1,
+    //       [
+    //         {
+    //           offset: 0,
+    //           color: 'rgba(185,150,248,0.3)',
+    //         },
+    //         {
+    //           offset: 0.8,
+    //           color: 'rgba(185,150,248,0)',
+    //         },
+    //       ],
+    //       false
+    //     ),
+    //     shadowColor: 'rgba(0, 0, 0, 0.1)',
+    //     shadowBlur: 10,
+    //   },
+    //   itemStyle: { color: '#B996F8' },
+    //   data: [],
+    // },
     {
       name: '瞬时流量',
       type: 'line',

+ 17 - 4
src/views/vent/monitorManager/deviceMonitor/components/device/device.data.ts

@@ -220,7 +220,20 @@ export const majorColumns: BasicColumn[] = [
   },
 ];
 
-export const noDetailArr = ['nitrogen', 'forcFan'];
-export const haveDetailArr = ['windrect', 'window', 'gate', 'fanlocal', 'fanmain', 'fiber', 'bundletube', 'dusting', 'pump', 'safetymonitor'];
-export const haveHandlerArr = ['windrect', 'window', 'gate', 'fanlocal', 'fanmain', 'pump', 'obfurage', 'nitrogen', 'pulping', 'spray', 'dustdev'];
-export const noWarningArr = ['location', 'vehicle', 'cheliang'];
+export const noDetailArr = ['nitrogen', 'forcFan']; // 前端详情的,
+export const haveDetailArr = [
+  'windrect',
+  'window',
+  'gate',
+  'fanlocal',
+  'fanmain',
+  'fiber',
+  'bundletube',
+  // 'dusting',
+  'pump',
+  'safetymonitor',
+  'nitrogen',
+];
+export const haveHandlerArr = ['windrect', 'window', 'gate', 'fanlocal', 'fanmain', 'pump', 'obfurage', 'nitrogen', 'pulping', 'spray', 'dustdev']; // table无操作
+export const noWarningArr = ['location', 'vehicle', 'cheliang']; // 无预警详情的
+export const haveSysDetailArr = ['']; //有场景详情的

+ 93 - 23
src/views/vent/monitorManager/deviceMonitor/components/device/index.vue

@@ -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)) ? [
                     {
@@ -125,6 +117,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">
                       <a-tag
@@ -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) {

+ 47 - 44
src/views/vent/monitorManager/deviceMonitor/components/device/modal/bundle.modal.vue

@@ -69,7 +69,7 @@
             </div>
             <div class="item-container">
               <div class="title">风险等级</div>
-              <div class="warning-value">低风险</div>
+              <div class="warning-value">{{ posMonitor['warnLevel_str'] ? posMonitor['warnLevel_str'] : '-' }}</div>
             </div>
           </div>
           <div class="top-item warning-box">
@@ -78,7 +78,7 @@
             </div>
             <div class="item-container">
               <div class="title">连接状态</div>
-              <div class="warning-value">连接</div>
+              <div class="warning-value">{{ posMonitor['netStatus'] == 1 ? '连接': '未连接' }}</div>
             </div>
           </div>
         </div>
@@ -87,8 +87,8 @@
           <div class="echarts-box">
             <BarAndLine
               class="echarts-line"
-              xAxisPropType="readTime"
-              :dataSource="deviceList"
+              xAxisPropType="time"
+              :dataSource="historyList"
               height="100%"
               :chartsColumns="chartsColumns"
               :option="echatsOption"
@@ -100,7 +100,7 @@
   </BasicModal>
 </template>
 <script lang="ts">
-import { defineComponent, ref, watch, shallowRef, reactive } from 'vue';
+import { defineComponent, ref, watch, shallowRef } from 'vue';
 import { BasicModal, useModalInner } from '/@/components/Modal';
 import BarAndLine from '/@/components/chart/BarAndLine.vue';
 import { SvgIcon } from '/@/components/Icon';
@@ -119,27 +119,28 @@ export default defineComponent({
     const loading = ref(true);
     const activeDeviceID = ref('');
     const deviceList = ref<any[]>([])
+    const historyList = ref<any[]>([])
     const posList = ref<any[]>([])
     const posMonitor = shallowRef({})
 
     const echatsOption = {
       grid: {
         top: '25%',
-        left: '0%',
-        right: '0%',
+        left: '30',
+        right: '45',
         bottom: '3%',
         containLabel: true
       },
       toolbox: {
         feature: {}
-      }
+      },
     }
 
     const chartsColumns = [
       {
         legend: '一氧化碳',
         seriesName: '(ppm)',
-        ymax: 20,
+        ymax: 10,
         yname: 'ppm',
         linetype: 'line',
         yaxispos: 'left',
@@ -149,10 +150,34 @@ export default defineComponent({
         dataIndex: 'coval',
       },
       {
+        legend: '乙炔',
+        seriesName: '',
+        ymax: 10,
+        yname: 'ppm',
+        linetype: 'line',
+        yaxispos: 'left',
+        color: '#00FFA8',
+        sort: 1,
+        xRotate: 0,
+        dataIndex: 'chval',
+      },
+      {
+        legend: '乙烯',
+        seriesName: '',
+        ymax: 10,
+        yname: 'ppm',
+        linetype: 'line',
+        yaxispos: 'left',
+        color: '#AE19FF',
+        sort: 1,
+        xRotate: 0,
+        dataIndex: 'ch2val',
+      },
+      {
         legend: '二氧化碳',
         seriesName: '(%)',
-        ymax: 10,
-        yname: '%',
+        ymax: 20,
+        yname: '1%',
         linetype: 'line',
         yaxispos: 'right',
         color: '#9C83D9',
@@ -162,9 +187,9 @@ export default defineComponent({
       },
       {
         legend: '甲烷',
-        seriesName: '(%)',
-        ymax: 10,
-        yname: '%',
+        seriesName: '',
+        ymax: 20,
+        yname: '1%',
         linetype: 'line',
         yaxispos: 'right',
         color: '#DA3914',
@@ -174,40 +199,17 @@ export default defineComponent({
       },
       {
         legend: '氧气',
-        seriesName: '(%)',
-        ymax: 10,
-        yname: '%',
+        seriesName: '(氧气%)',
+        ymax: 30,
+        yname: '2%',
         linetype: 'line',
         yaxispos: 'right',
         color: '#03C2EC',
-        sort: 2,
+        sort: 3,
         xRotate: 0,
         dataIndex: 'o2val',
       },
-      {
-        legend: '乙炔',
-        seriesName: '(ppm)',
-        ymax: 20,
-        yname: 'ppm',
-        linetype: 'line',
-        yaxispos: 'left',
-        color: '#00FFA8',
-        sort: 1,
-        xRotate: 0,
-        dataIndex: 'chval',
-      },
-      {
-        legend: '乙烯',
-        seriesName: '(ppm)',
-        ymax: 20,
-        yname: 'ppm',
-        linetype: 'line',
-        yaxispos: 'left',
-        color: '#AE19FF',
-        sort: 1,
-        xRotate: 0,
-        dataIndex: 'ch2val',
-      },
+      
     ]
     const [register, { setModalProps, closeModal }] = useModalInner();
 
@@ -251,14 +253,15 @@ export default defineComponent({
       deviceList.value = newDataSource?.filter((item:any, index) => {
         if((!activeDeviceID.value && index == 0) || item.deviceID === activeDeviceID.value){
           activeDeviceID.value = item.deviceID
-          posMonitor.value = item.readData
+          posMonitor.value = Object.assign(item, item.readData)
+          historyList.value = item['history']
         }
         item.readTime = item.readTime?.substring(11)
         return item
       })
     })
 
-    return { register, model: modelRef, currentTime, handleVisibleChange, selectDevice, handleOk, handleCancel, deviceList, activeDeviceID, posMonitor, echatsOption, posList, chartsColumns };
+    return { register, model: modelRef, currentTime, handleVisibleChange, selectDevice, handleOk, handleCancel, deviceList, historyList, activeDeviceID, posMonitor, echatsOption, posList, chartsColumns };
   },
   
 });

+ 17 - 16
src/views/vent/monitorManager/deviceMonitor/components/device/modal/dust.modal.vue

@@ -14,7 +14,7 @@
             </div>
             <div class="item-container">
               <div class="title">巷道温度</div>
-              <div class="value"><span class="data">{{ dustMonitor.temperature }}</span> <span>℃</span> </div>
+              <div class="value"><span class="data">{{ dustMonitor.temperature ? dustMonitor.temperature : '-' }}</span> <span>℃</span> </div>
             </div>
           </div>
           <div class="top-item">
@@ -23,7 +23,7 @@
             </div>
             <div class="item-container">
               <div class="title">粉尘浓度</div>
-              <div class="value"><span class="data">{{ dustMonitor.humidity }}</span> <span>mg/m³</span></div>
+              <div class="value"><span class="data">{{ dustMonitor.humidity ? dustMonitor.humidity : '-' }}</span> <span>mg/m³</span></div>
             </div>
           </div>
           <div class="top-item">
@@ -32,7 +32,7 @@
             </div>
             <div class="item-container">
               <div class="title">喷雾水压</div>
-              <div class="value"><span class="data">{{ dustMonitor.waterPressure }}</span> <span>MPa</span></div>
+              <div class="value"><span class="data">{{ dustMonitor.waterPressure ? dustMonitor.waterPressure : '-' }}</span> <span>MPa</span></div>
             </div>
           </div>
           <div class="top-item warning-box">
@@ -41,7 +41,7 @@
             </div>
             <div class="item-container">
               <div class="title">喷雾装置</div>
-              <div class="warning-value">低风险</div>
+              <div class="warning-value">{{ dustMonitor['warnLevel_str'] ? dustMonitor['warnLevel_str'] : '-' }}</div>
             </div>
           </div>
           <div class="top-item warning-box">
@@ -61,19 +61,19 @@
           <div class="dust-group">
             <div class="dust-item">
               <div class="title">粉尘浓度(实时)</div>
-              <div class="value">{{ dustMonitor.breathWeighted }}<span>mg/m³</span></div>
+              <div class="value">{{ dustMonitor.breathWeighted ? dustMonitor.breathWeighted : '-' }}<span>mg/m³</span></div>
             </div>
             <div class="dust-item">
               <div class="title">总尘浓度(时间加权)</div>
-              <div class="value">{{ dustMonitor.totalDust }}<span>mg/m³</span></div>
+              <div class="value">{{ dustMonitor.totalDust ? dustMonitor.totalDust : '-' }}<span>mg/m³</span></div>
             </div>
             <div class="dust-item">
               <div class="title">呼吸加权容许浓度</div>
-              <div class="value">{{ dustMonitor.breathWeighted }}<span>mg/m³</span></div>
+              <div class="value">{{ dustMonitor.breathWeighted ? dustMonitor.breathWeighted : '-' }}<span>mg/m³</span></div>
             </div>
             <div class="dust-item">
               <div class="title">爆炸浓度(煤尘)</div>
-              <div class="value">{{ dustMonitor.dustval }}<span>mg/m³</span></div>
+              <div class="value">{{ dustMonitor.dustval ? dustMonitor.dustval : '-' }}<span>mg/m³</span></div>
             </div>
           </div> 
         </div>
@@ -81,7 +81,7 @@
           <span class="base-title">粉尘预测曲线</span>
           <div class="echarts-box">
             <BarAndLine
-              xAxisPropType="readTime"
+              xAxisPropType="time"
               :dataSource="posList"
               height="100%"
               :chartsColumns="chartsColumns"
@@ -253,13 +253,14 @@ export default defineComponent({
       newDataSource?.forEach((item:any, index) => {
         if((!activeDeviceID.value && index == 0) || item.deviceID === activeDeviceID.value){
           activeDeviceID.value = item.deviceID
-          const list = item.summaryHour
-          list.filter(data => {
-            const date = new Date();     //1. js获取当前时间
-            const min = date.getMinutes();  //2. 获取当前分钟
-            return Object.assign(data, data.dustval, { readTime: (dayjs(date.setMinutes(min + 10))).format('YYYY-MM-DD HH:mm:ss') })
-          })
-          if(list.length > 0) posList.value = list
+          // const list = item.summaryHour
+          // list.filter(data => {
+          //   const date = new Date();     //1. js获取当前时间
+          //   const min = date.getMinutes();  //2. 获取当前分钟
+          //   return Object.assign(data, data.dustval, { readTime: (dayjs(date.setMinutes(min + 10))).format('YYYY-MM-DD HH:mm:ss') })
+          // })
+          // if(list.length > 0) posList.value = list
+          posList.value = item['history']
           dustMonitor.value = item.readData
         }
       })

+ 7 - 7
src/views/vent/monitorManager/fanLocalMonitor/fanLocal.three.ts

@@ -131,7 +131,7 @@ export const addText = (selectData) => {
       y: 110,
     },
     {
-      text: `进风量(m³/min):`,
+      text: `供风距离(m):`,
       font: 'normal 30px Arial',
       color: '#009900',
       strokeStyle: '#002200',
@@ -139,7 +139,7 @@ export const addText = (selectData) => {
       y: 165,
     },
     {
-      text: `${selectData.windQuantity1}`,
+      text: `${selectData.flength ? selectData.flength : '-'}`,
       font: 'normal 30px Arial',
       color: '#009900',
       strokeStyle: '#002200',
@@ -147,7 +147,7 @@ export const addText = (selectData) => {
       y: 165,
     },
     {
-      text: `供风量(m³/min): `,
+      text: `风筒直径(m): `,
       font: 'normal 30px Arial',
       color: '#009900',
       strokeStyle: '#002200',
@@ -155,7 +155,7 @@ export const addText = (selectData) => {
       y: 220,
     },
     {
-      text: ` ${selectData.windQuantity2}`,
+      text: ` ${selectData.fsectarea ? selectData.fsectarea : '-'}`,
       font: 'normal 30px Arial',
       color: '#009900',
       strokeStyle: '#002200',
@@ -171,7 +171,7 @@ export const addText = (selectData) => {
       y: 275,
     },
     {
-      text: `${selectData.fault}`,
+      text: `${selectData.warnLevel_str ? selectData.warnLevel_str : '-'}`,
       font: 'normal 30px Arial',
       color: '#009900',
       strokeStyle: '#002200',
@@ -179,11 +179,11 @@ export const addText = (selectData) => {
       y: 275,
     },
     {
-      text: `煤炭科学技术研究院有限公司研制`,
+      text: `国能神东煤炭集团监制`,
       font: 'normal 28px Arial',
       color: '#009900',
       strokeStyle: '#002200',
-      x: 20,
+      x: 80, //20  煤炭科学技术研究院有限公司研制
       y: 325,
     },
   ];

+ 29 - 10
src/views/vent/monitorManager/fanLocalMonitor/index.vue

@@ -476,7 +476,7 @@
     sourcePressure: '-', //气源压力
     dataDequivalarea: '-',
     netStatus: '0', //通信状态
-    fault: '气源压力超限',
+    warnLevel_str: '',
     stationname: ''
   };
   const dataSource = ref([]);
@@ -551,8 +551,6 @@
     }else{
       return dataSource.value = []
     }
-    
-    
   };
 
   // https获取监测数据
@@ -569,7 +567,8 @@
             MonitorDataTable.value.setSelectedRowKeys(dataSource.value[0]['deviceID'])
           }
         }
-        lodash.omit(selectData, lodash.keys(selectData))
+        selectData = lodash.cloneDeep(initData)
+    
         if(dataSource.value.length > 0 && dataSource.value[selectRowIndex.value] ){
           Object.assign(selectData, dataSource.value[selectRowIndex.value])
           deviceType.value = selectData['deviceType']
@@ -577,7 +576,7 @@
           // playAnimation(data, selectData.maxarea);
           playSmoke(selectData)
         }else{
-          lodash.omit(selectData, lodash.keys(selectData))
+          // lodash.omit(selectData, lodash.keys(selectData))
           Object.assign(selectData, initData)
           deviceType.value = ''
         }
@@ -661,7 +660,11 @@
         // playSmoke(handType, 'top', frequency, 'open');
         data.paramcode = 'CtrlFan1Start';
         deviceControlApi(data).then(() => {
-          message.success('指令下发成功!')
+          if (globalConfig.History_Type == 'remote') {
+            message.success('指令已下发至生产管控平台成功!')
+          } else {
+            message.success('指令已下发成功!')
+          }
           modalTitle.value = '';
           modalIsShow.value = false;
         }).catch((err) => {
@@ -671,7 +674,11 @@
         // playSmoke(handType, 'down', frequency, 'open');
         data.paramcode = 'CtrlFan2Start';
         deviceControlApi(data).then(() => {
-          message.success('指令下发成功!')
+          if (globalConfig.History_Type == 'remote') {
+            message.success('指令已下发至生产管控平台成功!')
+          } else {
+            message.success('指令已下发成功!')
+          }
           modalTitle.value = '';
           modalIsShow.value = false;
         }).catch((err) => {
@@ -691,7 +698,11 @@
       }
       
       deviceControlApi(data).then((res) => {
-        message.success('指令下发成功!')
+        if (globalConfig.History_Type == 'remote') {
+          message.success('指令已下发至生产管控平台成功!')
+        } else {
+          message.success('指令已下发成功!')
+        }
         modalTitle.value = '';
         modalIsShow.value = false;
       }).catch((err) => {
@@ -701,7 +712,11 @@
       if(selectData['Fan1StartStatus'] == 0 || !selectData['Fan1StartStatus']){
         data.paramcode = 'CtrlFan1Start';
         deviceControlApi(data).then((res) => {
-          message.success('指令下发成功!')
+          if (globalConfig.History_Type == 'remote') {
+            message.success('指令已下发至生产管控平台成功!')
+          } else {
+            message.success('指令已下发成功!')
+          }
           modalTitle.value = '';
           modalIsShow.value = false;
           mainWindIsShow1.value = 'stop';
@@ -713,7 +728,11 @@
       }else if(selectData['Fan2StartStatus'] == 0 || !selectData['Fan2StartStatus']){
         data.paramcode = 'CtrlFan2Start';
         deviceControlApi(data).then((res) => {
-          message.success('指令下发成功!')
+          if (globalConfig.History_Type == 'remote') {
+            message.success('指令已下发至生产管控平台成功!')
+          } else {
+            message.success('指令已下发成功!')
+          }
           modalTitle.value = '';
           modalIsShow.value = false;
           mainWindIsShow1.value = 'open';

+ 7 - 2
src/views/vent/monitorManager/gasPumpMonitor/components/DetailModal.vue

@@ -52,13 +52,14 @@
 </template>
 <script lang="ts" setup>
 
-import { onMounted, ref, defineEmits, onUnmounted } from 'vue';
+import { onMounted, ref, defineEmits, onUnmounted, inject } from 'vue';
 import { BasicModal, useModalInner } from '/@/components/Modal';
 import { pumpCtrlType, valveCtrlType, valveCtrl, PumpCtrlItems, publicPumpCtrlType } from '../gasPump.data'
 import { SvgIcon } from '/@/components/Icon'
 import { message } from 'ant-design-vue';
 import { ExclamationCircleFilled } from '@ant-design/icons-vue';
 import { deviceControlApi } from '/@/api/vent/index';
+const globalConfig = inject('globalConfig');
 
 const emit = defineEmits(['close', 'register'])
 const props = defineProps({
@@ -97,7 +98,11 @@ function handlerFn(paramcode) {
     value: value,
   };
   deviceControlApi(data).then((res) => {
-    message.success('指令下发成功!')
+    if (globalConfig.History_Type == 'remote') {
+      message.success('指令已下发至生产管控平台成功!')
+    } else {
+      message.success('指令已下发成功!')
+    }
   }).catch((err) => {
     // message.success('控制异常');
   });

+ 9 - 4
src/views/vent/monitorManager/gasPumpMonitor/components/gasPumpHome.vue

@@ -1,9 +1,9 @@
 <template>
-  <div id="FlowSensor" class="FlowSensor-box" style="position: absolute;" v-if="selectData.FlowSensor_InputFlux">
+  <!-- <div id="FlowSensor" class="FlowSensor-box" style="position: absolute;" v-if="selectData.FlowSensor_InputFlux">
     <div class="elementContent" >
       <p style="color: #50c8fc;"><span class="data-title">抽采泵流量(m³):</span>{{ formatNum(selectData.FlowSensor_InputFlux) }}</p>
     </div>
-  </div>
+  </div> -->
   <div class="monitor-container">
     <div class="lr left-box">
       <div class="left-container">
@@ -155,7 +155,7 @@
 
 <script setup lang="ts">
 
-import { onBeforeMount, ref, onMounted, onUnmounted, reactive, defineProps, watch } from 'vue';
+import { onBeforeMount, ref, onMounted, onUnmounted, reactive, defineProps, watch, inject } from 'vue';
 import ventBox1 from '/@/components/vent/ventBox1.vue'
 import { setModelType } from '../gasPump.threejs';
 import { stateHeader, valveState, pumpMonitorData, waterPumpData, dewateringPumpData, pumpCtrlType, valveCtrlType, valveCtrl, PumpCtrlItems, pumpCtrl } from '../gasPump.data'
@@ -167,6 +167,7 @@ import { useModal } from '/@/components/Modal';
 import { deviceControlApi } from '/@/api/vent/index';
 import PasswordModal from '../../comment/components/PasswordModal.vue'
 import { message } from 'ant-design-vue';
+const globalConfig = inject('globalConfig');
 
 const props = defineProps({
   deviceId: {
@@ -255,7 +256,11 @@ function handler(passWord, paramcode) {
     value: value,
   };
   deviceControlApi(data).then((res) => {
-    message.success('指令下发成功!')
+    if (globalConfig.History_Type == 'remote') {
+      message.success('指令已下发至生产管控平台成功!')
+    } else {
+      message.success('指令已下发成功!')
+    }
   }).catch((err) => {
     message.success('控制异常');
   });

+ 9 - 7
src/views/vent/monitorManager/gasPumpMonitor/gasPump.threejs.under.ts

@@ -38,13 +38,15 @@ class gasPumpUnder {
     if (!this.group) return;
     if (!this.group.getObjectByName('text1')) {
       const element = document.getElementById('FlowSensor') as HTMLElement;
-      const parentElement = document.getElementById('gas3DCSS') as HTMLElement;
-      parentElement.appendChild(element);
-      const fanLocalCSS3D = new CSS3DObject(element);
-      fanLocalCSS3D.name = 'text1';
-      fanLocalCSS3D.scale.set(0.015, 0.015, 0.015);
-      fanLocalCSS3D.position.set(0, 0.92, 0);
-      this.group.add(fanLocalCSS3D);
+      if (element) {
+        const parentElement = document.getElementById('gas3DCSS') as HTMLElement;
+        parentElement.appendChild(element);
+        const fanLocalCSS3D = new CSS3DObject(element);
+        fanLocalCSS3D.name = 'text1';
+        fanLocalCSS3D.scale.set(0.015, 0.015, 0.015);
+        fanLocalCSS3D.position.set(0, 0.92, 0);
+        this.group.add(fanLocalCSS3D);
+      }
     }
   };
 

+ 14 - 7
src/views/vent/monitorManager/gateMonitor/index.vue

@@ -56,7 +56,7 @@
               :dataSource="dataSource" design-scope="gate-monitor" @selectRow="getSelectRow" :scroll="{ y: scroll.y - 40 }" title="风门监测"
               :isShowPagination="true">
               <template #filterCell="{ column, record }">
-                <template v-if="column.dataIndex === 'frontGateOpen'">
+                <!-- <template v-if="column.dataIndex === 'frontGateOpen'">
                   <a-tag
                     v-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 0"
                     color="red">正在运行</a-tag>
@@ -66,8 +66,8 @@
                   <a-tag
                     v-else-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 1"
                     color="default">关到位</a-tag>
-                </template>
-                <!-- <template v-if="record.frontGateOpenCtrl == 1 || record.frontGateOpenCtrl === true">
+                </template> -->
+                <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>
@@ -107,7 +107,7 @@
                 }}</a-tag>
                 <a-tag v-if="column.dataIndex === 'netStatus'" :color="record.netStatus == 0 ? 'default' : 'green'">{{
                   record.netStatus == 0 ? '断开' : '连接'
-                }}</a-tag> -->
+                }}</a-tag>
               </template>
             </MonitorTable>
           </a-tab-pane>
@@ -163,7 +163,6 @@ import { setDivHeight } from '/@/utils/event';
 import { BorderBox8 as DvBorderBox8 } from '@kjgl77/datav-vue3';
 import { useRouter } from 'vue-router';
 import { deviceCameraInit } from '/@/utils/ventutil.ts'
-
 const globalConfig = inject('globalConfig');
 
 const { currentRoute } = useRouter();
@@ -468,7 +467,11 @@ function handleOK(passWord, handlerState) {
         // 模拟时开启
         if (res.success) {
           modalIsShow.value = false;
-          message.success('指令下发成功!')
+          if (globalConfig.History_Type == 'remote') {
+            message.success('指令已下发至生产管控平台成功!')
+          } else {
+            message.success('指令已下发成功!')
+          }
         }
       })
   }
@@ -593,7 +596,11 @@ function changeType() {
     value: selectData.autoRoManual,
   };
   deviceControlApi(data).then(() => {
-    message.success('指令下发成功!')
+    if (globalConfig.History_Type == 'remote') {
+      message.success('指令已下发至生产管控平台成功!')
+    } else {
+      message.success('指令已下发成功!')
+    }
   });
 };
 

+ 10 - 2
src/views/vent/monitorManager/obfurage1Monitor/index.vue

@@ -454,7 +454,11 @@ function handleOK(passWord, handlerState) {
         // 模拟时开启
         if (res.success) {
           modalIsShow.value = false;
-          message.success('指令下发成功!')
+          if (globalConfig.History_Type == 'remote') {
+            message.success('指令已下发至生产管控平台成功!')
+          } else {
+            message.success('指令已下发成功!')
+          }
         }
       })
   }
@@ -579,7 +583,11 @@ function changeType() {
     value: selectData.autoRoManual,
   };
   deviceControlApi(data).then(() => {
-    message.success('指令下发成功!')
+    if (globalConfig.History_Type == 'remote') {
+      message.success('指令已下发至生产管控平台成功!')
+    } else {
+      message.success('指令已下发成功!')
+    }
   });
 };
 

+ 2 - 2
src/views/vent/monitorManager/windowMonitor/dandaoFc.threejs.ts

@@ -278,8 +278,8 @@ class singleWindow {
     }
     if (!videoPlayer1 && videoPlayer1 === null) {
       monitorPlane.name = 'noPlayer1';
-      monitorPlane.scale.set(0.011, 0.0055, 0.011);
-      monitorPlane.position.set(-2.01, 0.15, -0.23);
+      monitorPlane.scale.set(0.011, 0.0053, 0.012);
+      monitorPlane.position.set(-4.3, 0.13, -0.23);
       this.group?.add(monitorPlane);
     } else if (videoPlayer1) {
       const mesh = renderVideo(this.group, videoPlayer1, 'player1');

+ 7 - 2
src/views/vent/monitorManager/windowMonitor/index.vue

@@ -121,7 +121,7 @@
 <script setup lang="ts">
   import { message } from 'ant-design-vue';
   import DeviceEcharts from '../comment/DeviceEcharts.vue';
-  import { onBeforeMount, ref, onMounted, onUnmounted, reactive, toRaw, watch, nextTick } from 'vue';
+  import { onBeforeMount, ref, onMounted, onUnmounted, reactive, toRaw, watch, nextTick, inject } from 'vue';
   import MonitorTable from '../comment/MonitorTable.vue';
   import HistoryTable from '../comment/HistoryTable.vue';
   import AlarmHistoryTable from '../comment/AlarmHistoryTable.vue';
@@ -137,6 +137,7 @@
   import { BorderBox8 as DvBorderBox8 } from '@kjgl77/datav-vue3';
   import { useRouter } from 'vue-router';
   import { deviceCameraInit } from '/@/utils/ventutil.ts'
+  const globalConfig = inject('globalConfig');
 
   const { currentRoute } = useRouter();
 
@@ -343,7 +344,11 @@
     };
     deviceControlApi(data)
       .then(() => {
-        message.success('指令下发成功!')
+        if (globalConfig.History_Type == 'remote') {
+          message.success('指令已下发至生产管控平台成功!')
+        } else {
+          message.success('指令已下发成功!')
+        }
       })
       .finally(() => {
         handleCancel();

+ 2 - 2
src/views/vent/monitorManager/windowMonitor/shuangdaoFc.threejs.ts

@@ -298,8 +298,8 @@ class doubleWindow {
       if (monitorPlane && !this.group.getObjectByName('noPlayer1')) {
         const planeMesh = monitorPlane.clone();
         planeMesh.name = 'noPlayer1';
-        planeMesh.scale.set(0.0085, 0.0056, 0.012);
-        planeMesh.position.set(-4.23, 0.02, -0.39);
+        planeMesh.scale.set(0.011, 0.0053, 0.012);
+        planeMesh.position.set(-4.3, 0.13, -0.23);
         this.group?.add(planeMesh.clone());
       }
     } else if (videoPlayer1) {

+ 1 - 0
src/views/vent/monitorManager/windowMonitor/window.threejs.ts

@@ -117,6 +117,7 @@ export const play = (rotationParam, flag) => {
 };
 
 export const initCameraCanvas = async (playerVal1?, playerVal2?) => {
+  debugger
   if (windowType === 'singleWindow' && singleWindowObj) {
     return await singleWindowObj.initCamera.call(singleWindowObj, playerVal1);
   } else if (windowType === 'doubleWindow' && doubleWindowObj) {

+ 5 - 1
src/views/vent/monitorManager/windrectMonitor/index.vue

@@ -678,7 +678,11 @@
       .then((res) => {
         // 模拟时开启
         if (res.success) {
-          message.success('指令下发成功!')
+          if (globalConfig.History_Type == 'remote') {
+            message.success('指令已下发至生产管控平台成功!')
+          } else {
+            message.success('指令已下发成功!')
+          }
         }
       })
     }