Bladeren bron

保德综合监测

hongrunxia 1 jaar geleden
bovenliggende
commit
542b262548
26 gewijzigde bestanden met toevoegingen van 755 en 74 verwijderingen
  1. 7 1
      build/vite/proxy.ts
  2. 5 5
      index.html
  3. BIN
      src/assets/images/vent/compre-1.png
  4. BIN
      src/assets/images/vent/compre-2-1.png
  5. BIN
      src/assets/images/vent/compre-2.png
  6. BIN
      src/assets/images/vent/compre-3.png
  7. BIN
      src/assets/images/vent/compre-bottom.png
  8. BIN
      src/assets/images/vent/compre-top.png
  9. 56 9
      src/components/Form/src/jeecg/components/MTreeSelect.vue
  10. 1 1
      src/views/vent/comment/EditRowTable.vue
  11. 4 2
      src/views/vent/deviceManager/comment/DeviceModal.vue
  12. 1 1
      src/views/vent/deviceManager/comment/NormalTable.vue
  13. 1 1
      src/views/vent/deviceManager/comment/cameraTabel/camera.api.ts
  14. 31 24
      src/views/vent/deviceManager/comment/cameraTabel/camera.data.ts
  15. 6 5
      src/views/vent/deviceManager/deviceTable/index.vue
  16. 2 1
      src/views/vent/deviceManager/pointTabel/index.vue
  17. 4 1
      src/views/vent/deviceManager/pointTabel/point.data.ts
  18. 2 4
      src/views/vent/deviceManager/tableColumns/tableColumns.data.ts
  19. 203 0
      src/views/vent/monitorManager/comment/DetailModal.vue
  20. 0 3
      src/views/vent/monitorManager/comment/DeviceEcharts.vue
  21. 11 0
      src/views/vent/monitorManager/compreMonitor/compre.api.ts
  22. 125 0
      src/views/vent/monitorManager/compreMonitor/compre.data.ts
  23. 277 0
      src/views/vent/monitorManager/compreMonitor/index.vue
  24. 3 3
      src/views/vent/monitorManager/fanLocalMonitor/index.vue
  25. 15 12
      src/views/vent/monitorManager/gateMonitor/index.vue
  26. 1 1
      src/views/vent/monitorManager/mainFanMonitor/index.vue

+ 7 - 1
build/vite/proxy.ts

