hongrunxia il y a 1 an
Parent
commit
b935009764

+ 4 - 0
public/js/config.js

@@ -1,4 +1,8 @@
 const VUE_APP_URL = {
   baseUrl: "http://182.92.126.35:9999", // 后台地址
   webRtcUrl: '//192.168.183.216:8000' // rtsp服务器IP地址
+}
+const History_Type = {
+  type: 'vent', // iot、gb、vent
+  deviceType: []
 }

BIN
public/model/glft/fc/ddFc_2023-06-02.glb


BIN
public/model/glft/fc/sdFc_2023-06-02.glb


BIN
public/model/glft/jbfj/jbfj-hd_2023-07-25.glb


+ 2 - 2
src/utils/threejs/main.worker.ts

@@ -19,7 +19,7 @@ export function initModalWorker() {
     'fm/fmThreeBase_2023-07-25.glb',
     'fc/wall_2023-10-11.glb',
     'fc/ddFc_2023-10-11.glb',
-    'fc/sdFc_2023-06-02.glb',
+    'fc/sdFc_2023-10-19.glb',
     'cf/lmcf_2023-06-02.glb',
     'cf/lmcfSide_2023-06-02.glb',
     'cf/zdcf_2023-06-02.glb',
@@ -27,7 +27,7 @@ export function initModalWorker() {
     'cf/dsgd_2023-06-02.glb',
     'cf/ddcf_2023-07-13.glb',
     'cf/dsmove_2023-06-02.glb',
-    'jbfj/jbfj-hd_2023-07-25.glb',
+    'jbfj/jbfj-hd_2023-10-19.glb',
     'jbfj/jbfj-fm_2023-06-02.glb',
     'jbfj/jbfj-fc_2023-06-02.glb',
     'ztfj/dj1_2023-06-02.glb',

+ 10 - 1
src/views/vent/deviceManager/equipManager/component/normalBtnTable.vue

@@ -21,7 +21,16 @@
         </a-dropdown> -->
       </template>
       <template #action="{ record }">
-        <TableAction :actions="getActions(record)" :dropDownActions="getDropDownAction(record)" />
+        <a class="table-action-link" @click="handleEdit(record)">编辑</a>
+        <a class="table-action-link" @click="handleAdds(record)">新增下级</a>
+        <a-popconfirm
+          title="确定删除?"
+          @confirm="handleDelete(record)"
+        >
+          <a class="table-action-link">删除</a>
+        </a-popconfirm>
+        <slot name="action" v-bind="{ record }"></slot>
+        <!-- <TableAction :actions="getActions(record)" :dropDownActions="getDropDownAction(record)" /> -->
       </template>
       <template #bodyCell="{ column, record }">
         <slot name="filterCell" v-bind="{ column, record }"></slot>

+ 3 - 0
src/views/vent/monitorManager/comment/GroupMonitorTable.vue

@@ -69,6 +69,7 @@
 
   /** 定义table Columns */
   function setColumns() {
+    debugger
     const isCheckColumn = {
       title: '',
       dataIndex: 'isCheck',
@@ -103,6 +104,7 @@
     }
     columns.splice(1, 0, runDevice);
     columns = [isCheckColumn, ...columns];
+   
     return columns;
   }
   const columns = setColumns();
@@ -113,6 +115,7 @@
       return props.dataSource;
     },
     (newVal, oldVal) => {
+      debugger
       const list: unknown[] = [];
       newVal.forEach((item) => {
         const data: any = toRaw(item);

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

@@ -19,7 +19,15 @@
   import dayjs from 'dayjs';
 
   const historyTable = ref();
-  const list = (params) => defHttp.get({ url: '/safety/ventanalyMonitorData/list', params });
+  const list = (params) => {
+    if(History_Type.type == 'iot') {
+      return defHttp.post({ url: '/ventanaly-device/history/getDataBySystem', params })
+    } else if (History_Type.type == 'gb') {
+      return defHttp.post({ url: '/ventanaly-device/history/getGbHistoryData', params })
+    } else {
+      return defHttp.get({ url: '/safety/ventanalyMonitorData/list', params })
+    }
+  };
   const emit = defineEmits(['change']);
   const props = defineProps({
     columnsType: {
@@ -182,8 +190,8 @@
         fieldMapToTime: [['tickectDate', ['ttime_begin', 'ttime_end'], '']],
       },
       fetchSetting: {
-        listField: 'datalist.records',
-        totalField: 'datalist.total',
+        listField: History_Type.type == 'iot'? 'records': History_Type.type == 'records'? '': 'datalist.records',
+        totalField: History_Type.type == 'iot' ? 'total' : History_Type.type == 'total' ? 'total' : 'datalist.total',
       },
       beforeFetch(params) {
         params.strtype = props.deviceType + '*';

+ 2 - 2
src/views/vent/monitorManager/compressor/components/nitrogenHome.vue

@@ -132,7 +132,7 @@
   
 </template>
 <script lang="ts" setup name="nitrogenHome">
-import { onMounted, onUnmounted, ref, watch, reactive, defineProps } from 'vue'
+import { onMounted, onUnmounted, ref, watch, reactive, defineProps, nextTick } from 'vue'
 import ventBox1 from '/@/components/vent/ventBox1.vue'
 import fourBorderBg from '../../../comment/components/fourBorderBg.vue'
 import { mountedThree, destroy, setModelType } from '../nitrogen.threejs'
@@ -141,7 +141,7 @@ import { SvgIcon } from '/@/components/Icon'
 import LivePlayer from '@liveqing/liveplayer-v3';
 import BarAndLineCustom from '/@/components/chart/BarAndLineCustom.vue';
 import { zhudanOption } from '../nitrogen.data.ts'
-import { nextTick } from 'vue'
+
 
 const props = defineProps({
   deviceId: {

+ 22 - 44
src/views/vent/monitorManager/compressor/components/nitrogenHome1.vue

@@ -21,14 +21,14 @@
           <div class="monitor-item">
             <span class="monitor-title">累计流量:</span>
             <span class="monitor-val"
-              ><span class="val">{{ monitorData[groupNum - 1]['FluxTotal1'] ? monitorData[groupNum - 1]['FluxTotal1'] ?  parseFloat(monitorData[groupNum - 1]['FluxTotal1']).toFixed(2) : '-' : '-' }}</span
-              ><span class="unit">m³/h</span></span
+              ><span class="val">{{ monitorData[groupNum - 1]['FluxTotal1'] ? monitorData[groupNum - 1]['FluxTotal1'].toFixed(2) : '-' }}</span
+              ><span class="unit">m³</span></span
             >
           </div>
           <div class="monitor-item">
             <span class="monitor-title">氮气纯度:</span>
             <span class="monitor-val"
-              ><span class="val">{{ monitorData[groupNum - 1]['NitrogenPurity'] ? monitorData[groupNum - 1]['NitrogenPurity'] ? parseFloat(monitorData[groupNum - 1]['NitrogenPurity']).toFixed(2) : '-' : '-' }}</span
+              ><span class="val">{{ monitorData[groupNum - 1]['NitrogenPurity'] ? monitorData[groupNum - 1]['NitrogenPurity'].toFixed(2) : '-' }}</span
               ><span class="unit">%</span></span
             >
           </div>
@@ -75,7 +75,7 @@
                       <span class="state-title">{{ Object.values(data)[0] }} :</span>
                       <span class="state-val">{{
                         (monitorData.length > 0 && monitorData[groupNum - 1][Object.keys(data)[0]]) >= 0
-                          ? monitorData[groupNum - 1][Object.keys(data)[0]] ?  parseFloat(monitorData[groupNum - 1][Object.keys(data)[0]]).toFixed(2) : '-'
+                          ? monitorData[groupNum - 1][Object.keys(data)[0]].toFixed(2)
                           : '-'
                       }}</span>
                     </div>
@@ -83,7 +83,7 @@
                       <span class="state-title">{{ Object.values(data)[1] }} :</span>
                       <span class="state-val">{{
                         (monitorData.length > 0 && monitorData[groupNum - 1][Object.keys(data)[1]]) >= 0
-                          ? monitorData[groupNum - 1][Object.keys(data)[1]] ? parseFloat(monitorData[groupNum - 1][Object.keys(data)[1]]).toFixed(2) : '-'
+                          ? monitorData[groupNum - 1][Object.keys(data)[1]].toFixed(2)
                           : '-'
                       }}</span>
                     </div>
@@ -127,32 +127,14 @@
                 <div class="control-item" v-for="(groupNum, index) in monitorDataGroupNum" :key="groupNum">
                   <div class="control-item-title">{{ monitorData[groupNum - 1]['strname'] }}</div>
                   <div class="control-item-state">
-                    <!-- <a-switch
+                    <a-switch
                       v-model="airCompressorState[groupNum - 1][`compressRunSigF1`]"
                       size="small"
                       checked-children="开启"
                       un-checked-children="关闭"
                       :disabled="airCompressorState[groupNum - 1][`controlModel`]"
                       @change="handlerDevice(airCompressorState[groupNum - 1], index)"
-                    /> -->
-                    <a-button v-if="index==0" size="small"  type="text" style="color: #fff;" @click="handlerDevice(airCompressorState[groupNum - 1],false)">一键启停</a-button>
-                    <a-button v-else size="small"  type="text" style="color: #fff;" @click="handlerDevice(airCompressorState[groupNum - 1], false)">一键启停</a-button>
-                 
-                  </div>
-                </div>
-                <div class="control-item" v-for="(groupNum, index) in monitorDataGroupNum" :key="groupNum">
-                  <div class="control-item-title">{{ monitorData[groupNum - 1]['strname'] }}</div>
-                  <div class="control-item-state">
-                    <!-- <a-switch
-                      v-model="airCompressorState[groupNum - 1][`compressRunSigF1`]"
-                      size="small"
-                      checked-children="开启"
-                      un-checked-children="关闭"
-                      :disabled="airCompressorState[groupNum - 1][`controlModel`]"
-                      @change="handlerDevice(airCompressorState[groupNum - 1], index)"
-                    /> -->
-                    <a-button v-if="index==0" size="small"  type="text" style="color: #fff;" @click="handlerDevice(airCompressorState[groupNum - 1],true)">一键复位</a-button>
-                    <a-button v-else size="small"  type="text" style="color: #fff;" @click="handlerDevice(airCompressorState[groupNum - 1],true)">一键复位</a-button>
+                    />
                   </div>
                 </div>
               </div>
@@ -207,7 +189,7 @@
   const loading = ref(true);
   let kzParam = reactive<any>({
     data: {},
-    isFw:null,
+    activeIndex: 0,
   });
   // const kyjs = ['1号空压机', '1号空压机', '1号空压机', '1号空压机'];
 
@@ -222,8 +204,8 @@
 
   const groupParameterData = [
     {
-      FluxTotal1: '累计流量',
-      InputFlux: '瞬时流量',
+      FluxTotal1: '累计流量(m³)',
+      InputFlux: '瞬时流量(m³/h)',
     },
     {
       PreMembraneTemperature: '膜前温度(­°C)',
@@ -236,8 +218,8 @@
       AirCompressor_ExhaustTemp: '排气温度(­°C)',
     },
     {
-      AirCompressor_RunTime: '运行时间',
-      AirCompressor_LoadTime: '加载时间',
+      AirCompressor_RunTime: '运行时间(h)',
+      AirCompressor_LoadTime: '加载时间(h)',
     },
   ];
 
@@ -288,7 +270,6 @@
   async function getDataSource(systemID) {
     const res = await getDevice({ devicetype: 'sys', systemID, type: 'all' });
     console.log(res, 'res---------------');
-   
     if (res) {
       const result = res;
       if (!result || result.msgTxt.length < 1) return;
@@ -310,8 +291,8 @@
             airCompressorState.push({
               id: v.deviceID,
               deviceType:v.deviceType,
-              HMIReset:v.readData.HMIReset,
-              HMIStartStop:v.readData.HMIStartStop
+              compressRunSigF1: false,
+              controlModel: false,
             });
           });
         }
@@ -321,21 +302,19 @@
     }
   }
 
-  function handlerDevice(data,bol) {
-    console.log(bol,'bol-------')
+  function handlerDevice(data, index) {
     kzParam.data = data;
-    kzParam.isFw = bol;
-    console.log(kzParam,'kz--------')
-    if ( bol) {
+    kzParam.activeIndex = index;
+    if (index == 1) {
       modalTitle.value = '一键复位';
       modalType.value = '1';
       modalIsShow.value = true;
-      kzParam.data.HMIReset=!data.HMIReset
+      kzParam.data.compressRunSigF1 = !kzParam.data.compressRunSigF1;
     } else {
       modalTitle.value = '一键启停';
       modalType.value = '2';
       modalIsShow.value = true;
-      kzParam.data.HMIStartStop =!data.HMIStartStop;
+      kzParam.data.compressRunSigF1 = !kzParam.data.compressRunSigF1;
     }
   }
   function handleOK(passWord, handlerState) {
@@ -346,19 +325,19 @@
     // }
 
     let data = {};
-    if (kzParam.isFw ) {
+    if (kzParam.activeIndex == 1) {
       data = {
         deviceid: kzParam.data.id,
         devicetype:kzParam.data.deviceType,
         password: passWord,
-        HMIReset: kzParam.data.HMIReset,
+        HMIReset: kzParam.data.compressRunSigF1,
       };
     } else {
       data = {
         deviceid: kzParam.data.id,
         password: passWord,
         devicetype:kzParam.data.deviceType,
-        HMIStartStop: kzParam.data.HMIStartStop,
+        HMIStartStop: kzParam.data.compressRunSigF1,
       };
     }
 
@@ -642,7 +621,6 @@
             flex-wrap: wrap;
 
             .control-item {
-              width: 50%;//lxh
               display: flex;
               flex-direction: column;
               justify-content: center;

+ 16 - 8
src/views/vent/monitorManager/deviceMonitor/components/device/index.vue

@@ -61,8 +61,8 @@
 
         <a-tabs class="tabs-box" v-model:activeKey="activeKey" @change="tabChange" id="tabsBox" v-if="isRefresh">
           <a-tab-pane key="1" tab="实时监测">
-            <template v-if="deviceType == 'fan' && activeKey == '1'">
-              <GroupMonitorTable :dataSource="dataSource" :columnsType="`${deviceType}_monitor`" />
+            <template v-if="(deviceType.startsWith('fanlocal') || deviceType.startsWith('fanmain')) && activeKey == '1'">
+              <GroupMonitorTable  ref="MonitorDataTable" :dataSource="dataSource" :columnsType="`${deviceType}_monitor`" :scroll="scroll1"/>
             </template>
             <template v-else-if="deviceType == 'majorpath' && activeKey == '1'">
               <a-table :columns="majorColumns" :data-source="dataSource" bordered :scroll="scroll" :pagination="false">
@@ -82,7 +82,7 @@
                 design-scope="device_monitor" :isShowPagination="false" :isShowActionColumn="true" title="设备监测"
                 :scroll="scroll">
                 <template #action="{ record }">
-                  <TableAction :actions="[
+                  <TableAction :actions="deviceType !== 'nitrogen' ?[
                     {
                       label: '详情',
                       onClick: goDetail.bind(null, record),
@@ -91,7 +91,12 @@
                       label: '定位',
                       onClick: goLocation.bind(null, record),
                     },
-                  ]" />
+                  ]: [
+                    {
+                      label: '定位',
+                      onClick: goLocation.bind(null, record),
+                    },
+                  ] " />
                 </template>
                 <template #filterCell="{ column, record }">
                   <template v-if="deviceType.startsWith('gate')">
@@ -253,7 +258,10 @@ const systemID = ref('') // 系统监测时,系统id
 const selectedKeys = ref<string[]>([]);
 const expandedKeys = ref<string[]>(['0-0-0-1']);
 const scroll = reactive({
-  y: 180
+  y: 210
+})
+const scroll1 = reactive({
+  y: 210
 })
 const treeData = ref<TreeProps['treeData']>([]);
 
@@ -418,9 +426,6 @@ function goDetail(record?) {
     } else if (deviceType.value.indexOf("fanlocal") != -1) {
       const newPage = router.resolve({ path: '/monitorChannel/monitor-fan-local', query: { id: activeID.value } })
       window.open(newPage.href, '_blank')
-    } else if (deviceType.value.indexOf("nitrogen") != -1) {
-      const newPage = router.resolve({ path: '/compressor-home', query: { id: activeID.value } })
-      window.open(newPage.href, '_blank')
     } else if (deviceType.value.indexOf("pulping") != -1) {
       const newPage = router.resolve({ path: '/grout-home', query: { id: activeID.value } })
       window.open(newPage.href, '_blank')
@@ -452,6 +457,9 @@ function goDetail(record?) {
     } else if (systemType.value.indexOf("sys_surface_junya") != -1) {
       const newPage = router.resolve({ path: '/monitorChannel/balancePress-home', query: { id: systemID.value } })
       window.open(newPage.href, '_blank')
+    } else if (systemType.value.indexOf("sys_nitrogen") != -1) {
+      const newPage = router.resolve({ path: '/compressor-home', query: { id: systemID.value } })
+      window.open(newPage.href, '_blank')
     } else {
       message.info('待开发。。。')
     }

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

@@ -277,9 +277,11 @@ export const addCssText = () => {
 //   }
 // };
 export const playSmoke = (selectData) => {
+  console.log('selectData[Fan1fHz]------------》',selectData['Fan1fHz'], Number(selectData['Fan1fHz']));
   if (selectData['Fan1StartStatus'] == 1) {
     // 主风机打开
-    setSmokeFrequency('top', selectData['Fan1fHz']);
+    // setSmokeFrequency('top', Number(selectData['Fan1fHz']) || 40);
+    setSmokeFrequency('top', 40);
     runFly('top', 'open');
   } else {
     // 备风机关闭
@@ -287,7 +289,8 @@ export const playSmoke = (selectData) => {
   }
   if (selectData['Fan2StartStatus'] == 1) {
     // 备风机打开
-    setSmokeFrequency('down', selectData['Fan2fHz']);
+    // setSmokeFrequency('down', Number(selectData['Fan2fHz']) || 40);
+    setSmokeFrequency('down', 40);
     runFly('down', 'open');
   } else {
     // 备风机关闭
@@ -400,19 +403,26 @@ const runFly = (deviceType, state) => {
       if (downSmoke.frameId) {
         downSmoke.stopSmoke();
       }
-      topSmoke.startSmoke();
+      if (!topSmoke.frameId) {
+        topSmoke.startSmoke();
+      }
     } else {
       if (topSmoke.frameId) {
         topSmoke.stopSmoke();
       }
-      downSmoke.startSmoke();
+      if (!downSmoke.frameId) {
+        downSmoke.startSmoke();
+      }
     }
   } else {
-    if (downSmoke.frameId) {
-      downSmoke.stopSmoke();
-    }
-    if (topSmoke.frameId) {
-      topSmoke.stopSmoke();
+    if (deviceType === 'top') {
+      if (topSmoke.frameId) {
+        topSmoke.stopSmoke();
+      }
+    } else {
+      if (downSmoke.frameId) {
+        downSmoke.stopSmoke();
+      }
     }
   }
 };
@@ -427,12 +437,14 @@ const setSmokeFrequency = (deviceType, frequency) => {
     if (topLife == life) {
       return;
     }
+    topLife = life;
     smoke = topSmoke;
     duration = (Math.abs(life - smoke.life) / 500) * 25;
   } else {
     if (downLife == life) {
       return;
     }
+    downLife = life;
     smoke = downSmoke;
     duration = (Math.abs(life - smoke.life) / 500) * 25;
   }
@@ -493,7 +505,8 @@ const mousemove = () => {
 export const mountedThree = (playerVal1) => {
   player1 = playerVal1;
   return new Promise((resolve) => {
-    model = new UseThree('#fanLocal3D', '#fanLocal3DCSS');
+    // model = new UseThree('#fanLocal3D', '#fanLocal3DCSS');
+    model = new UseThree('#fanLocal3D');
     model.setEnvMap('test1');
     model.renderer.toneMappingExposure = 1.0;
     if (model.renderer) {
@@ -521,11 +534,11 @@ export const mountedThree = (playerVal1) => {
       model?.animate();
       addLight(model?.scene);
 
-      fcFanObj = new fcFan(model);
-      await fcFanObj.mountedThree();
+      // fcFanObj = new fcFan(model);
+      // await fcFanObj.mountedThree();
 
-      fmFanObj = new fmFan(model);
-      await fmFanObj.mountedThree();
+      // fmFanObj = new fmFan(model);
+      // await fmFanObj.mountedThree();
 
       const videoPlayer1 = document.getElementById('jb-player1')?.getElementsByClassName('vjs-tech')[0];
       if (videoPlayer1) {

+ 60 - 38
src/views/vent/monitorManager/fanLocalMonitor/index.vue

@@ -2,7 +2,7 @@
   <div class="bg" style="width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden">
     <a-spin :spinning="loading" />
     <div id="fanLocal3D" style="width: 100%; height: 100%; position: absolute; overflow: hidden"> </div>
-    <div id="fanLocal3DCSS" class="threejs-Object-CSS" style="width: 100%; height: 100%; position: absolute; overflow: hidden; pointer-events: none;">
+    <!-- <div id="fanLocal3DCSS" class="threejs-Object-CSS" style="width: 100%; height: 100%; position: absolute; overflow: hidden; pointer-events: none;">
       <div style="z-index: -1; position: relative">
         <div class="elementTag" id="inputBox">
           <div class="elementContent">
@@ -33,7 +33,7 @@
           </div>
         </div>
       </div>
-    </div>
+    </div> -->
   </div>
   
   <div class="scene-box">
@@ -171,9 +171,9 @@
     <div class="bottom-tabs-box" @mousedown="setDivHeight($event, 170, scroll, 180)">
       
       <dv-border-box8 :dur="5" class="dv_border_8"  :style="`bottom: 20px; padding: 5px; height: ${scroll.y + 120}px`" >
-        <div class="enter-detail" @click="goDetail()">
+        <!-- <div class="enter-detail" @click="goDetail()">
           <send-outlined class=""/>风机运行详情
-        </div>
+        </div> -->
         <a-tabs class="tabs-box" v-model:activeKey="activeKey" @change="tabChange">
           <a-tab-pane key="1" tab="实时监测">
             <GroupMonitorTable  v-if="activeKey === '1'" ref="MonitorDataTable" :dataSource="dataSource" columnsType="fanlocal_monitor" @selectRow="getSelectRow" :scroll="scroll"/>
@@ -251,14 +251,14 @@
         </div>
       </div>
       <!-- 调频 -->
-      <div class="vent-flex-row input-box" v-if="modalType == 'Fan1Frequency'">
+      <!-- <div class="vent-flex-row input-box" v-if="modalType == 'Fan1Frequency'">
         <div class="label">主风机运行频率(Hz):</div>
         <a-input-number size="small" v-model:value="fan1FrequencyVal" :min="30" :max="50" :step="0.1" />
       </div>
       <div class="vent-flex-row input-box" v-if="modalType == 'Fan2Frequency'">
         <div class="label">备风机运行频率(Hz):</div>
         <a-input-number size="small" v-model:value="fan2FrequencyVal" :min="30" :max="50" :step="0.1" />
-      </div>
+      </div> -->
       <!-- <div class="vent-flex-row input-box" v-if="modalType == 'needAir'">
         <div class="label">需风量(单位):</div>
         <a-input-number size="small" v-model:value="frequencyVal" :min="30" :max="50" :step="0.1" />
@@ -311,7 +311,7 @@
       </div>
     </div>
   </a-modal>
-  <DetailModal @register="registerModal"/>
+  <!-- <DetailModal @register="registerModal"/> -->
 </template>
 
 <script setup lang="ts">
@@ -322,7 +322,7 @@
   import HistoryTable from '../comment/HistoryTable.vue';
   import AlarmHistoryTable from '../comment/AlarmHistoryTable.vue';
   import HandlerHistoryTable from '../comment/HandlerHistoryTable.vue';
-  import DetailModal from './components/DetailModal.vue';
+  // import DetailModal from './components/DetailModal.vue';
   import { mountedThree, setModelType, destroy, addCssText, addText, playSmoke } from './fanLocal.three';
   import lodash from 'lodash';
   import { getTableList, list } from '/@/views/vent/monitorManager/fanLocalMonitor/fanLocal.api';
@@ -351,14 +351,14 @@ import { message } from 'ant-design-vue';
         key: 'changeSmoke',
         value: '一键倒机',
       },
-      {
-        key: 'Fan1Frequency',
-        value: '主机调频',
-      },
-      {
-        key: 'Fan2Frequency',
-        value: '备机调频',
-      },
+      // {
+      //   key: 'Fan1Frequency',
+      //   value: '主机调频',
+      // },
+      // {
+      //   key: 'Fan2Frequency',
+      //   value: '备机调频',
+      // },
       // {
       //   key: 'windPower',
       //   value: '风电闭锁',
@@ -555,14 +555,14 @@ import { message } from 'ant-design-vue';
       loading.value = false;
     });
     const data = dataSource.value[baseDataIndex];
-    if (data['fanStart1'] == 1) {
+    if (data['Fan1StartStatus'] == 1) {
       mainWindIsShow1.value = 'open';
       mainWindIsShow2.value = 'stop';
-    } else if (data['fanStart2'] == 1) {
+    } else if (data['Fan2StartStatus'] == 1) {
       mainWindIsShow2.value = 'open';
       mainWindIsShow1.value = 'stop';
     }
-    addCssText();
+    // addCssText();
     return;
   };
 
@@ -591,13 +591,12 @@ import { message } from 'ant-design-vue';
     const handType = modalType.value;
     const data = {
       deviceid: selectData.deviceID,
-      devicetype: 'fanlocal_systeml_zj',
+      devicetype: selectData.deviceType,
       paramcode: '',
       password: passWord.value,
       value: null,
     };
     if (handType === 'startSmoke') {
-
       // 启动风机
       if (mainWindIsShow1.value === 'open' && mainWindIsShow2.value === 'stop') {
         // playSmoke(handType, 'top', frequency, 'open');
@@ -624,12 +623,11 @@ import { message } from 'ant-design-vue';
       }
     } else if (handType === 'Fan1Frequency' || handType === 'Fan2Frequency') {
       // 调频
-      // playSmoke(handType, 'top', fan1FrequencyVal, '');
       if (handType === 'Fan1Frequency') {
-        data.paramcode = 'Fan1fHz';
+        data.paramcode = 'Fan1FreqHz';
         data.value = fan1FrequencyVal.value;
       } else if (handType === 'Fan2Frequency') {
-        data.paramcode = 'Fan2fHz';
+        data.paramcode = 'Fan2FreqHz';
         data.value = fan2FrequencyVal.value;
       }
       
@@ -641,35 +639,59 @@ import { message } from 'ant-design-vue';
    
       });
     } else if (handType === 'changeSmoke') {
-
-      // 一键倒机
-      if (mainWindIsShow1.value === 'open' && mainWindIsShow2.value === 'stop') {
-        // playSmoke('startSmoke', 'down', frequency, 'open');
-        data.paramcode = 'fanRun2';
+      if(selectData['Fan1StartStatus'] == 0 || !selectData['Fan1StartStatus']){
+        data.paramcode = 'CtrlFan1Start';
         deviceControlApi(data).then((res) => {
           console.log('设备操作结果', res);
           modalTitle.value = '';
           modalIsShow.value = false;
+          mainWindIsShow1.value = 'stop';
+          mainWindIsShow2.value = 'open';
         }).catch((err) => {
 
         });
-        mainWindIsShow1.value = 'stop';
-        mainWindIsShow2.value = 'open';
-      } else if (mainWindIsShow2.value === 'open' && mainWindIsShow1.value === 'stop') {
-        // playSmoke('startSmoke', 'top', frequency, 'open');
-        data.paramcode = 'fanRun1';
+        
+      }else if(selectData['Fan2StartStatus'] == 0 || !selectData['Fan2StartStatus']){
+        data.paramcode = 'CtrlFan2Start';
         deviceControlApi(data).then((res) => {
           console.log('设备操作结果', res);
           modalTitle.value = '';
           modalIsShow.value = false;
+          mainWindIsShow1.value = 'open';
+          mainWindIsShow2.value = 'stop';
         }).catch((err) => {
 
         });
-        mainWindIsShow1.value = 'open';
-        mainWindIsShow2.value = 'stop';
-      } else if (mainWindIsShow1.value === 'stop' && mainWindIsShow2.value === 'stop') {
-        // playSmoke(handType, '', frequency, 'stop');
+        
       }
+      // // 一键倒机
+      // if (mainWindIsShow1.value === 'open' && mainWindIsShow2.value === 'stop') {
+      //   // playSmoke('startSmoke', 'down', frequency, 'open');
+      //   data.paramcode = 'CtrlFan2Start';
+      //   deviceControlApi(data).then((res) => {
+      //     console.log('设备操作结果', res);
+      //     modalTitle.value = '';
+      //     modalIsShow.value = false;
+      //   }).catch((err) => {
+
+      //   });
+      //   mainWindIsShow1.value = 'stop';
+      //   mainWindIsShow2.value = 'open';
+      // } else if (mainWindIsShow2.value === 'open' && mainWindIsShow1.value === 'stop') {
+      //   // playSmoke('startSmoke', 'top', frequency, 'open');
+      //   data.paramcode = 'CtrlFan1Start';
+      //   deviceControlApi(data).then((res) => {
+      //     console.log('设备操作结果', res);
+      //     modalTitle.value = '';
+      //     modalIsShow.value = false;
+      //   }).catch((err) => {
+
+      //   });
+      //   mainWindIsShow1.value = 'open';
+      //   mainWindIsShow2.value = 'stop';
+      // } else if (mainWindIsShow1.value === 'stop' && mainWindIsShow2.value === 'stop') {
+      //   // playSmoke(handType, '', frequency, 'stop');
+      // }
     }
     
   };

+ 240 - 122
src/views/vent/monitorManager/gasPumpMonitor/components/gasPumpHome.vue

@@ -7,19 +7,71 @@
     <div class="lr left-box">
       <div class="left-container">
         <div class="monitor-box">
-          <ventBox1 :class="{'vent-margin-t-10': key != 1} " v-for="key in 4" :key="key">
+          <ventBox1>
             <template #title>
-              <div>{{ key }}#抽采泵</div>
+              <div>抽采泵</div>
             </template>
             <template #container>
-              <div class="state-item" v-for="(data, index) in pumpMonitorData" :key="index">
-                <div class="item-col">
-                  <span class="state-title">{{ Object.values(data)[0] }} :</span>
-                  <span class="state-val">-</span>
+              <div  v-for="key in 2" :key="key">
+                <div class="parameter-title group-parameter-title"><SvgIcon class="icon" size="14" name="pulp-title"/><span>{{ key }}#抽采泵</span></div>
+                <div class="input-box">
+                  <div v-for="(item, index) in pumpMonitorData" class="input-item" :key="index">
+                    <div class="title">{{ item.title }}:</div>
+                    <template v-if="item.type !== 'sign'">
+                      <div class="value">{{ selectData && selectData[item.code.replace('CentrifugalPump', `CentrifugalPump${key}`)] ? formatNum(selectData[item.code.replace('CentrifugalPump', `CentrifugalPump${key}`)]) : '-' }}</div>
+                    </template>
+                    <template v-else>
+                      <div class="value">
+                        <span :class="{ 'signal-round': true, 'signal-round-run': selectData[item.code.replace('CentrifugalPump', `CentrifugalPump${key}`)], 'signal-round-gry': !selectData[item.code.replace('CentrifugalPump', `CentrifugalPump${key}`)] }"></span>
+                      </div>
+                    </template>
+                  </div>
                 </div>
-                <div class="item-col">
-                  <span class="state-title">{{ Object.values(data)[1] }} :</span>
-                  <span class="state-val">-</span>
+              </div>
+            </template>
+          </ventBox1>
+          <ventBox1 class="vent-margin-t-10">
+            <template #title>
+              <div>注水泵</div>
+            </template>
+            <template #container>
+              <div  v-for="key in 2" :key="key">
+                <div class="parameter-title group-parameter-title"><SvgIcon class="icon" size="14" name="pulp-title"/><span>{{ key }}#注水泵</span></div>
+                <div class="input-box">
+                  <div v-for="(item, index) in waterPumpData" class="input-item" :key="index">
+                    <div class="title">{{ item.title }}:</div>
+                    <template v-if="item.type !== 'sign'">
+                      <div class="value">{{ selectData && selectData[item.code.replace('WaterfloodPump', `WaterfloodPump${key}`)] ? formatNum(selectData[item.code.replace('WaterfloodPump', `WaterfloodPump${key}`)]) : '-' }}</div>
+                    </template>
+                    <template v-else>
+                      <div class="value">
+                        <span :class="{ 'signal-round': true, 'signal-round-run': selectData[item.code.replace('WaterfloodPump', `WaterfloodPump${key}`)], 'signal-round-gry': !selectData[item.code.replace('WaterfloodPump', `WaterfloodPump${key}`)] }"></span>
+                      </div>
+                    </template>
+                  </div>
+                </div>
+              </div>
+            </template>
+          </ventBox1>
+          <ventBox1 class="vent-margin-t-10">
+            <template #title>
+              <div>排水泵</div>
+            </template>
+            <template #container>
+              <div  v-for="key in 2" :key="key">
+                <div class="parameter-title group-parameter-title"><SvgIcon class="icon" size="14" name="pulp-title"/><span>{{ key }}#排水泵</span></div>
+                <div class="input-box">
+                  <div v-for="(item, index) in dewateringPumpData" class="input-item" :key="index">
+                    <div class="title">{{ item.title }}:</div>
+                    <template v-if="item.type !== 'sign'">
+                      <div class="value">{{ selectData && selectData[item.code.replace('DewateringPump', `DewateringPump${key}`)] ? formatNum(selectData[item.code.replace('DewateringPump', `DewateringPump${key}`)]) : '-' }}</div>
+                    </template>
+                    <template v-else>
+                      <div class="value">
+                        <span :class="{ 'signal-round': true, 'signal-round-run': selectData[item.code.replace('DewateringPump', `DewateringPump${key}`)], 'signal-round-gry': !selectData[item.code.replace('DewateringPump', `DewateringPump${key}`)] }"></span>
+                      </div>
+                    </template>
+                  </div>
                 </div>
               </div>
             </template>
@@ -29,107 +81,57 @@
     </div>
     <div class="lr right-box">
       <div class="item-box sensor-container">
-        <ventBox1>
+        <ventBox1 class="vent-margin-t-10">
           <template #title>
-            <div>泵站环境监测</div>
+            <div>泵站远程集中控制</div>
           </template>
           <template #container>
-            <div class="vent-flex-row environment-monitor">
-              <div class="item">
-                <div class="title">环境甲烷浓度(%)</div>
-                <div class="num">
-                  1.53
-                </div>
+            <div class="top-btn">
+              <div class="btn-group">
+                <a-button class="btn-item" type="primary" @click="handlerFn('zfw')">总复位</a-button>
+                <a-button class="btn-item" type="default" disabled @click="handlerFn('change')">一键切换</a-button>
               </div>
-              <div class="item">
-                <div class="title">泵站环境温度(℃)</div>
-                <div class="num">
-                  23.3
-                </div>
+              <div class="btn-group">
+                <a-button style="width: calc(100% - 16px); padding: 0 8px;" type="primary" @click="openModal">瓦斯泵控制</a-button>
               </div>
-            </div>
-            <div class="vent-flex-row-between pool-box">
-              <div class="vent-column-center vent-margin-l-10">
-                <div class="num">383mm</div>
-                <div class="">液压</div>
-              </div>
-              <div class="center">高位水池</div>
-              <div class="vent-column-center vent-margin-r-10">
-                <div class=" num">16.5℃</div>
-                <div class="">液温</div>
-              </div>
-            </div>
-            <div class="vent-flex-row-between pool-box">
-              <div class="vent-column-center vent-margin-l-10">
-                <div class="num">383mm</div>
-                <div class="">液压</div>
-              </div>
-              <div class="center">低位水池</div>
-              <div class="vent-column-center vent-margin-r-10">
-                <div class="num">16.5℃</div>
-                <div class="">液温</div>
+              <div>
+                <div class="control-item">
+                  <div class="control-title">控制模式:</div>
+                  <a-radio-group v-model:value="selectData['ykjdqh']" @change="changeCtr">
+                    <a-radio :value="1">就地</a-radio>
+                    <a-radio :value="2">远程</a-radio>
+                  </a-radio-group>
+                </div>
+                <div class="control-item">
+                  <div class="control-title">检修模式:</div>
+                  <a-radio-group v-model:value="selectData['jxmsqh']" @change="changeMode">
+                    <a-radio :value="1">开启</a-radio>
+                    <a-radio :value="2">关闭</a-radio>
+                  </a-radio-group>
+                </div>
               </div>
             </div>
           </template>
         </ventBox1>
         <ventBox1 class="vent-margin-t-10">
           <template #title>
-            <div>泵站远程集中控制</div>
+            <div>阀门运行状态</div>
           </template>
           <template #container>
-            <div class="parameter-title group-parameter-title"><SvgIcon class="icon" size="14" name="pulp-title"/><span>抽放泵控制</span></div>
-              
-            <div class="control-group">
-              <div class="control-item" v-for="(pump, index) in pumpCtrl" :key="index">
-                <div class="control-item-title">{{ pump.title }}</div>
-                <div class="control-item-state">
-                  <a-switch v-model="selectData[pump.code]" size="small"  checked-children="开启"
-                    un-checked-children="关闭"
-                    @change="handlerDevice(pump.code, selectData[pump.code])">
-                  </a-switch>
-                </div>
-              </div>
+            <div class="state-header">
+              <div class="header-item" v-for="(header, index) in stateHeader" :key="index">{{ header }}</div>
             </div>
-              
-            <div class="parameter-title group-parameter-title"><SvgIcon class="icon" size="14" name="pulp-title"/><span>水泵控制</span></div>
-            <div class="control-group">
-                <div class="control-item" v-for="(pump, index) in waterPumpCtrl" :key="index">
-                  <div class="control-item-title">{{ pump.title }}</div>
-                  <div class="control-item-state">
-                    <a-switch v-model="selectData[pump.code]" size="small"  checked-children="开启"
-                      un-checked-children="关闭"
-                      @change="handlerDevice(pump.code, selectData[pump.code])">
-                    </a-switch>
+            <div class="">
+              <div v-for="key in 2" :key="key">
+                <div class="device-row" v-for="(valveType, index) in valveCtrlType" :key="index">
+                  <div class="state"  >#{{ key }}{{ valveType.title }}</div>
+                  <div class="state" v-for="(state, i) in valveState" :key="i" >
+                    <span v-if="state.code == '_CtrlMode'">{{ selectData[`CentrifugalPump${key}_${valveType.code}${key}${state.code}`] ? selectData[`CentrifugalPump${key}_${valveType.code}${key}${state.code}`] : '-' }}</span>
+                    <span v-else :class="{ 'signal-round': true, 'signal-round-run': selectData[`CentrifugalPump${key}_${valveType.code}${key}${state.code}`] == '1', 'signal-round-gry': !selectData[`CentrifugalPump${key}_${valveType.code}${key}${state.code}`] }"></span>
                   </div>
                 </div>
               </div>
-            <div class="parameter-title group-parameter-title"><SvgIcon class="icon" size="14" name="pulp-title"/><span>气阀控制</span></div>
-            <div class="vent-flex-row environment-monitor">
-              <div class="item">
-                <div class="title">高负压配汽阀开度</div>
-                <div class="num">
-                  30%
-                </div>
-              </div>
-              <div class="item">
-                <div class="title">低负压配汽阀开度</div>
-                <div class="num">
-                  30%
-                </div>
-              </div>
             </div>
-            <div class="control-group">
-                <div class="control-item" v-for="(pump, index) in airValveCtrl" :key="index">
-                  <div class="control-item-title">{{ pump.title }}</div>
-                  <div class="control-item-state">
-                    <a-switch v-model="selectData[pump.code]" size="small"  checked-children="开启"
-                      un-checked-children="关闭"
-                      @change="handlerDevice(pump.code, selectData[pump.code])">
-                    </a-switch>
-                  </div>
-                </div>
-              </div>
-          
           </template>
         </ventBox1>
       </div>
@@ -138,7 +140,9 @@
     </div> -->
     </div>
   </div>
-
+  <DetailModal @register="register"  :deviceType="deviceType" :deviceId="deviceId"/>
+  <PasswordModal :modal-is-show="passwordModalIsShow" modal-title="密码检验" :modal-type="handlerType" @handle-ok="handleOK"
+      @handle-cancel="handleCancel"/>
 </template>
 
 <script setup lang="ts">
@@ -146,10 +150,15 @@
 import { onBeforeMount, ref, onMounted, onUnmounted, reactive, defineProps, watch } from 'vue';
 import ventBox1 from '/@/components/vent/ventBox1.vue'
 import { mountedThree, destroy, setModelType } from '../gasPump.threejs';
-import { pumpMonitorData, pumpCtrl, waterPumpCtrl, airValveCtrl } from '../gasPump.data'
+import { stateHeader, valveState, pumpMonitorData, waterPumpData, dewateringPumpData, pumpCtrlType, valveCtrlType, valveCtrl, PumpCtrlItems, pumpCtrl } from '../gasPump.data'
 import { list } from '../gasPump.api';
 import { SvgIcon } from '/@/components/Icon'
-import LivePlayer from '@liveqing/liveplayer-v3';
+import { formatNum } from '/@/utils/ventutil'
+import DetailModal from './DetailModal.vue'
+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 props = defineProps({
   deviceId: {
@@ -161,9 +170,11 @@ const props = defineProps({
     require: true
   }
 })
-
+const [register, { openModal }] = useModal()
 const loading = ref(false);
-
+const tabActiveKey = ref(1)
+const passwordModalIsShow = ref(false)
+const handlerType = ref('')
 // 默认初始是第一行
 
 
@@ -184,7 +195,9 @@ const selectData = reactive({
   inValve3: false,
   outValve3: false,
   inValve4: false,
-  outValve4: false
+  outValve4: false,
+  jxmsqh: '1',
+  ykjdqh: '1',
 });
 
 const flvURL1 = () => {
@@ -212,45 +225,94 @@ function getMonitor(flag?) {
 
 async function getDataSource(systemID) {
   const res = await list({ devicetype: props.deviceType, ids: systemID });
-  const result = res.msgTxt;
-  result.forEach(item => {
+  const result = res.msgTxt[0]['datalist'][0];
+  Object.assign(result, result['readData'])
+  return result
+}
 
-    
-  })
+function handler(passWord, paramcode) {
+  let value = null
+  if(paramcode == 'ykjdqh'){
+    value = selectData['ykjdqh'] == '1' ? '2' : '1'
+  }
+  if (paramcode == 'jxmsqh') {
+    value = selectData['jxmsqh'] == '1' ? '2' : '1'
+  }
+  const data = {
+    deviceid: selectData.deviceID,
+    devicetype: selectData.deviceType,
+    paramcode: paramcode,
+    password: passWord,
+    value: value,
+  };
+  deviceControlApi(data).then((res) => {
+    message.success('控制成功成功!');
+  }).catch((err) => {
+    message.success('控制异常');
+  });
 }
 
-// 喷粉操作
-function handlerDevice(code, data) {
-  code;
-  data
+function changeCtr(e) {
+  if(e.target.value == 1){
+    // 就地
+    handlerType.value = 'jxmsqh'
+  }else if(e.target.value == 2) {
+    // 远程
+    handlerType.value = 'jxmsqh'
+  }
+  passwordModalIsShow.value = true;
 }
 
-watch(() => props.deviceId, () => {
-  if(props.deviceType == 'pump_over'){
-    setModelType('gasPump')
-  }else if(props.deviceType == 'pump_under') {
-    setModelType('gasPumpUnder')
+function changeMode(e) {
+  if (e.target.value == 1) {
+    // 检修开
+    handlerType.value = 'ykjdqh'
+  } else if (e.target.value == 2) {
+    // 检修关
+    handlerType.value = 'ykjdqh'
   }
+  passwordModalIsShow.value = true;
+}
+
+function handlerFn(paramcode){
+  handlerType.value = paramcode
+  passwordModalIsShow.value = true;
+}
+
+function handleOK(passWord, handlerState) {
+  handler(passWord, handlerState)
+  passwordModalIsShow.value = false;
+  handlerType.value = ''
+}
+
+function handleCancel() {
+  passwordModalIsShow.value = false;
+  handlerType.value = ''
+};
+
+// 喷粉操作
+function handlerDevice(code, data) {
   
-  loading.value = true
+}
+
+watch(() => props.deviceType, () => {
+  // if(props.deviceType == 'pump_over'){
+  //   setModelType('gasPump')
+  // }else if(props.deviceType == 'pump_under') {
+  //   setModelType('gasPumpUnder')
+  // }
 })
 
 onBeforeMount(() => {
 
 });
 
-onMounted(() => {
-  loading.value = true;
-  mountedThree().then(async () => {
-    await setModelType('gasPump');
-    loading.value = false;
-    timer = null
-    await getMonitor(true)
-  });
+onMounted(async() => {
+  timer = null
+  await getMonitor(true)
 });
 
 onUnmounted(() => {
-  destroy();
   if (timer) {
     clearTimeout(timer);
     timer = undefined;
@@ -364,7 +426,63 @@ onUnmounted(() => {
 
 }
 
-
+.input-box{
+  width: calc(100%);
+  display: flex;
+  flex-direction: row !important;
+  flex-wrap: wrap !important;
+  .input-item{
+    width: calc(50% - 8px);
+    padding: 0 2px;
+  
+    &:nth-child(2n){
+      margin-left: 4px;
+    }
+  }
+}
+.btn-group{
+  display: flex;
+  justify-content: space-around;
+  .btn-item{
+    width: 82px;
+    text-align: center;
+  }
+}
+.top-btn{
+  .btn-group{
+    margin-bottom: 8px;
+    .btn-item{
+      width: calc(50% - 16px);
+      margin: 0 4px;
+    }
+  }
+  .control-item{
+    margin-left: 10px;
+    margin-bottom: 8px;
+    display: flex;
+    .control-title{
+      width: 150px;
+      color: #73e8fe;
+    }
+  }
+}
+.state-header{
+  display: flex;
+  color: #73e8fe;
+  .header-item{
+    width: 25%;
+    text-align: center;
+  }
+}
+.device-row{
+  display: flex;
+  margin-top: 10px;
+  .state{
+    width: 25%;
+    text-align: center;
+    font-size: 13px;
+  }
+}
 
 :deep(.@{ventSpace}-tabs-tabpane-active) {
   overflow: auto;

+ 120 - 44
src/views/vent/monitorManager/gasPumpMonitor/gasPump.data.ts

@@ -22,97 +22,173 @@ export const warningConfig = reactive({
 
 export const pumpMonitorData = [
   {
-    Va: '电压(kV)',
-    la: '电流(A)',
+    title: '运行状态',
+    code: 'CentrifugalPump_PU_CBStatus',
+    type: 'sign',
   },
   {
-    djtemp1: '电机前轴温(℃)',
-    djtemp2: '电机后轴温(℃)',
+    title: '启动准备',
+    code: 'CentrifugalPump_PU_Ready',
+    type: 'sign',
   },
   {
-    pumptemp1: '抽采泵前轴温(℃)',
-    pumptemp2: '抽采泵后轴温(℃)',
+    title: '电压(V)',
+    code: 'CentrifugalPump_PU_SysVoltage',
+    type: '',
   },
   {
-    zfver: '垂直振幅(mm)',
-    zfori: '水平振幅(mm)',
+    title: 'A相电流(A)',
+    code: 'CentrifugalPump_PU_Ia',
+    type: '',
   },
   {
-    time: '运行时间(s)',
+    title: 'B相电流(A)',
+    code: 'CentrifugalPump_PU_Ib',
+    type: '',
+  },
+  {
+    title: 'C相电流(A)',
+    code: 'CentrifugalPump_PU_Ic',
+    type: '',
   },
 ];
 
-export const pumpCtrl = [
+export const waterPumpData = [
   {
-    title: '1#抽采泵',
-    code: 'pump1',
+    title: '运行状态',
+    code: 'WaterfloodPump_CBStatus',
+    type: 'sign',
   },
   {
-    title: '2#抽采泵',
-    code: 'pump2',
+    title: '启动准备',
+    code: 'WaterfloodPump_Ready',
+    type: 'sign',
   },
   {
-    title: '3#抽采泵',
-    code: 'pump3',
+    title: '电压(V)',
+    code: 'WaterfloodPump_SysVoltage',
+    type: '',
   },
+];
+
+export const dewateringPumpData = [
   {
-    title: '4#抽采泵',
-    code: 'pump4',
+    title: '运行状态',
+    code: 'DewateringPump_CBStatus',
+    type: 'sign',
+  },
+  {
+    title: '启动准备',
+    code: 'DewateringPump_Ready',
+    type: 'sign',
+  },
+  {
+    title: '电压(V)',
+    code: 'DewateringPump_SysVoltage',
+    type: '',
   },
 ];
 
-export const waterPumpCtrl = [
+export const valveCtrlType = [
   {
-    title: '1#水泵',
-    code: 'waterPump1',
+    title: '进水阀',
+    code: 'WaterInValve',
   },
   {
-    title: '2#水泵',
-    code: 'waterPump2',
+    title: '排水阀',
+    code: 'WaterOutValve',
   },
   {
-    title: '3#水泵',
-    code: 'waterPump3',
+    title: '进气阀',
+    code: 'AirInValve',
   },
   {
-    title: '4#水泵',
-    code: 'waterPump4',
+    title: '排气阀',
+    code: 'AirOutValve',
   },
 ];
 
-export const airValveCtrl = [
+export const valveCtrl = [
   {
-    title: '1#进气阀',
-    code: 'inValve1',
+    title: '开启',
+    code: '_HMIOpen',
   },
   {
-    title: '1#出气阀',
-    code: 'outValve1',
+    title: '关闭',
+    code: '_HMIClose',
   },
   {
-    title: '2#进气阀',
-    code: 'inValve2',
+    title: '停止',
+    code: '_HMIStop',
   },
   {
-    title: '2#出气阀',
-    code: 'outValve2',
+    title: '复位',
+    code: '_Reset',
+  },
+];
+
+export const valveState = [
+  {
+    title: '是否健康',
+    code: '_Healthy',
+    defaultValue: '-',
+  },
+  {
+    title: '开失败',
+    code: '_OpenFail',
+    defaultValue: '-',
   },
   {
-    title: '3#进气阀',
-    code: 'inValve3',
+    title: '关失败',
+    code: '_CloseFail',
+    defaultValue: '-',
   },
   {
-    title: '3#出气阀',
-    code: 'outValve3',
+    title: '控制方式',
+    code: '_CtrlMode',
+    defaultValue: '-',
   },
+];
+
+export const pumpCtrlType = [
   {
-    title: '4#进气阀',
-    code: 'inValve4',
+    title: '瓦斯泵',
+    code: 'CentrifugalPump',
   },
   {
-    title: '4#出气阀',
-    code: 'outValve4',
+    title: '排水泵',
+    code: 'DewateringPump',
   },
 ];
+export const publicPumpCtrlType = [
+  {
+    title: '注水泵',
+    code: 'WaterfloodPump',
+  },
+];
+export const PumpCtrlItems = [
+  {
+    title: '启动',
+    code: '_SwitchOn',
+  },
+  {
+    title: '停止',
+    code: '_SwitchOff',
+  },
+  {
+    title: '短路测试',
+    code: '_HMIShortTest',
+  },
+  {
+    title: '漏电测试',
+    code: '_HMILeakageTest',
+  },
+];
+
+
+export const stateHeader = ['设备名称', '是否健康', '开失败', '关失败', '控制方式'];
+
+
+
 
 

+ 17 - 10
src/views/vent/monitorManager/gasPumpMonitor/index.vue

@@ -2,7 +2,7 @@
   <div class="bg"
     style="width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden">
     <a-spin :spinning="loading" />
-    <div id="gasPump3D" v-show="!loading" style="width: 100%; height: 100%; position: absolute; overflow: hidden"> </div>
+    <div id="gasPump3D" v-if="activeKey == 'monitor'" style="width: 100%; height: 100%; position: absolute; overflow: hidden"> </div>
     <!-- <div id="damper3DCSS" v-show="!loading" style="width: 100%; height: 100%; top:0; left: 0; position: absolute; overflow: hidden;">
       <div>
         <div ref="elementContent" class="elementContent">
@@ -45,6 +45,7 @@ import gasPumpHome from './components/gasPumpHome.vue';
 import gasPumpHistory from './components/gasPumpHistory.vue';
 import gasPumpHandleHistoryVue from './components/gasPumpHandleHistory.vue';
 import gasPumpAlarmHistory from './components/gasPumpAlarmHistory.vue';
+import { mountedThree, destroy, setModelType } from './gasPump.threejs';
 import { useRouter } from 'vue-router';
 
 type DeviceType = { deviceType: string, deviceName: string, datalist: any[] };
@@ -79,7 +80,10 @@ function changeActive(activeValue) {
 }
 
 function deviceChange(index) {
-  deviceActive.value = deviceType.value = deviceList.value[index].deviceType
+  if(deviceList.value.length > 0){
+    deviceActive.value = deviceType.value = deviceList.value[index].deviceType
+    
+  }
 }
 
 // 查询关联设备列表
@@ -98,7 +102,6 @@ async function getDeviceList() {
   })
   deviceList.value = deviceArr
   deviceActive.value = deviceArr[0].deviceType
-  deviceChange(0)
 };
 
 async function getSysDataSource () {
@@ -115,6 +118,7 @@ async function getSysDataSource () {
     if(!optionValue.value){
       optionValue.value = dataSource.value[0]['deviceID']
       Object.assign(selectData, dataSource.value[0])
+      getSelectRow(optionValue.value)
     }else{
       const currentData = dataSource.value.find(item => item['deviceID'] === optionValue.value) || {}
       Object.assign(selectData, currentData)
@@ -133,21 +137,24 @@ function getSelectRow(deviceID){
     optionValue.value = currentData['deviceID']
     currentDeviceType.value = currentData['deviceType']
     Object.assign(selectData, currentData)
+    if (currentDeviceType.value == 'pump_over') {
+      setModelType('gasPump')
+    } else if (currentDeviceType.value == 'pump_under') {
+      setModelType('gasPumpUnder')
+    }
   }
 }
 
-onBeforeMount(() => {
-
-});
-
 onMounted(async() => {
   if (currentRoute.value['query'] && currentRoute.value['query']['id']) optionValue.value = currentRoute.value['query']['id']
-  await getSysDataSource()
-  await getDeviceList()
+  mountedThree().then(async () => {
+    await getSysDataSource()
+    await getDeviceList()  
+  });
 });
 
 onUnmounted(() => {
- 
+  destroy();
 });
 </script>
 <style lang="less" scoped>

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

@@ -155,7 +155,7 @@ class singleWindow {
         const planeMesh = new THREE.Mesh(planeGeometry, textMaterial);
         planeMesh.name = 'monitorText';
         planeMesh.scale.set(0.002, 0.002, 0.002);
-        planeMesh.position.set(3.61, 0.158, -0.23);
+        planeMesh.position.set(1.97, 0.158, -0.23);
         this.group?.add(planeMesh);
       }
     });

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

@@ -349,8 +349,7 @@ class doubleWindow {
 
   mountedThree() {
     return new Promise((resolve) => {
-      this.model.setGLTFModel([this.modelName]).then((gltf) => {
-        this.group = gltf[0];
+      this.model.setGLTFModel(['sdFc', 'wall'], this.group).then(() => {
         this.setModalPosition();
         this.initAnimation();
         resolve(null);