hongrunxia il y a 2 jours
Parent
commit
059a04ff7c
39 fichiers modifiés avec 3762 ajouts et 1658 suppressions
  1. BIN
      src/assets/images/home-container/configurable/tashanhome/board-bg-l1.png
  2. BIN
      src/assets/images/home-container/configurable/tashanhome/board-bg-l2.png
  3. BIN
      src/assets/images/home-container/configurable/tashanhome/board-bg-m1.png
  4. BIN
      src/assets/images/home-container/configurable/tashanhome/board-bg-m2.png
  5. BIN
      src/assets/images/home-container/configurable/tashanhome/board-bg-n1.png
  6. BIN
      src/assets/images/home-container/configurable/tashanhome/board-bg-n2.png
  7. BIN
      src/assets/images/home-container/configurable/tashanhome/board-bg-n3.png
  8. BIN
      src/assets/images/home-container/configurable/tashanhome/board-bg-n4.png
  9. BIN
      src/assets/images/home-container/configurable/tashanhome/board-bg-o.png
  10. BIN
      src/assets/images/home-container/configurable/tashanhome/center-bar-bg.png
  11. BIN
      src/assets/images/home-container/configurable/tashanhome/center-bar-circle.png
  12. BIN
      src/assets/images/home-container/configurable/tashanhome/leftbar-bg1.png
  13. BIN
      src/assets/images/home-container/configurable/tashanhome/leftbar-bg2.png
  14. BIN
      src/assets/images/home-container/configurable/tashanhome/rightbar-bg1.png
  15. BIN
      src/assets/images/home-container/configurable/tashanhome/rightbar-bg2.png
  16. 34 63
      src/hooks/system/useMethods.ts
  17. 2 0
      src/layouts/default/header/components/VoiceBroadcast.vue
  18. 12 2
      src/views/vent/deviceManager/comment/warningTabel/warning.data.ts
  19. 1 1
      src/views/vent/deviceManager/configurationTable/types.ts
  20. 20 11
      src/views/vent/home/configurable/components/ModuleCommon.vue
  21. 167 0
      src/views/vent/home/configurable/components/ModuleCommonDual.vue
  22. 46 45
      src/views/vent/home/configurable/components/ModuleOriginal.vue
  23. 93 0
      src/views/vent/home/configurable/components/detail/MiniBoard.vue
  24. 10 8
      src/views/vent/home/configurable/components/original/moduleBottom.vue
  25. 10 8
      src/views/vent/home/configurable/components/original/moduleLeft.vue
  26. 100 0
      src/views/vent/home/configurable/components/original/moduleRight.vue
  27. 669 0
      src/views/vent/home/configurable/configurable.data.tashan.ts
  28. 0 1
      src/views/vent/home/configurable/fireMine.vue
  29. 292 0
      src/views/vent/home/configurable/fireTS.vue
  30. 34 4
      src/views/vent/home/configurable/ventSDG.vue
  31. 2 0
      src/views/vent/monitorManager/balancePressMonitor/balancePress.api.ts
  32. 2 2
      src/views/vent/monitorManager/balancePressMonitor/balancePress.data.ts
  33. 210 155
      src/views/vent/monitorManager/balancePressMonitor/components/balancePressHomeBD.vue
  34. 17 6
      src/views/vent/monitorManager/balancePressMonitor/hooks/useControl.ts
  35. 583 583
      src/views/vent/monitorManager/comment/HistoryTable.vue
  36. 593 0
      src/views/vent/monitorManager/comment/HistoryTableChart.vue
  37. 17 5
      src/views/vent/monitorManager/gateMonitor/gate.data.ts
  38. 767 683
      src/views/vent/monitorManager/gateMonitor/index.vue
  39. 81 81
      src/views/vent/monitorManager/mainFanMonitor/components/AnalysisTable.vue

BIN
src/assets/images/home-container/configurable/tashanhome/board-bg-l1.png


BIN
src/assets/images/home-container/configurable/tashanhome/board-bg-l2.png


BIN
src/assets/images/home-container/configurable/tashanhome/board-bg-m1.png


BIN
src/assets/images/home-container/configurable/tashanhome/board-bg-m2.png


BIN
src/assets/images/home-container/configurable/tashanhome/board-bg-n1.png


BIN
src/assets/images/home-container/configurable/tashanhome/board-bg-n2.png


BIN
src/assets/images/home-container/configurable/tashanhome/board-bg-n3.png


BIN
src/assets/images/home-container/configurable/tashanhome/board-bg-n4.png


BIN
src/assets/images/home-container/configurable/tashanhome/board-bg-o.png


BIN
src/assets/images/home-container/configurable/tashanhome/center-bar-bg.png


BIN
src/assets/images/home-container/configurable/tashanhome/center-bar-circle.png


BIN
src/assets/images/home-container/configurable/tashanhome/leftbar-bg1.png


BIN
src/assets/images/home-container/configurable/tashanhome/leftbar-bg2.png


BIN
src/assets/images/home-container/configurable/tashanhome/rightbar-bg1.png


BIN
src/assets/images/home-container/configurable/tashanhome/rightbar-bg2.png


+ 34 - 63
src/hooks/system/useMethods.ts