@@ -18,8 +18,14 @@ const httpsRE = /^https:\/\//;
 export function createProxy(list: ProxyList = []) {
   const ret: ProxyTargetList = {};
   for (const [prefix, target] of list) {
-    const isHttps = httpsRE.test(target);
+    
+    // if(process.env.NODE_ENV == 'production'){
+
+    // }else{
 
+    // }
+
+    const isHttps = httpsRE.test(target);
     // https://github.com/http-party/node-http-proxy#options
     ret[prefix] = {
       target: target,

+ 5 - 5
index.html

@@ -7,13 +7,13 @@
     <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0" />
     <title><%= title %></title>
     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css" />
+    <link rel="preload" as="script" href="/js/config.js">
     <!-- <link rel="icon" href="/logo.png" /> -->
     <!-- 全局配置 -->
-    <script src="/js/config.js"></script> 
-    <script src="/js/liveplayer-lib.min.js"></script>
-    <script src="/js/webrtcstreamer.js"></script>
-    <script src="/js/adapter.min.js"></script>
-    <script type="text/javascript" src="http://182.92.126.35:9050/web-apps/apps/api/documents/api.js"></script>
+    <script defer src="/js/liveplayer-lib.min.js"></script>
+    <script defer src="/js/webrtcstreamer.js"></script>
+    <script defer src="/js/adapter.min.js"></script>
+    <script defer type="text/javascript" src="http://182.92.126.35:9050/web-apps/apps/api/documents/api.js"></script>
   </head>
   <body style="background-color: #09172C">
     <script>

BIN
src/assets/images/vent/compre-1.png


BIN
src/assets/images/vent/compre-2-1.png


BIN
src/assets/images/vent/compre-2.png


BIN
src/assets/images/vent/compre-3.png


BIN
src/assets/images/vent/compre-bottom.png


BIN
src/assets/images/vent/compre-top.png


+ 56 - 9
src/components/Form/src/jeecg/components/MTreeSelect.vue

@@ -8,6 +8,7 @@
     :dropdownStyle="{ maxHeight: '400px', overflow: 'auto', zIndex: 99999 }"
     :placeholder="placeholder"
     :treeData="treeData"
+    :value="treeValue"
     :field-names="{
       children: 'children',
       label: 'itemText',
@@ -22,10 +23,11 @@
    * 异步树加载组件 通过传入表名 显示字段 存储字段 加载一个树控件
    * <j-tree-select dict="aa_tree_test,aad,id" pid-field="pid" ></j-tree-select>
    * */
-  import { ref } from 'vue';
+  import { ref, watch } from 'vue';
   import { defHttp } from '/@/utils/http/axios';
   import { propTypes } from '/@/utils/propTypes';
   import { useMessage } from '/@/hooks/web/useMessage';
+import { onMounted, nextTick } from 'vue';
 
   enum Api {
     url = '/sys/dict/DeviceKind/query',
@@ -50,26 +52,25 @@
    * 根据code获取下拉数据并回显
    */
   async function loadItemByCode() {
-    treeData.value = [];
+    const treeDataValue = <any[]>[];
     let params = { key: props.value };
     let result = await defHttp.get({ url: Api.url, params }, { isTransformResponse: false });
     if (result.success) {
-      console.log(999, result.result);
-
       result.result.forEach((item, index) => {
         if (item.children && item.children.length > 0) {
-          treeData.value.push({
+          treeDataValue.push({
             children: item.children,
             itemText: item.itemText,
             itemValue: item.itemValue,
           });
         } else {
-          treeData.value.push({
+          treeDataValue.push({
             itemText: item.itemText,
             itemValue: item.itemValue,
           });
         }
       });
+      treeData.value = treeDataValue
     }
   }
 
@@ -87,7 +88,6 @@
       }else{
         emitValue(value);
       }
-      
     }
     treeValue.value = value;
     console.log(treeValue.value);
@@ -106,6 +106,37 @@
   }
 
   /**
+ * 根据已有的树数据 翻译选项
+ */
+  function getItemFromTreeData() {
+    let data = treeData.value;
+    let arr = []
+    findChildrenNode(data, arr);
+    debugger
+  }
+  /**
+   * 递归找子节点
+   * @param data
+   * @param arr
+   */
+  function findChildrenNode(data, arr) {
+    let val = props.value;
+    if (data && data.length) {
+      for (let item of data) {
+        if (val === item.value) {
+          arr.push({
+            key: item.key,
+            value: item.value,
+            label: item.label || item.title
+          })
+        } else {
+          findChildrenNode(item.children, arr)
+        }
+      }
+    }
+  }
+
+  /**
    * 校验条件配置是否有误
    */
   function validateProp() {
@@ -130,10 +161,26 @@
     });
   }
 
+  watch(() => props.value, (val) => {
+    if(!val){
+      treeValue.value = ''
+    }else{
+      treeValue.value = val
+    }
+  })
+
+//https://blog.csdn.net/u014192915/article/details/116074337
   // // onCreated
-  validateProp().then(async () => {
+  // validateProp().then(async () => {
+  //   await loadItemByCode();
+  // });
+
+  onMounted(async() => {
     await loadItemByCode();
-  });
+    nextTick(() => {
+      onChange(props.value)
+    })
+  })
 </script>
 
 <style lang="less"></style>

+ 1 - 1
src/views/vent/comment/EditRowTable.vue

@@ -129,7 +129,7 @@
         if (valid) {
           try {
             //TODO 此处将数据提交给服务器保存
-            emit('saveOrUpdate', Object.assign(record, record.editValueRefs));
+            emit('saveOrUpdate', Object.assign(record, record.editValueRefs), reload);
             // 保存之后提交编辑状态
             const pass = await record.onEdit?.(false, true);
             if (pass) {

+ 4 - 2
src/views/vent/deviceManager/comment/DeviceModal.vue

@@ -111,9 +111,11 @@
     const record = cloneDeep(data.editValueRefs);
     pointSaveOrUpdate(Object.assign(record, { id: data.id, deviceId: deviceData.id }), data.id);
   };
-  const saveCameraData = (data: any) => {
+  const saveCameraData = (data: any, reload:Function) => {
     const record = cloneDeep(data.editValueRefs);
-    cameraSaveOrUpdate(Object.assign(record, { id: data.id, deviceid: deviceData.id }), data.id);
+    cameraSaveOrUpdate(Object.assign(record, { id: data.id, deviceid: deviceData.id }), data.id).then(() => {
+      reload()
+    })
   };
   const deletePointById = (id, reload) => {
     pointDeleteById({ id: id }, reload);

+ 1 - 1
src/views/vent/deviceManager/comment/NormalTable.vue

@@ -197,7 +197,7 @@
     Object.assign(record, toRaw(data));
     openModal(true, {
       record,
-    });
+    }, false);
   }
 
   /**

+ 1 - 1
src/views/vent/deviceManager/comment/cameraTabel/camera.api.ts

@@ -39,5 +39,5 @@ export const deleteById = (params, handleSuccess) => {
  */
 export const saveOrUpdate = (params, isUpdate) => {
   const url = isUpdate ? Api.edit : Api.save;
-  return defHttp.put({ url: url, params });
+  return defHttp.post({ url: url, params });
 };

+ 31 - 24
src/views/vent/deviceManager/comment/cameraTabel/camera.data.ts

@@ -13,37 +13,44 @@ export const columns: BasicColumn[] = [
     editRow: true,
   },
   {
-    title: 'IP地址',
-    dataIndex: 'ip',
-    width: 100,
-    editRow: true,
-    editRule: true,
-  },
-  {
-    title: '端口号',
-    width: 100,
-    dataIndex: 'port',
-    editRow: true,
-    editRule: true,
-    editComponent: 'InputNumber',
-  },
-  {
     title: '摄像头名称',
     dataIndex: 'name',
     width: 100,
     editRow: true,
-  },
-  {
-    title: '控制密码',
-    dataIndex: 'password',
-    width: 120,
-    editRow: true,
     editRule: true,
   },
   {
-    title: '摄像头用户',
-    dataIndex: 'username',
-    width: 120,
+    title: '摄像头地址',
+    dataIndex: 'addr',
+    width: 100,
     editRow: true,
+    editRule: true,
   },
+  // {
+  //   title: '端口号',
+  //   width: 100,
+  //   dataIndex: 'port',
+  //   editRow: true,
+  //   editRule: true,
+  //   editComponent: 'InputNumber',
+  // },
+  // {
+  //   title: '摄像头名称',
+  //   dataIndex: 'name',
+  //   width: 100,
+  //   editRow: true,
+  // },
+  // {
+  //   title: '控制密码',
+  //   dataIndex: 'password',
+  //   width: 120,
+  //   editRow: true,
+  //   editRule: true,
+  // },
+  // {
+  //   title: '摄像头用户',
+  //   dataIndex: 'username',
+  //   width: 120,
+  //   editRow: true,
+  // },
 ];

+ 6 - 5
src/views/vent/deviceManager/deviceTable/index.vue

@@ -130,11 +130,12 @@
 
   onMounted(() => {
     const pageType = currentRoute.value.name
-    if(pageType === 'nitrogen'){
-      deviceType.value = 'pressurefan'
-    }else {
-      deviceType.value = pageType
-    }
+    // if(pageType === 'nitrogen'){
+    //   deviceType.value = 'pressurefan'
+    // }else {
+    //   deviceType.value = pageType
+    // }
+    deviceType.value = pageType
     searchFormSchema[0].componentProps['dictCode'] =  `${deviceType.value}kind`
     columns.value = getTableHeaderColumns(`${deviceType.value}_list`) || []
     const formSchemaColumns = getFormSchemaColumns(`${deviceType.value}_edit`) || []

+ 2 - 1
src/views/vent/deviceManager/pointTabel/index.vue

@@ -13,7 +13,8 @@
       designScope="point-tabel"
       title="点表列表"
       :showTab="false"
-    />
+    >
+    </NormalTable>
   </div>
 </template>
 

+ 4 - 1
src/views/vent/deviceManager/pointTabel/point.data.ts

@@ -136,6 +136,9 @@ export const formSchema: FormSchema[] = [
             },
           });
         },
+        resetFields: () => {
+          debugger
+        }
       };
     },
   },
