浏览代码

机电硐室-接口对接完成

lxh 6 天之前
父节点
当前提交
883e204b20

+ 6 - 1
src/views/vent/home/configurable/components/partition-top.vue

@@ -12,7 +12,7 @@
           </div>
           <div v-if="ind==7">
             <div>{{ m.tempStop || '---' }}</div>
-            <div v-if="m.tempStop" class="td-line"></div>
+            <div v-if="m.tempStop" class="td-line-yellow"></div>
           </div>
         </div>
       </div>
@@ -169,6 +169,11 @@ onMounted(() => {
         height: 1px;
         background-color: red;
       }
+       .td-line-yellow{
+        width: 100%;
+        height: 1px;
+        background-color: rgb(241, 245, 6);
+      }
     }
   }
 

+ 6 - 0
src/views/vent/home/configurable/components/three3D.vue

@@ -36,6 +36,12 @@
           newP: { x: -2.211555197992825, y: 27.130029732875393, z: 2.3018919451652007 },
           newT: { x: -2.211555197992825, y: -8.604453425019353, z: 2.301856157557903 },
         },
+          jdds: {
+          render: null,
+          group: modalGroup ? modalGroup : null,
+          newP: { x: 0.22197787154285728, y: 29.010792085965782, z:  2.477736279196267},
+          newT: { x: 0.22197787154285728, y: -8.604453177192061, z: 2.477698375233975 },
+        },
       };
       await initModal();
       if (modalConfigurations[props.modalName]) {

+ 22 - 38
src/views/vent/home/configurable/configurable.api.ts

@@ -3,8 +3,6 @@ import { defHttp } from '/@/utils/http/axios';
 import { get } from '../billboard/utils';
 import { useGlobSetting } from '/@/hooks/setting';
 import { ref, reactive } from 'vue'
-import ceshi from './ceshi.json'
-import { e } from 'unocss';
 
 
 enum Api {
@@ -18,6 +16,7 @@ enum Api {
   getTotal = '/safety/ventanalyAlarmLog/total',
   sysTypeWarnList = '/safety/ventanalyAlarmLog/sysTypeWarn',
   getDisasterProportion = '/safety/ventanalyAlarmLog/getDisasterProportion',
+  system = '/ventanaly-device/monitor/system'
 }
 
 // 搞这个缓存是由于:目前代码上的设计是多个模块发出多次请求,每个模块自己负责消费前者的响应。
@@ -616,55 +615,40 @@ export const getTotal = (params) => {
 
 //机电硐室
 export const getElectroData = (params) => {
-  //  const { sysOrgCode, sysDataType } = useGlobSetting();
-  //
-  //  const key = `${Api.getTotal}?${JSON.stringify(params)}`;
-  //  if (!cache.has(key)) {
-  //    cache.set(
-  //      key,
-  //      defHttp.get({ url: Api.getTotal, params }).finally(() => {
-  //        cache.delete(key);
-  //      })
-  //    );
-  //  }
-  //  return (cache.get(key) as Promise<any>).then(async (res) => {
-  //    return res;
-  //  });
-
-
-  let res = ceshi.msgTxt.find(el => el.type == 'ballvalve_auto')
-
-  res.tempData = res?.datalist?.map((el, index) => {
+  const key = `${Api.system}?${JSON.stringify(params)}`;
+  if (!cache.has(key)) {
+    cache.set(
+      key,
+      defHttp.post({ url: Api.system, params }).finally(() => {
+        cache.delete(key);
+      })
+    );
+  }
+  return (cache.get(key) as Promise<any>).then(async (res) => {
+    let data = res.msgTxt.find(el => el.type == 'ballvalve_auto')
+    data.tempData = data?.datalist?.map((el, index) => {
     return {
       areaName: el.readData.areaName,
       tempStart: el.readData.tempStart,
       tempStop: el.readData.tempStop,
-      CORealtime:el.readData.CORealtime
+      CORealtime: el.readData.CORealtime
     }
   })
 
-  if (res?.datalist) {
-    res.datalist.forEach(el => {
+  if (data?.datalist) {
+    data.datalist.forEach(el => {
       el.cardData = {
         title: el.strinstallpos, areaText: '区域', areaVal: el.readData.areaName, moduleText: '模式', moduleVal: el.readData.smokePattern, statusText: '烟雾传感器状态', statusVal: el.readData.smokeSensorStatus == 'False' ? '正常-低电平' : '异常', phoneText: '机号', phoneVal: el.readData.deviceName, tempNowText: '实时测温', tempNowVal: el.readData.tempRealtime, tempOpenText: '开启温度', tempOpenVal: el.readData.tempStart, timeText: '延时t1', timeVal: 0, tempMaxText: '最高温度', tempMaxVal: el.readData.tempMax, tempCloseText: '关闭温度', tempCloseVal: el.readData.tempMin, time3Text: '延时t3', time3Val: 0, deviceSTAT: el.readData.deviceSTAT == '1' ? true : false
       }
     })
-    res.chartData=res.datalist.map(el=>{
+    data.chartData = data.datalist.map(el => {
       return {
-        time:el.readData.areaName,
-        coRealTime:el.readData.CORealtime,
-        coWarn:el.readData.COWarn,
+        time: el.readData.areaName,
+        coRealTime: el.readData.CORealtime,
+        coWarn: el.readData.COWarn,
       }
     })
   }
-  console.log(res, '机电硐室数据')
-  return new Promise((resolve) => {
-    resolve(res)
-  })
-
-
-
-
-
-
+    return data;
+  });
 };

+ 43 - 18
src/views/vent/home/configurable/electroChamber.vue

@@ -4,45 +4,70 @@
       <div class="main-title">{{ mainTitle }}</div>
     </div>
     <div class="content-container">
-      <div class="top-area">
-        <PartitionTop :tempData="data.tempData"></PartitionTop>
+      <div style="width:100%;height: 100%;" v-if="activeKey == 'monitor'">
+        <div class="top-area">
+          <PartitionTop :tempData="data.tempData"></PartitionTop>
+        </div>
+        <div class="bot-area">
+          <!-- 采用定位方式以避免出现各个模块隐藏时其他模块下移的问题 -->
+          <ModuleCommon v-for="cfg in configs" :key="cfg.deviceType" :show-style="cfg.showStyle"
+            :module-data="cfg.moduleData" :module-name="cfg.moduleName" :device-type="cfg.deviceType" :data="data"
+            :visible="true" :style="{ zIndex: 1 }" />
+        </div>
+        <div style="width: 1100px; height: calc(100% - 260px); position: absolute; left: calc(50% - 550px); top: 245px">
+          <three3D :modal-name="modelName" />
+        </div>
+
       </div>
-      <div class="bot-area">
-        <!-- 采用定位方式以避免出现各个模块隐藏时其他模块下移的问题 -->
-        <ModuleCommon v-for="cfg in configs" :key="cfg.deviceType" :show-style="cfg.showStyle"
-          :module-data="cfg.moduleData" :module-name="cfg.moduleName" :device-type="cfg.deviceType" :data="data"
-          :visible="true" :style="{ zIndex: 1 }" />
+      <div class="history-content">
+        <chamberHistory v-if="activeKey == 'monitor_history'" ref="historyTable" class="vent-margin-t-20"
+          :deviceId='optionValue' :device-type="deviceType" />
+        <chamberHandleHistoryVue v-if="activeKey == 'handler_history'" ref="alarmHistoryTable" class="vent-margin-t-20"
+          :deviceId='optionValue' :device-type="deviceType" />
+        <chamberAlarmHistory v-if="activeKey == 'faultRecord'" ref="handlerHistoryTable" class="vent-margin-t-20"
+          :deviceId='optionValue' :device-type="deviceType" />
       </div>
-
-      <!-- <div style="width: 1000px; height: 570px; position: absolute; left: calc(50% - 500px); top: 60px">
-        <VentModal />
-      </div> -->
     </div>
-
+    <div class="bottom-menu">
+      <BottomMenu @change="changeActive" />
+    </div>
   </div>
 </template>
 <script lang="ts" setup>
-import { onMounted, onUnmounted } from 'vue';
+import { ref, onMounted, onUnmounted } from 'vue';
 import { useInitConfigs, useInitPage } from './hooks/useInit';
 import PartitionTop from './components/partition-top.vue'
 import ModuleCommon from './components/ModuleCommon.vue';
-import VentModal from '/@/components/vent/micro/ventModal.vue';
+import three3D from './components/three3D.vue'
+import BottomMenu from '/@/views/vent/comment/components/bottomMenu.vue'
+import chamberHistory from '../../monitorManager/chamberMonitor/components/chamberHistory.vue';
+import chamberHandleHistoryVue from '../../monitorManager/chamberMonitor/components/chamberHandleHistory.vue';
+import chamberAlarmHistory from '../../monitorManager/chamberMonitor/components/chamberAlarmHistory.vue';
 import { getElectroData } from './configurable.api';
 import { testConfigElectro } from './configurable.data';
+import { useRouter } from 'vue-router';
 
-
+const { currentRoute } = useRouter();
+const activeKey = ref('monitor');
+const modelName = ref('jdds')
+const optionValue = ref('')
+const deviceType = ref('ballvalve_auto')
 const { configs, devicesTypes, fetchConfigs } = useInitConfigs();
 const { mainTitle, data, updateData } = useInitPage('机电硐室');
 let interval: number | undefined;
 
+function changeActive(activeValue) {
+  activeKey.value = activeValue
+}
 onMounted(() => {
+  if (currentRoute.value && currentRoute.value['query'] && currentRoute.value['query']['id']) optionValue.value = currentRoute.value['query']['id']
   fetchConfigs('electro-champer').then(() => {
     configs.value = testConfigElectro;
-    getElectroData({}).then(updateData);
+    getElectroData({devicetype:deviceType.value}).then(updateData);
   });
   setInterval(() => {
-    getElectroData({}).then(updateData);
-  }, 200000);
+    getElectroData({devicetype:deviceType.value}).then(updateData);
+  }, 10000);
 });
 
 onUnmounted(() => {