@@ -57,69 +57,40 @@ export function useMethods() {
    * @param url
    */
   async function exportXlsPost(name, url, params, isXlsx = false) {
-
-    const data = await defHttp.post({ url: url, params: params, responseType: 'blob', timeout: 1000 * 1000 }, { isTransformResponse: false });
-    if (!data) {
-      createMessage.warning('文件下载失败');
-      return;
-    }
-    if (!name || typeof name != 'string') {
-      name = '导出文件';
-    }
-    const blobOptions = { type: 'application/vnd.ms-excel' };
-    let fileSuffix = '.xls';
-    if (isXlsx === true) {
-      blobOptions['type'] = XLSX_MIME_TYPE;
-      fileSuffix = XLSX_FILE_SUFFIX;
-    }
-    if (typeof window.navigator.msSaveBlob !== 'undefined') {
-      window.navigator.msSaveBlob(new Blob([data], blobOptions), name + fileSuffix);
-    } else {
-      const url = window.URL.createObjectURL(new Blob([data], blobOptions));
-      const link = document.createElement('a');
-      link.style.display = 'none';
-      link.href = url;
-      link.setAttribute('download', name + fileSuffix);
-      document.body.appendChild(link);
-      link.click();
-      document.body.removeChild(link); //下载完成移除元素
-      window.URL.revokeObjectURL(url); //释放掉blob对象
-    }
-   
-    // const key = 'updatable';
-    // message.loading({ content: '正在导出,请稍等...', key });
-    // defHttp
-    //   .post({ url: url, params: params, timeout: 1000 * 1000 }, { isTransformResponse: false })
-    //   .then((data) => {
-    //     debugger;
-    //     if (data.code == 200 && data.result) {
-    //       const messageArr = data.result.split('/');
-    //       const fileUrl = messageArr[messageArr.length - 1];
-    //       if (fileUrl) {
-    //         const baseApiUrl = glob.domainUrl;
-    //         // 下载文件
-    //         const a = document.createElement('a');
-    //         // 定义下载名称
-    //         a.download = name;
-    //         // 隐藏标签
-    //         a.style.display = 'none';
-    //         // 设置文件路径
-    //         a.href = `${baseApiUrl}/sys/common/static/${fileUrl}`;
-    //         // 将创建的标签插入dom
-    //         document.body.appendChild(a);
-    //         // 点击标签,执行下载
-    //         a.click();
-    //         // 将标签从dom移除
-    //         document.body.removeChild(a);
-    //         message.success({ content: '导出成功!', key, duration: 1 });
-    //       }
-    //     } else {
-    //       message.error({ content: '下载失败!', key, duration: 1 });
-    //     }
-    //   })
-    //   .catch(() => {
-    //     message.error({ content: '下载失败!', key, duration: 1 });
-    //   });
+     const key = 'updatable';
+     message.loading({ content: '正在导出,请稍等...', key });
+     defHttp
+       .post({ url: url, params: params, timeout: 1000 * 1000 }, { isTransformResponse: false })
+       .then((data) => {
+         debugger;
+         if (data.code == 200 && data.result) {
+           const messageArr = data.result.split('/');
+           const fileUrl = messageArr[messageArr.length - 1];
+           if (fileUrl) {
+             const baseApiUrl = glob.domainUrl;
+             // 下载文件
+             const a = document.createElement('a');
+             // 定义下载名称
+             a.download = name;
+             // 隐藏标签
+             a.style.display = 'none';
+             // 设置文件路径
+             a.href = `${baseApiUrl}/sys/common/static/${fileUrl}`;
+             // 将创建的标签插入dom
+             document.body.appendChild(a);
+             // 点击标签,执行下载
+             a.click();
+             // 将标签从dom移除
+             document.body.removeChild(a);
+             message.success({ content: '导出成功!', key, duration: 1 });
+           }
+         } else {
+           message.error({ content: '下载失败!', key, duration: 1 });
+        }
+       })
+       .catch(() => {
+         message.error({ content: '下载失败!', key, duration: 1 });
+       });
   }
 
   async function exportXlsPost1(name, url, params, isXlsx = false) {

+ 2 - 0
src/layouts/default/header/components/VoiceBroadcast.vue

@@ -123,9 +123,11 @@
         // let wsClientId = md5(token);
         // let userId = unref(userStore.getUserInfo).id + '_' + wsClientId;
         let userId = unref(userStore.getUserInfo).id + '?token=' + token;
+        console.log(userStore.getUserInfo,'userId---')
         // WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
         // let url = glob.wsUrl?.replace('https://', 'wss://').replace('http://', 'ws://') + '/websocket/' + userId;
         let url = 'http://' + window.location.hostname + ':9999'?.replace('https://', 'wss://').replace('http://', 'ws://') + '/websocket/' + userId;
+        console.log(url,'url------')
         connectWebSocket(url);
         onWebSocket(onWebSocketMessage);
       }

+ 12 - 2
src/views/vent/deviceManager/comment/warningTabel/warning.data.ts

@@ -47,7 +47,7 @@ export const levelColumns: BasicColumn[] = [
     editComponent: 'Input',
   },
   {
-    title: '是否语音报',
+    title: '是否语音报',
     width: 110,
     editRow: true,
     dataIndex: 'isVoice',
@@ -57,7 +57,17 @@ export const levelColumns: BasicColumn[] = [
     },
   },
   {
-    title: '语音播报频率(s)',
+    title: '是否持续语音播报',
+    width: 130,
+    editRow: true,
+    dataIndex: 'isCxVoice',
+    editComponent: 'Switch',
+    editValueMap: (value) => {
+      return value ? '是' : '否';
+    },
+  },
+  {
+    title: '持续播报频率(s)',
     width: 120,
     editRow: true,
     dataIndex: 'voiceFre',

+ 1 - 1
src/views/vent/deviceManager/configurationTable/types.ts

@@ -146,7 +146,7 @@ export interface CommonItem {
 
 export interface ModuleDataBoard extends ReadFrom {
   /** 展示牌预设的背景类型 */
-  type: 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'New' | 'New1' | 'New2' | 'New3'| 'J' | 'K';
+  type: 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'New' | 'New1' | 'New2' | 'New3'| 'J' | 'K' | 'L' | 'M' | 'N' | 'O';
   /** 展示牌布局,决定是 label 部分在上方或是 value 在上方 */
   layout: 'val-top' | 'label-top' | 'new-top' | 'new1-top' | 'new2-top' | 'new3-top';
   /** 核心配置,每个展示牌对应一项 */

+ 20 - 11
src/views/vent/home/configurable/components/ModuleCommon.vue

@@ -1,16 +1,21 @@
 <template>
   <!-- 常用模块 -->
-  <ventBox1 :class="getModuleClass(showStyle)" :style="style">
-    <template v-if="moduleName" #title>
-      <div :class="{ 'cursor-pointer': !!moduleData.to }" @click="redirectTo">{{ moduleName }}</div>
-    </template>
-    <template #container>
-      <slot>
-        <Header :deviceType="deviceType" :moduleData="moduleData" :data="data" @select="selectedData = $event" />
-        <Content :style="{ height: header.show ? 'calc(100% - 30px)' : '100%' }" :moduleData="moduleData" :data="selectedData" />
-      </slot>
-    </template>
-  </ventBox1>
+  <Transition
+    :enter-active-class="`animate__animated  animate__fadeIn${capitalizedPosition}`"
+    :leave-active-class="`animate__animated  animate__fadeOut${capitalizedPosition}`"
+  >
+    <ventBox1 v-if="visible" :class="getModuleClass(showStyle)" :style="style">
+      <template v-if="moduleName" #title>
+        <div :class="{ 'cursor-pointer': !!moduleData.to }" @click="redirectTo">{{ moduleName }}</div>
+      </template>
+      <template #container>
+        <slot>
+          <Header :deviceType="deviceType" :moduleData="moduleData" :data="data" @select="selectedData = $event" />
+          <Content :style="{ height: header.show ? 'calc(100% - 30px)' : '100%' }" :moduleData="moduleData" :data="selectedData" />
+        </slot>
+      </template>
+    </ventBox1>
+  </Transition>
 </template>
 <script lang="ts" setup>
   import Header from './header.vue';
@@ -46,6 +51,10 @@
     return size + position + 'position: absolute; pointer-events: auto;';
   });
 
+  const capitalizedPosition = computed(() => {
+    return props.showStyle.position.includes('left') ? 'Left' : 'Right';
+  });
+
   // 根据配置里的定位判断应该使用哪个class
   function getModuleClass({ size, position }) {
     const [_, width] = size.match(/width:([0-9]+)px/) || [];

+ 167 - 0
src/views/vent/home/configurable/components/ModuleCommonDual.vue

@@ -0,0 +1,167 @@
+<template>
+  <ventBox1 :class="getModuleClass(showStyle)" :style="style">
+    <template #title>
+      <div class="dual-title">
+        <div class="title-left">
+          <div :class="{ deactived: index === 1, 'cursor-pointer': !!moduleDataA.to }" @click="index = 0">{{ moduleNameA }}</div>
+          <div :class="{ deactived: index === 0, 'cursor-pointer': !!moduleDataB.to }" @click="index = 1">{{ moduleNameB }}</div>
+        </div>
+        <div class="title-center">{{ commonTitle }}</div>
+      </div>
+    </template>
+    <template #container>
+      <slot>
+        <Header
+          v-if="index === 0"
+          :deviceType="deviceTypeA"
+          :moduleData="moduleDataA"
+          :data="data"
+          @select="selectedDataA = $event"
+        />
+        <Header
+          v-if="index === 1"
+          :deviceType="deviceTypeB"
+          :moduleData="moduleDataB"
+          :data="data"
+          @select="selectedDataB = $event"
+        />
+        <Content
+          v-if="index === 0"
+          :style="{ height: moduleDataA.header?.show ? 'calc(100% - 30px)' : '100%' }"
+          :moduleData="moduleDataA"
+          :data="selectedDataA"
+        />
+        <Content
+          v-if="index === 1"
+          :style="{ height: moduleDataB.header?.show ? 'calc(100% - 30px)' : '100%' }"
+          :moduleData="moduleDataB"
+          :data="selectedDataB"
+        />
+      </slot>
+    </template>
+  </ventBox1>
+</template>
+
+<script lang="ts" setup>
+import Header from './header.vue';
+import Content from './content.vue';
+import { computed, ref } from 'vue';
+import ventBox1 from '/@/components/vent/ventBox1.vue';
+import { openWindow } from '/@/utils';
+import { getFormattedText } from '../hooks/helper';
+
+const props = defineProps<{
+  moduleDataA: any;
+  moduleNameA: string;
+  deviceTypeA: string;
+  moduleDataB: any;
+  moduleNameB: string;
+  deviceTypeB: string;
+  showStyle: any;
+  visible: boolean;
+  data: any;
+  commonTitle: string;
+}>();
+defineEmits(['close', 'click']);
+
+const index = ref(0);
+
+const selectedDataA = ref();
+const selectedDataB = ref();
+
+const style = computed(() => {
+  const size = props.showStyle.size;
+  const position = props.showStyle.position;
+  
+  return size + position + ';position: absolute; pointer-events: auto;';
+});
+
+// 根据配置里的定位判断应该使用哪个class
+function getModuleClass({ size, position }) {
+  const [_, width] = size.match(/width:([0-9]+)px/) || [];
+  if (position.includes('bottom') || parseInt(width) > 800) {
+    return 'module-common-dual module-common-dual-longer';
+  }
+  return 'module-common-dual';
+}
+
+// 跳转
+function redirectToA() {
+  const { to } = props.moduleDataA;
+  if (!to) return;
+  openWindow(getFormattedText(selectedDataA.value, to));
+}
+function redirectToB() {
+  const { to } = props.moduleDataB;
+  if (!to) return;
+  openWindow(getFormattedText(selectedDataB.value, to));
+}
+</script>
+
+<style lang="less" scoped>
+@import '/@/design/theme.less';
+
+.module-common-dual .box1-center {
+  height: calc(100% - 48px);
+}
+
+:deep(.box1-center) {
+  height: calc(100% - 48px);
+}
+:deep(.box1-center > .box-container) {
+  height: 100%;
+  padding: 0 !important;
+  width: 100% !important;
+}
+.dual-title {
+  position: relative;
+  width: 100%;
+  height: 100%;
+  align-items: center;
+  display: flex;
+  font-size: 14px;
+  .title-center {
+    position: absolute;
+    left: 50%;
+    transform: translateX(-50%);
+  }
+  .title-left {
+    height: 100%;
+    margin-left: 30px;
+    display: flex;
+    div {
+      display: flex;
+      align-items: center;
+      height: 100%;
+      cursor: pointer;
+      padding: 0 12px;
+      background: linear-gradient(to top, #2bafc6 0%, rgba(44, 255, 221, 0.1) 50%,rgba(44, 255, 221, 0) 90%);
+    }
+  }
+
+  .deactived {
+    background: none !important;
+    color: #8087a1;
+  }
+}
+// @{theme-deepblue} {
+//   .module-common-dual-longer {
+//     :deep(.box1-top) {
+//       --image-box1-top: url('/@/assets/images/themify/deepblue/vent/border/box2-top-long.png');
+//     }
+//     :deep(.box1-bottom) {
+//       --image-box1-bottom: none;
+//     }
+//   }
+// }
+.module-common-dual-longer {
+  :deep(.box1-top) {
+    --image-box1-top: url('/@/assets/images/vent/box-top-bg.png');
+    background-image: var(--image-box1-top);
+  }
+  :deep(.box1-bottom) {
+    --image-box1-bottom: url('/@/assets/images/vent/box-bottom-bg.png');
+    background-image: var(--image-box1-bottom);
+  }
+}
+</style>

+ 46 - 45
src/views/vent/home/configurable/components/ModuleOriginal.vue

@@ -16,56 +16,57 @@
   </component>
 </template>
 <script lang="ts" setup>
-import Header from './header.vue';
-import Content from './content.vue';
-import ModuleLeft from './original/moduleLeft.vue';
-import ModuleBottom from './original/moduleBottom.vue';
-import { computed, ref } from 'vue';
-import { openWindow } from '/@/utils';
-import { getFormattedText } from '../hooks/helper';
-// import { ModuleProps } from '../types';
+  import Header from './header.vue';
+  import Content from './content.vue';
+  import ModuleLeft from './original/moduleLeft.vue';
+  import ModuleRight from './original/moduleRight.vue';
+  import ModuleBottom from './original/moduleBottom.vue';
+  import { computed, ref } from 'vue';
+  import { openWindow } from '/@/utils';
+  import { getFormattedText } from '../hooks/helper';
+  // import { ModuleProps } from '../types';
 
-const props = defineProps<{
-  /** 配置的详细模块信息 */
-  moduleData: any;
-  /** 配置的详细样式信息 */
-  showStyle: any;
-  /** 该模块配置中的设备标识符 */
-  deviceType: string;
-  /** api返回的数据 */
-  data: any;
-  moduleName: string;
-  visible: boolean;
-}>();
-defineEmits(['close', 'click']);
+  const props = defineProps<{
+    /** 配置的详细模块信息 */
+    moduleData: any;
+    /** 配置的详细样式信息 */
+    showStyle: any;
+    /** 该模块配置中的设备标识符 */
+    deviceType: string;
+    /** api返回的数据 */
+    data: any;
+    moduleName: string;
+    visible: boolean;
+  }>();
+  defineEmits(['close', 'click']);
 
-const { header } = props.moduleData;
-const selectedData = ref();
+  const { header } = props.moduleData;
+  const selectedData = ref();
 
-const style = computed(() => {
-  const size = props.showStyle.size;
-  const position = props.showStyle.position;
-  return size + position;
-});
+  const style = computed(() => {
+    const size = props.showStyle.size;
+    const position = props.showStyle.position;
+    return size + position;
+  });
 
-// 根据配置里的定位判断应该使用哪个module组件
-function getModuleComponent({ size, position }) {
-  const [_, width] = size.match(/width:([0-9]+)px/) || [];
-  if (position.includes('bottom') || parseInt(width) > 800) {
+  // 根据配置里的定位判断应该使用哪个module组件
+  function getModuleComponent({ size, position }) {
+    const [_, width] = size.match(/width:([0-9]+)px/) || [];
+    if (position.includes('bottom') || parseInt(width) > 800) {
+      return ModuleBottom;
+    }
+    if (position.includes('left')) {
+      return ModuleLeft;
+    }
+    if (position.includes('right')) {
+      return ModuleRight;
+    }
     return ModuleBottom;
   }
-  if (position.includes('left')) {
-    return ModuleLeft;
-  }
-  if (position.includes('right')) {
-    return ModuleLeft;
-  }
-  return ModuleBottom;
-}
 
-function redirectTo() {
-  const { to } = props.moduleData;
-  if (!to) return;
-  openWindow(getFormattedText(selectedData.value, to));
-}
+  function redirectTo() {
+    const { to } = props.moduleData;
+    if (!to) return;
+    openWindow(getFormattedText(selectedData.value, to));
+  }
 </script>

+ 93 - 0
src/views/vent/home/configurable/components/detail/MiniBoard.vue

@@ -148,6 +148,15 @@ defineEmits(['click']);
   --image-board-bg-J: url('/@/assets/images/home-container/configurable/minehome/board-bg-j.png');
   --image-board-bg-k1: url('/@/assets/images/home-container/configurable/minehome/board-bg-k1.png');
   --image-board-bg-k2: url('/@/assets/images/home-container/configurable/minehome/board-bg-k2.png');
+  --image-board-bg-l1: url('/@/assets/images/home-container/configurable/tashanhome/board-bg-l1.png');
+  --image-board-bg-l2: url('/@/assets/images/home-container/configurable/tashanhome/board-bg-l2.png');
+  --image-board-bg-m1: url('/@/assets/images/home-container/configurable/tashanhome/board-bg-m1.png');
+  --image-board-bg-m2: url('/@/assets/images/home-container/configurable/tashanhome/board-bg-m2.png');
+  --image-board-bg-nl1: url('/@/assets/images/home-container/configurable/tashanhome/board-bg-n1.png');
+  --image-board-bg-nr1: url('/@/assets/images/home-container/configurable/tashanhome/board-bg-n2.png');
+  --image-board-bg-nl2: url('/@/assets/images/home-container/configurable/tashanhome/board-bg-n3.png');
+  --image-board-bg-nr2: url('/@/assets/images/home-container/configurable/tashanhome/board-bg-n4.png');
+  --image-board-bg-o: url('/@/assets/images/home-container/configurable/tashanhome/board-bg-o.png');
 
   --image-hycd: url(/@/assets/images/home-container/configurable/dusthome/hycd.png);
   --image-dyfl: url(/@/assets/images/home-container/configurable/dusthome/dyfl.png);
@@ -294,6 +303,58 @@ defineEmits(['click']);
   background-image: var(--image-board-bg-k2);
 }
 
+.mini-board_L {
+  width: 120px;
+  height: 100px;
+  background-size: 100% 100%;
+}
+.mini-board_L:nth-child(odd) {
+  background-image: var(--image-board-bg-l1);
+}
+.mini-board_L:nth-child(even) {
+  background-image: var(--image-board-bg-l2);
+}
+
+.mini-board_M {
+  width: 180px;
+  height: 60px;
+  background-image: var(--image-board-bg-m1);
+  background-size: 100% 100%;
+}
+.mini-board_M:nth-child(2),
+.mini-board_M:nth-child(3) {
+  background-image: var(--image-board-bg-m2);
+}
+
+.mini-board_N {
+  width: 200px;
+  height: 59px;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding: 0 25px 0 20px;
+  background-image: var(--image-board-bg-nl1);
+  background-size: 100% 100%;
+}
+.mini-board_N:nth-child(2) {
+  background-image: var(--image-board-bg-nr1);
+}
+.mini-board_N:nth-child(3) {
+  margin-top: -15px;
+  background-image: var(--image-board-bg-nl2);
+}
+.mini-board_N:nth-child(4) {
+  margin-top: -15px;
+  background-image: var(--image-board-bg-nr2);
+}
+
+.mini-board_O {
+  width: 130px;
+  height: 50px;
+  background-image: var(--image-board-bg-o);
+  background-size: 100% 100%;
+}
+
 .mini-board__value_New {
   color: @vent-gas-primary-text;
   font-size: 15px;
@@ -439,6 +500,38 @@ defineEmits(['click']);
   text-align: end;
   font-size: 13px;
 }
+.mini-board__label_L {
+  line-height: 21px;
+  height: 21px;
+  text-align: center;
+  font-size: 14px;
+  margin-top: 30px;
+}
+.mini-board__value_L {
+  font-family: 'douyuFont';
+  color: @vent-gas-primary-text;
+  font-size: 14px;
+  height: 30px;
+  line-height: 30px;
+}
+
+.mini-board__label_M {
+  line-height: 21px;
+  height: 21px;
+  text-align: center;
+  font-size: 14px;
+}
+.mini-board__value_M {
+  font-family: 'douyuFont';
+  color: @vent-gas-primary-text;
+  font-size: 12px;
+  height: 23px;
+  margin-top: 5px;
+}
+.mini-board__value_M:nth-child(2),
+.mini-board__value_M:nth-child(3) {
+  color: #218a89;
+}
 
 .mini-board_E:nth-child(1) {
   .mini-board__label_E {

+ 10 - 8
src/views/vent/home/configurable/components/original/moduleBottom.vue

@@ -1,13 +1,15 @@
 <template>
-  <div v-if="visible" class="module-content">
-    <div v-if="title" class="module-content__title__expand">
-      <span class="action-btn close-btn" @click="closeModel"></span>
-      <span @click="clickHandler">{{ title }}</span>
+  <Transition>
+    <div v-if="visible" class="module-content">
+      <div v-if="title" class="module-content__title__expand">
+        <span class="action-btn close-btn" @click="closeModel"></span>
+        <span @click="clickHandler">{{ title }}</span>
+      </div>
+      <div class="module-slot">
+        <slot></slot>
+      </div>
     </div>
-    <div class="module-slot">
-      <slot></slot>
-    </div>
-  </div>
+  </Transition>
 </template>
 <script lang="ts" setup>
   defineProps<{ title: string; visible: boolean }>();

+ 10 - 8
src/views/vent/home/configurable/components/original/moduleLeft.vue

@@ -1,13 +1,15 @@
 <template>
-  <div v-if="visible" class="module-content">
-    <div v-if="title" class="module-content__title__expand">
-      <span class="action-btn close-btn" @click="closeModel"></span>
-      <span @click="clickHandler">{{ title }}</span>
+  <Transition>
+    <div v-if="visible" class="module-content">
+      <div v-if="title" class="module-content__title__expand">
+        <span class="action-btn close-btn" @click="closeModel"></span>
+        <span @click="clickHandler">{{ title }}</span>
+      </div>
+      <div class="module-slot">
+        <slot></slot>
+      </div>
     </div>
-    <div class="module-slot">
-      <slot></slot>
-    </div>
-  </div>
+  </Transition>
 </template>
 <script lang="ts" setup>
   defineProps<{ title: string; visible: boolean }>();

+ 100 - 0
src/views/vent/home/configurable/components/original/moduleRight.vue

@@ -0,0 +1,100 @@
+<template>
+  <Transition>
+    <div v-if="visible" class="module-content">
+      <div v-if="title" class="module-content__title__expand">
+        <span class="action-btn close-btn" @click="closeModel"></span>
+        <span @click="clickHandler">{{ title }}</span>
+      </div>
+      <div class="module-slot">
+        <slot></slot>
+      </div>
+    </div>
+  </Transition>
+</template>
+<script lang="ts" setup>
+  // 和 ./moduleLeft 一样,针对动画做了一些修改
+  defineProps<{ title: string; visible: boolean }>();
+  const emit = defineEmits(['close', 'click']);
+
+  function closeModel() {
+    emit('close');
+  }
+  function clickHandler() {
+    emit('click');
+  }
+</script>
+<style lang="less" scoped>
+  @import '/@/design/theme.less';
+
+  @{theme-deepblue} {
+    .module-content {
+      --image-model_original_title_bg: url('@/assets/images/themify/deepblue/home-container/configurable/model_original_title_bg.png');
+    }
+  }
+
+  .module-content {
+    --image-model_original_title_bg: url('@/assets/images/home-container/configurable/model_original_title_bg.png');
+    --bg-height: 33px;
+    color: #fff;
+    box-sizing: border-box;
+    position: absolute;
+    width: 100%;
+    height: 100%;
+  }
+
+  .module-content__title__expand {
+    width: 100%;
+    height: var(--bg-height);
+    background: var(--image-model_original_title_bg) no-repeat;
+    background-size: 100% 100%;
+    position: relative;
+    text-align: center;
+    line-height: var(--bg-height);
+  }
+
+  // .module-content__title {
+  //   width: 50%;
+  //   height: var(--bg-height);
+  //   background: url('@/assets/images/home-container/configurable/model_left_title_bg.png') no-repeat;
+  //   background-size: 100% 100%;
+  //   position: relative;
+  //   text-align: right;
+  //   padding: 4px 10% 0 0;
+  // }
+
+  // 固定在父容器右上角的按钮图标
+  // .action-btn {
+  //   width: 18px;
+  //   height: 18px;
+  //   background: url('@/assets/images/home-container/configurable/expand.svg') no-repeat center;
+  //   position: absolute;
+  //   right: 0;
+  //   top: 0;
+  // }
+  // .close-btn {
+  //   transform: rotate(-90deg);
+  // }
+
+  .module-slot {
+    height: calc(100% - 33px);
+    width: calc(100% - 20px);
+    backdrop-filter: blur(5px);
+    // #182d47
+    background-color: var(--vent-configurable-original-module-bg);
+    margin-left: 10px;
+  }
+
+  // Transition动画相关
+  .v-enter-active,
+  .v-leave-active {
+    transition: all 0.3s ease;
+  }
+
+  .v-enter-from,
+  .v-leave-to {
+    // opacity: 1;
+    transform: translateX(100%);
+    // transform: scaleY(0);
+    // transform-origin: center top;
+  }
+</style>

+ 669 - 0
src/views/vent/home/configurable/configurable.data.tashan.ts

@@ -0,0 +1,669 @@
+import type { Config } from '../../deviceManager/configurationTable/types';
+
+export const testConfigTSFire: Config[] = [
+
+  // 1. 采空区基本信息(左上)
+  {
+    deviceType: 'goafsInfo',
+    moduleName: '采空区基本信息',
+    pageType: 'ts_fire',
+    moduleData: {
+      header: {
+        show: false,
+        readFrom: '',
+        selector: { show: false, value: '' },
+        slot: { show: false, value: '' },
+      },
+      background: { show: false, type: 'video', link: '' },
+      layout: {
+        direction: 'row',
+        items: [{ name: 'board', basis: '100%' }],
+      },
+      list: [],
+      board: [
+        {
+          type: 'L',
+          readFrom: '',
+          layout: 'label-top',
+          items: [
+            {
+              label: '所属煤层',
+              value: '6煤',
+            },
+            {
+              label: '煤层厚度',
+              value: '2.62m',
+            },
+            {
+              label: '煤层角度',
+              value: '0°~10°',
+            },
+            {
+              label: '最短发火期',
+              value: '33天',
+            },
+            {
+              label: '工作面长度',
+              value: '303.69m',
+            },
+            {
+              label: '采空区管理',
+              value: '全部垮落',
+            },
+          ],
+        },
+      ],
+      chart: [],
+      gallery: [],
+      gallery_list: [],
+      table: [],
+      complex_list: [],
+      preset: [],
+    },
+    showStyle: {
+      size: 'width:440px;height:250px;',
+      version: '原版',
+      position: 'top:70px;left:10px;',
+      headerPosition: 'centerBottom',
+    },
+  },
+  // 2. 矿用自动喷洒系统(左中)
+  {
+    deviceType: 'autoSpraySystem',
+    moduleName: '矿用自动喷洒系统',
+    pageType: 'ts_fire',
+      moduleData: {
+      header: {
+        show: false,
+        readFrom: '',
+        selector: {
+          show: false,
+          value: '',
+        },
+        slot: {
+          show: false,
+          value: '',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: {
+        direction: 'column',
+        items: [
+          {
+             name: 'device_alarm',
+             basis: '40%',
+           },
+          { 
+            name: 'board', 
+            basis: '60%' 
+          }
+        ],
+      },
+      board: [
+        {
+          type: 'M',
+          readFrom: '',
+          layout: 'val-top',
+          items: [
+            {
+              label: '流量传感器#1',
+              value: 'xxxxxx',
+            },
+            {
+              label: '流量传感器#2',
+              value: 'xxxxxx',
+            },
+            {
+              label: '压力传感器',
+              value: 'xxxxxx',
+            },
+            {
+              label: '液位计',
+              value: '液位超限',
+            }
+          ],
+        },],
+      chart: [],
+      gallery: [],
+      gallery_list: [],
+      table: [],
+      list: [],
+      complex_list: [],
+      preset: [
+        {
+          readFrom: 'device',
+        },
+      ],
+      mock: {},
+    },
+    showStyle: {
+      size: 'width:440px;height:290px;',
+      version: '原版',
+      position: 'top:325px;left:10px;',
+    },
+  },
+  // 3. 光纤测温系统(左下)
+  {
+    deviceType: 'pdArray',
+    moduleName: '光纤测温系统',
+    pageType: 'ts_fire',
+    moduleData: {
+      header: {
+        show: true,
+        readFrom: '',
+        selector: {
+          show: true,
+          value: '${systemname}',
+        },
+        slot: {
+          show: false,
+          value: '',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: {
+        direction: 'column',
+        items: [
+          {
+            name: 'chart',
+            basis: '100%',
+          },
+        ],
+      },
+      chart: [
+        {
+          type: 'line_smooth',
+          readFrom: 'arrayFiber',
+          legend: { show: false },
+          xAxis: [{ show: true }],
+          yAxis: [{ show: true, name: '温度(℃)', position: 'left' }],
+          series: [
+            {
+              label: '${strinstallpos}',
+              readFrom: 'fibreTemperatureArr',
+              xprop: 'pos',
+              yprop: 'value',
+            },
+          ],
+        },
+      ],
+      gallery: [],
+      gallery_list: [],
+      table: [],
+      list: [],
+      complex_list: [],
+      preset: [],
+    },
+    showStyle: {
+      size: 'width:440px;height:270px;',
+      version: '原版',
+      position: 'bottom:8px;left:10px;',
+      headerPosition: 'centerBottom',
+    },
+  },
+  // 4. 可采煤层煤自燃特性(右上)
+  {
+    deviceType: 'coalFireFeature',
+    moduleName: '开采煤层自燃发火特性',
+    pageType: 'ts_fire',
+        moduleData: {
+      header: {
+        show: false,
+        readFrom: '',
+        selector: {
+          show: false,
+          value: '',
+        },
+        slot: {
+          show: false,
+          value: '',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: {
+        direction: 'row',
+        items: [
+          {
+            name: 'table',
+            basis: '100%',
+          },
+        ],
+      },
+      board: [],
+      chart: [],
+      gallery: [],
+      gallery_list: [],
+      table: [
+        {
+          type: 'A',
+          readFrom: 'mockTable',
+          columns: [
+            {
+              name: '煤层',
+              prop: 'a',
+            },
+            {
+              name: '自燃倾向性',
+              prop: 'b',
+            },
+            {
+              name: '最短发火期',
+              prop: 'c',
+            },
+            {
+              name: '煤层爆炸指数',
+              prop: 'd',
+            },
+          ],
+        },
+      ],
+      list: [],
+      complex_list: [],
+      preset: [],
+      mock: {
+        mockTable: [
+          {
+            a: '1煤',
+            b: '自燃',
+            c: '123天',
+            d: '0%',
+          },
+          {
+            a: '2煤',
+            b: '自燃',
+            c: '123天',
+            d: '0%',
+          },
+          {
+            a: '3煤',
+            b: '自燃',
+            c: '123天',
+            d: '0%',
+          },
+          {
+            a: '4煤',
+            b: '自燃',
+            c: '123天',
+            d: '0%',
+          },
+          {
+            a: '5煤',
+            b: '自燃',
+            c: '123天',
+            d: '0%',
+          },
+          {
+            a: '6煤',
+            b: '自燃',
+            c: '123天',
+            d: '0%',
+          },
+          {
+            a: '7煤',
+            b: '自燃',
+            c: '123天',
+            d: '0%',
+          },
+        ],
+      },
+    },
+    showStyle: {
+      size: 'width:440px;height:200px;',
+      version: '原版',
+      position: 'top:75px;right:10px;',
+    },
+  },
+  // 5. 注氮系统(右中)
+  {
+    deviceType: 'NitrogenMonitor',
+    moduleName: '注氮系统',
+    pageType: 'ts_fire',
+    moduleData: {
+      header: { show: false, readFrom: '', selector: { show: false, value: '' }, slot: { show: false, value: '' } },
+      background: { show: false, type: 'video', link: '' },
+      layout: {
+        direction: 'column',
+        items: [
+          {
+            name: 'board',
+            basis: '40%',
+          },
+          { 
+            name: 'board', 
+            basis: '30%' 
+          },
+          { 
+            name: 'board', 
+            basis: '30%' 
+          },
+          { 
+            name: 'board', 
+            basis: '30%' 
+          }],
+      },
+      table: [],
+      board: [
+        {
+          type: 'N',
+          readFrom: '',
+          layout: 'label-top',
+          items: [
+            {
+              label: '流量',
+              value: '2663',
+            },
+            {
+              label: '管道温度',
+              value: '40.1',
+            },
+            {
+              label: '氮气压力',
+              value: '0.86',
+            },
+            {
+              label: '氮含量',
+              value: '97.3',
+            }
+          ],
+        },
+        {
+          type: 'O',
+          readFrom: '',
+          layout: 'val-top',
+          items: [
+            {
+              label: '排气压力',
+              value: '0.97',
+            },
+            {
+              label: '排气温度',
+              value: '84.4',
+            },
+            {
+              label: '油压',
+              value: '0.99',
+            }
+          ],
+        },
+        {
+          type: 'O',
+          readFrom: '',
+          layout: 'val-top',
+          items: [
+            {
+              label: '排气压力',
+              value: '0.97',
+            },
+            {
+              label: '排气温度',
+              value: '84.4',
+            },
+            {
+              label: '油压',
+              value: '0.99',
+            }
+          ],
+        },
+        {
+          type: 'O',
+          readFrom: '',
+          layout: 'val-top',
+          items: [
+            {
+              label: '排气压力',
+              value: '0.97',
+            },
+            {
+              label: '排气温度',
+              value: '84.4',
+            },
+            {
+              label: '油压',
+              value: '0.99',
+            }
+          ],
+        }
+      ],
+      chart: [],
+      gallery: [],
+      gallery_list: [],
+      list: [],
+      complex_list: [],
+      preset: [],
+      mock: {},
+    },
+    showStyle: {
+      size: 'width:440px;height:290px;',
+      version: '原版',
+      position: 'top:280px;right:10px;',
+    },
+  },
+  // 6. 采空区密闭监测系统(右下)
+  {
+    deviceType: 'pdArray',
+    moduleName: '采空区密闭监测系统',
+    pageType: 'ts_fire',
+    moduleData: {
+      header: {
+        show: true,
+        readFrom: '',
+        selector: {
+          show: true,
+          value: '${systemname}',
+        },
+        slot: {
+          show: false,
+          value: '',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: {
+        direction: 'column',
+        items: [
+          {
+            name: 'chart',
+            basis: '100%',
+          },
+        ],
+      },
+      chart: [
+        {
+          type: 'line_smooth',
+          readFrom: 'arrayFiber',
+          legend: { show: false },
+          xAxis: [{ show: true }],
+          yAxis: [{ show: true, name: '温度(℃)', position: 'left' }],
+          series: [
+            {
+              label: '${strinstallpos}',
+              readFrom: 'fibreTemperatureArr',
+              xprop: 'pos',
+              yprop: 'value',
+            },
+          ],
+        },
+      ],
+      gallery: [],
+      gallery_list: [],
+      table: [],
+      list: [],
+      complex_list: [],
+      preset: [],
+    },
+    showStyle: {
+      size: 'width:440px;height:280px;',
+      version: '原版',
+      position: 'bottom:8px;right:10px;',
+    },
+  },
+  // 7. 工作面束管监测(中下1)
+  {
+    deviceType: 'RealtimeMonitor',
+    moduleName: '实时监视',
+    pageType: 'ts_fire',
+    moduleData: {
+      header: {
+        show: false,
+        readFrom: '',
+        selector: {
+          show: false,
+          value: '',
+        },
+        slot: {
+          show: false,
+          value: '',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: {
+        direction: 'row',
+        items: [
+          {
+            name: 'table',
+            basis: '100%',
+          },
+
+        ],
+      },
+      board: [],
+      chart: [],
+      gallery: [],
+      gallery_list: [],
+      table: [
+        {
+          type: 'A',
+          readFrom: 'mockTable',
+          columns: [
+            { name: '序号', prop: 'serialVal' },
+            { name: '监测点', prop: 'MonitorPoint' },
+            { name: '报警等级', prop: 'warnLevel' },
+            { name: '类型', prop: 'warnType' },
+            { name: '值', prop: 'nowVal' },
+          ],
+        },],
+      list: [],
+      complex_list: [],
+      preset: [],
+      mock: {
+        mockTable: [
+          {
+            serialVal: '1',
+            MonitorPoint: '130608工作面采空区30mC2H6',
+            warnLevel: '低风险',
+            warnType: '乙烷',
+            nowVal: '0ppm',
+          },
+          {
+            serialVal: '2',
+            MonitorPoint: '130608工作面采空区30mC2H6',
+            warnLevel: '低风险',
+            warnType: '乙烷',
+            nowVal: '0ppm',
+          },
+          {
+            serialVal: '3',
+            MonitorPoint: '130608工作面采空区30mC2H6',
+            warnLevel: '低风险',
+            warnType: '乙烷',
+            nowVal: '0ppm',
+          },
+          {
+            serialVal: '4',
+            MonitorPoint: '130608工作面采空区30mC2H6',
+            warnLevel: '低风险',
+            warnType: '乙烷',
+            nowVal: '0ppm',
+          }
+        ],
+      },
+    },
+    showStyle: {
+      size: 'width:980px;height:270px;',
+      version: '原版',
+      position: 'bottom:8px;left:470px',
+    },
+  },
+  // 8. 异常待处理(中下2)
+  {
+    deviceType: 'sgGxObj',
+    moduleName: '异常待处理',
+    pageType: 'ts_fire',
+    moduleData: {
+      header: {
+        show: true,
+        readFrom: 'devGxcw',
+        selector: {
+          show: true,
+          value: '${strinstallpos}',
+        },
+        slot: {
+          show: false,
+          value: '',
+        },
+      },
+      background: {
+        show: false,
+        type: 'video',
+        link: '',
+      },
+      layout: {
+        direction: 'row',
+        items: [
+          {
+            name: 'chart',
+            basis: '100%',
+          },
+        ],
+      },
+      board: [],
+      chart: [
+        {
+          type: 'line_smooth',
+          readFrom: '',
+          legend: { show: true },
+          xAxis: [{ show: true }],
+          yAxis: [{ show: true, name: '温度(℃)', position: 'left' }],
+          series: [
+            {
+              label: '${strinstallpos}',
+              readFrom: 'fibreTemperatureArr',
+              xprop: 'pos',
+              yprop: 'value',
+            },
+          ],
+        },
+      ],
+      gallery: [],
+      gallery_list: [],
+      table: [],
+      list: [],
+      complex_list: [],
+      preset: [],
+    },
+    showStyle: {
+      size: 'width:980px;height:315px;',
+      version: '原版',
+      position: 'bottom:8px;left:470px',
+    },
+  }
+];

+ 0 - 1
src/views/vent/home/configurable/fireMine.vue

@@ -159,7 +159,6 @@ function redirectTo(url) {
     justify-content: center;
     z-index: 2;
     background: url('@/assets/images/home-container/configurable/minehome/center-info-bg.png') no-repeat center;
-    box-shadow: 0 2px 12px #000a;
     padding: 0 20px;
     gap: 15px;
 

+ 292 - 0
src/views/vent/home/configurable/fireTS.vue

@@ -0,0 +1,292 @@
+<!-- eslint-disable vue/multi-word-component-names -->
+<template>
+  <div class="company-home">
+    <!-- 顶部标题样式块 -->
+    <div class="top-bg">
+      <div class="main-title">{{ mainTitle }}</div>
+    </div>
+    <!-- 中间样式块 -->
+    <div class="center-info-bar">
+      <div class="left-info-content">
+        <div class="left-block block1">
+          <div class="info-value">无</div>
+          <div class="info-label">突变预警</div>
+        </div>
+        <div class="left-block block2">
+          <div class="info-value">无自燃隐患</div>
+          <div class="info-label">煤自燃氧化阶段</div>
+        </div>
+        <div class="left-block block3">
+          <div class="info-value">-</div>
+          <div class="info-label">最高温度</div>
+        </div>
+      </div>
+      <div class="center-info-content">
+        <div class="info-value">正常</div>
+        <div class="info-label">火灾安全等级</div>
+      </div>
+      <div class="right-info-content">
+        <div class="right-block block1">
+          <div class="info-value">0</div>
+          <div class="info-label">指标预警</div>
+        </div>
+        <div class="right-block block2">
+          <div class="info-value">无</div>
+          <div class="info-label">预警等级</div>
+        </div>
+        <div class="right-block block3">
+          <div class="info-value">无</div>
+          <div class="info-label">升温预警</div>
+        </div>
+      </div>
+    </div>
+    <!-- 渲染所有模块 -->
+    <ModuleCommon 
+      v-for="cfg in cfgs" 
+      :key="cfg.deviceType + cfg.moduleName"
+      :show-style="cfg.showStyle" 
+      :module-data="cfg.moduleData"
+      :module-name="cfg.moduleName" 
+      :device-type="cfg.deviceType" 
+      :data="data" 
+      :visible="true" />
+    <ModuleCommonDual
+      v-if="cfgA && cfgB"
+      :show-style="cfgA.showStyle"
+      :module-data-a="cfgA.moduleData"
+      :module-name-a="cfgA.moduleName"
+      :device-type-a="cfgA.deviceType"
+      :module-data-b="cfgB.moduleData"
+      :module-name-b="cfgB.moduleName"
+      :device-type-b="cfgB.deviceType"
+      :data="data"
+      :visible="true"
+      :common-title="commonTitle"
+    />
+  </div>
+</template>
+<script lang="ts" setup>
+import { computed, onMounted, onUnmounted } from 'vue';
+import { useInitConfigs, useInitPage } from './hooks/useInit';
+import ModuleBDDual from './components/ModuleBDDual.vue';
+import { getDisHome } from './configurable.api';
+import { testConfigTSFire } from './configurable.data.tashan';
+import ModuleCommon from './components/ModuleCommon.vue';
+import ModuleCommonDual from './components/ModuleCommonDual.vue';
+
+const cfgs = computed(() =>
+  configs.value.filter((_, index) => index !== 6 && index !== 7)
+);
+const cfgA = computed<any>(() =>
+  configs.value[6]
+);
+const cfgB = computed<any>(() =>
+  configs.value[7]
+);
+const { configs, devicesTypes, fetchConfigs } = useInitConfigs();
+const { mainTitle, data, updateData } = useInitPage('回采工作面智能管控');
+let interval: ReturnType<typeof setInterval> | undefined;
+const commonTitle = "实时监测与预警"
+onMounted(() => {
+  fetchConfigs('ts_fire').then(() => {
+    configs.value = testConfigTSFire;
+    getDisHome({
+      dataList: devicesTypes.value.concat('fireAllMineWarn').join(','),
+    }).then(updateData);
+  });
+  interval = setInterval(() => {
+    getDisHome({
+      dataList: devicesTypes.value.concat('fireAllMineWarn').join(','),
+    }).then(updateData);
+  }, 2000);
+});
+
+onUnmounted(() => {
+  clearInterval(interval);
+});
+function redirectTo(url) {
+  window.open(url);
+}
+</script>
+<style lang="less" scoped>
+@import '/@/design/theme.less';
+
+@font-face {
+  font-family: 'douyuFont';
+  src: url('../../../../assets/font/douyuFont.otf');
+}
+
+.company-home {
+  --image-fire-title: url(/@/assets/images/vent/vent-header1.png);
+  --image-common-border1: url('/@/assets/images/home-container/configurable/minehome/common-border1.png');
+  --image-common-border3: url('/@/assets/images/home-container/configurable/minehome/common-border3.png');
+  width: 100%;
+  height: 100%;
+  color: @white;
+  position: relative;
+  background: #09172c;
+
+  .top-bg {
+    width: 100%;
+    height: 73px;
+    background: var(--image-fire-title) no-repeat top;
+    position: absolute;
+    z-index: 1;
+    .main-title {
+      height: 80px;
+      font-family: 'douyuFont';
+      font-size: 26px;
+      letter-spacing: 2px;
+      display: flex;
+      justify-content: center;
+      align-items: center;
+      padding: 0 0 10px 0;
+    }
+  }
+  // 顶部中间样式块
+  .center-info-bar {
+    position: relative;
+    top: 75px;
+    left: 50%;
+    transform: translateX(-50%);
+    width: 900px;
+    height: 160px;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    background: url('@/assets/images/home-container/configurable/tashanhome/center-bar-bg.png') no-repeat center;
+
+    .center-info-content {
+      position: relative;
+      top: 15px;
+      background: url('@/assets/images/home-container/configurable/tashanhome/center-bar-circle.png') no-repeat center;
+      width: 160px;
+      height: 160px;
+      text-align: center;
+      .info-value {
+        position: absolute;
+        top: 34%;
+        left: 50%;
+        transform: translateX(-50%);
+        font-family: 'douyuFont';
+        font-size: 25px;
+        color: #2cffdd;
+      }
+      .info-label {
+        width: 100%;
+        position: absolute;
+        bottom: 25px;
+        font-size: 17px;
+        left: 50%;
+        transform: translateX(-50%);
+      }
+    }
+    .left-info-content {
+      position: relative;
+      text-align: right;
+      .left-block {
+        position: absolute;
+        width: 190px;
+        height: 55px;
+        background: url('@/assets/images/home-container/configurable/tashanhome/leftbar-bg1.png') no-repeat right;
+        padding-right: 52px;
+        .info-value {
+          height: 28px;
+          line-height: 28px;
+          font-family: 'douyuFont';
+          font-size: 12px;
+          color: var(--vent-gas-primary-text);
+        }
+        .info-label {
+          height: 28px;
+          line-height: 28px;
+        }
+      }
+      .block1 {
+        top: -70px;
+        right: -5px;
+      }
+      .block2 {
+        top: -15px;
+        left: -280px;
+        background: url('@/assets/images/home-container/configurable/tashanhome/leftbar-bg2.png') no-repeat right;
+        .info-value {
+          color: #2cffdd;
+        }
+      }
+      .block3 {
+        top: 40px;
+        right: -5px;
+      }
+    }
+    .right-info-content {
+      position: relative;
+      .right-block {
+        position: absolute;
+        width: 190px;
+        height: 55px;
+        background: url('@/assets/images/home-container/configurable/tashanhome/rightbar-bg1.png') no-repeat left;
+        padding-left: 52px;
+        .info-value {
+          height: 28px;
+          line-height: 28px;
+          font-family: 'douyuFont';
+          font-size: 12px;
+          color: var(--vent-gas-primary-text);
+        }
+        .info-label {
+          height: 28px;
+          line-height: 28px;
+        }
+      }
+      .block1 {
+        top: -70px;
+        left: -5px;
+      }
+      .block2 {
+        top: -15px;
+        right: -280px;
+        background: url('@/assets/images/home-container/configurable/tashanhome/rightbar-bg2.png') no-repeat left;
+        .info-value {
+          color: #2cffdd;
+        }
+      }
+      .block3 {
+        top: 40px;
+        left: -5px;
+      }
+    }
+  }
+
+  ::v-deep .dane-bd {
+    background-repeat: no-repeat;
+    background-position: center;
+    background-size: 100% 100%;
+    &.dane-w {
+      background-image: var(--image-common-border3);
+    }
+    .dane-title {
+      justify-content: space-around;
+      padding: 0 50px 0 0;
+
+      .common-navL {
+        font-size: 14px;
+        font-weight: bold;
+        font-family: 'douyuFont';
+      }
+    }
+    .dane-content {
+      border: none;
+      background: none;
+      padding: 10px 35px;
+    }
+
+  }
+  ::v-deep .table__content .table__content_list {
+    width: 95%;  
+  }
+  ::v-deep .table__content .table__content_label {
+    width: 95%;
+  }
+}
+</style>

+ 34 - 4
src/views/vent/home/configurable/ventSDG.vue

@@ -1,8 +1,25 @@
 <!-- eslint-disable vue/multi-word-component-names -->
 <template>
   <div class="company-home">
-    <div style="width: 100%; height: 100%; position: absolute; left: 0; top: 0; z-index: 0">
+    <CustomHeader> 三道沟煤矿均压综采面智能监测与动态调控 </CustomHeader>
+    <!-- <div style="width: 100%; height: 100%; position: absolute; left: 0; top: 0; z-index: 0">
       <VentModal />
+    </div> -->
+    <div class="bg" style="width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; overflow: hidden; z-index: 0">
+      <a-spin :spinning="loading" />
+      <div id="balancePress3D" v-show="!loading" 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">
+          <p><span class="data-title">压力(Pa):</span>{{selectData.frontRearDP}}</p>
+          <p><span class="data-title">动力源压力(MPa):</span>{{selectData.sourcePressure}}</p>
+          <p><span class="data-title">故障诊断:</span>
+            <i
+              :class="{'state-icon': true, 'open': selectData.messageBoxStatus, 'close': !selectData.messageBoxStatus}"
+            ></i>{{selectData.fault}}</p>
+        </div>
+      </div>
+    </div> -->
     </div>
     <!-- 如果是有 deviceType、type 等 query,认为是详情页,不需要展示普通模块,只需要模型 -->
     <template v-if="!route.query.deviceType">
@@ -29,8 +46,11 @@
           :module-name="cfg.moduleName"
           :device-type="cfg.deviceType"
           :data="data"
-          :visible="true"
+          :visible="showModules"
         />
+
+        <div v-if="showModules" class="switch-button icon-goto right-475px bottom-300px" @click="showModules = false"></div>
+        <div v-else class="switch-button icon-goto right-20px bottom-20px" @click="showModules = true"></div>
       </template>
       <template v-else-if="isCommon">
         <ModuleCommon
@@ -71,11 +91,11 @@
         class="switch-button report-mode right-525px"
         @click="switchDataMode"
       ></div> -->
-      <div class="switch-button icon-goto right-475px" @click="goMicroApp()"></div>
     </template>
   </div>
 </template>
 <script lang="ts" setup>
+  import CustomHeader from '/@/components/vent/customHeader.vue';
   import { onMounted, onUnmounted, ref, watch } from 'vue';
   // import { CaretDownOutlined } from '@ant-design/icons-vue';
   // import MonitorBar from './components/MonitorBar.vue';
@@ -85,6 +105,7 @@
   import ModuleCommon from './components/ModuleCommon.vue';
   // import { useRoute } from 'vue-router';
   import VentModal from '/@/components/vent/micro/ventModal.vue';
+  import { mountedThree, destroy, setModelType, updateText, play } from '/@/views/vent/monitorManager/balancePressMonitor/balancePress.threejs';
   import { list } from './configurable.api';
   import { useRoute, useRouter } from 'vue-router';
   import { useGlobSetting } from '/@/hooks/setting';
@@ -97,6 +118,8 @@
   const router = useRouter();
   const isDataRealTime = ref(sysDataType === 'monitor');
   // const showBar = ref(true);
+  const loading = ref(false);
+  const showModules = ref(true);
   let interval: number | undefined;
 
   // function switchDataMode() {
@@ -184,9 +207,16 @@
   onMounted(() => {
     refresh();
     initInterval();
+
+    mountedThree().then(async () => {
+      await setModelType('balancePressTun'); //balancePressBase
+      loading.value = false;
+      play('startSmoke', 'top', 30, 'open', 0);
+    });
   });
 
   onUnmounted(() => {
+    destroy();
     clearInterval(interval);
   });
 </script>
@@ -280,7 +310,7 @@
       height: 34px;
       position: absolute;
       // right: 5px;
-      bottom: 300px;
+      // bottom: 300px;
       z-index: 5;
       background-repeat: no-repeat;
       background-size: 100% 100%;

+ 2 - 0
src/views/vent/monitorManager/balancePressMonitor/balancePress.api.ts

@@ -11,6 +11,7 @@ enum Api {
   updatePassword = '/monitor/demo/avePress/update/password',
   validPassword = '/monitor/demo/avePress/valid/password',
   controlWindow = '/monitor/demo/avePress/controlWindow',
+  cancelcontrolWindow = '/monitor/demo/avePress/cancel-controlWindow',
 }
 /**
  * 列表接口
@@ -50,6 +51,7 @@ export const subList2 = (params) => defHttp.get({ url: Api.subList2, params });
 export const submitEdit = (params) => defHttp.post({ url: Api.submitEdit, params });
 
 export const controlWindow = (params) => defHttp.get({ url: Api.controlWindow, params }, { joinParamsToUrl: true });
+export const cancelcontrolWindow = (params) => defHttp.get({ url: Api.cancelcontrolWindow, params }, { joinParamsToUrl: true });
 
 export const updatePassword = (params) =>
   defHttp.get({ url: Api.updatePassword, params }).then((e) => {

+ 2 - 2
src/views/vent/monitorManager/balancePressMonitor/balancePress.data.ts

@@ -206,12 +206,12 @@ export const settingParam4 = [
     title: '氧气上限',
     code: 'o2MaxVal',
     value: '',
-    unit: 'm³/min',
+    unit: '%',
   },
   {
     title: '氧气下限',
     code: 'o2MinVal',
     value: '',
-    unit: 'm³/min',
+    unit: '%',
   },
 ];

+ 210 - 155
src/views/vent/monitorManager/balancePressMonitor/components/balancePressHomeBD.vue

@@ -2,102 +2,96 @@
   <a-spin tip="Loading..." :spinning="loading">
     <div class="monitor-container">
       <div class="lr left-box">
-        <ventBox1>
-          <template #title>
-            <div>均压与低氧参数监测与设置</div>
-          </template>
-          <template #container>
-            <div class="vent-flex-row-between auto-control mt-10px mb-10px">
-              <div class="title">自动调节:</div>
-              <a-radio-group :value="avePressSetting.isAutoControl" name="radioGroup" @change="changeIsAutoControl">
-                <a-radio value="1">关闭</a-radio>
-                <a-radio value="2">开启</a-radio>
-              </a-radio-group>
-            </div>
-            <div class="vent-flex-row-between auto-control mt-10px mb-10px">
-              <div class="title">调节类型:</div>
-              <a-radio-group :value="avePressSetting.controlType" name="radioGroup" @change="changeIsAutoControl">
-                <a-radio value="o2">氧气</a-radio>
-                <a-radio value="pressure">压差</a-radio>
-              </a-radio-group>
-            </div>
-            <div class="input-box">
-              <!-- <div class="divider-line">开始条件</div>
+        <Transition enter-active-class="animate__animated  animate__fadeInLeft" leave-active-class="animate__animated  animate__fadeOutLeft">
+          <ventBox1 v-if="showModules">
+            <template #title>
+              <div>均压与低氧参数监测与设置</div>
+            </template>
+            <template #container>
+              <div class="vent-flex-row-between auto-control mt-10px mb-10px">
+                <div class="title">自动调节:</div>
+                <a-radio-group :value="avePressSetting.isAuto" name="radioGroup" @change="changeAvePressState($event, 'isAuto')">
+                  <a-radio :value="false">关闭</a-radio>
+                  <a-radio :value="true">开启</a-radio>
+                </a-radio-group>
+              </div>
+              <div class="vent-flex-row-between auto-control mt-10px mb-10px">
+                <div class="title">调节类型:</div>
+                <a-radio-group :value="avePressSetting.controlType" name="radioGroup" @change="changeAvePressState($event, 'controlType')">
+                  <a-radio value="o2">氧气</a-radio>
+                  <a-radio value="pressure">压差</a-radio>
+                </a-radio-group>
+              </div>
+              <div>
+                <!-- <div class="divider-line">开始条件</div>
               <div v-for="(item, index) in settingParam1" class="input-item" :key="index">
                 <div class="title">{{ item.title }}:</div>
                 <a-input-number class="input-value" v-model:value="formData[item.code]" placeholder="" />
                 <div class="unit">{{ item.unit }}</div>
               </div> -->
-              <div class="divider-line">调节参数</div>
-              <div v-for="(item, index) in settingParam4" class="input-item" :key="index">
-                <div class="title">{{ item.title }}:</div>
-                <a-input-number class="input-value" v-model:value="avePressSetting[item.code]" placeholder="" :disabled="settingFormDisabled" />
-                <div class="unit">{{ item.unit }}</div>
-              </div>
-              <!-- <div class="divider-line">结束时间</div>
+                <div class="divider-line"></div>
+                <div v-for="(item, index) in settingParam4" class="input-item" :key="index">
+                  <div class="title">{{ item.title }}:</div>
+                  <a-input-number class="input-value" v-model:value="avePressSetting[item.code]" placeholder="" :disabled="settingFormDisabled" />
+                  <div class="unit">&nbsp;{{ item.unit }}</div>
+                </div>
+                <!-- <div class="divider-line">结束时间</div>
               <div v-for="(item, index) in settingParam3" class="input-item" :key="index">
                 <div class="title">{{ item.title }}:</div>
                 <a-input-number class="input-value" v-model:value="formData[item.code]" placeholder="" />
                 <div class="unit">{{ item.unit }}</div>
               </div> -->
-            </div>
-            <div class="btn-box flex" style="text-align: center">
-              <div class="btn btn1 flex-1" @click="editSettingForm">{{ settingFormDisabled ? '编辑' : '取消' }}</div>
-              <div class="btn btn1 flex-1" @click="submitSettingForm">提交</div>
-            </div>
-          </template>
-        </ventBox1>
-      </div>
-      <div style="pointer-events: auto" class="flex mt-10px h-100% w-770px">
-        <ventBox1 class="mr-10px">
-          <template #title>
-            <div>均压工作面风门与风门联动</div>
-          </template>
-          <template #container>
-            <div class="vent-flex-row-between auto-control mt-10px mb-10px">
-              <div class="title">自动调节:</div>
-              <a-radio-group :value="gateLinkage.isAuto" name="radioGroup" @change="changeIsAuto($event, gateLinkage.id)">
-                <a-radio :value="false">关闭</a-radio>
-                <a-radio :value="true">开启</a-radio>
-              </a-radio-group>
-            </div>
-            <div class="btn-box" style="text-align: center">
-              <div class="btn btn1" @click="() => openModal(false, { id: gateLinkage.id })">控制密码修改</div>
-            </div>
-          </template>
-        </ventBox1>
-        <ventBox1>
-          <template #title>
-            <div>均压工作面风机与风门联动</div>
-          </template>
-          <template #container>
-            <div class="vent-flex-row-between auto-control mt-10px mb-10px">
-              <div class="title">自动调节:</div>
-              <a-radio-group :value="avePressLinkage.isAuto" name="radioGroup" @change="changeIsAuto($event, avePressLinkage.id)">
-                <a-radio :value="false">关闭</a-radio>
-                <a-radio :value="true">开启</a-radio>
-              </a-radio-group>
-            </div>
-            <div class="btn-box" style="text-align: center">
-              <div class="btn btn1" @click="() => openModal(false, { id: avePressLinkage.id })">控制密码修改</div>
-            </div>
-          </template>
-        </ventBox1>
+              </div>
+              <div class="btn-box flex" style="text-align: center">
+                <div class="btn btn1 flex-1" @click="editSettingForm">{{ settingFormDisabled ? '编辑' : '取消' }}</div>
+                <div class="btn btn1 flex-1" @click="submitSettingForm">提交</div>
+              </div>
+            </template>
+          </ventBox1>
+        </Transition>
+        <Transition enter-active-class="animate__animated  animate__fadeInLeft" leave-active-class="animate__animated  animate__fadeOutLeft">
+          <ventBox1 v-if="showModules" class="mt-10px">
+            <template #title>
+              <div>均压工作面联动控制</div>
+            </template>
+            <template #container>
+              <div class="vent-flex-row-between auto-control mt-10px mb-10px">
+                <div class="title">风门与风门自动调节:</div>
+                <a-radio-group :value="gateLinkage.isAuto" name="radioGroup" @change="changeIsAuto($event, gateLinkage.id)">
+                  <a-radio :value="false">关闭</a-radio>
+                  <a-radio :value="true">开启</a-radio>
+                </a-radio-group>
+                <div class="btn btn1" @click="() => openModal(false, { id: gateLinkage.id })">密码修改</div>
+              </div>
+              <div class="vent-flex-row-between auto-control mt-10px mb-10px">
+                <div class="title">风机与风门自动调节:</div>
+                <a-radio-group :value="avePressLinkage.isAuto" name="radioGroup" @change="changeIsAuto($event, avePressLinkage.id)">
+                  <a-radio :value="false">关闭</a-radio>
+                  <a-radio :value="true">开启</a-radio>
+                </a-radio-group>
+                <div class="btn btn1" @click="() => openModal(false, { id: avePressLinkage.id })">密码修改</div>
+              </div>
+              <!-- <div class="btn-box" style="text-align: center">
+            </div> -->
+            </template>
+          </ventBox1>
+        </Transition>
       </div>
+
       <ModuleCommon
-        v-for="cfg in configs"
-        :key="cfg.deviceType"
+        v-for="(cfg, index) in configs"
+        :key="`svvmbcb${index}`"
         :show-style="cfg.showStyle"
         :module-data="cfg.moduleData"
         :module-name="cfg.moduleName"
         :device-type="cfg.deviceType"
         :data="selectData"
-        :visible="true"
+        :visible="showModules"
       />
     </div>
     <PasswordModal :modal-is-show="modalVisible" modal-title="提交" @handle-ok="handleResolve" @handle-cancel="handleReject" />
     <UpdatePassword @register="updatePwdRegister" @submit="handleChangePassword" />
-    <BasicModal title="风门状态监测" :mask="false" :bodyStyle="{ height: '50px' }" style="top: 20px" :show-ok-btn="false" @register="warnRegister2">
+    <!-- <BasicModal title="风门状态监测" :mask="false" :bodyStyle="{ height: '50px' }" style="top: 20px" :show-ok-btn="false" @register="warnRegister2">
       {{ warnModalText2 }}
     </BasicModal>
     <BasicModal
@@ -113,22 +107,25 @@
     </BasicModal>
     <BasicModal title="局扇状态监测" :mask="false" :bodyStyle="{ height: '50px' }" style="top: 420px" :show-ok-btn="false" @register="warnRegister3">
       {{ warnModalText3 }}
-    </BasicModal>
+    </BasicModal> -->
+
+    <div class="switch-button icon-goto right-10px top-70px" :class="{ 'right-390px': showModules }" @click="showModules = !showModules"></div>
+    <!-- <div v-else class="switch-button icon-goto right-10px top-70px" @click="showModules = true"></div> -->
   </a-spin>
 </template>
 <script setup lang="ts">
-  import { ref, onMounted, onUnmounted, defineProps } from 'vue';
+  import { ref, onMounted, onUnmounted, defineProps, h } from 'vue';
   import { mountedThree, destroy, setModelType, updateText, play } from '../balancePress.threejs';
   import { list } from '../balancePress.api';
   import ModuleCommon from '../../../home/configurable/components/ModuleCommon.vue';
   import { useInitConfigs } from '../../../home/configurable/hooks/useInit';
   import { useGlobSetting } from '/@/hooks/setting';
   import { settingParam4 } from '../balancePress.data';
-  import { notification } from 'ant-design-vue';
+  import { Modal } from 'ant-design-vue';
   import ventBox1 from '/@/components/vent/ventBox1.vue';
   import PasswordModal from '../../comment/components/PasswordModal.vue';
   import UpdatePassword from '../../comment/components/UpdatePassword.vue';
-  import { BasicModal, useModal } from '/@/components/Modal';
+  import { useModal } from '/@/components/Modal';
   import { connectWebSocket, onWebSocket } from '/@/hooks/web/useWebSocket';
   import { getToken } from '/@/utils/auth';
   import { useUserStore } from '/@/store/modules/user';
@@ -145,6 +142,7 @@
   const { sysOrgCode } = useGlobSetting();
 
   const loading = ref(false);
+  const showModules = ref(true);
 
   // 监测数据
   const selectData = ref();
@@ -216,17 +214,24 @@
     return result;
   }
 
-  const { avePressSetting, avePressLinkage, gateLinkage, formData, getAvePress, changePassword, linkageControl, settingControl, autoControl } =
-    usePressControl();
+  const {
+    avePressSetting,
+    avePressLinkage,
+    gateLinkage,
+    formData,
+    getAvePress,
+    changePassword,
+    linkageControl,
+    settingControl,
+    autoControl,
+    cancelControl,
+  } = usePressControl();
 
   const modalVisible = ref(false);
 
   const { configs, fetchConfigs } = useInitConfigs();
 
   const [updatePwdRegister, { openModal, closeModal, setModalProps }] = useModal();
-  const [warnRegister1, warnModal1] = useModal();
-  const [warnRegister2, warnModal2] = useModal();
-  const [warnRegister3, warnModal3] = useModal();
 
   function handleChangePassword(values) {
     setModalProps({ confirmLoading: true });
@@ -250,14 +255,14 @@
       });
     };
   }
-  function changeIsAutoControl({ target }) {
-    formData.value.isAutoControl = target.value;
+  function changeAvePressState({ target }, key) {
+    formData.value.temp = target.value;
     modalVisible.value = true;
     resolver = (password) => {
       settingControl(
         { password, id: avePressSetting.value.id },
         {
-          isAutoControl: formData.value.isAutoControl,
+          [key]: formData.value.temp,
         }
       ).finally(() => {
         modalVisible.value = false;
@@ -286,9 +291,15 @@
     resolver = null;
   }
 
-  const warnModalText1 = ref('');
-  const warnModalText2 = ref('');
-  const warnModalText3 = ref('');
+  // const [warnRegister1, warnModal1] = useModal();
+  // const [warnRegister2, warnModal2] = useModal();
+  // const [warnRegister3, warnModal3] = useModal();
+  const warnModal1 = ref();
+  const warnModal2 = ref();
+  const warnModal3 = ref();
+  // const warnModalText1 = ref('');
+  // const warnModalText2 = ref('');
+  // const warnModalText3 = ref('');
 
   // 初始化 WebSocket
   function initWebSocket() {
@@ -299,73 +310,88 @@
     const url = `${glob.wsUrl?.replace('https://', 'wss://').replace('http://', 'ws://')}/websocket/${userStore.getUserInfo.id}?token=${token}`;
     connectWebSocket(url);
     onWebSocket((data: any) => {
-      if (data.cmd === 'topic') {
-        if (data.msgTxt) {
-          const { info = '' } = JSON.parse(data.msgTxt);
-          if (info.includes('局扇')) {
-            warnModalText3.value = info;
-            warnModal3.openModal();
-          }
-          if (info.includes('风门')) {
-            warnModalText2.value = info;
-            warnModal2.openModal();
-          }
-          if (info.includes('压差')) {
-            warnModalText1.value = info;
-            warnModal1.openModal();
-          }
-        }
+      if (data.cmd !== 'topic' || data.topic !== 'warn') return;
+      if (!data.msgTxt) return;
+
+      const { info = '', type = '', avgPressLogId, date } = JSON.parse(data.msgTxt);
+      switch (type) {
+        case 'o2':
+          if (warnModal1.value) break;
+          warnModal1.value = Modal.confirm({
+            title: data.msgTitle,
+            content: h('div', { style: { color: '#fff' } }, [h('p', date), h('p', info)]),
+            centered: true,
+            okText: '下发调节指令',
+            mask: true,
+            class: 'balancePress',
+            async onOk() {
+              await autoControl(avgPressLogId);
+              warnModal1.value = null;
+            },
+            async onCancel() {
+              await cancelControl(avgPressLogId);
+              warnModal1.value = null;
+            },
+          });
+          // warnModalText1.value = info;
+          // warnModal1.openModal();
+
+          break;
+        case 'pressure':
+          // warnModalText1.value = info;
+          // warnModal1.openModal();
+          if (warnModal1.value) break;
+          warnModal1.value = Modal.confirm({
+            title: data.msgTitle,
+            content: h('div', { style: { color: '#fff' } }, [h('p', date), h('p', info)]),
+            centered: true,
+            okText: '下发调节指令',
+            mask: true,
+            class: 'balancePress',
+            async onOk() {
+              await autoControl(avgPressLogId);
+              warnModal1.value = null;
+            },
+            async onCancel() {
+              await cancelControl(avgPressLogId);
+              warnModal1.value = null;
+            },
+          });
+
+          break;
+        case 'gate':
+          if (warnModal2.value) break;
+          warnModal2.value = Modal.warn({
+            title: data.msgTitle,
+            content: info,
+            showOkBtn: false,
+            mask: true,
+            class: 'balancePress',
+            onOk: () => {
+              warnModal2.value = null;
+            },
+          });
+          break;
+        case 'fansys':
+          if (warnModal3.value) break;
+          warnModal3.value = Modal.warn({
+            title: data.msgTitle,
+            content: info,
+            showOkBtn: false,
+            mask: true,
+            class: 'balancePress',
+            style: 'top: 700px',
+            onOk: () => {
+              warnModal3.value = null;
+            },
+          });
+
+          break;
+
+        default:
+          break;
       }
     });
-
-    // setInterval(() => {
-    //   const data = [
-    //     {
-    //       cmd: 'topic',
-    //       msgTxt: `{"info":"局扇-我是局扇啊!"}`,
-    //     },
-    //     {
-    //       cmd: 'topic',
-    //       msgTxt: `{"info":"压差-我是压差啊!"}`,
-    //     },
-    //     {
-    //       cmd: 'topic',
-    //       msgTxt: `{"info":"风门-我是风门啊!"}`,
-    //     },
-    //   ][(Math.random() * 3) | 0];
-    //   if (data.cmd === 'topic') {
-    //     if (data.msgTxt) {
-    //       const { info = '' } = JSON.parse(data.msgTxt);
-    //       if (info.includes('局扇')) {
-    //         warnModalText3.value = info;
-    //         warnModal3.openModal();
-    //         // notification.warn({
-    //         //   description: info,
-    //         //   message: '警报!',
-    //         //   duration: 0,
-    //         // });
-    //       }
-    //       if (info.includes('风门')) {
-    //         warnModalText2.value = info;
-    //         warnModal2.openModal();
-    //         // notification.warn({
-    //         //   description: info,
-    //         //   message: '警报!',
-    //         //   duration: 0,
-    //         // });
-    //       }
-    //       if (info.includes('压差')) {
-    //         warnModalText1.value = info;
-    //         warnModal1.openModal();
-    //         // notification.warn({
-    //         //   description: info,
-    //         //   message: '警报!',
-    //         //   duration: 0,
-    //         // });
-    //       }
-    //     }
-    //   }
-    // }, 5000);
   }
 
   const settingFormDisabled = ref(true);
@@ -409,4 +435,33 @@
   .monitor-container {
     margin-top: 60px;
   }
+
+  .switch-button {
+    width: 34px;
+    height: 34px;
+    position: fixed;
+    // right: 5px;
+    // bottom: 300px;
+    z-index: 1000;
+    background-repeat: no-repeat;
+    background-size: 100% 100%;
+    pointer-events: auto;
+    transition: right 1s;
+  }
+  .icon-goto {
+    --image-monitor-goto: url('/@/assets/images/company/monitor-goto.png');
+    background-image: var(--image-monitor-goto);
+  }
+
+  .divider-line {
+    border-bottom: 1px solid white;
+  }
+</style>
+<style>
+  /* .balancePress .zxm-modal-confirm-title {
+    font-size: 20px;
+  } */
+  .balancePress .zxm-modal-confirm-content {
+    font-size: 22px;
+  }
 </style>

+ 17 - 6
src/views/vent/monitorManager/balancePressMonitor/hooks/useControl.ts

@@ -1,19 +1,19 @@
 import { message } from 'ant-design-vue';
 import { get } from 'lodash-es';
 import { ref } from 'vue';
-import { submitEdit, updatePassword, validPassword, subList2, controlWindow } from '../balancePress.api';
+import { submitEdit, updatePassword, validPassword, subList2, controlWindow, cancelcontrolWindow } from '../balancePress.api';
 
 export function usePressControl() {
   /** 参数与设置、风机风门联动表单数据 */
   const formData = ref({
     /** 风机风门联动的自动调控 */
     isAuto: false,
-    /** 参数与设置的自动调控 */
-    isAutoControl: false,
+    /** 参数与设置的状态暂存字段 */
+    temp: false,
   });
   /** 参数与设置、风机风门联动的数据 */
   const avePressLinkage = ref<any>({ isAuto: false });
-  const avePressSetting = ref<any>({ isAutoControl: false });
+  const avePressSetting = ref<any>({ isAuto: false });
   /** 风门与风门联动控制 */
   const gateLinkage = ref<any>({ isAuto: false });
 
@@ -106,8 +106,18 @@ export function usePressControl() {
       });
   }
 
-  function autoControl() {
-    return controlWindow({ id: avePressSetting.value.id })
+  function autoControl(avgPressLogId) {
+    return controlWindow({ avgPressId: avePressSetting.value.id, avgPressLogId })
+      .then(() => {
+        message.success('下发成功');
+      })
+      .catch(() => {
+        message.error('下发失败');
+      });
+  }
+
+  function cancelControl(avgPressLogId) {
+    return cancelcontrolWindow({ avgPressId: avePressSetting.value.id, avgPressLogId })
       .then(() => {
         message.success('下发成功');
       })
@@ -122,6 +132,7 @@ export function usePressControl() {
     changePassword,
     getAvePress,
     autoControl,
+    cancelControl,
     avePressLinkage,
     avePressSetting,
     gateLinkage,

+ 583 - 583
src/views/vent/monitorManager/comment/HistoryTable.vue

@@ -47,632 +47,632 @@
 </template>
 
 <script lang="ts" setup>
-  //ts语法
-  import { watchEffect, ref, watch, defineExpose, inject, nextTick, onMounted, computed } from 'vue';
-  import { FormSchema } from '/@/components/Form/index';
-  import { BasicTable } from '/@/components/Table';
-  import { useListPage } from '/@/hooks/system/useListPage';
-  import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
-  import { defHttp } from '/@/utils/http/axios';
-  import dayjs from 'dayjs';
-  import { getAutoScrollContainer } from '/@/utils/common/compUtils';
-  import { render } from '/@/utils/common/renderUtils';
-  import { useMethods } from '/@/hooks/system/useMethods';
-  import BarAndLine from '/@/components/chart/BarAndLine.vue';
-  import { getDictItemsByCode } from '/@/utils/dict';
-  import { get } from 'lodash-es';
-
-  const globalConfig = inject('globalConfig');
-  const props = defineProps({
-    columnsType: {
-      type: String,
-    },
-    columns: {
-      type: Array,
-      // required: true,
-      default: () => [],
-    },
-    deviceType: {
-      type: String,
-      required: true,
-    },
-    deviceListApi: {
-      type: Function,
-    },
-    deviceArr: {
-      type: Array,
-      // required: true,
-      default: () => [],
-    },
-    designScope: {
-      type: String,
-    },
-    sysId: {
-      type: String,
-    },
-    deviceId: {
-      type: String,
-    },
-    scroll: {
-      type: Object,
-      default: { y: 0 },
-    },
-    formSchemas: {
-      type: Array<FormSchema>,
-      default: () => [],
-    },
-    /** 仅展示已绑定设备,选择是则从系统中获取sysId下已绑定设备。仅能查询到已绑定设备的历史数据 */
-    onlyBounedDevices: {
-      type: Boolean,
-      default: false,
-    },
-    showHistoryCurve: {
-      type: Boolean,
-      default: false,
-    },
+//ts语法
+import { watchEffect, ref, watch, defineExpose, inject, nextTick, onMounted, computed } from 'vue';
+import { FormSchema } from '/@/components/Form/index';
+import { BasicTable } from '/@/components/Table';
+import { useListPage } from '/@/hooks/system/useListPage';
+import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
+import { defHttp } from '/@/utils/http/axios';
+import dayjs from 'dayjs';
+import { getAutoScrollContainer } from '/@/utils/common/compUtils';
+import { render } from '/@/utils/common/renderUtils';
+import { useMethods } from '/@/hooks/system/useMethods';
+import BarAndLine from '/@/components/chart/BarAndLine.vue';
+import { getDictItemsByCode } from '/@/utils/dict';
+import { get } from 'lodash-es';
+
+const globalConfig = inject('globalConfig');
+const props = defineProps({
+  columnsType: {
+    type: String,
+  },
+  columns: {
+    type: Array,
+    // required: true,
+    default: () => [],
+  },
+  deviceType: {
+    type: String,
+    required: true,
+  },
+  deviceListApi: {
+    type: Function,
+  },
+  deviceArr: {
+    type: Array,
+    // required: true,
+    default: () => [],
+  },
+  designScope: {
+    type: String,
+  },
+  sysId: {
+    type: String,
+  },
+  deviceId: {
+    type: String,
+  },
+  scroll: {
+    type: Object,
+    default: { y: 0 },
+  },
+  formSchemas: {
+    type: Array<FormSchema>,
+    default: () => [],
+  },
+  /** 仅展示已绑定设备,选择是则从系统中获取sysId下已绑定设备。仅能查询到已绑定设备的历史数据 */
+  onlyBounedDevices: {
+    type: Boolean,
+    default: false,
+  },
+  showHistoryCurve: {
+    type: Boolean,
+    default: false,
+  },
+});
+const getDeviceListApi = (params) => defHttp.post({ url: '/monitor/device', params });
+const historyTable = ref();
+const loading = ref(false);
+const stationType = ref('plc1');
+const dataSource = ref([]);
+const intervalMap = new Map([
+  ['1', '1s'],
+  ['2', '5s'],
+  ['3', '10s'],
+  ['4', '30s'],
+  ['5', '1m'],
+  ['6', '10m'],
+  ['7', '30m'],
+  ['8', '1h'],
+  ['9', '1d'],
+]);
+
+const getExportXlsUrl = () => {
+  if (stationType.value !== 'redis') {
+    return '/safety/ventanalyMonitorData/export/historydata';
+  } else {
+    return '/monitor/history/exportHistoryData';
+  }
+};
+const emit = defineEmits(['change']);
+
+const historyType = ref('');
+const deviceKide = ref('');
+const columns = ref([]);
+let deviceOptions = ref([]);
+const deviceTypeStr = ref('');
+const deviceTypeName = ref('');
+const deviceType = ref('');
+const chartsColumns = ref([]);
+loading.value = true;
+
+const selectedOption = computed<Record<string, any> | undefined>(() => {
+  let idval: string | undefined = getForm()?.getFieldsValue()?.gdeviceids;
+  if (VENT_PARAM.historyIsMultiple && idval) {
+    const arr = idval.split(',');
+    idval = arr[arr.length - 1];
+  }
+  return deviceOptions.value.find((e: any) => {
+    return e.value === idval;
   });
-  const getDeviceListApi = (params) => defHttp.post({ url: '/monitor/device', params });
-  const historyTable = ref();
-  const loading = ref(false);
-  const stationType = ref('plc1');
-  const dataSource = ref([]);
-  const intervalMap = new Map([
-    ['1', '1s'],
-    ['2', '5s'],
-    ['3', '10s'],
-    ['4', '30s'],
-    ['5', '1m'],
-    ['6', '10m'],
-    ['7', '30m'],
-    ['8', '1h'],
-    ['9', '1d'],
-  ]);
-
-  const getExportXlsUrl = () => {
-    if (stationType.value !== 'redis') {
-      return '/safety/ventanalyMonitorData/export/historydata';
-    } else {
-      return '/monitor/history/exportHistoryData';
-    }
-  };
-  const emit = defineEmits(['change']);
-
-  const historyType = ref('');
-  const deviceKide = ref('');
-  const columns = ref([]);
-  let deviceOptions = ref([]);
-  const deviceTypeStr = ref('');
-  const deviceTypeName = ref('');
-  const deviceType = ref('');
-  const chartsColumns = ref([]);
-  loading.value = true;
-
-  const selectedOption = computed<Record<string, any> | undefined>(() => {
-    let idval: string | undefined = getForm()?.getFieldsValue()?.gdeviceids;
-    if (VENT_PARAM.historyIsMultiple && idval) {
-      const arr = idval.split(',');
-      idval = arr[arr.length - 1];
+});
+
+watch(
+  () => {
+    return props.columnsType;
+  },
+  async (newVal) => {
+    if (!newVal) return;
+    deviceKide.value = newVal;
+    if (historyTable.value) {
+      getForm().resetFields();
+      // getForm().updateSchema();
+      // getForm();
     }
-    return deviceOptions.value.find((e: any) => {
-      return e.value === idval;
+    dataSource.value = [];
+    // const column = getTableHeaderColumns(newVal.includes('_history') ? newVal : newVal + '_history');
+    // if (column && column.length < 1) {
+    //   const arr = newVal.split('_');
+    //   console.log('历史记录列表表头------------>', arr[0] + '_monitor');
+    //   columns.value = getTableHeaderColumns(arr[0] + '_history');
+    //   if (columns.value.length < 1) {
+    //     if (historyType.value) {
+    //       columns.value = getTableHeaderColumns(historyType.value + '_history');
+    //     }
+    //   }
+    // } else {
+    //   columns.value = column;
+    // }
+    await getDeviceList();
+    nextTick(() => {
+      getDataSource();
     });
-  });
-
-  watch(
-    () => {
-      return props.columnsType;
-    },
-    async (newVal) => {
-      if (!newVal) return;
-      deviceKide.value = newVal;
-      if (historyTable.value) {
-        getForm().resetFields();
-        // getForm().updateSchema();
-        // getForm();
-      }
-      dataSource.value = [];
-      // const column = getTableHeaderColumns(newVal.includes('_history') ? newVal : newVal + '_history');
-      // if (column && column.length < 1) {
-      //   const arr = newVal.split('_');
-      //   console.log('历史记录列表表头------------>', arr[0] + '_monitor');
-      //   columns.value = getTableHeaderColumns(arr[0] + '_history');
-      //   if (columns.value.length < 1) {
-      //     if (historyType.value) {
-      //       columns.value = getTableHeaderColumns(historyType.value + '_history');
-      //     }
-      //   }
-      // } else {
-      //   columns.value = column;
-      // }
-      await getDeviceList();
-      nextTick(() => {
-        getDataSource();
-      });
-
-      if (historyTable.value) reload();
-    },
-    {
-      immediate: true,
-    }
-  );
-
-  watch(historyType, (type) => {
-    if (!type) return;
-    // if (historyTable.value) getForm().resetFields()
-
-    const column = getTableHeaderColumns(type.includes('_history') ? type : type + '_history');
-    if (column && column.length < 1) {
-      const arr = type.split('_');
-      columns.value = getTableHeaderColumns(arr[0] + '_history');
-    } else {
-      columns.value = column;
-    }
-    setColumns(columns.value);
-  });
-
-  const showCurve = ref(false);
-
-  // 是否显示历史曲线,在devices_shows_history_curve字典里可以配置哪些设备类型需要显示曲线
-  // 字典内的字段可以是前缀,例如fanlocal之于fanlocal_normal
-  // 安全监控设备需要更多的配置,除去配置safetymonitor,还需要配置哪些安全监控设备需要曲线
-  // 因此可以配置例如A1001的dataTypeName代码(可以查看真实数据参考)
-  function calcShowCurveValue() {
-    const historyCurveDicts = getDictItemsByCode('devices_shows_history_curve') || [];
-    const findDict = (str) => historyCurveDicts.some(({ value }) => str.startsWith(value));
-
-    if (!props.showHistoryCurve) return false;
-    const dt = props.deviceType; // 依赖项
 
-    if (!findDict(dt)) return false;
-    if (!dt.startsWith('safetymonitor')) return true;
-
-    // 和字典的设备类型匹配后,如果是安全监控设备,需要额外的匹配安全监控类型
-    const dtns = get(selectedOption.value, 'readData.dataTypeName', ''); // 依赖项
-    return findDict(dtns);
+    if (historyTable.value) reload();
+  },
+  {
+    immediate: true,
+  }
+);
+
+watch(historyType, (type) => {
+  if (!type) return;
+  // if (historyTable.value) getForm().resetFields()
+
+  const column = getTableHeaderColumns(type.includes('_history') ? type : type + '_history');
+  if (column && column.length < 1) {
+    const arr = type.split('_');
+    columns.value = getTableHeaderColumns(arr[0] + '_history');
+  } else {
+    columns.value = column;
+  }
+  setColumns(columns.value);
+});
+
+const showCurve = ref(false);
+
+// 是否显示历史曲线,在devices_shows_history_curve字典里可以配置哪些设备类型需要显示曲线
+// 字典内的字段可以是前缀,例如fanlocal之于fanlocal_normal
+// 安全监控设备需要更多的配置,除去配置safetymonitor,还需要配置哪些安全监控设备需要曲线
+// 因此可以配置例如A1001的dataTypeName代码(可以查看真实数据参考)
+function calcShowCurveValue() {
+  const historyCurveDicts = getDictItemsByCode('devices_shows_history_curve') || [];
+  const findDict = (str) => historyCurveDicts.some(({ value }) => str.startsWith(value));
+
+  if (!props.showHistoryCurve) return false;
+  const dt = props.deviceType; // 依赖项
+
+  if (!findDict(dt)) return false;
+  if (!dt.startsWith('safetymonitor')) return true;
+
+  // 和字典的设备类型匹配后,如果是安全监控设备,需要额外的匹配安全监控类型
+  const dtns = get(selectedOption.value, 'readData.dataTypeName', ''); // 依赖项
+  return findDict(dtns);
+}
+
+function initHistoryCurveColumns() {
+  if (!props.showHistoryCurve) return;
+  const arr = historyType.value.split('_');
+  // 没错,又是安全监控。安全监控的单位无法一次定好,所以根据返回的数据协定单位
+  if (props.deviceType.startsWith('safetymonitor')) {
+    chartsColumns.value = getTableHeaderColumns(arr[0] + '_chart').map((e) => {
+      const unit = get(selectedOption.value, 'readData.unit', e.unit);
+      return {
+        ...e,
+        unit: unit,
+        seriesName: unit,
+      };
+    });
+  } else {
+    chartsColumns.value = getTableHeaderColumns(arr[0] + '_chart');
+  }
+}
+
+const tableScroll = computed(() => {
+  if (props.scroll.y && showCurve.value) return { y: props.scroll.y - 450 };
+  if (props.scroll.y) return { y: props.scroll.y - 100 };
+  return {};
+});
+
+// watch(stationType, (type) => {
+//   if (type) {
+//     nextTick(() => {
+//       getDataSource();
+//     });
+//   }
+// });
+
+watch(
+  () => props.deviceId,
+  async () => {
+    await getForm().setFieldsValue({});
+    await getDeviceList();
+  }
+);
+
+/** 获取可供查询历史数据的设备列表 */
+async function getDeviceList() {
+  // if (props.deviceType.split('_')[1] && props.deviceType.split('_')[1] === 'history') return;
+  let result;
+  let response;
+  if (props.onlyBounedDevices) {
+    response = await getDeviceListApi({
+      systemID: props.sysId,
+      devicetype: 'sys',
+    }).then(({ msgTxt }) => {
+      return { msgTxt: msgTxt.filter((e) => e.type === props.deviceType) };
+    });
+  } else if (props.sysId) {
+    response = await getDeviceListApi({
+      sysId: props.sysId,
+      devicetype: props.deviceType.startsWith('vehicle') ? 'location_normal' : props.deviceType,
+      pageSize: 10000,
+    });
+  } else if (props.deviceListApi) {
+    response = await props.deviceListApi();
+  } else {
+    response = await getDeviceListApi({ devicetype: props.deviceType, pageSize: 10000 });
   }
 
-  function initHistoryCurveColumns() {
-    if (!props.showHistoryCurve) return;
-    const arr = historyType.value.split('_');
-    // 没错,又是安全监控。安全监控的单位无法一次定好,所以根据返回的数据协定单位
-    if (props.deviceType.startsWith('safetymonitor')) {
-      chartsColumns.value = getTableHeaderColumns(arr[0] + '_chart').map((e) => {
-        const unit = get(selectedOption.value, 'readData.unit', e.unit);
-        return {
-          ...e,
-          unit: unit,
-          seriesName: unit,
-        };
-      });
-    } else {
-      chartsColumns.value = getTableHeaderColumns(arr[0] + '_chart');
-    }
+  // 处理不同格式的数据
+  if (response['records'] && response['records'].length > 0) {
+    result = response['records'];
+  } else if (response['msgTxt'] && response['msgTxt'][0] && response['msgTxt'][0]['datalist']) {
+    result = response['msgTxt'][0]['datalist'];
+  }
+  if (response['msgTxt'] && response['msgTxt'][0]) {
+    deviceTypeName.value = response['msgTxt'][0]['typeName'];
+    deviceType.value = response['msgTxt'][0]['type'];
   }
 
-  const tableScroll = computed(() => {
-    if (props.scroll.y && showCurve.value) return { y: props.scroll.y - 450 };
-    if (props.scroll.y) return { y: props.scroll.y - 100 };
-    return {};
-  });
+  if (result) {
+    deviceOptions.value = [];
+    deviceOptions.value = result.map((item, index) => {
+      return {
+        label: item['strinstallpos'],
+        value: item['id'] || item['deviceID'],
+        strtype: item['strtype'] || item['deviceType'],
+        strinstallpos: item['strinstallpos'],
+        devicekind: item['devicekind'],
+        stationtype: item['stationtype'],
+        readData: item['readData'],
+      };
+    });
 
-  // watch(stationType, (type) => {
-  //   if (type) {
-  //     nextTick(() => {
-  //       getDataSource();
-  //     });
-  //   }
-  // });
-
-  watch(
-    () => props.deviceId,
-    async () => {
-      await getForm().setFieldsValue({});
-      await getDeviceList();
-    }
-  );
-
-  /** 获取可供查询历史数据的设备列表 */
-  async function getDeviceList() {
-    // if (props.deviceType.split('_')[1] && props.deviceType.split('_')[1] === 'history') return;
-    let result;
-    let response;
-    if (props.onlyBounedDevices) {
-      response = await getDeviceListApi({
-        systemID: props.sysId,
-        devicetype: 'sys',
-      }).then(({ msgTxt }) => {
-        return { msgTxt: msgTxt.filter((e) => e.type === props.deviceType) };
-      });
-    } else if (props.sysId) {
-      response = await getDeviceListApi({
-        sysId: props.sysId,
-        devicetype: props.deviceType.startsWith('vehicle') ? 'location_normal' : props.deviceType,
-        pageSize: 10000,
-      });
-    } else if (props.deviceListApi) {
-      response = await props.deviceListApi();
+    stationType.value = deviceOptions.value[0]['stationtype'];
+    if (props.deviceType.startsWith('vehicle')) {
+      historyType.value = 'vehicle';
     } else {
-      response = await getDeviceListApi({ devicetype: props.deviceType, pageSize: 10000 });
+      historyType.value = deviceOptions.value[0]['strtype'] || deviceOptions.value[0]['devicekind'];
     }
 
-    // 处理不同格式的数据
-    if (response['records'] && response['records'].length > 0) {
-      result = response['records'];
-    } else if (response['msgTxt'] && response['msgTxt'][0] && response['msgTxt'][0]['datalist']) {
-      result = response['msgTxt'][0]['datalist'];
-    }
-    if (response['msgTxt'] && response['msgTxt'][0]) {
-      deviceTypeName.value = response['msgTxt'][0]['typeName'];
-      deviceType.value = response['msgTxt'][0]['type'];
-    }
-
-    if (result) {
-      deviceOptions.value = [];
-      deviceOptions.value = result.map((item, index) => {
-        return {
-          label: item['strinstallpos'],
-          value: item['id'] || item['deviceID'],
-          strtype: item['strtype'] || item['deviceType'],
-          strinstallpos: item['strinstallpos'],
-          devicekind: item['devicekind'],
-          stationtype: item['stationtype'],
-          readData: item['readData'],
-        };
-      });
-
-      stationType.value = deviceOptions.value[0]['stationtype'];
-      if (props.deviceType.startsWith('vehicle')) {
-        historyType.value = 'vehicle';
-      } else {
-        historyType.value = deviceOptions.value[0]['strtype'] || deviceOptions.value[0]['devicekind'];
-      }
-
-      /** 此处使用nextTick是由于可能表单暂未更新,而下面的方法依赖表单项 */
-      nextTick(() => {
-        showCurve.value = calcShowCurveValue();
-        initHistoryCurveColumns();
-      });
-    }
-    if (VENT_PARAM.historyIsMultiple) {
-      await getForm().setFieldsValue({
-        gdeviceids: [props.deviceId ? props.deviceId : deviceOptions.value[0] ? deviceOptions.value[0]['value'] : ''],
-      });
-      await getForm().updateSchema({
-        field: 'gdeviceids',
-        componentProps: {
-          mode: 'multiple',
-          maxTagCount: 'responsive',
-        },
-      });
-    } else {
-      await getForm().setFieldsValue({
-        gdeviceids: props.deviceId ? props.deviceId : deviceOptions.value[0] ? deviceOptions.value[0]['value'] : '',
-      });
-      await getForm().updateSchema({
-        field: 'gdeviceids',
-      });
-    }
+    /** 此处使用nextTick是由于可能表单暂未更新,而下面的方法依赖表单项 */
+    nextTick(() => {
+      showCurve.value = calcShowCurveValue();
+      initHistoryCurveColumns();
+    });
   }
-
-  function resetFormParam() {
-    const formData = getForm().getFieldsValue();
-    const pagination = getPaginationRef();
-    formData['pageNo'] = pagination['current'];
-    formData['pageSize'] = pagination['pageSize'];
-    formData['column'] = 'createTime';
-    if (stationType.value !== 'redis' && deviceOptions.value[0]) {
-      formData['strtype'] = deviceTypeStr.value
-        ? deviceTypeStr.value
-        : deviceOptions.value[0]['strtype']
-        ? deviceOptions.value[0]['strtype']
-        : props.deviceType + '*';
-      if (props.sysId) {
-        formData['sysId'] = props.sysId;
-      }
-      return formData;
-    } else {
-      const params = {
-        pageNum: pagination['current'],
-        pageSize: pagination['pageSize'],
-        column: pagination['createTime'],
-        startTime: formData['ttime_begin'],
-        endTime: formData['ttime_end'],
-        deviceId: formData['gdeviceids'],
-        strtype: props.deviceType + '*',
-        sysId: props.sysId,
-        interval: intervalMap.get(formData['skip']) ? intervalMap.get(formData['skip']) : '1h',
-        isEmployee: props.deviceType.startsWith('vehicle') ? false : true,
-      };
-      return params;
+  if (VENT_PARAM.historyIsMultiple) {
+    await getForm().setFieldsValue({
+      gdeviceids: [props.deviceId ? props.deviceId : deviceOptions.value[0] ? deviceOptions.value[0]['value'] : ''],
+    });
+    await getForm().updateSchema({
+      field: 'gdeviceids',
+      componentProps: {
+        mode: 'multiple',
+        maxTagCount: 'responsive',
+      },
+    });
+  } else {
+    await getForm().setFieldsValue({
+      gdeviceids: props.deviceId ? props.deviceId : deviceOptions.value[0] ? deviceOptions.value[0]['value'] : '',
+    });
+    await getForm().updateSchema({
+      field: 'gdeviceids',
+    });
+  }
+}
+
+function resetFormParam() {
+  const formData = getForm().getFieldsValue();
+  const pagination = getPaginationRef();
+  formData['pageNo'] = pagination['current'];
+  formData['pageSize'] = pagination['pageSize'];
+  formData['column'] = 'createTime';
+  if (stationType.value !== 'redis' && deviceOptions.value[0]) {
+    formData['strtype'] = deviceTypeStr.value
+      ? deviceTypeStr.value
+      : deviceOptions.value[0]['strtype']
+      ? deviceOptions.value[0]['strtype']
+      : props.deviceType + '*';
+    if (props.sysId) {
+      formData['sysId'] = props.sysId;
     }
+    return formData;
+  } else {
+    const params = {
+      pageNum: pagination['current'],
+      pageSize: pagination['pageSize'],
+      column: pagination['createTime'],
+      startTime: formData['ttime_begin'],
+      endTime: formData['ttime_end'],
+      deviceId: formData['gdeviceids'],
+      strtype: props.deviceType + '*',
+      sysId: props.sysId,
+      interval: intervalMap.get(formData['skip']) ? intervalMap.get(formData['skip']) : '1h',
+      isEmployee: props.deviceType.startsWith('vehicle') ? false : true,
+    };
+    return params;
   }
-
-  async function getDataSource() {
-    dataSource.value = [];
-    setLoading(true);
-    const params = await resetFormParam();
-    if (stationType.value !== 'redis') {
-      const result = await defHttp.get({ url: '/safety/ventanalyMonitorData/listdays', params: params });
-      setPagination({ total: Math.abs(result['datalist']['total']) || 0 });
-      if (result['datalist']['records'].length > 0) {
-        dataSource.value = result['datalist']['records'].map((item: any) => {
-          return Object.assign(item, item['readData']);
-        });
-      } else {
-        dataSource.value = [];
-      }
+}
+
+async function getDataSource() {
+  dataSource.value = [];
+  setLoading(true);
+  const params = await resetFormParam();
+  if (stationType.value !== 'redis') {
+    const result = await defHttp.get({ url: '/safety/ventanalyMonitorData/listdays', params: params });
+    setPagination({ total: Math.abs(result['datalist']['total']) || 0 });
+    if (result['datalist']['records'].length > 0) {
+      dataSource.value = result['datalist']['records'].map((item: any) => {
+        return Object.assign(item, item['readData']);
+      });
     } else {
-      const result = await defHttp.post({ url: '/monitor/history/getHistoryData', params: params });
-      setPagination({ total: Math.abs(result['total']) || 0 });
-      dataSource.value = result['records'] || [];
+      dataSource.value = [];
     }
-    setLoading(false);
+  } else {
+    const result = await defHttp.post({ url: '/monitor/history/getHistoryData', params: params });
+    setPagination({ total: Math.abs(result['total']) || 0 });
+    dataSource.value = result['records'] || [];
   }
-
-  // 列表页面公共参数、方法
-  const { tableContext, onExportXls, onExportXlsPost } = useListPage({
-    tableProps: {
-      // api: list,
-      columns: props.columnsType ? columns : (props.columns as any[]),
-      canResize: true,
-      showTableSetting: false,
-      showActionColumn: false,
-      bordered: false,
-      size: 'small',
-      showIndexColumn: true,
-      tableLayout: 'auto',
-      formConfig: {
-        labelAlign: 'left',
-        labelWidth: 80,
-        showAdvancedButton: false,
-        showSubmitButton: false,
-        showResetButton: false,
-        baseColProps: {
-          xs: 24,
-          sm: 24,
-          md: 24,
-          lg: 9,
-          xl: 7,
-          xxl: 4,
-        },
-        schemas:
-          props.formSchemas.length > 0
-            ? props.formSchemas
-            : [
-                {
-                  field: 'ttime_begin',
-                  label: '开始时间',
-                  component: 'DatePicker',
-                  defaultValue: dayjs().startOf('date'),
-                  required: true,
-                  componentProps: {
-                    showTime: true,
-                    valueFormat: 'YYYY-MM-DD HH:mm:ss',
-                    getPopupContainer: getAutoScrollContainer,
-                  },
-                  colProps: {
-                    span: 4,
-                  },
+  setLoading(false);
+}
+
+// 列表页面公共参数、方法
+const { tableContext, onExportXls, onExportXlsPost } = useListPage({
+  tableProps: {
+    // api: list,
+    columns: props.columnsType ? columns : (props.columns as any[]),
+    canResize: true,
+    showTableSetting: false,
+    showActionColumn: false,
+    bordered: false,
+    size: 'small',
+    showIndexColumn: true,
+    tableLayout: 'auto',
+    formConfig: {
+      labelAlign: 'left',
+      labelWidth: 80,
+      showAdvancedButton: false,
+      showSubmitButton: false,
+      showResetButton: false,
+      baseColProps: {
+        xs: 24,
+        sm: 24,
+        md: 24,
+        lg: 9,
+        xl: 7,
+        xxl: 4,
+      },
+      schemas:
+        props.formSchemas.length > 0
+          ? props.formSchemas
+          : [
+              {
+                field: 'ttime_begin',
+                label: '开始时间',
+                component: 'DatePicker',
+                defaultValue: dayjs().startOf('date'),
+                required: true,
+                componentProps: {
+                  showTime: true,
+                  valueFormat: 'YYYY-MM-DD HH:mm:ss',
+                  getPopupContainer: getAutoScrollContainer,
+                },
+                colProps: {
+                  span: 4,
+                },
+              },
+              {
+                field: 'ttime_end',
+                label: '结束时间',
+                component: 'DatePicker',
+                defaultValue: dayjs(),
+                required: true,
+                componentProps: {
+                  showTime: true,
+                  valueFormat: 'YYYY-MM-DD HH:mm:ss',
+                  getPopupContainer: getAutoScrollContainer,
                 },
-                {
-                  field: 'ttime_end',
-                  label: '结束时间',
-                  component: 'DatePicker',
-                  defaultValue: dayjs(),
-                  required: true,
-                  componentProps: {
-                    showTime: true,
-                    valueFormat: 'YYYY-MM-DD HH:mm:ss',
-                    getPopupContainer: getAutoScrollContainer,
+                colProps: {
+                  span: 4,
+                },
+              },
+              {
+                label: computed(() => `${deviceKide.value.startsWith('location') ? '查询人员' : '查询设备'}`),
+                field: 'gdeviceids',
+                component: 'Select',
+                required: true,
+                componentProps: {
+                  showSearch: true,
+                  filterOption: (input: string, option: any) => {
+                    return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
                   },
-                  colProps: {
-                    span: 4,
+                  options: deviceOptions,
+                  onChange: (e, option) => {
+                    if (option && (option['strinstallpos'] || option['strtype'] || option['devicekind'])) {
+                      historyType.value = option['strtype'] || option['devicekind'];
+                    }
+                    if (option['strtype']) {
+                      deviceTypeStr.value = option['strtype'];
+                    }
+                    stationType.value = option['stationtype'];
+                    nextTick(() => {
+                      showCurve.value = calcShowCurveValue();
+                      initHistoryCurveColumns();
+                      getDataSource();
+                    });
                   },
                 },
-                {
-                  label: computed(() => `${deviceKide.value.startsWith('location') ? '查询人员' : '查询设备'}`),
-                  field: 'gdeviceids',
-                  component: 'Select',
-                  required: true,
-                  componentProps: {
-                    showSearch: true,
-                    filterOption: (input: string, option: any) => {
-                      return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0;
+                colProps: {
+                  span: 5,
+                },
+              },
+              {
+                label: '间隔时间',
+                field: 'skip',
+                component: 'Select',
+                defaultValue: '8',
+                componentProps: {
+                  options: [
+                    {
+                      label: '1秒',
+                      value: '1',
                     },
-                    options: deviceOptions,
-                    onChange: (e, option) => {
-                      if (option && (option['strinstallpos'] || option['strtype'] || option['devicekind'])) {
-                        historyType.value = option['strtype'] || option['devicekind'];
-                      }
-                      if (option['strtype']) {
-                        deviceTypeStr.value = option['strtype'];
-                      }
-                      stationType.value = option['stationtype'];
-                      nextTick(() => {
-                        showCurve.value = calcShowCurveValue();
-                        initHistoryCurveColumns();
-                        getDataSource();
-                      });
+                    {
+                      label: '5秒',
+                      value: '2',
                     },
-                  },
-                  colProps: {
-                    span: 5,
-                  },
+                    {
+                      label: '10秒',
+                      value: '3',
+                    },
+                    {
+                      label: '30秒',
+                      value: '4',
+                    },
+                    {
+                      label: '1分钟',
+                      value: '5',
+                    },
+                    {
+                      label: '10分钟',
+                      value: '6',
+                    },
+                    {
+                      label: '30分钟',
+                      value: '7',
+                    },
+                    {
+                      label: '1小时',
+                      value: '8',
+                    },
+                    {
+                      label: '1天',
+                      value: '9',
+                    },
+                  ],
                 },
-                {
-                  label: '间隔时间',
-                  field: 'skip',
-                  component: 'Select',
-                  defaultValue: '8',
-                  componentProps: {
-                    options: [
-                      {
-                        label: '1秒',
-                        value: '1',
-                      },
-                      {
-                        label: '5秒',
-                        value: '2',
-                      },
-                      {
-                        label: '10秒',
-                        value: '3',
-                      },
-                      {
-                        label: '30秒',
-                        value: '4',
-                      },
-                      {
-                        label: '1分钟',
-                        value: '5',
-                      },
-                      {
-                        label: '10分钟',
-                        value: '6',
-                      },
-                      {
-                        label: '30分钟',
-                        value: '7',
-                      },
-                      {
-                        label: '1小时',
-                        value: '8',
-                      },
-                      {
-                        label: '1天',
-                        value: '9',
-                      },
-                    ],
-                  },
-                  colProps: {
-                    span: 3,
-                  },
+                colProps: {
+                  span: 3,
                 },
-              ],
-        // fieldMapToTime: [['tickectDate', ['ttime_begin', 'ttime_end'], '']],
-      },
-      // fetchSetting: {
-      //   listField: 'datalist',
-      //   totalField: 'datalist.total',
-      // },
-      pagination: {
-        current: 1,
-        pageSize: 10,
-        pageSizeOptions: ['10', '30', '50', '100'],
-        showQuickJumper: false,
-      },
-      beforeFetch() {
-        const newParams = { ...resetFormParam() };
-        return newParams;
-      },
-      // afterFetch(result) {
-      //   const resultItems = result['records'];
-      //   resultItems.map((item) => {
-      //     Object.assign(item, item['readData']);
-      //   });
-      //   console.log('result---------------->', result);
-      //   return resultItems;
-      // },
+              },
+            ],
+      // fieldMapToTime: [['tickectDate', ['ttime_begin', 'ttime_end'], '']],
     },
-    exportConfig: {
-      name: '设备历史列表',
-      url: getExportXlsUrl,
+    // fetchSetting: {
+    //   listField: 'datalist',
+    //   totalField: 'datalist.total',
+    // },
+    pagination: {
+      current: 1,
+      pageSize: 10,
+      pageSizeOptions: ['10', '30', '50', '100'],
+      showQuickJumper: false,
     },
-  });
-
-  //注册table数据
-  const [registerTable, { reload, setLoading, getForm, setColumns, getPaginationRef, setPagination }] = tableContext;
+    beforeFetch() {
+      const newParams = { ...resetFormParam() };
+      return newParams;
+    },
+    // afterFetch(result) {
+    //   const resultItems = result['records'];
+    //   resultItems.map((item) => {
+    //     Object.assign(item, item['readData']);
+    //   });
+    //   console.log('result---------------->', result);
+    //   return resultItems;
+    // },
+  },
+  exportConfig: {
+    name: '设备历史列表',
+    url: getExportXlsUrl,
+  },
+});
+
+//注册table数据
+const [registerTable, { reload, setLoading, getForm, setColumns, getPaginationRef, setPagination }] = tableContext;
+
+function onExportXlsFn() {
+  const params = resetFormParam();
+  // 判断时间间隔和查询时间区间,数据量下载大时进行提示
+  if (stationType.value !== 'redis') {
+    return onExportXls(params);
+  } else {
+    return onExportXlsPost(params);
+  }
+}
 
-  function onExportXlsFn() {
-    const params = resetFormParam();
-    // 判断时间间隔和查询时间区间,数据量下载大时进行提示
-    if (stationType.value !== 'redis') {
-      return onExportXls(params);
-    } else {
-      return onExportXlsPost(params);
-    }
+watchEffect(() => {
+  if (historyTable.value && dataSource) {
+    const data = dataSource.value || [];
+    emit('change', data);
   }
+});
 
-  watchEffect(() => {
-    if (historyTable.value && dataSource) {
-      const data = dataSource.value || [];
-      emit('change', data);
-    }
-  });
+onMounted(async () => {
+  await getDeviceList();
+  if (deviceOptions.value[0]) {
+    nextTick(async () => {
+      await getDataSource();
+    });
+  }
 
-  onMounted(async () => {
-    await getDeviceList();
+  watch([() => getPaginationRef()['current'], () => getPaginationRef()['pageSize']], async () => {
     if (deviceOptions.value[0]) {
-      nextTick(async () => {
-        await getDataSource();
-      });
-    }
-
-    watch([() => getPaginationRef()['current'], () => getPaginationRef()['pageSize']], async () => {
       if (deviceOptions.value[0]) {
-        if (deviceOptions.value[0]) {
-          await getDataSource();
-        }
+        await getDataSource();
       }
-    });
+    }
   });
-  defineExpose({ setLoading });
+});
+defineExpose({ setLoading });
 </script>
 
 <style scoped lang="less">
-  @import '/@/design/theme.less';
-
-  :deep(.@{ventSpace}-table-body) {
-    height: auto !important;
-  }
-  :deep(.zxm-picker) {
-    height: 30px !important;
-  }
-  .history-table {
-    width: 100%;
-    :deep(.jeecg-basic-table-form-container) {
-      .@{ventSpace}-form {
-        padding: 0 !important;
-        border: none !important;
-        margin-bottom: 0 !important;
-        .@{ventSpace}-picker,
-        .@{ventSpace}-select-selector {
-          width: 100% !important;
-          height: 100%;
-          background: #00000017;
-          border: 1px solid #b7b7b7;
-          input,
-          .@{ventSpace}-select-selection-item,
-          .@{ventSpace}-picker-suffix {
-            color: #fff;
-          }
-          .@{ventSpace}-select-selection-placeholder {
-            color: #ffffffaa;
-          }
+@import '/@/design/theme.less';
+
+:deep(.@{ventSpace}-table-body) {
+  height: auto !important;
+}
+:deep(.zxm-picker) {
+  height: 30px !important;
+}
+.history-table {
+  width: 100%;
+  :deep(.jeecg-basic-table-form-container) {
+    .@{ventSpace}-form {
+      padding: 0 !important;
+      border: none !important;
+      margin-bottom: 0 !important;
+      .@{ventSpace}-picker,
+      .@{ventSpace}-select-selector {
+        width: 100% !important;
+        height: 100%;
+        background: #00000017;
+        border: 1px solid #b7b7b7;
+        input,
+        .@{ventSpace}-select-selection-item,
+        .@{ventSpace}-picker-suffix {
+          color: #fff;
+        }
+        .@{ventSpace}-select-selection-placeholder {
+          color: #ffffffaa;
         }
-      }
-      .@{ventSpace}-table-title {
-        min-height: 0 !important;
       }
     }
-    .pagination-box {
-      display: flex;
-      justify-content: flex-end;
-      align-items: center;
-      .page-num {
-        border: 1px solid #0090d8;
-        padding: 4px 8px;
-        margin-right: 5px;
-        color: #0090d8;
-      }
-      .btn {
-        margin-right: 10px;
-      }
+    .@{ventSpace}-table-title {
+      min-height: 0 !important;
     }
   }
-
-  .history-chart {
-    background-color: #0090d822;
-    margin: 0 10px;
+  .pagination-box {
+    display: flex;
+    justify-content: flex-end;
+    align-items: center;
+    .page-num {
+      border: 1px solid #0090d8;
+      padding: 4px 8px;
+      margin-right: 5px;
+      color: #0090d8;
+    }
+    .btn {
+      margin-right: 10px;
+    }
   }
+}
+
+.history-chart {
+  background-color: #0090d822;
+  margin: 0 10px;
+}
 </style>

+ 593 - 0
src/views/vent/monitorManager/comment/HistoryTableChart.vue

@@ -0,0 +1,593 @@
+<template>
+  <div class="" v-if="loading">
+    <div class="charts-container">
+      <a-form
+        class="form-container"
+        :model="historyParams"
+        layout="inline"
+        :label-col="{ style: { width: '100px' } }"
+        :wrapper-col="{ span: 8 }"
+        autocomplete="off"
+        @submit.prevent="getDataSource"
+      >
+        <a-form-item label="查询设备">
+          <a-select v-model:value="historyParams.selectedDeviceId" style="width: 200px">
+            <a-select-option v-for="d in deviceOptions" :key="d.label" :value="d.value">{{ d.label }}</a-select-option>
+          </a-select>
+        </a-form-item>
+        <a-form-item label="间隔时间">
+          <a-select v-model:value="historyParams.interval" style="width: 200px">
+            <a-select-option v-for="[key, value] in Array.from(intervalMap)" :key="key" :value="key">
+              {{ value }}
+            </a-select-option>
+          </a-select>
+        </a-form-item>
+        <a-form-item label="开始时间">
+          <a-date-picker
+            v-model:value="historyParams.startTime"
+            style="width: 200px"
+            show-time
+            valueFormat="YYYY-MM-DD HH:mm:ss"
+            placeholder="请选择开始时间"
+          />
+        </a-form-item>
+        <a-form-item label="结束时间">
+          <a-date-picker
+            v-model:value="historyParams.endTime"
+            style="width: 200px"
+            show-time
+            valueFormat="YYYY-MM-DD HH:mm:ss"
+            placeholder="请选择结束时间"
+          />
+        </a-form-item>
+        <a-form-item>
+          <a-button type="primary" html-type="submit">查询</a-button>
+        </a-form-item>
+      </a-form>
+    </div>
+    <Pagination
+      v-model:current="pagination.current"
+      v-model:pageSize="pagination.pageSize"
+      :total="pagination.total"
+      size="small"
+      @change="handlePageChange"
+      style="position: absolute; z-index: 99; top: 53px; right: 30px"
+    />
+    <div class="history-chart">
+      <BarAndLine
+        :charts-columns="chartsColumns"
+        chartsType="history"
+        :option="{
+          legend: {
+            top: '5',
+          },
+          grid: {
+            top: 50,
+            left: 100,
+            right: 100,
+            bottom: 50,
+          },
+        }"
+        :data-source="dataSource"
+        height="290px"
+        :x-axis-prop-type="stationType !== 'redis' ? 'ttime' : 'time'"
+      />
+    </div>
+  </div>
+</template>
+
+<script lang="ts" setup>
+//ts语法
+import { watchEffect, ref, watch, nextTick, reactive, onMounted, computed } from 'vue';
+import { FormSchema } from '/@/components/Form/index';
+import { defHttp } from '/@/utils/http/axios';
+import { Pagination } from 'ant-design-vue';
+import dayjs from 'dayjs';
+import BarAndLine from '/@/components/chart/BarAndLine.vue';
+import { getDictItemsByCode } from '/@/utils/dict';
+import { get } from 'lodash-es';
+
+const props = defineProps({
+  columnsType: {
+    type: String,
+  },
+  columns: {
+    type: Array,
+    // required: true,
+    default: () => [],
+  },
+  deviceType: {
+    type: String,
+    required: true,
+  },
+  deviceListApi: {
+    type: Function,
+  },
+  deviceArr: {
+    type: Array,
+    // required: true,
+    default: () => [],
+  },
+  designScope: {
+    type: String,
+  },
+  sysId: {
+    type: String,
+  },
+  deviceId: {
+    type: String,
+  },
+  scroll: {
+    type: Object,
+    default: { y: 0 },
+  },
+  formSchemas: {
+    type: Array<FormSchema>,
+    default: () => [],
+  },
+  /** 仅展示已绑定设备,选择是则从系统中获取sysId下已绑定设备。仅能查询到已绑定设备的历史数据 */
+  onlyBounedDevices: {
+    type: Boolean,
+    default: false,
+  },
+  showHistoryCurve: {
+    type: Boolean,
+    default: false,
+  },
+});
+const getDeviceListApi = (params) => defHttp.post({ url: '/monitor/device', params });
+const historyTable = ref();
+const loading = ref(false);
+const stationType = ref('plc1');
+const dataSource = ref([]);
+const intervalMap = new Map([
+  ['1', '1秒'],
+  ['2', '5秒'],
+  ['3', '10秒'],
+  ['4', '30秒'],
+  ['5', '1分钟'],
+  ['6', '10分钟'],
+  ['7', '30分钟'],
+  ['8', '1小时'],
+  ['9', '1天'],
+]);
+const historyParams = reactive({
+  startTime: dayjs().startOf('date').format('YYYY-MM-DD HH:mm:ss').toString(),
+  endTime: dayjs().format('YYYY-MM-DD HH:mm:ss').toString(),
+  skip: '8',
+  interval: '1小时',
+  selectedDeviceId: '',
+});
+const emit = defineEmits(['change']);
+
+const historyType = ref('');
+const deviceKide = ref('');
+let deviceOptions = ref([]);
+const deviceTypeStr = ref('');
+const deviceTypeName = ref('');
+const deviceType = ref('');
+const chartsColumns = ref([
+  // {
+  //   legend: '压差',
+  //   seriesName: '(Pa)',
+  //   ymax: 100,
+  //   yname: 'Pa',
+  //   linetype: 'bar',
+  //   yaxispos: 'left',
+  //   color: '#37BCF2',
+  //   sort: 1,
+  //   xRotate: 0,
+  //   dataIndex: 'frontRearDP',
+  // },
+  {
+    legend: '前门推力',
+    seriesName: '',
+    ymax: 100,
+    yname: '前门推力',
+    linetype: 'line',
+    yaxispos: 'left',
+    color: '#37BCF2',
+    sort: 1,
+    xRotate: 0,
+    dataIndex: '1zdqfktl',
+  },
+  {
+    legend: '后门推力',
+    seriesName: '-',
+    ymax: 100,
+    yname: '后门推力',
+    linetype: 'line',
+    yaxispos: 'right',
+    color: '#FC4327',
+    sort: 2,
+    xRotate: 0,
+    dataIndex: '2zdqfktl',
+  },
+]);
+loading.value = true;
+const pagination = {
+  current: 1,
+  pageSize: 20,
+  showQuickJumper: false,
+  total: 0,
+};
+const selectedOption = computed<Record<string, any> | undefined>(() => {
+  let idval: string | undefined = getForm()?.getFieldsValue()?.gdeviceids;
+  if (VENT_PARAM.historyIsMultiple && idval) {
+    const arr = idval.split(',');
+    idval = arr[arr.length - 1];
+  }
+  return deviceOptions.value.find((e: any) => {
+    return e.value === idval;
+  });
+});
+
+watch(
+  () => {
+    return props.columnsType;
+  },
+  async (newVal) => {
+    if (!newVal) return;
+    deviceKide.value = newVal;
+    if (historyTable.value) {
+      getForm().resetFields();
+      // getForm().updateSchema();
+      // getForm();
+    }
+    dataSource.value = [];
+    // const column = getTableHeaderColumns(newVal.includes('_history') ? newVal : newVal + '_history');
+    // if (column && column.length < 1) {
+    //   const arr = newVal.split('_');
+    //   console.log('历史记录列表表头------------>', arr[0] + '_monitor');
+    //   columns.value = getTableHeaderColumns(arr[0] + '_history');
+    //   if (columns.value.length < 1) {
+    //     if (historyType.value) {
+    //       columns.value = getTableHeaderColumns(historyType.value + '_history');
+    //     }
+    //   }
+    // } else {
+    //   columns.value = column;
+    // }
+    await getDeviceList();
+    nextTick(() => {
+      getDataSource();
+    });
+
+    if (historyTable.value) reload();
+  },
+  {
+    immediate: true,
+  }
+);
+
+watch(historyType, (type) => {
+  if (!type) return;
+  // if (historyTable.value) getForm().resetFields()
+
+  // const column = getTableHeaderColumns(type.includes('_history') ? type : type + '_history');
+  // if (column && column.length < 1) {
+  //   const arr = type.split('_');
+  //   columns.value = getTableHeaderColumns(arr[0] + '_history');
+  // } else {
+  //   columns.value = column;
+  // }
+  // setColumns(columns.value);
+});
+
+const showCurve = ref(false);
+
+// 是否显示历史曲线,在devices_shows_history_curve字典里可以配置哪些设备类型需要显示曲线
+// 字典内的字段可以是前缀,例如fanlocal之于fanlocal_normal
+// 安全监控设备需要更多的配置,除去配置safetymonitor,还需要配置哪些安全监控设备需要曲线
+// 因此可以配置例如A1001的dataTypeName代码(可以查看真实数据参考)
+function calcShowCurveValue() {
+  const historyCurveDicts = getDictItemsByCode('devices_shows_history_curve') || [];
+  const findDict = (str) => historyCurveDicts.some(({ value }) => str.startsWith(value));
+
+  if (!props.showHistoryCurve) return false;
+  const dt = props.deviceType; // 依赖项
+
+  if (!findDict(dt)) return false;
+  if (!dt.startsWith('safetymonitor')) return true;
+
+  // 和字典的设备类型匹配后,如果是安全监控设备,需要额外的匹配安全监控类型
+  const dtns = get(selectedOption.value, 'readData.dataTypeName', ''); // 依赖项
+  return findDict(dtns);
+}
+
+// const tableScroll = computed(() => {
+//   if (props.scroll.y && showCurve.value) return { y: props.scroll.y - 450 };
+//   if (props.scroll.y) return { y: props.scroll.y - 100 };
+//   return {};
+// });
+
+watch(
+  () => props.deviceId,
+  async () => {
+    // await getForm().setFieldsValue({});
+    await getDeviceList();
+  }
+);
+
+/** 获取可供查询历史数据的设备列表 */
+async function getDeviceList() {
+  // if (props.deviceType.split('_')[1] && props.deviceType.split('_')[1] === 'history') return;
+  let result;
+  let response;
+  if (props.onlyBounedDevices) {
+    response = await getDeviceListApi({
+      systemID: props.sysId,
+      devicetype: 'sys',
+    }).then(({ msgTxt }) => {
+      return { msgTxt: msgTxt.filter((e) => e.type === props.deviceType) };
+    });
+  } else if (props.sysId) {
+    response = await getDeviceListApi({
+      sysId: props.sysId,
+      devicetype: props.deviceType.startsWith('vehicle') ? 'location_normal' : props.deviceType,
+      pageSize: 10000,
+    });
+  } else if (props.deviceListApi) {
+    response = await props.deviceListApi();
+  } else {
+    response = await getDeviceListApi({ devicetype: props.deviceType, pageSize: 10000 });
+  }
+
+  // 处理不同格式的数据
+  if (response['records'] && response['records'].length > 0) {
+    result = response['records'];
+  } else if (response['msgTxt'] && response['msgTxt'][0] && response['msgTxt'][0]['datalist']) {
+    result = response['msgTxt'][0]['datalist'];
+  }
+  if (response['msgTxt'] && response['msgTxt'][0]) {
+    deviceTypeName.value = response['msgTxt'][0]['typeName'];
+    deviceType.value = response['msgTxt'][0]['type'];
+  }
+
+  if (result) {
+    deviceOptions.value = [];
+    deviceOptions.value = result.map((item, index) => {
+      return {
+        label: item['strinstallpos'],
+        value: item['id'] || item['deviceID'],
+        strtype: item['strtype'] || item['deviceType'],
+        strinstallpos: item['strinstallpos'],
+        devicekind: item['devicekind'],
+        stationtype: item['stationtype'],
+        readData: item['readData'],
+      };
+    });
+
+    stationType.value = deviceOptions.value[0]['stationtype'];
+    if (props.deviceType.startsWith('vehicle')) {
+      historyType.value = 'vehicle';
+    } else {
+      historyType.value = deviceOptions.value[0]['strtype'] || deviceOptions.value[0]['devicekind'];
+    }
+
+    /** 此处使用nextTick是由于可能表单暂未更新,而下面的方法依赖表单项 */
+    nextTick(() => {
+      showCurve.value = calcShowCurveValue();
+      // initHistoryCurveColumns();
+    });
+  }
+  if (VENT_PARAM.historyIsMultiple) {
+    // await getForm().setFieldsValue({
+    //   gdeviceids: [props.deviceId ? props.deviceId : deviceOptions.value[0] ? deviceOptions.value[0]['value'] : ''],
+    // });
+    // await getForm().updateSchema({
+    //   field: 'gdeviceids',
+    //   componentProps: {
+    //     mode: 'multiple',
+    //     maxTagCount: 'responsive',
+    //   },
+    // });
+  } else {
+    // await getForm().setFieldsValue({
+    //   gdeviceids: props.deviceId ? props.deviceId : deviceOptions.value[0] ? deviceOptions.value[0]['value'] : '',
+    // });
+    // await getForm().updateSchema({
+    //   field: 'gdeviceids',
+    // });
+  }
+}
+function handlePageChange(page, size) {
+  console.log('当前页:', page, '每页条数:', size);
+  // 此处发起数据请求
+  pagination.current = page;
+  pagination.pageSize = size;
+  getDataSource();
+}
+function resetFormParam() {
+  const formData = {};
+  formData['pageNo'] = pagination.current;
+  formData['pageSize'] = pagination.pageSize;
+  formData['ttime_begin'] = historyParams.startTime;
+  formData['ttime_end'] = historyParams.endTime;
+  formData['column'] = 'createTime';
+  formData['gdeviceids'] = props.deviceId ? props.deviceId : deviceOptions.value[0] ? deviceOptions.value[0]['value'] : '';
+
+  if (stationType.value !== 'redis' && deviceOptions.value[0]) {
+    formData['strtype'] = deviceTypeStr.value
+      ? deviceTypeStr.value
+      : deviceOptions.value[0]['strtype']
+      ? deviceOptions.value[0]['strtype']
+      : props.deviceType + '*';
+    if (props.sysId) {
+      formData['sysId'] = props.sysId;
+    }
+    return formData;
+  } else {
+    const params = {
+      pageNum: pagination['current'],
+      pageSize: pagination['pageSize'],
+      column: pagination['createTime'],
+      startTime: formData['ttime_begin'],
+      endTime: formData['ttime_end'],
+      deviceId: formData['gdeviceids'],
+      strtype: props.deviceType + '*',
+      sysId: props.sysId,
+      interval: intervalMap.get(formData['skip']) ? intervalMap.get(formData['skip']) : '1h',
+      isEmployee: props.deviceType.startsWith('vehicle') ? false : true,
+    };
+    return params;
+  }
+}
+
+async function getDataSource() {
+  dataSource.value = [];
+  const params = await resetFormParam();
+  if (stationType.value !== 'redis') {
+    const result = await defHttp.get({ url: '/safety/ventanalyMonitorData/listdays', params: params });
+    pagination.total = Math.abs(result['datalist']['total']) || 0;
+    if (result['datalist']['records'].length > 0) {
+      dataSource.value = result['datalist']['records'].map((item: any) => {
+        return Object.assign(item, item['readData']);
+      });
+    } else {
+      dataSource.value = [];
+    }
+  } else {
+    const result = await defHttp.post({ url: '/monitor/history/getHistoryData', params: params });
+    pagination.total = Math.abs(result['total']) || 0;
+    dataSource.value = result['records'] || [];
+  }
+}
+
+watchEffect(() => {
+  if (historyTable.value && dataSource) {
+    const data = dataSource.value || [];
+    emit('change', data);
+  }
+});
+
+onMounted(async () => {
+  await getDeviceList();
+  console.log(deviceOptions.value, 'abacaca');
+  if (deviceOptions.value[0]) {
+    nextTick(async () => {
+      await getDataSource();
+    });
+  }
+});
+</script>
+
+<style scoped lang="less">
+@import '/@/design/theme.less';
+
+:deep(.@{ventSpace}-table-body) {
+  height: auto !important;
+}
+:deep(.zxm-picker) {
+  height: 30px !important;
+}
+.history-table {
+  width: 100%;
+  :deep(.jeecg-basic-table-form-container) {
+    .@{ventSpace}-form {
+      padding: 0 !important;
+      border: none !important;
+      margin-bottom: 0 !important;
+      .@{ventSpace}-picker,
+      .@{ventSpace}-select-selector {
+        width: 100% !important;
+        height: 100%;
+        background: #00000017;
+        border: 1px solid #b7b7b7;
+        input,
+        .@{ventSpace}-select-selection-item,
+        .@{ventSpace}-picker-suffix {
+          color: #fff;
+        }
+        .@{ventSpace}-select-selection-placeholder {
+          color: #ffffffaa;
+        }
+      }
+    }
+    .@{ventSpace}-table-title {
+      min-height: 0 !important;
+    }
+  }
+  .pagination-box {
+    display: flex;
+    justify-content: flex-end;
+    align-items: center;
+    .page-num {
+      border: 1px solid #0090d8;
+      padding: 4px 8px;
+      margin-right: 5px;
+      color: #0090d8;
+    }
+    .btn {
+      margin-right: 10px;
+    }
+  }
+}
+
+.history-chart {
+  background-color: #0090d822;
+  margin: 0 10px;
+}
+
+.charts-container {
+  --image-no-camera_bg: url('/@/assets/images/vent/no-data.png');
+  position: relative;
+  height: 100%;
+  .form-container {
+    display: flex;
+    // justify-content: center;
+    margin-top: 10px !important;
+    margin-bottom: 10px !important;
+  }
+  .charts-box {
+    width: 100%;
+    height: 100%;
+    position: absolute;
+    bottom: 0;
+    top: 0px;
+  }
+
+  .@{ventSpace}-picker,
+  .@{ventSpace}-select-selector {
+    background: #00000017 !important;
+    border: 1px solid @vent-form-item-border !important;
+    input,
+    .@{ventSpace}-select-selection-item,
+    .@{ventSpace}-picker-suffix {
+      color: #fff !important;
+    }
+    .@{ventSpace}-select-selection-placeholder {
+      color: #b7b7b7 !important;
+    }
+  }
+  .@{ventSpace}-select-arrow,
+  .@{ventSpace}-picker-separator {
+    color: #fff !important;
+  }
+}
+
+.no-data {
+  width: 100%;
+  height: 475px;
+  padding-top: 80px;
+  background: var(--image-no-camera_bg) no-repeat;
+  background-position: center;
+  display: flex;
+  justify-content: center;
+  font-size: 50px;
+  color: var(--vent-text-base);
+}
+:deep(.@{ventSpace}-select-dropdown) {
+  color: #000 !important;
+  .@{ventSpace}-select-item {
+    color: #000 !important;
+  }
+}
+.zxm-form-inline .zxm-form-item > .zxm-form-item-label > label {
+  color: #fff !important;
+}
+.page-info {
+  width: 100%;
+  height: 100%;
+}
+</style>

+ 17 - 5
src/views/vent/monitorManager/gateMonitor/gate.data.ts

@@ -290,15 +290,27 @@ export const chartsColumns = [
     dataIndex: 'frontRearDP',
   },
   // {
-  //   legend: '气源压力',
-  //   seriesName: '(MPa)',
-  //   ymax: 50,
-  //   yname: 'MPa',
+  //   legend: '前门推力',
+  //   seriesName: '',
+  //   ymax: 100,
+  //   yname: '前门推力',
+  //   linetype: 'line',
+  //   yaxispos: 'left',
+  //   color: '#37BCF2',
+  //   sort: 1,
+  //   xRotate: 0,
+  //   dataIndex: '1zdqfktl',
+  // },
+  // {
+  //   legend: '后门推力',
+  //   seriesName: '-',
+  //   ymax: 100,
+  //   yname: '后门推力',
   //   linetype: 'line',
   //   yaxispos: 'right',
   //   color: '#FC4327',
   //   sort: 2,
   //   xRotate: 0,
-  //   dataIndex: 'sourcePressure',
+  //   dataIndex: '2zdqfktl',
   // },
 ];

+ 767 - 683
src/views/vent/monitorManager/gateMonitor/index.vue

@@ -290,6 +290,30 @@
               />
             </div>
           </a-tab-pane>
+          <!-- v-if="sysOrgCode === 'sdmtjtswmk'" -->
+          <a-tab-pane v-if="sysOrgCode === 'sdmtjtswmk'" key="2" tab="风门轴反馈推力曲线">
+            <div class="tab-item" v-if="activeKey === '2'">
+              <!-- <div class="history-chart">
+                <BarAndLine
+                  :charts-columns="chartsColumns"
+                  chartsType="history"
+                  :option="Option"
+                  :data-source="sharedData"
+                  height="290px"
+                  :x-axis-prop-type="stationType !== 'redis' ? 'ttime' : 'time'"
+                />
+              </div> -->
+              <HistoryTableChart
+                chartsColumnsType="gate_chart"
+                :dataSource="sharedData"
+                height="100%"
+                :chartsColumns="chartsColumns"
+                device-type="gate"
+                :is-show-child-type="true"
+              >
+              </HistoryTableChart>
+            </div>
+          </a-tab-pane>
         </a-tabs>
       </dv-border-box8>
     </div>
@@ -317,170 +341,188 @@
 </template>
 
 <script setup lang="ts">
-  import { onBeforeUnmount, onUnmounted, onMounted, ref, reactive, nextTick, inject, unref } from 'vue';
-  import MonitorTable from '../comment/MonitorTable.vue';
-  import HistoryTable from '../comment/HistoryTable.vue';
-  import AlarmHistoryTable from '../comment/AlarmHistoryTable.vue';
-  import HandlerHistoryTable from '../comment/HandlerHistoryTable.vue';
-  import AlarmHistoryTableHj from './components/AlarmHistoryTableHj.vue';
-  import HandleModal from './modal.vue';
-  import DeviceBaseInfo from '../comment/components/DeviceBaseInfo.vue';
-  import { mountedThree, addMonitorText, play, destroy, setModelType, computePlay } from './gate.threejs';
-  import { deviceControlApi } from '/@/api/vent/index';
-  import { message } from 'ant-design-vue';
-  import { list, getTableList, cameraList, cameraAddrList } from './gate.api';
-  import lodash from 'lodash';
-  import { setDivHeight } from '/@/utils/event';
-  import { BorderBox8 as DvBorderBox8 } from '@kjgl77/datav-vue3';
-  import { useRouter } from 'vue-router';
-  import LivePlayer from '@liveqing/liveplayer-v3';
-  import { useModal } from '/@/components/Modal';
-  import { useCamera } from '/@/hooks/system/useCamera';
-  import { usePermission } from '/@/hooks/web/usePermission';
-  import { getDictItems } from '/@/api/common/api';
-  import { render } from '/@/utils/common/renderUtils';
-  import { useGlobSetting } from '/@/hooks/setting';
-  import { getDictItemsByCode } from '/@/utils/dict';
-
-  const { hasPermission } = usePermission();
-  const { sysOrgCode } = useGlobSetting();
-  const globalConfig = inject('globalConfig');
-
-  const { currentRoute } = useRouter();
-  const MonitorDataTable = ref();
-  let contrlValue = '';
-  const playerRef = ref();
-  const deviceType = ref('gate');
-  const activeKey = ref('1'); // tab
-  const loading = ref(false);
+import { onBeforeUnmount, onUnmounted, onMounted, ref, reactive, nextTick, inject, unref } from 'vue';
+import MonitorTable from '../comment/MonitorTable.vue';
+import HistoryTable from '../comment/HistoryTable.vue';
+import AlarmHistoryTable from '../comment/AlarmHistoryTable.vue';
+import HandlerHistoryTable from '../comment/HandlerHistoryTable.vue';
+import AlarmHistoryTableHj from './components/AlarmHistoryTableHj.vue';
+import HandleModal from './modal.vue';
+import DeviceBaseInfo from '../comment/components/DeviceBaseInfo.vue';
+import { mountedThree, addMonitorText, play, destroy, setModelType, computePlay } from './gate.threejs';
+import { deviceControlApi } from '/@/api/vent/index';
+import { message } from 'ant-design-vue';
+import { list, getTableList, cameraList, cameraAddrList } from './gate.api';
+import { chartsColumns } from './gate.data';
+import lodash from 'lodash';
+import { setDivHeight } from '/@/utils/event';
+import { BorderBox8 as DvBorderBox8 } from '@kjgl77/datav-vue3';
+import { useRouter } from 'vue-router';
+import LivePlayer from '@liveqing/liveplayer-v3';
+import { useModal } from '/@/components/Modal';
+import { useCamera } from '/@/hooks/system/useCamera';
+import { usePermission } from '/@/hooks/web/usePermission';
+import { getDictItems } from '/@/api/common/api';
+import { render } from '/@/utils/common/renderUtils';
+import { useGlobSetting } from '/@/hooks/setting';
+import { getDictItemsByCode } from '/@/utils/dict';
+import { defHttp } from '/@/utils/http/axios';
+import BarAndLine from '/@/components/chart/BarAndLine.vue';
+import HistoryTableChart from '../comment/HistoryTableChart.vue';
+const { hasPermission } = usePermission();
+const { sysOrgCode } = useGlobSetting();
+const globalConfig = inject('globalConfig');
 
-  const scroll = reactive({
-    y: 230,
-  });
-  const modelList = ref<{ text: string; value: string }[]>([]);
-  const frontDoorIsOpen = ref(false); //前门是否开启
-  const backDoorIsOpen = ref(false); //后门是否开启
-  const midDoorIsOpen = ref(false); //中间门是否开启
-
-  const modalIsShow = ref<boolean>(false); // 是否显示模态框
-  const modalTitle = ref(''); // 模态框标题显示内容,根据设备操作类型决定
-  const modalType = ref(''); // 模态框内容显示类型,设备操作类型
+const { currentRoute } = useRouter();
+const MonitorDataTable = ref();
+let contrlValue = '';
+const playerRef = ref();
+const deviceType = ref('gate');
+const activeKey = ref('1'); // tab
+const loading = ref(false);
+const stationType = ref('plc1');
+const scroll = reactive({
+  y: 230,
+});
+const modelList = ref<{ text: string; value: string }[]>([]);
+const frontDoorIsOpen = ref(false); //前门是否开启
+const backDoorIsOpen = ref(false); //后门是否开启
+const midDoorIsOpen = ref(false); //中间门是否开启
 
-  const selectRowIndex = ref(-1); // 选中行
-  const dataSource = ref([]);
+const modalIsShow = ref<boolean>(false); // 是否显示模态框
+const modalTitle = ref(''); // 模态框标题显示内容,根据设备操作类型决定
+const modalType = ref(''); // 模态框内容显示类型,设备操作类型
 
-  const deviceBaseList = ref([]); // 设备基本信息
-  const [registerModal, { openModal, closeModal }] = useModal();
+const selectRowIndex = ref(-1); // 选中行
+const dataSource = ref([]);
+const sharedData = ref([]);
+const deviceBaseList = ref([]); // 设备基本信息
+const updateSharedData = (data) => {
+  sharedData.value = data;
+};
+const Option = {
+  grid: {
+    top: '20%',
+    left: '5%',
+    right: '5%',
+    bottom: '3%',
+    containLabel: true,
+  },
+  toolbox: {
+    feature: null,
+  },
+};
+const [registerModal, { openModal, closeModal }] = useModal();
 
-  const { getCamera, removeCamera } = useCamera();
+const { getCamera, removeCamera } = useCamera();
 
-  const tabChange = (activeKeyVal) => {
-    activeKey.value = activeKeyVal;
-    if (activeKeyVal == 1) {
-      nextTick(() => {
-        if (MonitorDataTable.value) MonitorDataTable.value.setSelectedRowKeys([selectData.deviceID]);
-      });
-    }
-  };
+const tabChange = (activeKeyVal) => {
+  activeKey.value = activeKeyVal;
+  if (activeKeyVal == 1) {
+    nextTick(() => {
+      if (MonitorDataTable.value) MonitorDataTable.value.setSelectedRowKeys([selectData.deviceID]);
+    });
+  }
+};
 
-  const initData = {
-    deviceID: '',
-    deviceType: '',
-    strname: '',
-    frontRearDP: '-', //压差
-    // sourcePressure: '-', //气源压力
-    runRoRecondition: null,
-    autoRoManual: null,
-    netStatus: '0', //通信状态
-    frontGateOpen: '0',
-    frontGateClose: '1',
-    rearGateOpen: '0',
-    rearGateClose: '1',
-    midGateOpen: '0',
-    midGateClose: '1',
-    fault: '气源压力超限',
-    masterComputer: 0,
-    frontGateOpenCtrl: false,
-    rearGateOpenCtrl: false,
-    cameras: [],
-  };
+const initData = {
+  deviceID: '',
+  deviceType: '',
+  strname: '',
+  frontRearDP: '-', //压差
+  // sourcePressure: '-', //气源压力
+  runRoRecondition: null,
+  autoRoManual: null,
+  netStatus: '0', //通信状态
+  frontGateOpen: '0',
+  frontGateClose: '1',
+  rearGateOpen: '0',
+  rearGateClose: '1',
+  midGateOpen: '0',
+  midGateClose: '1',
+  fault: '气源压力超限',
+  masterComputer: 0,
+  frontGateOpenCtrl: false,
+  rearGateOpenCtrl: false,
+  cameras: [],
+};
 
-  // 监测数据
-  const selectData = reactive(lodash.cloneDeep(initData));
+// 监测数据
+const selectData = reactive(lodash.cloneDeep(initData));
 
-  const flvURL1 = () => {
-    // return ''
-    return `/video/gate.mp4`;
-  };
+const flvURL1 = () => {
+  // return ''
+  return `/video/gate.mp4`;
+};
 
-  function deviceEdit(e: Event, type: string, record) {
-    e.stopPropagation();
-    openModal(true, {
-      type,
-      deviceId: record['deviceID'],
-    });
-  }
-  // 获取设备基本信息列表
-  function getDeviceBaseList() {
-    getTableList({ pageSize: 1000 }).then((res) => {
-      deviceBaseList.value = res.records;
-    });
-  }
+function deviceEdit(e: Event, type: string, record) {
+  e.stopPropagation();
+  openModal(true, {
+    type,
+    deviceId: record['deviceID'],
+  });
+}
+// 获取设备基本信息列表
+function getDeviceBaseList() {
+  getTableList({ pageSize: 1000 }).then((res) => {
+    deviceBaseList.value = res.records;
+  });
+}
 
-  // https获取监测数据
-  let timer: null | NodeJS.Timeout = null;
-  async function getMonitor(flag?) {
-    if (Object.prototype.toString.call(timer) === '[object Null]') {
-      timer = await setTimeout(
-        async () => {
-          const res = await list({ devicetype: deviceType.value, pagetype: 'normal' });
-          if (res.msgTxt && res.msgTxt[0]) {
-            dataSource.value = res.msgTxt[0].datalist || [];
-            dataSource.value.forEach((data: any) => {
-              const readData = data.readData;
-              data = Object.assign(data, readData);
-            });
-            if (dataSource.value.length > 0 && selectRowIndex.value == -1 && MonitorDataTable.value) {
-              // 初始打开页面
-              if (currentRoute.value && currentRoute.value['query'] && currentRoute.value['query']['id']) {
-                MonitorDataTable.value.setSelectedRowKeys([currentRoute.value['query']['id']]);
-              } else {
-                MonitorDataTable.value.setSelectedRowKeys([dataSource.value[0]['deviceID']]);
-              }
-            }
-            Object.assign(selectData, dataSource.value[selectRowIndex.value]);
-            if (selectData.contrlMod == 'jnjhCtrl') {
-              selectData['autoRoManual'] = selectData['autoRoManual'] == 1 ? true : false;
-              selectData['autoRoManual1'] = selectData['autoRoManual1'] == 1 ? true : false;
-              selectData['autoRoManual2'] = selectData['autoRoManual2'] == 1 ? true : false;
-            }
-            addMonitorText(selectData);
-            monitorAnimation(selectData);
-            if (timer) {
-              timer = null;
+// https获取监测数据
+let timer: null | NodeJS.Timeout = null;
+async function getMonitor(flag?) {
+  if (Object.prototype.toString.call(timer) === '[object Null]') {
+    timer = await setTimeout(
+      async () => {
+        const res = await list({ devicetype: deviceType.value, pagetype: 'normal' });
+        if (res.msgTxt && res.msgTxt[0]) {
+          dataSource.value = res.msgTxt[0].datalist || [];
+          dataSource.value.forEach((data: any) => {
+            const readData = data.readData;
+            data = Object.assign(data, readData);
+          });
+          if (dataSource.value.length > 0 && selectRowIndex.value == -1 && MonitorDataTable.value) {
+            // 初始打开页面
+            if (currentRoute.value && currentRoute.value['query'] && currentRoute.value['query']['id']) {
+              MonitorDataTable.value.setSelectedRowKeys([currentRoute.value['query']['id']]);
+            } else {
+              MonitorDataTable.value.setSelectedRowKeys([dataSource.value[0]['deviceID']]);
             }
-            getMonitor();
           }
-        },
-        flag ? 0 : 1000
-      );
-    }
+          Object.assign(selectData, dataSource.value[selectRowIndex.value]);
+          if (selectData.contrlMod == 'jnjhCtrl') {
+            selectData['autoRoManual'] = selectData['autoRoManual'] == 1 ? true : false;
+            selectData['autoRoManual1'] = selectData['autoRoManual1'] == 1 ? true : false;
+            selectData['autoRoManual2'] = selectData['autoRoManual2'] == 1 ? true : false;
+          }
+          addMonitorText(selectData);
+          monitorAnimation(selectData);
+          if (timer) {
+            timer = null;
+          }
+          getMonitor();
+        }
+      },
+      flag ? 0 : 1000
+    );
   }
+}
 
-  // 切换检测数据
-  async function getSelectRow(selectRow, index) {
-    if (!selectRow) return;
-    loading.value = true;
-    selectRowIndex.value = index;
+// 切换检测数据
+async function getSelectRow(selectRow, index) {
+  if (!selectRow) return;
+  loading.value = true;
+  selectRowIndex.value = index;
 
-    const baseData: any = deviceBaseList.value.find((baseData: any) => baseData.id === selectRow.deviceID);
-    Object.assign(selectData, initData, selectRow, baseData);
-    isFrontOpenRunning = false; //开关门动作是否在进行
-    isRearOpenRunning = false; //开关门动作是否在进行
-    isMidOpenRunning = false; //开关门动作是否在进行
-    frontDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
-    rearDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
-    midDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
+  const baseData: any = deviceBaseList.value.find((baseData: any) => baseData.id === selectRow.deviceID);
+  Object.assign(selectData, initData, selectRow, baseData);
+  isFrontOpenRunning = false; //开关门动作是否在进行
+  isRearOpenRunning = false; //开关门动作是否在进行
+  isMidOpenRunning = false; //开关门动作是否在进行
+  frontDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
+  rearDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
+  midDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
 
     let type;
     const dictCodes = getDictItemsByCode('gateStyle');
@@ -546,603 +588,645 @@
       }
     }
     debugger;
-    setModelType(type).then(async () => {
-      addMonitorText(selectData);
-      loading.value = false;
-    });
-    await getCamera(selectRow.deviceID, playerRef.value);
-  }
-
-  // 播放动画
-  function playAnimation(handlerState, data: any = null) {
-    const value = data;
-    switch (handlerState) {
-      case 1: // 打开前门
-        if (selectData.frontGateOpen == '0' && selectData.frontGateClose == '1') {
-          modalTitle.value = '打开前门';
-          modalType.value = '1';
-          modalIsShow.value = true;
-        } else {
-          // message.warning('前门已经打开或正在打开,请勿重新操作');
-          message.warning('没有监测到前门关到位,无法进行指令下发操作');
-        }
         break;
-      case 2: // 关闭前门
-        if (selectData.frontGateOpen == '1' && selectData.frontGateClose == '0') {
-          modalTitle.value = '关闭前门';
-          modalType.value = '2';
-          modalIsShow.value = true;
-        } else {
-          // message.warning('前门已经关闭或正在关闭,请勿重新操作');
-          message.warning('没有监测到前门开到位,无法进行指令下发操作');
-        }
+      case 'fmSs':
+        type = 'fmTwoSs';
         break;
-      case 3: // 打开后门
-        if (selectData.rearGateOpen == '0' && selectData.rearGateClose == '1') {
-          modalTitle.value = '打开后门';
-          modalType.value = '3';
-          modalIsShow.value = true;
-        } else {
-          // message.warning('后门已经打开或正在打开,请勿重新操作');
-          message.warning('没有监测到后门关到位,无法进行指令下发操作');
-        }
+      case 'fm_fc':
+        type = 'fmWindow';
         break;
-      case 4: // 关闭后门
-        if (selectData.rearGateOpen == '1' && selectData.rearGateClose == '0') {
-          modalTitle.value = '关闭后门';
-          modalType.value = '4';
-          modalIsShow.value = true;
-        } else {
-          // message.warning('后门已经关闭或正在关闭,请勿重新操作');
-          message.warning('没有监测到后门开到位,无法进行指令下发操作');
-        }
+      case 'fmXr':
+        type = 'fmXr';
         break;
-      case 8: // 打开中间门
-        if (selectData.midGateOpen == '0' && selectData.midGateClose == '1') {
-          modalTitle.value = '打开中间门';
-          modalType.value = '8';
-          modalIsShow.value = true;
-        } else {
-          // message.warning('后门已经打开或正在打开,请勿重新操作');
-          message.warning('没有监测到中间门关到位,无法进行指令下发操作');
-        }
+      case 'fmYy':
+        type = 'fm1';
         break;
-      case 9: // 关闭中间门
-        if (selectData.midGateOpen == '1' && selectData.midGateClose == '0') {
-          modalTitle.value = '关闭中间门';
-          modalType.value = '9';
-          modalIsShow.value = true;
-        } else {
-          // message.warning('后门已经关闭或正在关闭,请勿重新操作');
-          message.warning('没有监测到中间门开到位,无法进行指令下发操作');
-        }
+      case 'fmSs3':
+        type = 'fm2';
         break;
-      case 5: // 打开前后门
-        if (
-          selectData.frontGateOpen == '0' &&
-          selectData.frontGateClose == '1' &&
-          selectData.rearGateOpen == '0' &&
-          selectData.rearGateClose == '1'
-        ) {
-          modalTitle.value = '打开前后门';
-          modalType.value = '5';
-          modalIsShow.value = true;
-        } else {
-          // message.warning('前后门已经打开或正在打开,请勿重新操作');
-          message.warning('没有监测到前门、后门关到位,无法进行指令下发操作');
-        }
+      case 'fm_fc_hjg':
+        type = 'fmWindowHjg';
         break;
-      case 6: // 关闭前后门
-        if (
-          selectData.frontGateOpen == '1' &&
-          selectData.frontGateClose == '0' &&
-          selectData.rearGateOpen == '1' &&
-          selectData.rearGateClose == '0'
-        ) {
-          modalTitle.value = '关闭前后门';
-          modalType.value = '6';
-          modalIsShow.value = true;
-        } else {
-          // message.warning('前后门已经关闭或正在关闭,请勿重新操作');
-          message.warning('没有监测到前门、后门开到位,无法进行指令下发操作');
-        }
+      case 'fm_fc_zhq':
+        type = 'fmWindowZhq';
         break;
+    }
+  } else {
+    type = selectData.nwindownum == 1 ? 'singleWindow' : 'doubleWindow';
+    if (selectData['doorUse'] == 2) {
+      type = 'fmXr';
+    } else if (selectData.ndoorcount == '3' || selectData.deviceType == 'gate_nomal3') {
+      type = 'fmThreeTl';
+    } else {
+      if (selectData.deviceType == 'gate_ss') {
+        type = 'fm2';
+        // type = 'fmWindow';
+      } else if (selectData.deviceType == 'gate_qd' || selectData.deviceType == 'gate_normal') {
+        type = 'fm3';
+      } else if (selectData.deviceType == 'gate_ss_two' || selectData.deviceType == 'gate_ss_two1') {
+        type = 'fmTwoSs';
+      } else if (selectData.deviceType == 'gate_tj') {
+        type = 'fmWindow';
+      } else {
+        type = 'fm1'; // 液压
+      }
+    }
+  }
+  debugger;
+  setModelType(type).then(async () => {
+    addMonitorText(selectData);
+    loading.value = false;
+  });
+  await getCamera(selectRow.deviceID, playerRef.value);
+}
 
-      case 7: // 控制模式切换
-        modalTitle.value = '控制模式切换';
-        modalType.value = '7';
+// 播放动画
+function playAnimation(handlerState, data: any = null) {
+  const value = data;
+  switch (handlerState) {
+    case 1: // 打开前门
+      if (selectData.frontGateOpen == '0' && selectData.frontGateClose == '1') {
+        modalTitle.value = '打开前门';
+        modalType.value = '1';
         modalIsShow.value = true;
-        break;
-
-      case 10: // 风窗控制
-        modalTitle.value = 'A窗控制';
-        modalType.value = '10';
+      } else {
+        // message.warning('前门已经打开或正在打开,请勿重新操作');
+        message.warning('没有监测到前门关到位,无法进行指令下发操作');
+      }
+      break;
+    case 2: // 关闭前门
+      if (selectData.frontGateOpen == '1' && selectData.frontGateClose == '0') {
+        modalTitle.value = '关闭前门';
+        modalType.value = '2';
         modalIsShow.value = true;
-        break;
-
-      case 11: // 风窗控制
-        modalTitle.value = 'B窗控制';
-        modalType.value = '11';
+      } else {
+        // message.warning('前门已经关闭或正在关闭,请勿重新操作');
+        message.warning('没有监测到前门开到位,无法进行指令下发操作');
+      }
+      break;
+    case 3: // 打开后门
+      if (selectData.rearGateOpen == '0' && selectData.rearGateClose == '1') {
+        modalTitle.value = '打开后门';
+        modalType.value = '3';
         modalIsShow.value = true;
-        break;
-      case 12: // 风窗控制
-        modalTitle.value = 'C窗控制';
-        modalType.value = '12';
+      } else {
+        // message.warning('后门已经打开或正在打开,请勿重新操作');
+        message.warning('没有监测到后门关到位,无法进行指令下发操作');
+      }
+      break;
+    case 4: // 关闭后门
+      if (selectData.rearGateOpen == '1' && selectData.rearGateClose == '0') {
+        modalTitle.value = '关闭后门';
+        modalType.value = '4';
         modalIsShow.value = true;
-        break;
-      case 13: // 风窗控制
-        modalTitle.value = 'D窗控制';
-        modalType.value = '13';
+      } else {
+        // message.warning('后门已经关闭或正在关闭,请勿重新操作');
+        message.warning('没有监测到后门开到位,无法进行指令下发操作');
+      }
+      break;
+    case 8: // 打开中间门
+      if (selectData.midGateOpen == '0' && selectData.midGateClose == '1') {
+        modalTitle.value = '打开中间门';
+        modalType.value = '8';
         modalIsShow.value = true;
-        break;
-    }
+      } else {
+        // message.warning('后门已经打开或正在打开,请勿重新操作');
+        message.warning('没有监测到中间门关到位,无法进行指令下发操作');
+      }
+      break;
+    case 9: // 关闭中间门
+      if (selectData.midGateOpen == '1' && selectData.midGateClose == '0') {
+        modalTitle.value = '关闭中间门';
+        modalType.value = '9';
+        modalIsShow.value = true;
+      } else {
+        // message.warning('后门已经关闭或正在关闭,请勿重新操作');
+        message.warning('没有监测到中间门开到位,无法进行指令下发操作');
+      }
+      break;
+    case 5: // 打开前后门
+      if (selectData.frontGateOpen == '0' && selectData.frontGateClose == '1' && selectData.rearGateOpen == '0' && selectData.rearGateClose == '1') {
+        modalTitle.value = '打开前后门';
+        modalType.value = '5';
+        modalIsShow.value = true;
+      } else {
+        // message.warning('前后门已经打开或正在打开,请勿重新操作');
+        message.warning('没有监测到前门、后门关到位,无法进行指令下发操作');
+      }
+      break;
+    case 6: // 关闭前后门
+      if (selectData.frontGateOpen == '1' && selectData.frontGateClose == '0' && selectData.rearGateOpen == '1' && selectData.rearGateClose == '0') {
+        modalTitle.value = '关闭前后门';
+        modalType.value = '6';
+        modalIsShow.value = true;
+      } else {
+        // message.warning('前后门已经关闭或正在关闭,请勿重新操作');
+        message.warning('没有监测到前门、后门开到位,无法进行指令下发操作');
+      }
+      break;
 
-    if (globalConfig?.simulatedPassword) {
-      handleOK('', handlerState + '');
-    }
-    contrlValue = value;
+    case 7: // 控制模式切换
+      modalTitle.value = '控制模式切换';
+      modalType.value = '7';
+      modalIsShow.value = true;
+      break;
+
+    case 10: // 风窗控制
+      modalTitle.value = 'A窗控制';
+      modalType.value = '10';
+      modalIsShow.value = true;
+      break;
+
+    case 11: // 风窗控制
+      modalTitle.value = 'B窗控制';
+      modalType.value = '11';
+      modalIsShow.value = true;
+      break;
+    case 12: // 风窗控制
+      modalTitle.value = 'C窗控制';
+      modalType.value = '12';
+      modalIsShow.value = true;
+      break;
+    case 13: // 风窗控制
+      modalTitle.value = 'D窗控制';
+      modalType.value = '13';
+      modalIsShow.value = true;
+      break;
   }
-  // 保德缺打开状态
 
-  // function playAnimation(handlerState, data: any = null) {
-  //   const value = data;
-  //   switch (handlerState) {
-  //     case 1: // 打开前门
-  //       modalTitle.value = '打开前门';
-  //       modalType.value = '1';
-  //       modalIsShow.value = true;
-  //       break;
-  //     case 2: // 关闭前门
-  //       modalTitle.value = '关闭前门';
-  //       modalType.value = '2';
-  //       modalIsShow.value = true;
-  //       break;
-  //     case 3: // 打开后门
-  //       modalTitle.value = '打开后门';
-  //       modalType.value = '3';
-  //       modalIsShow.value = true;
-  //       break;
-  //     case 4: // 关闭后门
-  //       modalTitle.value = '关闭后门';
-  //       modalType.value = '4';
-  //       modalIsShow.value = true;
-  //       break;
-  //     case 8: // 打开中间门
-  //       modalTitle.value = '打开中间门';
-  //       modalType.value = '8';
-  //       modalIsShow.value = true;
-  //       break;
-  //     case 9: // 关闭中间门
-  //       modalTitle.value = '关闭中间门';
-  //       modalType.value = '9';
-  //       modalIsShow.value = true;
-  //       break;
-  //     case 5: // 打开前后门
-  //       modalTitle.value = '打开前后门';
-  //       modalType.value = '5';
-  //       modalIsShow.value = true;
-  //       break;
-  //     case 6: // 关闭前后门
-  //       modalTitle.value = '关闭前后门';
-  //       modalType.value = '6';
-  //       modalIsShow.value = true;
-  //       break;
+  if (globalConfig?.simulatedPassword) {
+    handleOK('', handlerState + '');
+  }
+  contrlValue = value;
+}
+// 保德缺打开状态
 
-  //     case 7: // 控制模式切换
-  //       modalTitle.value = '控制模式切换';
-  //       modalType.value = '7';
-  //       modalIsShow.value = true;
-  //       break;
-  //     case 10: // 风窗控制
-  //       modalTitle.value = '风窗控制';
-  //       modalType.value = '10';
-  //       modalIsShow.value = true;
-  //       break;
-  //   }
+// function playAnimation(handlerState, data: any = null) {
+//   const value = data;
+//   switch (handlerState) {
+//     case 1: // 打开前门
+//       modalTitle.value = '打开前门';
+//       modalType.value = '1';
+//       modalIsShow.value = true;
+//       break;
+//     case 2: // 关闭前门
+//       modalTitle.value = '关闭前门';
+//       modalType.value = '2';
+//       modalIsShow.value = true;
+//       break;
+//     case 3: // 打开后门
+//       modalTitle.value = '打开后门';
+//       modalType.value = '3';
+//       modalIsShow.value = true;
+//       break;
+//     case 4: // 关闭后门
+//       modalTitle.value = '关闭后门';
+//       modalType.value = '4';
+//       modalIsShow.value = true;
+//       break;
+//     case 8: // 打开中间门
+//       modalTitle.value = '打开中间门';
+//       modalType.value = '8';
+//       modalIsShow.value = true;
+//       break;
+//     case 9: // 关闭中间门
+//       modalTitle.value = '关闭中间门';
+//       modalType.value = '9';
+//       modalIsShow.value = true;
+//       break;
+//     case 5: // 打开前后门
+//       modalTitle.value = '打开前后门';
+//       modalType.value = '5';
+//       modalIsShow.value = true;
+//       break;
+//     case 6: // 关闭前后门
+//       modalTitle.value = '关闭前后门';
+//       modalType.value = '6';
+//       modalIsShow.value = true;
+//       break;
 
-  //   if (globalConfig?.simulatedPassword) {
-  //     handleOK('', handlerState + '');
-  //   }
-  //   contrlValue = value;
-  // }
+//     case 7: // 控制模式切换
+//       modalTitle.value = '控制模式切换';
+//       modalType.value = '7';
+//       modalIsShow.value = true;
+//       break;
+//     case 10: // 风窗控制
+//       modalTitle.value = '风窗控制';
+//       modalType.value = '10';
+//       modalIsShow.value = true;
+//       break;
+//   }
 
-  function handleOK(passWord, handlerState, value?) {
-    if (!passWord && !globalConfig?.simulatedPassword) {
-      message.warning('请输入密码');
-      return;
-    }
-    if (isOpenRunning) {
-      message.warning('风门正在运行。。。');
-      modalIsShow.value = false;
-      return;
-    }
-    const data = {
-      deviceid: selectData.deviceID,
-      devicetype: selectData.deviceType,
-      paramcode: '',
-      value: contrlValue,
-      password: passWord || globalConfig?.simulatedPassword,
-      masterComputer: selectData.masterComputer,
-    };
-    let handler = () => {};
-    debugger;
+//   if (globalConfig?.simulatedPassword) {
+//     handleOK('', handlerState + '');
+//   }
+//   contrlValue = value;
+// }
 
-    switch (handlerState) {
-      case '1': // 打开前门
-        if (selectData.frontGateOpen == '0' && selectData.frontGateClose == '1') {
-          handler = () => {
-            frontDoorIsOpen.value = true;
-          };
-          data.paramcode = 'frontGateOpen_S';
-        } else {
-          message.warning('前门已打开。。。');
-          modalIsShow.value = false;
-        }
-        break;
-      case '2': // 关闭前门
-        if (selectData.frontGateOpen == '1' && selectData.frontGateClose == '0') {
-          handler = () => {
-            frontDoorIsOpen.value = false;
-          };
-          data.paramcode = 'frontGateClose_S';
-        } else {
-          message.warning('前门已关闭。。。');
-          modalIsShow.value = false;
-        }
-        break;
-      case '3': // 打开后门
-        if (selectData.rearGateOpen == '0' && selectData.rearGateClose == '1') {
-          handler = () => {
-            backDoorIsOpen.value = true;
-          };
-          data.paramcode = 'rearGateOpen_S';
-        } else {
-          message.warning('后门已打开。。。');
-          modalIsShow.value = false;
-        }
-        break;
-      case '4': // 关闭后门
-        if (selectData.rearGateOpen == '1' && selectData.rearGateClose == '0') {
-          handler = () => {
-            backDoorIsOpen.value = false;
-          };
-          data.paramcode = 'rearGateClose_S';
-        } else {
-          message.warning('后门已关闭。。。');
-          modalIsShow.value = false;
-        }
-        break;
-      case '8': // 打开中间门
-        if (selectData.midGateOpen == '0' && selectData.midGateClose == '1') {
-          handler = () => {
-            midDoorIsOpen.value = true;
-          };
-          data.paramcode = 'midGateOpen_S';
-        } else {
-          message.warning('中间风门已打开。。。');
-          modalIsShow.value = false;
-        }
-        break;
-      case '9': // 关闭中间门
-        if (selectData.midGateOpen == '1' && selectData.midGateClose == '0') {
-          handler = () => {
-            midDoorIsOpen.value = false;
-          };
-          data.paramcode = 'midGateClose_S';
-        } else {
-          message.warning('中间风门已关闭。。。');
-          modalIsShow.value = false;
-        }
-        break;
-      case '5': // 打开前后门
-        if (
-          selectData.frontGateOpen == '0' &&
-          selectData.frontGateClose == '1' &&
-          selectData.rearGateOpen == '0' &&
-          selectData.rearGateClose == '1'
-        ) {
-          handler = () => {
-            frontDoorIsOpen.value = true;
-            backDoorIsOpen.value = true;
-          };
-          data.paramcode = 'sameTimeOpen';
-        }
-        break;
-      case '6': // 关闭前后门
-        if (
-          selectData.frontGateOpen == '1' &&
-          selectData.frontGateClose == '0' &&
-          selectData.rearGateOpen == '1' &&
-          selectData.rearGateClose == '0'
-        ) {
-          handler = () => {
-            frontDoorIsOpen.value = false;
-            backDoorIsOpen.value = false;
-          };
-          data.paramcode = 'sameTimeClose';
-        }
-        break;
-      case '7': // 远程与就地
-        if (selectData.contrlMod == 'codeCtrl') {
-          if (contrlValue == '1') {
-            data.paramcode = 'autoRoManualControl1';
-          } else if (contrlValue == '0') {
-            data.paramcode = 'autoRoManualControl2';
-          } else {
-            data.paramcode = 'autoRoManualControl0';
-          }
-          data.value = '';
-          selectData.autoRoManual = null;
-        } else if (selectData.contrlMod == 'loopCtrl' || selectData.contrlMod == 'jnjhCtrl') {
-          data.paramcode = 'autoRoManualControl';
-          data.value = '';
-          selectData.autoRoManual = null;
+function handleOK(passWord, handlerState, value?) {
+  if (!passWord && !globalConfig?.simulatedPassword) {
+    message.warning('请输入密码');
+    return;
+  }
+  if (isOpenRunning) {
+    message.warning('风门正在运行。。。');
+    modalIsShow.value = false;
+    return;
+  }
+  const data = {
+    deviceid: selectData.deviceID,
+    devicetype: selectData.deviceType,
+    paramcode: '',
+    value: contrlValue,
+    password: passWord || globalConfig?.simulatedPassword,
+    masterComputer: selectData.masterComputer,
+  };
+  let handler = () => {};
+  debugger;
+
+  switch (handlerState) {
+    case '1': // 打开前门
+      if (selectData.frontGateOpen == '0' && selectData.frontGateClose == '1') {
+        handler = () => {
+          frontDoorIsOpen.value = true;
+        };
+        data.paramcode = 'frontGateOpen_S';
+      } else {
+        message.warning('前门已打开。。。');
+        modalIsShow.value = false;
+      }
+      break;
+    case '2': // 关闭前门
+      if (selectData.frontGateOpen == '1' && selectData.frontGateClose == '0') {
+        handler = () => {
+          frontDoorIsOpen.value = false;
+        };
+        data.paramcode = 'frontGateClose_S';
+      } else {
+        message.warning('前门已关闭。。。');
+        modalIsShow.value = false;
+      }
+      break;
+    case '3': // 打开后门
+      if (selectData.rearGateOpen == '0' && selectData.rearGateClose == '1') {
+        handler = () => {
+          backDoorIsOpen.value = true;
+        };
+        data.paramcode = 'rearGateOpen_S';
+      } else {
+        message.warning('后门已打开。。。');
+        modalIsShow.value = false;
+      }
+      break;
+    case '4': // 关闭后门
+      if (selectData.rearGateOpen == '1' && selectData.rearGateClose == '0') {
+        handler = () => {
+          backDoorIsOpen.value = false;
+        };
+        data.paramcode = 'rearGateClose_S';
+      } else {
+        message.warning('后门已关闭。。。');
+        modalIsShow.value = false;
+      }
+      break;
+    case '8': // 打开中间门
+      if (selectData.midGateOpen == '0' && selectData.midGateClose == '1') {
+        handler = () => {
+          midDoorIsOpen.value = true;
+        };
+        data.paramcode = 'midGateOpen_S';
+      } else {
+        message.warning('中间风门已打开。。。');
+        modalIsShow.value = false;
+      }
+      break;
+    case '9': // 关闭中间门
+      if (selectData.midGateOpen == '1' && selectData.midGateClose == '0') {
+        handler = () => {
+          midDoorIsOpen.value = false;
+        };
+        data.paramcode = 'midGateClose_S';
+      } else {
+        message.warning('中间风门已关闭。。。');
+        modalIsShow.value = false;
+      }
+      break;
+    case '5': // 打开前后门
+      if (selectData.frontGateOpen == '0' && selectData.frontGateClose == '1' && selectData.rearGateOpen == '0' && selectData.rearGateClose == '1') {
+        handler = () => {
+          frontDoorIsOpen.value = true;
+          backDoorIsOpen.value = true;
+        };
+        data.paramcode = 'sameTimeOpen';
+      }
+      break;
+    case '6': // 关闭前后门
+      if (selectData.frontGateOpen == '1' && selectData.frontGateClose == '0' && selectData.rearGateOpen == '1' && selectData.rearGateClose == '0') {
+        handler = () => {
+          frontDoorIsOpen.value = false;
+          backDoorIsOpen.value = false;
+        };
+        data.paramcode = 'sameTimeClose';
+      }
+      break;
+    case '7': // 远程与就地
+      if (selectData.contrlMod == 'codeCtrl') {
+        if (contrlValue == '1') {
+          data.paramcode = 'autoRoManualControl1';
+        } else if (contrlValue == '0') {
+          data.paramcode = 'autoRoManualControl2';
         } else {
-          data.paramcode = 'autoRoManualControl';
-          data.value = contrlValue;
-          selectData.autoRoManual = null;
+          data.paramcode = 'autoRoManualControl0';
         }
-        break;
-      case '10': // 前(A)窗控制
-        data.paramcode = 'frontSetValue1';
-        data.value = value;
-        break;
-      case '11': // 后(B)窗控制
-        data.paramcode = 'frontSetValue2';
-        data.value = value;
-        break;
-      case '12': // 后(B)窗控制
-        data.paramcode = 'rearSetValue1';
-        data.value = value;
-        break;
-      case '13': // 后(B)窗控制
-        data.paramcode = 'rearSetValue2';
-        data.value = value;
-        break;
-    }
+        data.value = '';
+        selectData.autoRoManual = null;
+      } else if (selectData.contrlMod == 'loopCtrl' || selectData.contrlMod == 'jnjhCtrl') {
+        data.paramcode = 'autoRoManualControl';
+        data.value = '';
+        selectData.autoRoManual = null;
+      } else {
+        data.paramcode = 'autoRoManualControl';
+        data.value = contrlValue;
+        selectData.autoRoManual = null;
+      }
+      break;
+    case '10': // 前(A)窗控制
+      data.paramcode = 'frontSetValue1';
+      data.value = value;
+      break;
+    case '11': // 后(B)窗控制
+      data.paramcode = 'frontSetValue2';
+      data.value = value;
+      break;
+    case '12': // 后(B)窗控制
+      data.paramcode = 'rearSetValue1';
+      data.value = value;
+      break;
+    case '13': // 后(B)窗控制
+      data.paramcode = 'rearSetValue2';
+      data.value = value;
+      break;
+  }
 
-    if (data.paramcode) {
-      deviceControlApi(data).then((res) => {
-        // 模拟时开启
-        if (res.success) {
-          modalIsShow.value = false;
-          if (globalConfig.History_Type == 'remote') {
-            message.success('指令已下发至生产管控平台成功!');
-          } else {
-            message.success('指令已下发成功!');
-          }
+  if (data.paramcode) {
+    deviceControlApi(data).then((res) => {
+      // 模拟时开启
+      if (res.success) {
+        modalIsShow.value = false;
+        if (globalConfig.History_Type == 'remote') {
+          message.success('指令已下发至生产管控平台成功!');
         } else {
-          message.error(res.message);
+          message.success('指令已下发成功!');
         }
-      });
-    }
+      } else {
+        message.error(res.message);
+      }
+    });
   }
-  let isOpenRunning = false; //开关门动作是否在进行
-  /** 开关门动画调用 */
-  let isFrontOpenRunning = false; //开关门动作是否在进行
-  // let isFrontCloseRunning = false; //开关门动作是否在进行
-  let isRearOpenRunning = false; //开关门动作是否在进行
-  // let isRearCloseRunning = false; //开关门动作是否在进行
-  let isMidOpenRunning = false; //中间门动作是否在进行
-  // let isMidCloseRunning = false; //中间门动作是否在进行
-  // 0 关闭 1 正在打开 2 打开 3正在关闭
-  let frontDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
-  let rearDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
-  let midDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
-  function monitorAnimation(selectData) {
-    const timeScale = 0.005;
-    // 带风窗 风窗动画
-    if (selectData['gateStyle'] && selectData['gateStyle'].includes('fm_fc')) playWindowAnimation(selectData);
+}
+let isOpenRunning = false; //开关门动作是否在进行
+/** 开关门动画调用 */
+let isFrontOpenRunning = false; //开关门动作是否在进行
+// let isFrontCloseRunning = false; //开关门动作是否在进行
+let isRearOpenRunning = false; //开关门动作是否在进行
+// let isRearCloseRunning = false; //开关门动作是否在进行
+let isMidOpenRunning = false; //中间门动作是否在进行
+// let isMidCloseRunning = false; //中间门动作是否在进行
+// 0 关闭 1 正在打开 2 打开 3正在关闭
+let frontDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
+let rearDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
+let midDeviceState = 0; //记录设备状态,为了与下一次监测数据做比较
+function monitorAnimation(selectData) {
+  const timeScale = 0.005;
+  // 带风窗 风窗动画
+  if (selectData['gateStyle'] && selectData['gateStyle'].includes('fm_fc')) playWindowAnimation(selectData);
 
-    if (selectData.frontGateOpen == '1' && selectData.frontGateClose == '0' && !isFrontOpenRunning) {
-      isFrontOpenRunning = true;
-      if (frontDeviceState != 1) {
-        // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(1, timeScale) : play(1);
-        play(1, timeScale);
-        frontDeviceState = 1;
-        frontDoorIsOpen.value = false;
-        backDoorIsOpen.value = true;
-      }
+  if (selectData.frontGateOpen == '1' && selectData.frontGateClose == '0' && !isFrontOpenRunning) {
+    isFrontOpenRunning = true;
+    if (frontDeviceState != 1) {
+      // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(1, timeScale) : play(1);
+      play(1, timeScale);
+      frontDeviceState = 1;
+      frontDoorIsOpen.value = false;
+      backDoorIsOpen.value = true;
     }
+  }
 
-    if (selectData.frontGateOpen == '0' && selectData.frontGateClose == '0' && !isFrontOpenRunning) {
-      isFrontOpenRunning = true;
-      if (frontDeviceState != 1) {
-        // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(1, timeScale) : play(1);
-        play(1, timeScale);
-        frontDeviceState = 1;
-        frontDoorIsOpen.value = false;
-        backDoorIsOpen.value = true;
-      }
+  if (selectData.frontGateOpen == '0' && selectData.frontGateClose == '0' && !isFrontOpenRunning) {
+    isFrontOpenRunning = true;
+    if (frontDeviceState != 1) {
+      // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(1, timeScale) : play(1);
+      play(1, timeScale);
+      frontDeviceState = 1;
+      frontDoorIsOpen.value = false;
+      backDoorIsOpen.value = true;
     }
+  }
 
-    if (selectData.frontGateClose == '1' && selectData.frontGateOpen == '0' && isFrontOpenRunning) {
-      isFrontOpenRunning = false;
-      if (frontDeviceState != 0) {
-        // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(2, timeScale) : play(2);
-        play(2, timeScale);
-        frontDeviceState = 0;
-        frontDoorIsOpen.value = false;
-        // backDoorIsOpen.value = false
-      }
+  if (selectData.frontGateClose == '1' && selectData.frontGateOpen == '0' && isFrontOpenRunning) {
+    isFrontOpenRunning = false;
+    if (frontDeviceState != 0) {
+      // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(2, timeScale) : play(2);
+      play(2, timeScale);
+      frontDeviceState = 0;
+      frontDoorIsOpen.value = false;
+      // backDoorIsOpen.value = false
     }
-    if (selectData.rearGateOpen == '1' && selectData.rearGateClose == '0' && !isRearOpenRunning) {
-      isRearOpenRunning = true;
+  }
+  if (selectData.rearGateOpen == '1' && selectData.rearGateClose == '0' && !isRearOpenRunning) {
+    isRearOpenRunning = true;
 
-      if (rearDeviceState != 1) {
-        rearDeviceState = 1;
-        // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
-        play(3, timeScale);
-        backDoorIsOpen.value = false;
-        frontDoorIsOpen.value = true;
-      }
+    if (rearDeviceState != 1) {
+      rearDeviceState = 1;
+      // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
+      play(3, timeScale);
+      backDoorIsOpen.value = false;
+      frontDoorIsOpen.value = true;
     }
-    if (selectData.rearGateOpen == '0' && selectData.rearGateClose == '0' && !isRearOpenRunning) {
-      isRearOpenRunning = true;
+  }
+  if (selectData.rearGateOpen == '0' && selectData.rearGateClose == '0' && !isRearOpenRunning) {
+    isRearOpenRunning = true;
 
-      if (rearDeviceState != 1) {
-        rearDeviceState = 1;
-        // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
-        play(3, timeScale);
-        backDoorIsOpen.value = false;
-        frontDoorIsOpen.value = true;
-      }
+    if (rearDeviceState != 1) {
+      rearDeviceState = 1;
+      // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
+      play(3, timeScale);
+      backDoorIsOpen.value = false;
+      frontDoorIsOpen.value = true;
     }
+  }
 
-    if (selectData.rearGateClose == '1' && selectData.rearGateOpen == '0' && isRearOpenRunning) {
-      isRearOpenRunning = false;
-      if (rearDeviceState != 0) {
-        rearDeviceState = 0;
-        // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(4, timeScale) : play(4);
-        play(4, timeScale);
-        backDoorIsOpen.value = false;
-      }
+  if (selectData.rearGateClose == '1' && selectData.rearGateOpen == '0' && isRearOpenRunning) {
+    isRearOpenRunning = false;
+    if (rearDeviceState != 0) {
+      rearDeviceState = 0;
+      // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(4, timeScale) : play(4);
+      play(4, timeScale);
+      backDoorIsOpen.value = false;
     }
+  }
 
-    if (selectData.midGateOpen == '1' && selectData.midGateClose == '0' && !isMidOpenRunning) {
-      isMidOpenRunning = true;
+  if (selectData.midGateOpen == '1' && selectData.midGateClose == '0' && !isMidOpenRunning) {
+    isMidOpenRunning = true;
 
-      if (midDeviceState != 1) {
-        midDeviceState = 1;
-        // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
-        play(8, timeScale);
-        backDoorIsOpen.value = false;
-        frontDoorIsOpen.value = true;
-      }
+    if (midDeviceState != 1) {
+      midDeviceState = 1;
+      // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
+      play(8, timeScale);
+      backDoorIsOpen.value = false;
+      frontDoorIsOpen.value = true;
     }
+  }
 
-    if (selectData.midGateOpen == '0' && selectData.midGateClose == '0' && !isMidOpenRunning) {
-      isMidOpenRunning = true;
+  if (selectData.midGateOpen == '0' && selectData.midGateClose == '0' && !isMidOpenRunning) {
+    isMidOpenRunning = true;
 
-      if (midDeviceState != 1) {
-        midDeviceState = 1;
-        // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
-        play(8, timeScale);
-        backDoorIsOpen.value = false;
-        frontDoorIsOpen.value = true;
-      }
+    if (midDeviceState != 1) {
+      midDeviceState = 1;
+      // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(3, timeScale) : play(3);
+      play(8, timeScale);
+      backDoorIsOpen.value = false;
+      frontDoorIsOpen.value = true;
     }
+  }
 
-    if (selectData.midGateClose == '1' && selectData.midGateOpen == '0' && isMidOpenRunning) {
-      isMidOpenRunning = false;
-      if (midDeviceState != 0) {
-        midDeviceState = 0;
-        // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(4, timeScale) : play(4);
-        play(9, timeScale);
-        backDoorIsOpen.value = false;
-      }
+  if (selectData.midGateClose == '1' && selectData.midGateOpen == '0' && isMidOpenRunning) {
+    isMidOpenRunning = false;
+    if (midDeviceState != 0) {
+      midDeviceState = 0;
+      // import.meta.env.VITE_GLOB_IS_SIMULATE ? play(4, timeScale) : play(4);
+      play(9, timeScale);
+      backDoorIsOpen.value = false;
     }
   }
+}
 
-  function playWindowAnimation(data, maxarea = 90, isFirst = false) {
-    computePlay(data, maxarea, isFirst);
-  }
+function playWindowAnimation(data, maxarea = 90, isFirst = false) {
+  computePlay(data, maxarea, isFirst);
+}
 
-  function handleCancel() {
-    modalIsShow.value = false;
-    modalTitle.value = '';
-    modalType.value = '';
-  }
+function handleCancel() {
+  modalIsShow.value = false;
+  modalTitle.value = '';
+  modalType.value = '';
+}
 
-  // // 远程、就地切换
-  // function changeType() {
-  //   const data = {
-  //     deviceid: selectData.deviceID,
-  //     devicetype: selectData.deviceType,
-  //     paramcode: 'autoRoManualControl',
-  //     value: selectData.autoRoManual,
-  //   };
-  //   deviceControlApi(data).then(() => {
-  //     if (globalConfig.History_Type == 'remote') {
-  //       message.success('指令已下发至生产管控平台成功!');
-  //     } else {
-  //       message.success('指令已下发成功!');
-  //     }
-  //   });
-  // }
+// // 远程、就地切换
+// function changeType() {
+//   const data = {
+//     deviceid: selectData.deviceID,
+//     devicetype: selectData.deviceType,
+//     paramcode: 'autoRoManualControl',
+//     value: selectData.autoRoManual,
+//   };
+//   deviceControlApi(data).then(() => {
+//     if (globalConfig.History_Type == 'remote') {
+//       message.success('指令已下发至生产管控平台成功!');
+//     } else {
+//       message.success('指令已下发成功!');
+//     }
+//   });
+// }
 
-  onMounted(async () => {
-    const { query } = unref(currentRoute);
-    if (query['deviceType']) deviceType.value = query['deviceType'] as string;
-    modelList.value = await getDictItems('gateModel');
-    loading.value = true;
-    const playerDom = document.getElementById('fm-player1')?.getElementsByClassName('vjs-tech')[0];
-    debugger;
-    mountedThree(playerDom)
-      .then(async () => {
-        if (sysOrgCode != 'zmhjhzmy') {
-          await getMonitor(true);
+// async function getDataSource() {
+//   dataSource.value = [];
+//   const params = await resetFormParam();
+//   if (stationType.value !== 'redis') {
+//     const result = await defHttp.get({ url: '/safety/ventanalyMonitorData/listdays', params: params });
+//     if (result['datalist']['records'].length > 0) {
+//       dataSource.value = result['datalist']['records'].map((item: any) => {
+//         return Object.assign(item, item['readData']);
+//       });
+//     } else {
+//       dataSource.value = [];
+//     }
+//   } else {
+//     const result = await defHttp.post({ url: '/monitor/history/getHistoryData', params: params });
+//     dataSource.value = result['records'] || [];
+//   }
+// }
+onMounted(async () => {
+  const { query } = unref(currentRoute);
+  if (query['deviceType']) deviceType.value = query['deviceType'] as string;
+  modelList.value = await getDictItems('gateModel');
+  loading.value = true;
+  const playerDom = document.getElementById('fm-player1')?.getElementsByClassName('vjs-tech')[0];
+  debugger;
+  mountedThree(playerDom)
+    .then(async () => {
+      if (sysOrgCode != 'zmhjhzmy') {
+        await getMonitor(true);
+        loading.value = false;
+      } else {
+        // 韩咀无风门设备,只有报警历史数据,无其他数据
+        setModelType('fm1').then(async () => {
           loading.value = false;
-        } else {
-          // 韩咀无风门设备,只有报警历史数据,无其他数据
-          setModelType('fm1').then(async () => {
-            loading.value = false;
-            dataSource.value = [];
-            addMonitorText(selectData);
-          });
-        }
-      })
-      .catch(() => {
-        debugger;
-      });
-  });
+          dataSource.value = [];
+          addMonitorText(selectData);
+        });
+      }
+    })
+    .catch(() => {
+      debugger;
+    });
+});
 
-  onBeforeUnmount(() => {
-    getDeviceBaseList();
-  });
+onBeforeUnmount(() => {
+  getDeviceBaseList();
+});
 
-  onUnmounted(() => {
-    removeCamera();
-    if (timer) {
-      clearTimeout(timer);
-      timer = undefined;
-    }
-    destroy();
-  });
+onUnmounted(() => {
+  removeCamera();
+  if (timer) {
+    clearTimeout(timer);
+    timer = undefined;
+  }
+  destroy();
+});
 </script>
 ,
 <style lang="less" scoped>
-  @import '/@/design/theme.less';
-  @import '/@/design/vent/modal.less';
-  .scene-box {
-    .bottom-tabs-box {
-      height: 350px;
-    }
+@import '/@/design/theme.less';
+@import '/@/design/vent/modal.less';
+.scene-box {
+  .bottom-tabs-box {
+    height: 350px;
   }
-  .button-box {
-    border: none !important;
-    height: 34px !important;
-
-    &:hover {
-      background: var(--vent-device-manager-control-btn-hover) !important;
-    }
+}
+.button-box {
+  border: none !important;
+  height: 34px !important;
 
-    &::before {
-      height: 27px !important;
-      background: var(--vent-device-manager-control-btn) !important;
-    }
-
-    &::after {
-      top: 35px !important;
-    }
+  &:hover {
+    background: var(--vent-device-manager-control-btn-hover) !important;
   }
 
-  :deep(.@{ventSpace}-tabs-tabpane-active) {
-    height: 100%;
+  &::before {
+    height: 27px !important;
+    background: var(--vent-device-manager-control-btn) !important;
   }
 
-  ::-webkit-scrollbar-thumb {
-    -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
-    background: #4288a444;
-  }
-  :deep(.zxm-radio-disabled + span) {
-    color: var(--vent-font-color) !important;
-  }
-  :deep(.zxm-radio-disabled .zxm-radio-inner::after) {
-    background-color: #127cb5 !important;
-  }
-  :deep(.@{ventSpace}-picker-datetime-panel) {
-    height: 200px !important;
-    overflow-y: auto !important;
+  &::after {
+    top: 35px !important;
   }
+}
+
+:deep(.@{ventSpace}-tabs-tabpane-active) {
+  height: 100%;
+}
+
+::-webkit-scrollbar-thumb {
+  -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
+  background: #4288a444;
+}
+:deep(.zxm-radio-disabled + span) {
+  color: var(--vent-font-color) !important;
+}
+:deep(.zxm-radio-disabled .zxm-radio-inner::after) {
+  background-color: #127cb5 !important;
+}
+:deep(.@{ventSpace}-picker-datetime-panel) {
+  height: 200px !important;
+  overflow-y: auto !important;
+}
 </style>

+ 81 - 81
src/views/vent/monitorManager/mainFanMonitor/components/AnalysisTable.vue

@@ -1,95 +1,95 @@
 <template>
   <div class="alarm-history-table">
-    <a-table :dataSource="mockData" :columns="Warncolumns" :scroll="{ y: 180 }" />
+    <a-table :dataSource="mockData" :columns="Warncolumns" :scroll="{ y: 300 }"> </a-table>
   </div>
 </template>
 
 <script setup lang="ts">
-  import { ref } from 'vue';
+import { ref } from 'vue';
 
-  const Warncolumns = ref([
-    {
-      title: '序号',
-      align: 'center',
-      key: 'index',
-      width: 80,
-      customRender: ({ index }) => {
-        return index + 1;
-      },
+const Warncolumns = ref([
+  {
+    title: '序号',
+    align: 'center',
+    key: 'index',
+    width: 80,
+    customRender: ({ index }) => {
+      return index + 1;
     },
-    {
-      title: '设备名称',
-      align: 'center',
-      width: 200,
-      customRender: () => '羊马河主通风机',
+  },
+  {
+    title: '设备名称',
+    align: 'center',
+    width: 200,
+    customRender: () => '羊马河主通风机',
+  },
+  {
+    title: '故障描述',
+    align: 'center',
+    customRender: ({ record }) => {
+      const activeFaults = record.title;
+      return activeFaults;
     },
-    {
-      title: '故障描述',
-      align: 'center',
-      customRender: ({ record }) => {
-        const activeFaults = record.title;
-        return activeFaults;
-      },
+  },
+  {
+    title: '故障原因',
+    align: 'center',
+    key: 'faultStatus',
+    customRender: ({ record }) => {
+      const activeFaults = record.faultStatus;
+      return activeFaults;
     },
-    {
-      title: '故障原因',
-      align: 'center',
-      key: 'faultStatus',
-      customRender: ({ record }) => {
-        const activeFaults = record.faultStatus;
-        return activeFaults;
-      },
+  },
+  {
+    title: '解决方案',
+    align: 'center',
+    key: 'netStatus',
+    customRender: ({ record }) => {
+      const activeFaults = record.netStatus;
+      return activeFaults;
     },
-    {
-      title: '解决方案',
-      align: 'center',
-      key: 'netStatus',
-      customRender: ({ record }) => {
-        const activeFaults = record.netStatus;
-        return activeFaults;
-      },
+  },
+  {
+    title: '时间',
+    align: 'center',
+    key: 'readTime',
+    customRender: () => {
+      const now = new Date();
+      return now.toLocaleString(); // 格式化为本地时间字符串
     },
-    {
-      title: '时间',
-      align: 'center',
-      key: 'readTime',
-      customRender: () => {
-        const now = new Date();
-        return now.toLocaleString(); // 格式化为本地时间字符串
-      },
-    },
-  ]);
+  },
+]);
 
-  const mockData = [
-    {
-      key: 0,
-      title: '水平或垂直振动>6mm',
-      faultStatus: '通风阻力增大;静压值低于正常运行值100pa',
-      netStatus: '检查相关参数传感器、增大风机运行频率',
-    },
-    {
-      key: 1,
-      title: '前轴/后轴温度>70℃',
-      faultStatus: '缺乏润滑脂或轴承损坏',
-      netStatus: '检查轴承润滑脂状态、检查轴承是否损坏、检查相关参数传感器',
-    },
-    {
-      key: 2,
-      title: '前轴/后轴温度>105℃',
-      faultStatus: '轴承损坏',
-      netStatus: '检查轴承是否损坏',
-    },
-    {
-      key: 3,
-      title: '水平或垂直振动>8mm,且变化范围较大',
-      faultStatus: '电机轴承发生损坏;风机扇叶发生损坏',
-      netStatus: '检查振动传感器、检查电机轴承、检查风机扇叶',
-    },
-    {
-      key: 4,
-      title: '额定电压超过额定值的10%时',
-      faultStatus: '电网电压出现出现异常或者通风阻力增大',
-      netStatus: '检查相关参数传感器、检查电网电压',
-    },
-  ];
+const mockData = [
+  {
+    key: 0,
+    title: '水平或垂直振动>6mm',
+    faultStatus: '通风阻力增大;静压值低于正常运行值100pa',
+    netStatus: '检查相关参数传感器、增大风机运行频率',
+  },
+  {
+    key: 1,
+    title: '前轴/后轴温度>70℃',
+    faultStatus: '缺乏润滑脂或轴承损坏',
+    netStatus: '检查轴承润滑脂状态、检查轴承是否损坏、检查相关参数传感器',
+  },
+  {
+    key: 2,
+    title: '前轴/后轴温度>105℃',
+    faultStatus: '轴承损坏',
+    netStatus: '检查轴承是否损坏',
+  },
+  {
+    key: 3,
+    title: '水平或垂直振动>8mm,且变化范围较大',
+    faultStatus: '电机轴承发生损坏;风机扇叶发生损坏',
+    netStatus: '检查振动传感器、检查电机轴承、检查风机扇叶',
+  },
+  {
+    key: 4,
+    title: '额定电压超过额定值的10%时',
+    faultStatus: '电网电压出现出现异常或者通风阻力增大',
+    netStatus: '检查相关参数传感器、检查电网电压',
+  },
+];
 </script>