@@ -143,7 +146,7 @@ export const formSchema: FormSchema[] = [
     label: '点表类型',
     field: 'devicetype',
     component: 'ApiSelect',
-    componentProps: ({ formModel, formActionType }) => {
+    componentProps: ({ formModel }) => {
       return {
         componentProps: {},
         api: (params) => defHttp.get({ url: `/sys/dict/getDictItems/${formModel.devicekind + 'kind'}` }, params),

+ 2 - 4
src/views/vent/deviceManager/tableColumns/tableColumns.data.ts

@@ -75,12 +75,10 @@ export const formSchema: FormSchema[] = [
   },
   {
     label: '设备类型',
-    // field: 'monitorflag',lxh
     field: 'devicetype',
-    component: 'JDictSelectTag',
+    component: 'MTreeSelect',
     componentProps: {
-      dictCode: 'devicekind',
-      placeholder: '请选择状态',
+      isSearch: false,
     },
   },
 

+ 203 - 0
src/views/vent/monitorManager/comment/DetailModal.vue

@@ -0,0 +1,203 @@
+<template>
+  <BasicModal @register="register" title="预警详情" width="100%" v-bind="$attrs" @ok="onSubmit" @cancel="onSubmit" :defaultFullscreen="true">
+    <MonitorTable ref="monitorTable" :columnsType="`${deviceType}_monitor`" :dataSource="dataSource"
+      design-scope="device_monitor" :isShowPagination="false" :isShowActionColumn="true" title="设备监测">
+
+      <template #filterCell="{ column, record }">
+        <template v-if="deviceType.startsWith('gate')">
+          <template v-if="record.frontGateOpenCtrl">
+            <a-tag
+              v-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 0"
+              color="red">正在打开</a-tag>
+            <a-tag v-else-if="column.dataIndex === 'frontGateOpen'" color="processing">打开</a-tag>
+          </template>
+          <template v-else>
+            <a-tag
+              v-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 0"
+              color="red">正在关闭</a-tag>
+            <a-tag
+              v-else-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 1"
+              color="default">关闭</a-tag>
+            <a-tag
+              v-else-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 1 && record.frontGateClose == 0"
+              color="default">打开</a-tag>
+          </template>
+          <template v-if="record.rearGateOpenCtrl">
+            <a-tag
+              v-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 0 && record.rearGateClose == 0"
+              color="red">正在打开</a-tag>
+            <a-tag v-else-if="column.dataIndex === 'rearGateOpen'" color="processing">打开</a-tag>
+          </template>
+          <template v-else>
+            <a-tag
+              v-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 0 && record.rearGateClose == 0"
+              color="red">正在关闭</a-tag>
+            <a-tag
+              v-else-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 0 && record.rearGateClose == 1"
+              color="default">关闭</a-tag>
+            <a-tag
+              v-else-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 1 && record.rearGateClose == 0"
+              color="default">打开</a-tag>
+          </template>
+        </template>
+        <template v-if="deviceType.startsWith('windrect')">
+          <a-tag v-if="column.dataIndex === 'sign'"
+            :color="record.sign == 0 ? '#95CF65' : record.sign == 1 ? '#4590EA' : '#9876AA'"> {{
+              record.sign == 0 ? '高位' : record.sign == 1 ? '中位' : '低位'
+            }}</a-tag>
+          <template v-if="record && column && column.dataIndex === 'isRun' && record.isRun">
+            <a-tag v-if="record.isRun == -2 || record.isRun == -1"
+              :color="record.isRun == -2 ? '#95CF65' : '#ED5700'">{{
+                record.isRun == -2 ? '空闲' : '等待'
+              }}</a-tag>
+            <a-tag v-else-if="record.isRun == 100" color="#4693FF">完成</a-tag>
+            <Progress v-else :percent="Number(record.isRun)" size="small" status="active" />
+          </template>
+        </template>
+        <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>
+        <a-tag v-if="column.dataIndex === 'netStatus'" :color="record.netStatus == 0 ? 'default' : 'green'">{{
+          record.netStatus == 0 ? '断开' : '连接'
+        }}</a-tag>
+      </template>
+    </MonitorTable>
+  </BasicModal>
+</template>
+<script lang="ts" setup>
+
+import { onMounted, ref, defineEmits, onUnmounted, watch } from 'vue';
+import MonitorTable from '../comment/MonitorTable.vue';
+import { BasicModal, useModalInner } from '/@/components/Modal';
+
+const emit = defineEmits(['close', 'register'])
+const props = defineProps({
+  deviceType: { 
+    type: String,
+    default: ''
+  },
+  scroll: {
+    type: Object,
+    default: { y: 0 }
+  }
+})
+
+const dataSource = ref([]);
+
+// 注册 modal
+const [register, { closeModal }] = useModalInner();
+
+async function onSubmit() {
+  emit('close')
+  closeModal();
+}
+
+onMounted(async () => {
+
+});
+onUnmounted(() => {
+
+});
+</script>
+<style scoped lang="less">
+
+  @import '/@/design/vent/color.less';
+  @import '/@/design/vent/modal.less';
+  .padding-0 {
+    padding: 10px 0 !important;
+  }
+  .alarm-modal {
+    position: relative;
+    padding: 10px;
+    z-index: 999;
+    max-height: calc(100vh - 150px);
+    .title-text {
+      position: absolute;
+      top: -14px;
+      left: 0;
+      width: 100%;
+      text-align: center;
+      color: #fff;
+    }
+    .table-box {
+      height: calc(60vh - 150px);
+      padding: 20px 10px;
+      overflow-y: auto;
+    }
+
+    .box-bg {
+      border: 1px solid #4d7ad855;
+      border-radius: 2px;
+      // background-color: #001d3055;
+      // -webkit-backdrop-filter: blur(8px);
+      // backdrop-filter: blur(8px);
+      box-shadow: 0 0 10px #5984e055 inset;
+      // background-color: #00b3ff12;
+    }
+    .charts-box {
+      height: calc(40vh - 80px);
+      padding: 5px 10px;
+      margin-top: 10px;
+    }
+  }
+    .@{ventSpace}-picker,
+    .@{ventSpace}-select-selector {
+      width: 100% !important;
+      background: #00000017 !important;
+      border: 1px solid @vent-form-item-boder !important;
+      input,
+      .@{ventSpace}-select-selection-item,
+      .@{ventSpace}-picker-suffix {
+        color: #fff !important;
+      }
+      .@{ventSpace}-select-selection-placeholder {
+        color: #b7b7b7 !important;
+      }
+    }
+    .@{ventSpace}-pagination-next,
+    .action,
+    .@{ventSpace}-select-arrow,
+    .@{ventSpace}-picker-separator {
+      color: #fff !important;
+    }
+    .@{ventSpace}-table-cell-row-hover {
+      background: #264d8833 !important;
+    }
+    .@{ventSpace}-table-row-selected {
+      background: #00c0a311  !important;
+      td {
+        background-color: #00000000 !important;
+      }
+    }
+    .@{ventSpace}-table-thead {
+      // background: linear-gradient(#004a8655 0%, #004a86aa 10%) !important;
+      background: #3d9dd45d!important;
+
+      & > tr > th,
+      .@{ventSpace}-table-column-title {
+        // color: #70f9fc !important;
+        border-color: #84f2ff  !important;
+        border-left: none !important;
+        border-right: none !important;
+        padding: 7px;
+      }
+    }
+
+    .@{ventSpace}-table-tbody {
+      tr > td {
+        padding: 12px;
+      }
+    }
+    .@{ventSpace}-table-tbody > tr:hover.@{ventSpace}-table-row > td {
+      background-color: #26648855 !important;
+    }
+
+    .jeecg-basic-table-row__striped {
+      // background: #97efff11 !important;
+      td {
+        background-color: #97efff11 !important;
+      }
+    }
+  
+</style>

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

@@ -12,7 +12,6 @@
         :xAxisPropType="xAxisPropType"
         :dataSource="dataSource"
         height="100%"
-        :chartsColumns="chartsColumns"
         chartsType="listMonitor"
         :option="echartsOption"
       />
@@ -31,7 +30,6 @@
         :xAxisPropType="resultXAxisPropType"
         :dataSource="detailDataSource"
         height="100%"
-        :chartsColumns="chartsColumns"
         chartsType="detail"
       />
     </div>
@@ -83,7 +81,6 @@
         :xAxisPropType="resultXAxisPropType"
         :dataSource="resultDataSource"
         height="100%"
-        :chartsColumns="chartsColumns"
         :option="echartsOption1"
         chartsType="history"
       />

+ 11 - 0
src/views/vent/monitorManager/compreMonitor/compre.api.ts

@@ -0,0 +1,11 @@
+import { defHttp } from '/@/utils/http/axios';
+
+enum Api {
+  list = '/ventanaly-device/safety/secMonit/getList',
+}
+/**
+ * 列表接口
+ * @param params
+ */
+export const list = (params) => defHttp.post({ url: Api.list, params });
+

+ 125 - 0
src/views/vent/monitorManager/compreMonitor/compre.data.ts

@@ -0,0 +1,125 @@
+export const param = [
+  {
+    title: '总回风量',
+    code: 'fl',
+    value: 2504,
+  },
+  {
+    title: '瓦斯浓度',
+    code: 'gas',
+    value: 2504,
+  },
+  {
+    title: '风排瓦斯量',
+    code: 'fpGas',
+    value: 2504,
+  },
+];
+
+export const httpParam = [
+  {
+    devcode: '14010100313501MN0002018A11',
+    code: '1_fs1',
+  },
+  {
+    devcode: '14010100313501MN0002018A15',
+    code: '1_fs2',
+  },
+  {
+    devcode: '14010100313501MN0001018A09',
+    code: '1_gas1',
+  },
+  {
+    devcode: '14010100313501MN0001018A13',
+    code: '1_gas2',
+  },
+
+  {
+    devcode: '14010100313501MN0002053A12',
+    code: '2_fs1',
+  },
+  {
+    devcode: '14010100313501MN0002053A15',
+    code: '2_fs2',
+  },
+  {
+    devcode: '14010100313501MN0001053A10',
+    code: '2_gas1',
+  },
+  {
+    devcode: '14010100313501MN0001053A13',
+    code: '2_gas2',
+  },
+];
+
+export const result1 = [
+  {
+    faceArea: 19.58,
+    fs: 0,
+    fl: 0,
+    gas: 0,
+    fpGas: 0,
+  },
+  {
+    faceArea: 20.84,
+    fs: 0,
+    fl: 0,
+    gas: 0,
+    fpGas: 0,
+  },
+];
+
+export const result2 = [
+  {
+    faceArea: 18.66,
+    fs: 0,
+    fl: 0,
+    gas: 0,
+    fpGas: 0,
+  },
+  {
+    faceArea: 20.44,
+    fs: 0,
+    fl: 0,
+    gas: 0,
+    fpGas: 0,
+  },
+];
+
+// export const resultFn1 = () => {
+//   return [
+//     {
+//       faceArea: 19.58,
+//       fs: Number(Math.random() * 100.68 + 212),
+//       fl: Number(Math.random() * 100.68 + 12),
+//       gas: Number(Math.random() * 2.68 + 2),
+//       fpGas: 0,
+//     },
+//     {
+//       faceArea: 20.84,
+//       fs: Number(Math.random() * 190.68 + 202),
+//       fl: Number(Math.random() * 80.68 + 12),
+//       gas: Number(Math.random() * 1.68 + 2),
+//       fpGas: 0,
+//     },
+//   ];
+// };
+
+// export const resultFn2 = () => {
+//   return [
+//     {
+//       faceArea: 18.66,
+//       fs: Number(Math.random() * 100.68 + 212),
+//       fl: Number(Math.random() * 100.68 + 12),
+//       gas: Number(Math.random() * 2.68 + 2),
+//       fpGas: 0,
+//     },
+//     {
+//       faceArea: 20.44,
+//       fs: Number(Math.random() * 190.68 + 202),
+//       fl: Number(Math.random() * 80.68 + 12),
+//       gas: Number(Math.random() * 1.68 + 2),
+//       fpGas: 0,
+//     },
+//   ];
+// };

+ 277 - 0
src/views/vent/monitorManager/compreMonitor/index.vue

@@ -0,0 +1,277 @@
+<template>
+  <div class="scene-box">
+    <customHeader >智能通风综合监测</customHeader>
+    <div class="center-container">
+      <div class="top box">
+        <div class="title top-title">枣林</div>
+        <div class="items-top items-box">
+          <div  v-for="(item, n) in param" :key = n class="item" :class="`item${n+1}`">
+            <template v-if="item.code != 'gas'">
+              <div class="item-title">{{ item.title }}</div>
+              <div class="item-value">{{ dataSource[0] ? new Intl.NumberFormat('ja-JP').format(dataSource[0][item.code]): '-' }}</div>
+            </template>
+            <div class="gas-item" v-else-if="dataSource[0] && dataSource[0][item.code]">
+              <div class="gas" v-for="(gasItem, i) in dataSource[0][item.code]" :key="i">
+                <div class="title1">{{ gasItem['title'] }}</div>
+                <div class="title2">瓦斯浓度</div>
+                <div class="item-value">{{ gasItem['value'] ? new Intl.NumberFormat('ja-JP').format(gasItem['value']) : '-' }}</div>
+              </div>
+            </div>
+            
+          </div>
+        </div>
+      </div>
+      <div class="bottom box">
+        <div class="title bottom-title">刘家堰</div>
+        <div class="items-bottom items-box">
+          <div  v-for="(item, n) in param" :key = n class="item" :class="`item${n+1}`">
+            <template v-if="item.code != 'gas'">
+              <div class="item-title">{{ item.title }}</div>
+              <div class="item-value">{{ dataSource[1] ? new Intl.NumberFormat('ja-JP').format(dataSource[1][item.code]) : '-' }}</div>
+            </template>
+            <div class="gas-item" v-else-if="dataSource[0] && dataSource[0][item.code]">
+              <div class="gas" v-for="(gasItem, i) in dataSource[1][item.code]" :key="i">
+                <div class="title1">{{ gasItem['title'] }}</div>
+                <div class="title2">瓦斯浓度</div>
+                <div class="item-value">{{ gasItem['value'] ? new Intl.NumberFormat('ja-JP').format(gasItem['value']) : '-' }}</div>
+              </div>
+            </div>
+          </div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script setup lang="ts">
+import { ref, onMounted, onUnmounted, nextTick } from 'vue';
+import customHeader from '/@/views/vent/comment/components/customHeader.vue';
+import { param, httpParam, result1, result2 } from './compre.data'
+import { list } from './compre.api'
+
+type DataSource = {
+  fl: number,
+  gas: Array<any[]>,
+  fpGas: number,
+}
+const dataSource = ref<DataSource[]>([])
+
+let timer = null as unknown as NodeJS.Timer;
+async function getDataSource(t:NodeJS.Timer){
+  setTimeout(async() => {
+    // const result1 = resultFn1()
+    // const result2 = resultFn2()
+    try {
+      for(let i=0; i < httpParam.length; i++){
+        const item = httpParam[i]
+        const res = await list({ devcode: item.devcode })[0]
+        if (res) {
+          switch(item.code){
+            case '1_fs1':
+              result1[0]['fs'] = res['realvalue'];
+              break;
+            case '1_fs2':
+              result1[1]['fs'] = res['realvalue'];
+              break;
+            case '1_gas1':
+              result1[0]['gas'] = res['realvalue'];
+              break;
+            case '1_gas2':
+              result1[1]['gas'] = res['realvalue'];
+              break;
+            case '2_fs1':
+              result2[0]['fs'] = res['realvalue'];
+              break;
+            case '2_fs2':
+              result2[1]['fs'] = res['realvalue'];
+              break;
+            case '2_gas1':
+              result2[0]['gas'] = res['realvalue'];
+              break;
+            case '2_gas2':
+              result2[1]['gas'] = res['realvalue'];
+              break;
+          } 
+        }
+      }
+      
+      // 计算
+      const data = [
+        {
+          fl: 0,
+          gas: <any[]>[],
+          fpGas: 0,
+        },
+        {
+          fl: 0,
+          gas: <any[]>[],
+          fpGas: 0,
+        }
+      ]
+
+      result1[0]['fl'] = result1[0].fs * result1[0].faceArea * 60
+      result1[1]['fl'] = result1[1].fs * result1[1].faceArea * 60
+
+      result2[0]['fl'] = result2[0].fs * result2[0].faceArea * 60
+      result2[1]['fl'] = result2[1].fs * result2[1].faceArea * 60
+
+      data[0]['fl'] = result1[0]['fl'] + result1[1]['fl']
+      data[1]['fl'] = result2[0]['fl'] + result2[1]['fl']
+
+      data[0]['fpGas'] = (result1[0]['fl'] * result1[0]['gas'] / 100) + (result1[1]['fl'] * result1[1]['gas'] / 100)
+      data[1]['fpGas'] = (result2[0]['fl'] * result2[0]['gas'] / 100) + (result2[1]['fl'] * result2[1]['gas'] / 100)
+
+      data[0]['gas'] = [
+        {
+          title: '二盘区一号回风联巷',
+          value: result1[0]['gas']
+        },
+        {
+          title: '二盘区二号回风联巷',
+          value: result1[1]['gas']
+        },
+      ]
+      data[1]['gas'] = [
+        {
+          title: '五盘区一号回风巷',
+          value: result2[0]['gas']
+        },
+        {
+          title: '五盘区二号回风巷',
+          value: result2[1]['gas']
+        },
+      ]
+
+      dataSource.value = data
+    } catch (error) {
+      clearInterval(t)
+    }
+  }, 0)
+}
+
+
+onMounted(async () => {
+  await getDataSource(timer)
+  timer = setInterval(async() => {
+    await getDataSource(timer)
+  }, 5000)
+});
+
+onUnmounted(() => {
+  clearInterval(timer)
+});
+
+</script>
+<style lang="less" scoped>
+.center-container{
+  width: 100%;
+  height: 100%;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+  flex-direction: column;
+  
+  .top{
+    background: url('/@/assets/images/vent/compre-top.png') no-repeat;
+    margin-top: 60px;
+  }
+  .bottom{
+    background: url('/@/assets/images/vent/compre-bottom.png') no-repeat;
+    margin-top: 80px;
+  }
+  .box{
+    width: 1500px;
+    height: 320px;
+    background-size: contain;
+    position: relative;
+    .title{
+      width: 100%;
+      position: absolute;
+      color: #dddddd;
+      text-align: center;
+      font-size: 28px;
+      font-weight: 600;
+      text-shadow: 2px 2px 4px #00000088;
+    }
+    .top-title{
+      top: 10px;
+    }
+    .bottom-title{
+      bottom: 25px;
+    }
+
+  }
+  .items-top{
+    margin-top: 130px;
+  }
+  .items-bottom{
+    margin-top: 45px;
+  }
+  .items-box{
+    width: 100%;
+    height: 100%;
+    display: flex;
+    justify-content: space-around;
+    padding: 0 40px;
+    .item{
+      width: 375px;
+      height: 132px;
+      display: flex;
+      flex-direction: column;
+      justify-content: center;
+      align-items: flex-start;
+      padding-left: 160px;
+      position: relative;
+      .item-title{
+        color: #e8e8e8;
+        margin-bottom: 10px;
+        font-weight: 600;
+      }
+      .item-value{
+        font-size: 22px;
+        font-family: 'douyuFont';
+      }
+      .gas-item{
+        position: absolute;
+        width: 100%;
+        height: 100%;
+        display: flex;
+        flex-direction: row;
+        justify-content: space-between;
+        left: 0px;
+        padding: 0 60px;
+        top: 20px;
+        .gas{
+          .title1{
+            color: #00d9ff;
+            margin-bottom: 10px;
+            font-size: 16px;
+            font-weight: 600;
+          }
+          .title2{
+            color: #fff;
+            margin-bottom: 10px;
+            font-weight: 600;
+          }
+        }
+      }
+    }
+    .item1{
+      background: url('/@/assets/images/vent/compre-3.png') no-repeat;
+      color: #30B6FF;
+    }
+    .item2{
+      width: 507px;
+      height: 135px;
+      background: url('/@/assets/images/vent/compre-2-1.png') no-repeat;
+      color: #A9B6FF;
+    } 
+    .item3{
+      background: url('/@/assets/images/vent/compre-1.png') no-repeat;
+      color: #27FDED;
+    } 
+  }
+  
+} 
+  
+</style>

+ 3 - 3
src/views/vent/monitorManager/fanLocalMonitor/index.vue

@@ -168,8 +168,8 @@
       </div>
     </div>
 
-    <div class="bottom-tabs-box" @mousedown="setDivHeight($event, 250, scroll, 95)">
-      <dv-border-box8 :dur="5"  :style="`top: 65px; padding: 5px; height: ${scroll.y + 100}px`" >
+    <div class="bottom-tabs-box" @mousedown="setDivHeight($event, 100, scroll, 125)">
+      <dv-border-box8 :dur="5"  :style="`top: 65px; padding: 5px; height: ${scroll.y + 120}px`" >
         <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"/>
@@ -494,7 +494,7 @@
           if (currentRoute.value['query'] && currentRoute.value['query']['id']) {
             MonitorDataTable.value.setSelectedRowKeys(currentRoute.value['query']['id'])
           }else{
-            MonitorDataTable.value.setSelectedRowKeys([dataSource.value[0]['deviceID']])
+            MonitorDataTable.value.setSelectedRowKeys(dataSource.value[0]['deviceID'])
           }
         }
         Object.assign(selectData, deviceBaseList.value, dataSource.value[selectRowIndex.value]);

+ 15 - 12
src/views/vent/monitorManager/gateMonitor/index.vue

@@ -86,20 +86,26 @@
                 <template v-if="record.frontGateOpenCtrl">
                   <a-tag v-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 0" color="red">正在打开</a-tag>
                   <a-tag v-else-if="column.dataIndex === 'frontGateOpen'" color="processing">打开</a-tag>
+                  <!-- <a-tag v-if="column.dataIndex === 'frontGateOpen'" color="processing">打开</a-tag> -->
                 </template>
                 <template v-else>
                   <a-tag v-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 0" color="red">正在关闭</a-tag>
                   <a-tag v-else-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 1" color="default">关闭</a-tag>
                   <a-tag v-else-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 1 && record.frontGateClose == 0" color="default">打开</a-tag>
+                  <!-- <a-tag v-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 0 && record.frontGateClose == 1" color="default">关闭</a-tag>
+                  <a-tag v-else-if="column.dataIndex === 'frontGateOpen' && record.frontGateOpen == 1 && record.frontGateClose == 0" color="default">打开</a-tag> -->
                 </template>
                 <template v-if="record.rearGateOpenCtrl">
                   <a-tag v-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 0 && record.rearGateClose == 0" color="red">正在打开</a-tag>
                   <a-tag v-else-if="column.dataIndex === 'rearGateOpen'" color="processing">打开</a-tag>
+                  <!-- <a-tag v-if="column.dataIndex === 'rearGateOpen'" color="processing">打开</a-tag> -->
                 </template>
                 <template v-else>
                   <a-tag v-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 0 && record.rearGateClose == 0" color="red">正在关闭</a-tag>
                   <a-tag v-else-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 0 && record.rearGateClose == 1" color="default">关闭</a-tag>
                   <a-tag v-else-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 1 && record.rearGateClose == 0" color="default">打开</a-tag>
+                  <!-- <a-tag v-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 0 && record.rearGateClose == 1" color="default">关闭</a-tag>
+                  <a-tag v-else-if="column.dataIndex === 'rearGateOpen' && record.rearGateOpen == 1 && record.rearGateClose == 0" color="default">打开</a-tag> -->
                 </template>
                 
                 <a-tag v-if="column.dataIndex === 'warnFlag'" :color="record.warnFlag == 0 ? 'green' : 'red'">{{
@@ -144,8 +150,8 @@
     </div>
   </div>
   <div style="z-index: -1; position: absolute; top: 50px; right: 10px; width: 300px; height: 280px; margin: auto" class="palyer1">
-    <LivePlayer id="fm-player1" ref="player1" :videoUrl="flvURL1()" muted live loading controls />
-    <LivePlayer id="fm-player2" ref="player2" :videoUrl="flvURL1()" muted live loading controls style="margin-top: 10px" />
+    <LivePlayer id="fm-player1" ref="player1" :videoUrl="flvURL1" muted live loading controls />
+    <LivePlayer id="fm-player2" ref="player2" :videoUrl="flvURL2" muted live loading controls style="margin-top: 10px" />
   </div>
   <!-- <a-modal v-model:visible="modalIsShow" :title="modalTitle" @ok="handleOk">
     <div class="modal-container">
@@ -229,20 +235,15 @@
     fault: '气源压力超限',
     masterComputer: 0,
     frontGateOpenCtrl: false,
-    rearGateOpenCtrl: false
-
+    rearGateOpenCtrl: false,
+    cameras: []
   };
 
   // 监测数据
   const selectData = reactive(lodash.cloneDeep(initData));
 
-  const flvURL1 = () => {
-    // return `https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv`;
-    return ''
-  };
-  const flvURL2 = () => {
-    return `https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv`;
-  };
+  const flvURL1 = ref('')
+  const flvURL2 = ref('')
 
   // 获取设备基本信息列表
   function getDeviceBaseList() {
@@ -272,6 +273,8 @@
             }
           }
           Object.assign(selectData, dataSource.value[selectRowIndex.value]);
+          if (!flvURL1.value) flvURL1.value = selectData.cameras && selectData.cameras[0] ? selectData.cameras[0]['addr'] : ''
+          if (!flvURL2.value) flvURL2.value = selectData.cameras && selectData.cameras[1] ? selectData.cameras[1]['addr'] : ''
           addMonitorText(selectData);
           monitorAnimation(selectData)
           if (timer) {
@@ -462,7 +465,7 @@
   let frontDeviceState = 0 //记录设备状态,为了与下一次监测数据做比较
   let rearDeviceState = 0 //记录设备状态,为了与下一次监测数据做比较  
   function monitorAnimation(selectData) {
-    const timeScale = 0.0003
+    const timeScale = 0.003
     if (selectData.frontGateOpenCtrl) {
 
       if (selectData.frontGateOpen == 0 && selectData.frontGateClose == 0) {

+ 1 - 1
src/views/vent/monitorManager/mainFanMonitor/index.vue

@@ -428,7 +428,7 @@
           if (currentRoute.value['query'] && currentRoute.value['query']['id']) {
             MonitorDataTable.value.setSelectedRowKeys(currentRoute.value['query']['id'])
           } else {
-            MonitorDataTable.value.setSelectedRowKeys([dataSource.value[0]['deviceID']])
+            MonitorDataTable.value.setSelectedRowKeys(dataSource.value[0]['deviceID'])
           }
         }
         Object.assign(selectData, deviceBaseList.value, dataSource.value[selectRowIndex.value]);