3 Комити 2d2622bd70 ... 6e671587c6

Аутор SHA1 Порука Датум
  bobo04052021@163.com 6e671587c6 [Feat 0000]测风装置规程值设置功能 пре 5 дана
  bobo04052021@163.com 96b9608c9f 合并冲突 пре 1 недеља
  bobo04052021@163.com b94d515fde [Feat 0000]测风装置规程值设置功能 пре 1 недеља

+ 1 - 1
.env.development

@@ -9,7 +9,7 @@ VITE_PUBLIC_PATH = /
 VITE_PROXY = [["/sw","http://182.92.126.35:6008"],["/jeecgsystem","http://182.92.126.35:9999"],["/upload","http://182.92.126.35:9999/upload"],["/documents", "http://182.92.126.35:9050"],["/modelreq", "http://182.92.126.35:9999"],["/webRtc", "http://182.92.126.35:8051"], ["/python", "http://127.0.0.1:8008"], ["/tun2D", "http://127.0.0.1:8088/micro-vent-2dModal/tun2D"]]
 # VITE_PROXY = [["/jeecgsystem","http://192.168.183.88:9999"],["/upload","http://192.168.183.88:9999/upload"],["/documents", "http://192.168.183.88:9050"],["/modelreq", "http://192.168.183.88:9999"],["/webRtc", "http://192.168.183.88:8051"]]
 # VITE_PROXY = [["/jeecgsystem","http://10.10.150.72:9999"],["/upload","http://localhost:3300/upload"],["/documents", "http://10.10.150.72:9050"],["/modelreq", "http://10.10.150.72:9999"],["/webRtc", "http://192.168.183.216:8051"]]
-#VITE_PROXY = [["/jeecgsystem","http://192.168.1.8:9999"],["/upload","http://localhost:3300/upload"]]
+# VITE_PROXY = [["/jeecgsystem","http://192.168.1.8:9999"],["/upload","http://localhost:3300/upload"]]
 
 # 控制台不输出  
 VITE_DROP_CONSOLE = false

+ 21 - 3
src/views/vent/deviceManager/comment/warningTabel/warning.data.ts

@@ -48,11 +48,29 @@ export const levelColumns: BasicColumn[] = [
   },
   {
     title: '报警类型',
-    width: 180,
-    editRow: true,
+    // width: 180,
+    // editRow: true,
+    // dataIndex: 'alarm_type',
+    // editRule: true,
+    // editComponent: 'ApiSelect',
+    // editComponentProps: { api: initDictOptions.bind(null, 'alarm_type'), labelField: 'label', valueField: 'value' },
     dataIndex: 'alarm_type',
+    editRow: true,
+    editRule: true,
+    width: 100,
     editComponent: 'ApiSelect',
-    editComponentProps: { api: initDictOptions.bind(null, 'alarm_type') },
+    editComponentProps: {
+      api: initDictOptions.bind(null, 'alarm_type'),
+      labelField: 'label',
+      valueField: 'value',
+    },
+  },
+  {
+    title: '关联字段',
+    width: 180,
+    editRow: true,
+    dataIndex: 'relatedCode',
+    editComponent: 'Input',
   },
   {
     title: '是否语音播报',

+ 3 - 0
src/views/vent/deviceManager/substationTabel/substation.api.ts

@@ -11,6 +11,7 @@ enum Api {
   exportXls = '/sys/user/exportXls',
   addDevice = '/safety/ventanalySubStation/addDeviceBystation',
   getHistory = '/safety/ventanalyAlarmLog/list',
+  getRegulation = '/monitor/getDeviceRegulation',
 }
 /**
  * 导出api
@@ -36,6 +37,8 @@ export const deleteById = (params, handleSuccess) => {
     handleSuccess();
   });
 };
+export const getRegulation = () => defHttp.post({ url: Api.getRegulation });
+
 /**
  * 批量删除用户
  * @param params

+ 308 - 297
src/views/vent/monitorManager/comment/components/DeviceBaseInfo.vue

@@ -11,322 +11,333 @@
   </BasicModal>
 </template>
 <script lang="ts" setup>
-  import { onMounted, ref, defineEmits, onUnmounted, watch, computed } from 'vue';
-  import { BasicModal, useModalInner } from '/@/components/Modal';
-  import { BasicForm, useForm } from '/@/components/Form/index';
-  import { FormSchema } from '/@/components/Form';
-  import { getFormSchemaColumns } from '/@/hooks/web/useWebColumns';
-  import { list as substationList } from '/@/views/vent/deviceManager/substationTabel/substation.api';
-  import { list, updateDeviceInfo, updateReportInfo } from '../comment.api';
-  import { getAutoScrollContainer } from '/@/utils/common/compUtils';
+import { onMounted, ref, defineEmits, onUnmounted, watch, computed } from 'vue';
+import { BasicModal, useModalInner } from '/@/components/Modal';
+import { BasicForm, useForm } from '/@/components/Form/index';
+import { FormSchema } from '/@/components/Form';
+import { getFormSchemaColumns } from '/@/hooks/web/useWebColumns';
+import { list as substationList } from '/@/views/vent/deviceManager/substationTabel/substation.api';
+import { getRegulation as getRegulationList } from '/@/views/vent/deviceManager/substationTabel/substation.api';
+import { list, updateDeviceInfo, updateReportInfo } from '../comment.api';
+import { getAutoScrollContainer } from '/@/utils/common/compUtils';
 
-  const emit = defineEmits(['close', 'register']);
-  const props = defineProps({
-    // formSchema: {
-    //   type: Array as PropType<FormSchema[]>,
-    //   default: () => [],
-    // },
-    deviceType: {
-      type: String,
-      default: '',
-    },
-  });
-  const FormRef = ref();
-  const tabType = ref('deviceInfo');
-  const formSchema = ref<Array<FormSchema>>([]);
-  const formData = ref({});
-  // const props.deviceType ref('');
-  const deviceType = computed(() => props.deviceType);
+const emit = defineEmits(['close', 'register']);
+const props = defineProps({
+  // formSchema: {
+  //   type: Array as PropType<FormSchema[]>,
+  //   default: () => [],
+  // },
+  deviceType: {
+    type: String,
+    default: '',
+  },
+});
+const FormRef = ref();
+const tabType = ref('deviceInfo');
+const formSchema = ref<Array<FormSchema>>([]);
+const formData = ref({});
+// const props.deviceType ref('');
+const deviceType = computed(() => props.deviceType);
 
-  // const arrToFormColumns = (tableHeaderColumns = [], devicetype) => {
-  //   const columnList: any[] = [];
-  //   tableHeaderColumns.forEach((item: any) => {
-  //     let columnsItem;
-  //     if (item.type == 1 || item.type == 10) {
-  //       columnsItem = {
-  //         label: item.des, //_dictText
-  //         field: item.monitorcode,
-  //         component: item.type == 1 ? 'Input' : item.type == 10 ? 'InputTextArea' : '',
-  //       };
-  //     } else {
-  //       if (item.type == 2 && item['monitorcode'] == 'nsubstationid') {
-  //         columnsItem = {
-  //           label: item.des, //_dictText
-  //           field: item.monitorcode,
-  //           component: 'ApiSelect',
-  //           componentProps: {
-  //             api: substationList,
-  //             labelField: 'strname',
-  //             valueField: 'id',
-  //           },
-  //         };
-  //       }
-  //       if (item.type == 3) {
-  //         columnsItem = {
-  //           label: item.des, //_dictText
-  //           field: item.monitorcode,
-  //           component: 'RadioGroup',
-  //           defaultValue: 1,
-  //           componentProps: () => {
-  //             return {
-  //               options: [
-  //                 { label: '是', value: 1, key: '1' },
-  //                 { label: '否', value: 0, key: '2' },
-  //               ],
-  //               stringToNumber: true,
-  //             };
-  //           },
-  //         };
-  //       }
-  //       if (item.type == 4) {
-  //         columnsItem = {
-  //           label: item.des, //_dictText
-  //           field: item.monitorcode,
-  //           component: 'JDictSelectTag',
-  //           componentProps: {
-  //             dictCode: item.dict,
-  //             placeholder: '请选择',
-  //             stringToNumber: true,
-  //           },
-  //         };
-  //       }
-  //     }
-  //     columnList.push(columnsItem);
-  //   });
-  //   formSchema.value = columnList
-  //   if(tabType.value === 'deviceInfo'){
-  //     formSchema.value.unshift(
-  //       {
-  //         label: '设备id', //_dictText
-  //         field: 'id',
-  //         component: 'Input',
-  //         componentProps: {
-  //           disabled: true,
-  //           show: false
-  //         },
-  //       },
-  //       {
-  //         label: '点表',
-  //         field: 'strtype',
-  //         component: 'JDictSelectTag',
-  //         componentProps: {
-  //           dictCode: `${devicetype.split('_')[0]}kind`,
-  //           placeholder: '请选择点表',
-  //         },
-  //       })
-  //       formSchema.value.push(
-  //       {
-  //         label: '备用分站',
-  //         field: 'stationids',
-  //         component: 'ApiSelect',
-  //         componentProps: {
-  //           api: substationList,
-  //           labelField: 'strname',
-  //           valueField: 'id',
-  //         },
-  //       },
-  //     )
-  //   }else{
-  //     formSchema.value.unshift(
-  //       {
-  //         label: '设备id', //_dictText
-  //         field: 'id',
-  //         component: 'Input',
-  //         componentProps: {
-  //           disabled: true,
-  //           show: false
-  //         },
-  //       })
-  //   }
-  // };
+// const arrToFormColumns = (tableHeaderColumns = [], devicetype) => {
+//   const columnList: any[] = [];
+//   tableHeaderColumns.forEach((item: any) => {
+//     let columnsItem;
+//     if (item.type == 1 || item.type == 10) {
+//       columnsItem = {
+//         label: item.des, //_dictText
+//         field: item.monitorcode,
+//         component: item.type == 1 ? 'Input' : item.type == 10 ? 'InputTextArea' : '',
+//       };
+//     } else {
+//       if (item.type == 2 && item['monitorcode'] == 'nsubstationid') {
+//         columnsItem = {
+//           label: item.des, //_dictText
+//           field: item.monitorcode,
+//           component: 'ApiSelect',
+//           componentProps: {
+//             api: substationList,
+//             labelField: 'strname',
+//             valueField: 'id',
+//           },
+//         };
+//       }
+//       if (item.type == 3) {
+//         columnsItem = {
+//           label: item.des, //_dictText
+//           field: item.monitorcode,
+//           component: 'RadioGroup',
+//           defaultValue: 1,
+//           componentProps: () => {
+//             return {
+//               options: [
+//                 { label: '是', value: 1, key: '1' },
+//                 { label: '否', value: 0, key: '2' },
+//               ],
+//               stringToNumber: true,
+//             };
+//           },
+//         };
+//       }
+//       if (item.type == 4) {
+//         columnsItem = {
+//           label: item.des, //_dictText
+//           field: item.monitorcode,
+//           component: 'JDictSelectTag',
+//           componentProps: {
+//             dictCode: item.dict,
+//             placeholder: '请选择',
+//             stringToNumber: true,
+//           },
+//         };
+//       }
+//     }
+//     columnList.push(columnsItem);
+//   });
+//   formSchema.value = columnList
+//   if(tabType.value === 'deviceInfo'){
+//     formSchema.value.unshift(
+//       {
+//         label: '设备id', //_dictText
+//         field: 'id',
+//         component: 'Input',
+//         componentProps: {
+//           disabled: true,
+//           show: false
+//         },
+//       },
+//       {
+//         label: '点表',
+//         field: 'strtype',
+//         component: 'JDictSelectTag',
+//         componentProps: {
+//           dictCode: `${devicetype.split('_')[0]}kind`,
+//           placeholder: '请选择点表',
+//         },
+//       })
+//       formSchema.value.push(
+//       {
+//         label: '备用分站',
+//         field: 'stationids',
+//         component: 'ApiSelect',
+//         componentProps: {
+//           api: substationList,
+//           labelField: 'strname',
+//           valueField: 'id',
+//         },
+//       },
+//     )
+//   }else{
+//     formSchema.value.unshift(
+//       {
+//         label: '设备id', //_dictText
+//         field: 'id',
+//         component: 'Input',
+//         componentProps: {
+//           disabled: true,
+//           show: false
+//         },
+//       })
+//   }
+// };
 
-  const arrToFormColumns = (tableHeaderColumns = []) => {
-    const columnList: any[] = [];
-    tableHeaderColumns.forEach((item: any) => {
-      let columnsItem;
-      if (item.type == 1 || item.type == 10) {
+const arrToFormColumns = (tableHeaderColumns = []) => {
+  const columnList: any[] = [];
+  tableHeaderColumns.forEach((item: any) => {
+    let columnsItem;
+    if (item.type == 1 || item.type == 10) {
+      columnsItem = {
+        label: item.des, //_dictText
+        field: item.monitorcode,
+        component: item.type == 1 ? 'Input' : item.type == 10 ? 'InputTextArea' : '',
+      };
+    } else {
+      if (item.type == 2 && item['monitorcode'] == 'nsubstationid') {
         columnsItem = {
           label: item.des, //_dictText
           field: item.monitorcode,
-          component: item.type == 1 ? 'Input' : item.type == 10 ? 'InputTextArea' : '',
+          component: 'ApiSelect',
+          componentProps: {
+            api: substationList,
+            labelField: 'strname',
+            valueField: 'id',
+          },
         };
-      } else {
-        if (item.type == 2 && item['monitorcode'] == 'nsubstationid') {
-          columnsItem = {
-            label: item.des, //_dictText
-            field: item.monitorcode,
-            component: 'ApiSelect',
-            componentProps: {
-              api: substationList,
-              labelField: 'strname',
-              valueField: 'id',
-            },
-          };
-        }
-        if (item.type == 3) {
-          columnsItem = {
-            label: item.des, //_dictText
-            field: item.monitorcode,
-            component: 'RadioGroup',
-            defaultValue: 1,
-            componentProps: () => {
-              return {
-                options: [
-                  { label: '是', value: 1, key: '1' },
-                  { label: '否', value: 0, key: '2' },
-                ],
-                stringToNumber: true,
-              };
-            },
-          };
-        }
-        if (item.type == 4) {
-          columnsItem = {
-            label: item.des, //_dictText
-            field: item.monitorcode,
-            component: 'JDictSelectTag',
-            componentProps: {
-              dictCode: item.dict,
-              placeholder: '请选择',
-              // stringToNumber: true,
-            },
-          };
-        }
-        // date日期
-        if (item.type == 8) {
-          columnsItem = {
-            label: item.des, //_dictText
-            field: item.monitorcode,
-            component: 'DatePicker',
-            componentProps: {
-              showTime: false,
-              valueFormat: 'YYYY-MM-DD',
-              getPopupContainer: getAutoScrollContainer,
-            },
-          };
-        }
-        // 日期+时间
-        if (item.type == 9) {
-          columnsItem = {
-            label: item.des, //_dictText
-            field: item.monitorcode,
-            component: 'DatePicker',
-            componentProps: {
-              showTime: true,
-              valueFormat: 'YYYY-MM-DD HH:mm:ss',
-              getPopupContainer: getAutoScrollContainer,
-            },
-          };
-        }
       }
-      columnList.push(columnsItem);
-    });
-    formSchema.value = columnList;
-    formSchema.value.unshift(
-      {
-        label: '设备id', //_dictText
-        field: 'id',
-        component: 'Input',
-        componentProps: {
-          disabled: true,
-        },
-      },
-      {
-        label: '点表',
-        field: 'strtype',
-        component: 'JDictSelectTag',
-        componentProps: {
-          dictCode: `${deviceType.value.split('_')[0]}kind`, //${deviceType.value}kind
-          placeholder: '请选择点表',
-          // stringToNumber: true,
-        },
+      if (item.type == 3) {
+        columnsItem = {
+          label: item.des, //_dictText
+          field: item.monitorcode,
+          component: 'RadioGroup',
+          defaultValue: 1,
+          componentProps: () => {
+            return {
+              options: [
+                { label: '是', value: 1, key: '1' },
+                { label: '否', value: 0, key: '2' },
+              ],
+              stringToNumber: true,
+            };
+          },
+        };
       }
-    );
-    formSchema.value.push(
-      {
-        label: '备用分站',
-        field: 'stationids',
-        component: 'ApiSelect',
-        componentProps: {
-          api: substationList,
-          labelField: 'strname',
-          valueField: 'id',
-        },
-      },
-      {
-        label: '是否显示',
-        field: 'linkId',
-        component: 'RadioGroup',
-        defaultValue: 1,
-        componentProps: () => {
-          return {
-            options: [
-              { label: '是', value: 1, key: '1' },
-              { label: '否', value: 0, key: '2' },
-            ],
-            stringToNumber: true,
-          };
-        },
+      if (item.type == 4) {
+        columnsItem = {
+          label: item.des, //_dictText
+          field: item.monitorcode,
+          component: 'JDictSelectTag',
+          componentProps: {
+            dictCode: item.dict,
+            placeholder: '请选择',
+            // stringToNumber: true,
+          },
+        };
+      }
+      // date日期
+      if (item.type == 8) {
+        columnsItem = {
+          label: item.des, //_dictText
+          field: item.monitorcode,
+          component: 'DatePicker',
+          componentProps: {
+            showTime: false,
+            valueFormat: 'YYYY-MM-DD',
+            getPopupContainer: getAutoScrollContainer,
+          },
+        };
+      }
+      // 日期+时间
+      if (item.type == 9) {
+        columnsItem = {
+          label: item.des, //_dictText
+          field: item.monitorcode,
+          component: 'DatePicker',
+          componentProps: {
+            showTime: true,
+            valueFormat: 'YYYY-MM-DD HH:mm:ss',
+            getPopupContainer: getAutoScrollContainer,
+          },
+        };
       }
-    );
-  };
-  // 注册 modal
-  const [register, { closeModal, setModalProps }] = useModalInner(async (data) => {
-    tabType.value = data.type;
-    const deviceId = data.deviceId;
-    if (FormRef.value) {
-      setModalProps({ confirmLoading: false });
-      getColumns();
-      resetSchema(formSchema.value);
-      resetFields();
-      const result = await list({ id: deviceId });
-      formData.value = result['records'][0];
-      await setFieldsValue({
-        ...formData.value,
-      });
     }
+    columnList.push(columnsItem);
   });
-
-  const [registerForm, { resetSchema, getFieldsValue, setFieldsValue, resetFields }] = useForm({
-    schemas: formSchema.value,
-    showActionButtonGroup: false,
-  });
-
-  function getColumns() {
-    let formSchemaArr = getFormSchemaColumns(tabType.value === 'deviceInfo' ? `${props.deviceType}_edit` : `${props.deviceType}_input`) || [];
-    if (formSchemaArr && formSchemaArr.length < 1) {
-      const arr = props.deviceType.split('_');
-      formSchemaArr = getFormSchemaColumns(tabType.value === 'deviceInfo' ? arr[0] + '_edit' : arr[0] + '_input') || [];
+  formSchema.value = columnList;
+  formSchema.value.unshift(
+    {
+      label: '设备id', //_dictText
+      field: 'id',
+      component: 'Input',
+      componentProps: {
+        disabled: true,
+      },
+    },
+    {
+      label: '点表',
+      field: 'strtype',
+      component: 'JDictSelectTag',
+      componentProps: {
+        dictCode: `${deviceType.value.split('_')[0]}kind`, //${deviceType.value}kind
+        placeholder: '请选择点表',
+        // stringToNumber: true,
+      },
+    },
+    {
+      label: '规程值',
+      field: 'regulation',
+      component: 'ApiSelect',
+      componentProps: {
+        api: getRegulationList,
+        labelField: 'name',
+        valueField: 'id',
+      },
     }
-    arrToFormColumns(formSchemaArr);
-  }
-
-  watch(
-    () => props.deviceType,
-    () => {
-      getColumns();
-      if (FormRef.value) resetSchema(formSchema.value);
+  );
+  formSchema.value.push(
+    {
+      label: '备用分站',
+      field: 'stationids',
+      component: 'ApiSelect',
+      componentProps: {
+        api: substationList,
+        labelField: 'strname',
+        valueField: 'id',
+      },
+    },
+    {
+      label: '是否显示',
+      field: 'linkId',
+      component: 'RadioGroup',
+      defaultValue: 1,
+      componentProps: () => {
+        return {
+          options: [
+            { label: '是', value: 1, key: '1' },
+            { label: '否', value: 0, key: '2' },
+          ],
+          stringToNumber: true,
+        };
+      },
     }
   );
+};
+// 注册 modal
+const [register, { closeModal, setModalProps }] = useModalInner(async (data) => {
+  tabType.value = data.type;
+  const deviceId = data.deviceId;
+  if (FormRef.value) {
+    setModalProps({ confirmLoading: false });
+    getColumns();
+    resetSchema(formSchema.value);
+    resetFields();
+    const result = await list({ id: deviceId });
+    formData.value = result['records'][0];
+    await setFieldsValue({
+      ...formData.value,
+    });
+  }
+});
 
-  async function onSubmit() {
-    let formValue = getFieldsValue();
-    setModalProps({ confirmLoading: true });
-    if (tabType.value === 'deviceInfo') {
-      await updateDeviceInfo(formValue);
-    } else {
-      await updateReportInfo(formValue);
-    }
+const [registerForm, { resetSchema, getFieldsValue, setFieldsValue, resetFields }] = useForm({
+  schemas: formSchema.value,
+  showActionButtonGroup: false,
+});
 
-    setModalProps({ confirmLoading: false });
-    emit('close');
-    closeModal();
+function getColumns() {
+  let formSchemaArr = getFormSchemaColumns(tabType.value === 'deviceInfo' ? `${props.deviceType}_edit` : `${props.deviceType}_input`) || [];
+  if (formSchemaArr && formSchemaArr.length < 1) {
+    const arr = props.deviceType.split('_');
+    formSchemaArr = getFormSchemaColumns(tabType.value === 'deviceInfo' ? arr[0] + '_edit' : arr[0] + '_input') || [];
+  }
+  arrToFormColumns(formSchemaArr);
+}
+
+watch(
+  () => props.deviceType,
+  () => {
+    getColumns();
+    if (FormRef.value) resetSchema(formSchema.value);
   }
+);
+
+async function onSubmit() {
+  let formValue = getFieldsValue();
+  setModalProps({ confirmLoading: true });
+  if (tabType.value === 'deviceInfo') {
+    await updateDeviceInfo(formValue);
+  } else {
+    await updateReportInfo(formValue);
+  }
+
+  setModalProps({ confirmLoading: false });
+  emit('close');
+  closeModal();
+}
 
-  onMounted(async () => {});
-  onUnmounted(() => {});
+onMounted(async () => {});
+onUnmounted(() => {});
 </script>
 <style scoped lang="less">
-  @import '/@/design/theme.less';
-  @import '/@/design/vent/modal.less';
+@import '/@/design/theme.less';
+@import '/@/design/vent/modal.less';
 </style>

+ 695 - 635
src/views/vent/monitorManager/windrectMonitor/index.vue

@@ -151,716 +151,776 @@
 </template>
 
 <script setup lang="ts">
-  import DeviceEcharts from '../comment/DeviceEcharts.vue';
-  import { unref, onBeforeMount, ref, onMounted, onUnmounted, reactive, toRaw, nextTick, inject } from 'vue';
-  import { BasicModal, useModalInner } from '/@/components/Modal';
-  import MonitorTable from '../comment/MonitorTable.vue';
-  import ModalTable from './components/modalTable.vue';
-  import HandleModal from './components/modal.vue';
-  import DeviceBaseInfo from '../comment/components/DeviceBaseInfo.vue';
-  import ResultTable from './components/resultTable.vue';
-  import HistoryTable from '../comment/HistoryTable.vue';
-  import AlarmHistoryTable from '../comment/AlarmHistoryTable.vue';
-  import AlarmNumTable from '../comment/AlarmNumTable.vue';
-  import HandlerHistoryTable from '../comment/HandlerHistoryTable.vue';
-  import { deviceControlApi } from '/@/api/vent/index';
-  import { mountedThree, destroy, addMonitorText, play, setModelType, playCamera } from './windrect.threejs';
-  import { list, pathList, deviceList, testWind, exportXls, resetWind } from './windrect.api';
-  import { message, Progress } from 'ant-design-vue';
-  import { chartsColumns, chartsColumnsHistory, option } from './windrect.data';
-  import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
-  import { setDivHeight } from '/@/utils/event';
-  import { BorderBox8 as DvBorderBox8 } from '@kjgl77/datav-vue3';
-  import { useRouter } from 'vue-router';
-  import { useModal } from '/@/components/Modal';
-  import { useCamera } from '/@/hooks/system/useCamera';
-  import { usePermission } from '/@/hooks/web/usePermission';
-  import { useGlobSetting } from '/@/hooks/setting';
-  const { hasPermission } = usePermission();
-
-  const globalConfig = inject('globalConfig');
-
-  const { sysOrgCode } = useGlobSetting();
-  const { currentRoute } = useRouter();
-
-  const MonitorDataTable = ref();
-  const scroll = reactive({
-    y: 230,
-  });
-  const modalType = ref('');
-  const modalIsShow = ref(false);
-  const modalTable = ref();
-  const runNum = ref(5); //设备运行数量
-  const criticalPathList = ref([]);
-  const playerRef = ref();
-  const activeKey = ref('1');
-  const loading = ref(false);
-  // 默认初始是第一行
-  const selectRowIndex = ref(-1);
-  // 监测数据
-  const selectData = reactive({
-    deviceID: '',
-    deviceType: '',
-    strname: '',
-    dataDh: '-', //压差
-    dataDtestq: '-', //测试风量
-    // sourcePressure: '-', //气源压力
-    dataDequivalarea: '-',
-    netStatus: '0', //通信状态
-    fault: '气源压力超限',
-    sign: -1,
-    sensorRight: 0,
-    sensorMiddle: 1,
-    sensorLeft: 0,
-  });
-  const deviceType = ref('windrect');
-  const deviceId = ref('');
-  const chartsColumnArr = getTableHeaderColumns('windrect_chart');
-  const chartsColumnList = ref(chartsColumnArr.length > 0 ? chartsColumnArr : chartsColumns);
-
-  // const dataSource = computed(() => {
-  //   const data = [...getRecordList()] || [];
-  //   Object.assign(selectData, toRaw(data[selectRowIndex.value]));
-  //   addMonitorText(selectData);
-  //   return data;
-  // });
-
-  const dataSource = ref([]);
-  const [regModal, { openModal }] = useModal();
-
-  const { getCamera, removeCamera } = useCamera();
-  const tabChange = (activeKeyVal) => {
-    activeKey.value = activeKeyVal;
-    if (activeKeyVal == 1) {
-      nextTick(() => {
-        MonitorDataTable.value.setSelectedRowKeys([selectData.deviceID]);
-      });
-    }
-  };
-
-  // 设备数据
-  const controlType = ref(1);
-  //表单赋值
-  const [registerModal, { setModalProps, closeModal }] = useModalInner();
-
-  // https获取监测数据
-  let timer: null | NodeJS.Timeout = null;
-  function getMonitor(flag?) {
-    if (Object.prototype.toString.call(timer) === '[object Null]') {
-      timer = setTimeout(
-        () => {
-          list({ devicetype: deviceType.value, pagetype: 'normal' }).then((res) => {
-            if (res && res.msgTxt[0]) {
-              // dataSource.value = res.msgTxt[0].datalist || [];
-              const getData = res.msgTxt[0].datalist || [];
-              getData.forEach((data) => {
-                if (data.limits) {
-                  const limitsKeys = Object.keys(data.limits);
-                  limitsKeys.forEach((limitKey) => {
-                    const limit = data.limits[limitKey];
-                    if (limit && Array.isArray(limit.limitlevels)) {
-                      // 确保 data.readData 已初始化
-                      data.readData = data.readData || {};
-                      limit.limitlevels.forEach((item) => {
-                        if (item && item.alarmType) {
-                          // 拼接字段名并存入readData
-                          data.readData[`${item.alarmType}_fmin`] = item.fmin;
-                          data.readData[`${item.alarmType}_fmax`] = item.fmax;
-                        }
-                      });
-                    }
-                  });
-                  return data;
-                }
-              });
-              dataSource.value = getData;
-              if (dataSource.value.length > 0) {
-                dataSource.value.forEach((data: any) => {
-                  const readData = data.readData;
-                  data = Object.assign(data, readData);
-                });
-                if (dataSource.value.length > 0 && selectRowIndex.value == -1) {
-                  // 初始打开页面
-                  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']]);
-                  }
-                }
-                const data: any = toRaw(dataSource.value[selectRowIndex.value]); //maxarea
-                Object.assign(selectData, data);
-                addMonitorText(selectData);
-
-                palyAnimation(selectData);
-              }
-            }
-            if (timer) {
-              timer = null;
+import DeviceEcharts from '../comment/DeviceEcharts.vue';
+import { unref, onBeforeMount, ref, onMounted, onUnmounted, reactive, toRaw, nextTick, inject } from 'vue';
+import { BasicModal, useModalInner } from '/@/components/Modal';
+import MonitorTable from '../comment/MonitorTable.vue';
+import ModalTable from './components/modalTable.vue';
+import HandleModal from './components/modal.vue';
+import DeviceBaseInfo from '../comment/components/DeviceBaseInfo.vue';
+import ResultTable from './components/resultTable.vue';
+import HistoryTable from '../comment/HistoryTable.vue';
+import AlarmHistoryTable from '../comment/AlarmHistoryTable.vue';
+import AlarmNumTable from '../comment/AlarmNumTable.vue';
+import HandlerHistoryTable from '../comment/HandlerHistoryTable.vue';
+import { deviceControlApi } from '/@/api/vent/index';
+import { mountedThree, destroy, addMonitorText, play, setModelType, playCamera } from './windrect.threejs';
+import { list, pathList, deviceList, testWind, exportXls, resetWind, getRegulation } from './windrect.api';
+import { message, Progress } from 'ant-design-vue';
+import { chartsColumns, chartsColumnsHistory, option } from './windrect.data';
+import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
+import { setDivHeight } from '/@/utils/event';
+import { BorderBox8 as DvBorderBox8 } from '@kjgl77/datav-vue3';
+import { useRouter } from 'vue-router';
+import { useModal } from '/@/components/Modal';
+import { useCamera } from '/@/hooks/system/useCamera';
+import { usePermission } from '/@/hooks/web/usePermission';
+import { useGlobSetting } from '/@/hooks/setting';
+const { hasPermission } = usePermission();
+
+const globalConfig = inject('globalConfig');
+
+const { sysOrgCode } = useGlobSetting();
+const { currentRoute } = useRouter();
+
+const MonitorDataTable = ref();
+const scroll = reactive({
+  y: 230,
+});
+const modalType = ref('');
+const modalIsShow = ref(false);
+const modalTable = ref();
+const runNum = ref(5); //设备运行数量
+const criticalPathList = ref([]);
+const playerRef = ref();
+const activeKey = ref('1');
+const loading = ref(false);
+// 默认初始是第一行
+const selectRowIndex = ref(-1);
+// 监测数据
+const selectData = reactive({
+  deviceID: '',
+  deviceType: '',
+  strname: '',
+  dataDh: '-', //压差
+  dataDtestq: '-', //测试风量
+  // sourcePressure: '-', //气源压力
+  dataDequivalarea: '-',
+  netStatus: '0', //通信状态
+  fault: '气源压力超限',
+  sign: -1,
+  sensorRight: 0,
+  sensorMiddle: 1,
+  sensorLeft: 0,
+});
+const deviceType = ref('windrect');
+const deviceId = ref('');
+const chartsColumnArr = getTableHeaderColumns('windrect_chart');
+const chartsColumnList = ref(chartsColumnArr.length > 0 ? chartsColumnArr : chartsColumns);
+
+// const dataSource = computed(() => {
+//   const data = [...getRecordList()] || [];
+//   Object.assign(selectData, toRaw(data[selectRowIndex.value]));
+//   addMonitorText(selectData);
+//   return data;
+// });
+
+const dataSource = ref([]);
+const [regModal, { openModal }] = useModal();
+
+const { getCamera, removeCamera } = useCamera();
+const tabChange = (activeKeyVal) => {
+  activeKey.value = activeKeyVal;
+  if (activeKeyVal == 1) {
+    nextTick(() => {
+      MonitorDataTable.value.setSelectedRowKeys([selectData.deviceID]);
+    });
+  }
+};
+
+// 设备数据
+const controlType = ref(1);
+//表单赋值
+const [registerModal, { setModalProps, closeModal }] = useModalInner();
+
+// https获取监测数据
+let timer: null | NodeJS.Timeout = null;
+// function getMonitor(flag?) {
+//   if (Object.prototype.toString.call(timer) === '[object Null]') {
+//     timer = setTimeout(
+//       () => {
+//         list({ devicetype: deviceType.value, pagetype: 'normal' }).then((res) => {
+//           if (res && res.msgTxt[0]) {
+//             // dataSource.value = res.msgTxt[0].datalist || [];
+//             const getData = res.msgTxt[0].datalist || [];
+//             getData.forEach((data) => {
+//               if (data.regulation) {
+//                 getRegulationList(data.regulation);
+//               }
+//             });
+//             dataSource.value = getData;
+//             if (dataSource.value.length > 0) {
+//               dataSource.value.forEach((data: any) => {
+//                 const readData = data.readData;
+//                 data = Object.assign(data, readData);
+//               });
+//               if (dataSource.value.length > 0 && selectRowIndex.value == -1) {
+//                 // 初始打开页面
+//                 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']]);
+//                 }
+//               }
+//               const data: any = toRaw(dataSource.value[selectRowIndex.value]); //maxarea
+//               Object.assign(selectData, data);
+//               addMonitorText(selectData);
+
+//               palyAnimation(selectData);
+//             }
+//           }
+//           if (timer) {
+//             timer = null;
+//           }
+//           getMonitor();
+//         });
+//       },
+//       flag ? 0 : 1000
+//     );
+//   }
+// }
+// function getRegulationList(data) {
+//   getRegulation().then((res) => {
+//     if (res) {
+//       const regulation = res.find((item) => item.id == data);
+//       data.regulation = regulation;
+//       data.fmin = data.regulation.fmin;
+//       data.fmax = data.regulation.fmax;
+//     }
+//   });
+// }
+function getMonitor(flag?: boolean) {
+  if (timer === null) {
+    timer = setTimeout(
+      async () => {
+        try {
+          const res = await list({ devicetype: deviceType.value, pagetype: 'normal' });
+          if (res && res.msgTxt[0]) {
+            const rawData = res.msgTxt[0].datalist || [];
+            const processedData = [...rawData];
+
+            // 并行获取所有regulation数据
+            const regulationPromises = processedData.filter((data) => data.regulation).map((data) => getRegulationList(data.regulation, data));
+
+            await Promise.all(regulationPromises);
+
+            // 确保所有异步操作完成后再更新数据源
+            dataSource.value = processedData;
+
+            // 处理readData和初始选择
+            if (dataSource.value.length > 0) {
+              await processReadData(processedData);
+              await handleInitialSelection();
             }
-            getMonitor();
-          });
-        },
-        flag ? 0 : 1000
-      );
+          }
+        } catch (error) {
+          console.error('Erro', error);
+        } finally {
+          timer = null;
+          getMonitor(flag);
+        }
+      },
+      flag ? 0 : 1000
+    );
+  }
+}
+
+async function getRegulationList(regulationId: string, data: any) {
+  const res = await getRegulation();
+  if (res) {
+    const regulation = res.find((item) => item.id === regulationId);
+    if (regulation) {
+      data.regulation = regulation;
+      data.fmin = regulation.fmin;
+      data.fmax = regulation.fmax;
     }
   }
+}
 
-  let deviceRunState = '',
-    tanTouRunState = '';
-  // 根据3个点位分别执行动画
-  function palyAnimation(selectData) {
-    if (selectData.deviceType == 'windrect_normal') {
-      if (selectData['apparatusRun'] == 1) {
-        const flag = selectData.sign == '0' ? 'up' : selectData.sign == 1 ? 'center' : selectData.sign == 2 ? 'down' : null;
-        if (flag) play(flag);
-      } else {
-        const flag = selectData.sign == 1 ? 'center' : selectData.sign == 2 ? 'down' : null;
-        if (flag) play(flag, true);
-      }
+async function processReadData(data: any[]) {
+  const promises = data
+    .filter((item) => item.readData)
+    .map(async (item) => {
+      item.readData && Object.assign(item, item.readData);
+    });
+  await Promise.all(promises);
+}
+
+async function handleInitialSelection() {
+  if (selectRowIndex.value === -1 && dataSource.value.length > 0) {
+    const deviceId = currentRoute.value?.query?.['id'] || dataSource.value[0]['deviceID'];
+    selectRowIndex.value = dataSource.value.findIndex((item) => item.deviceID === deviceId);
+
+    const selectedData = toRaw(dataSource.value[selectRowIndex.value]);
+    Object.assign(selectData, selectedData);
+    addMonitorText(selectData);
+    palyAnimation(selectedData);
+
+    MonitorDataTable.value.setSelectedRowKeys([deviceId]);
+  }
+}
+let deviceRunState = '',
+  tanTouRunState = '';
+// 根据3个点位分别执行动画
+function palyAnimation(selectData) {
+  if (selectData.deviceType == 'windrect_normal') {
+    if (selectData['apparatusRun'] == 1) {
+      const flag = selectData.sign == '0' ? 'up' : selectData.sign == 1 ? 'center' : selectData.sign == 2 ? 'down' : null;
+      if (flag) play(flag);
+    } else {
+      const flag = selectData.sign == 1 ? 'center' : selectData.sign == 2 ? 'down' : null;
+      if (flag) play(flag, true);
     }
-    // 运行中是0,运行到达是1
-    if (selectData.deviceType == 'windrect_rect_single') {
-      if (selectData['apparatusRun'] == 1) {
-        // 镜头指向横杆
-        // if(!deviceRunState && !tanTouRunState)playCamera('start')
-        // 正在执行或是开始执行
-
-        //开始执行时,
-        // selectData['poleIncipient'] == 1 selectData.sensorMiddle == 1 代表可是执行 或是 执行结束
-
-        // 1. selectData['poleIncipient'] == 1 selectData.sensorMiddle == 1, 执行 play('up', true),play('middle', true)
-        // 2. 探头左移play('left')
-        // 3. 探头右移play('right')
-        // 4. 横杆向中位移动,探头在右边
-        // 5. 探头移到中间play('middle')
-        // 6. 探头移到左边play('left')
-        // 7. 横杆向低位移动,探头在左边
-        // 8. 探头移到中间play('middle')
-        // 9. 探头右移play('right')
-        // 10. 测风结束,探头移到中间play('middle'),横杆向高位移动
-        if (selectData['poleIncipient'] == 1) {
-          // 横杆在高位,开始执行 或是 执行结束
-          if (selectData.sensorMiddle == 1 && !deviceRunState && !tanTouRunState) {
-            // 1. 开始执行
-            deviceRunState = 'up';
-            tanTouRunState = 'middle';
-            play('up', true);
-            play('middle', true);
-          }
-          if (deviceRunState == 'up-m') {
-            play('up', true);
-            play('middle', true);
-            deviceRunState = '';
-            tanTouRunState = '';
-            playCamera('end');
-          }
-          // 初始已经在运行
+  }
+  // 运行中是0,运行到达是1
+  if (selectData.deviceType == 'windrect_rect_single') {
+    if (selectData['apparatusRun'] == 1) {
+      // 镜头指向横杆
+      // if(!deviceRunState && !tanTouRunState)playCamera('start')
+      // 正在执行或是开始执行
+
+      //开始执行时,
+      // selectData['poleIncipient'] == 1 selectData.sensorMiddle == 1 代表可是执行 或是 执行结束
+
+      // 1. selectData['poleIncipient'] == 1 selectData.sensorMiddle == 1, 执行 play('up', true),play('middle', true)
+      // 2. 探头左移play('left')
+      // 3. 探头右移play('right')
+      // 4. 横杆向中位移动,探头在右边
+      // 5. 探头移到中间play('middle')
+      // 6. 探头移到左边play('left')
+      // 7. 横杆向低位移动,探头在左边
+      // 8. 探头移到中间play('middle')
+      // 9. 探头右移play('right')
+      // 10. 测风结束,探头移到中间play('middle'),横杆向高位移动
+      if (selectData['poleIncipient'] == 1) {
+        // 横杆在高位,开始执行 或是 执行结束
+        if (selectData.sensorMiddle == 1 && !deviceRunState && !tanTouRunState) {
+          // 1. 开始执行
+          deviceRunState = 'up';
+          tanTouRunState = 'middle';
+          play('up', true);
+          play('middle', true);
+        }
+        if (deviceRunState == 'up-m') {
+          play('up', true);
+          play('middle', true);
+          deviceRunState = '';
+          tanTouRunState = '';
+          playCamera('end');
+        }
+        // 初始已经在运行
 
-          if (selectData.sensorLeft == '0' && selectData.sensorMiddle == '0' && selectData.sensorRight == '0') {
-            //2.探头左移play('left')
-            if (tanTouRunState == 'middle') {
-              tanTouRunState = 'left-m';
-              play('left');
-            }
-            //3. 探头右移play('right')
-            if (tanTouRunState == 'left') {
-              tanTouRunState = 'right-m';
-              play('right');
-            }
+        if (selectData.sensorLeft == '0' && selectData.sensorMiddle == '0' && selectData.sensorRight == '0') {
+          //2.探头左移play('left')
+          if (tanTouRunState == 'middle') {
+            tanTouRunState = 'left-m';
+            play('left');
           }
-          if (selectData.sensorLeft == 1) {
-            tanTouRunState = 'left';
-            if (!tanTouRunState || tanTouRunState == 'left-m') {
-              play('left', true);
-            }
+          //3. 探头右移play('right')
+          if (tanTouRunState == 'left') {
+            tanTouRunState = 'right-m';
+            play('right');
           }
-          if (selectData.sensorRight == 1) {
-            tanTouRunState = 'right';
-            if (!tanTouRunState || tanTouRunState == 'right-m') {
-              play('right', true);
-            }
-          }
-        } else if (selectData['poleMiddle'] == 1) {
-          if (deviceRunState == 'center-m') {
-            play('center', true);
-            deviceRunState = 'center';
-            tanTouRunState = 'right';
-            play('right', true);
-          }
-          if (!deviceRunState) {
-            deviceRunState = 'center';
-            play('center', true);
+        }
+        if (selectData.sensorLeft == 1) {
+          tanTouRunState = 'left';
+          if (!tanTouRunState || tanTouRunState == 'left-m') {
+            play('left', true);
           }
-          if (!tanTouRunState) {
+        }
+        if (selectData.sensorRight == 1) {
+          tanTouRunState = 'right';
+          if (!tanTouRunState || tanTouRunState == 'right-m') {
             play('right', true);
           }
+        }
+      } else if (selectData['poleMiddle'] == 1) {
+        if (deviceRunState == 'center-m') {
+          play('center', true);
+          deviceRunState = 'center';
+          tanTouRunState = 'right';
+          play('right', true);
+        }
+        if (!deviceRunState) {
+          deviceRunState = 'center';
+          play('center', true);
+        }
+        if (!tanTouRunState) {
+          play('right', true);
+        }
 
-          // 横杆在中位
-          if (selectData.sensorLeft == '0' && selectData.sensorMiddle == '0' && selectData.sensorRight == '0') {
-            //5. 探头移到中间play('middle')
-            if (tanTouRunState == 'right') {
-              tanTouRunState = 'middle-m';
-              play('middle');
-            }
-            //6. 探头移到左边play('left')
-            if (tanTouRunState == 'middle') {
-              tanTouRunState = 'left-m';
-              play('left');
-            }
+        // 横杆在中位
+        if (selectData.sensorLeft == '0' && selectData.sensorMiddle == '0' && selectData.sensorRight == '0') {
+          //5. 探头移到中间play('middle')
+          if (tanTouRunState == 'right') {
+            tanTouRunState = 'middle-m';
+            play('middle');
           }
-          if (selectData.sensorMiddle == 1) {
-            tanTouRunState = 'middle';
-            if (!tanTouRunState || tanTouRunState == 'middle-m') {
-              play('middle', true);
-            }
+          //6. 探头移到左边play('left')
+          if (tanTouRunState == 'middle') {
+            tanTouRunState = 'left-m';
+            play('left');
           }
-          if (selectData.sensorLeft == 1) {
-            tanTouRunState = 'left';
-            if (!tanTouRunState || tanTouRunState == 'left-m') {
-              play('left', true);
-            }
+        }
+        if (selectData.sensorMiddle == 1) {
+          tanTouRunState = 'middle';
+          if (!tanTouRunState || tanTouRunState == 'middle-m') {
+            play('middle', true);
           }
-        } else if (selectData['poleNether'] == 1) {
-          if (deviceRunState == 'down-m') {
-            play('down', true);
-            deviceRunState = 'down';
-            tanTouRunState = 'left';
+        }
+        if (selectData.sensorLeft == 1) {
+          tanTouRunState = 'left';
+          if (!tanTouRunState || tanTouRunState == 'left-m') {
             play('left', true);
           }
-          if (!deviceRunState) {
-            play('down', true);
-            deviceRunState = 'down';
+        }
+      } else if (selectData['poleNether'] == 1) {
+        if (deviceRunState == 'down-m') {
+          play('down', true);
+          deviceRunState = 'down';
+          tanTouRunState = 'left';
+          play('left', true);
+        }
+        if (!deviceRunState) {
+          play('down', true);
+          deviceRunState = 'down';
+        }
+        if (!tanTouRunState) {
+          play('left', true);
+        }
+        // 横杆在低位
+        if (selectData.sensorLeft == '0' && selectData.sensorMiddle == '0' && selectData.sensorRight == '0') {
+          //8. 探头移到中间play('middle')
+          if (tanTouRunState == 'left') {
+            tanTouRunState = 'left-middle-m';
+            play('middle');
           }
-          if (!tanTouRunState) {
-            play('left', true);
+          //9. 探头右移play('right')
+          if (tanTouRunState == 'middle1') {
+            tanTouRunState = 'right-m';
+            play('right');
           }
-          // 横杆在低位
-          if (selectData.sensorLeft == '0' && selectData.sensorMiddle == '0' && selectData.sensorRight == '0') {
-            //8. 探头移到中间play('middle')
-            if (tanTouRunState == 'left') {
-              tanTouRunState = 'left-middle-m';
-              play('middle');
-            }
-            //9. 探头右移play('right')
-            if (tanTouRunState == 'middle1') {
-              tanTouRunState = 'right-m';
-              play('right');
-            }
-            // 10. 测风结束,探头移到中间play('middle'),横杆向高位移动
-            if (tanTouRunState == 'right') {
-              tanTouRunState = 'right-middle-m';
-              play('middle');
-            }
+          // 10. 测风结束,探头移到中间play('middle'),横杆向高位移动
+          if (tanTouRunState == 'right') {
+            tanTouRunState = 'right-middle-m';
+            play('middle');
           }
+        }
 
-          if (selectData.sensorMiddle == 1) {
-            if (tanTouRunState == 'left-middle-m') tanTouRunState = 'middle1';
-            if (tanTouRunState == 'right-middle-m') tanTouRunState = 'middle2';
+        if (selectData.sensorMiddle == 1) {
+          if (tanTouRunState == 'left-middle-m') tanTouRunState = 'middle1';
+          if (tanTouRunState == 'right-middle-m') tanTouRunState = 'middle2';
 
-            if (!tanTouRunState || tanTouRunState == 'left-middle-m' || tanTouRunState == 'right-middle-m') {
-              play('middle', true);
-            }
+          if (!tanTouRunState || tanTouRunState == 'left-middle-m' || tanTouRunState == 'right-middle-m') {
+            play('middle', true);
           }
+        }
 
-          if (selectData.sensorRight == 1) {
-            tanTouRunState = 'right';
-            if (!tanTouRunState || tanTouRunState == 'right-m') {
-              play('right', true);
-            }
-          }
-        } else {
-          // 横杆正在运行
-          if (deviceRunState == 'up') {
-            deviceRunState = 'center-m';
-            play('center');
-          }
-          if (deviceRunState == 'center') {
-            deviceRunState = 'down-m';
-            play('down');
-          }
-          if (deviceRunState == 'down') {
-            deviceRunState = 'up-m';
-            play('up');
+        if (selectData.sensorRight == 1) {
+          tanTouRunState = 'right';
+          if (!tanTouRunState || tanTouRunState == 'right-m') {
+            play('right', true);
           }
         }
+      } else {
+        // 横杆正在运行
+        if (deviceRunState == 'up') {
+          deviceRunState = 'center-m';
+          play('center');
+        }
+        if (deviceRunState == 'center') {
+          deviceRunState = 'down-m';
+          play('down');
+        }
+        if (deviceRunState == 'down') {
+          deviceRunState = 'up-m';
+          play('up');
+        }
+      }
 
-        // //正在执行时
-
-        // // 判断上中下是否都为0
-        // if(selectData['poleIncipient'] == 0 && selectData['poleMiddle'] == 0 && selectData['poleNether'] == 0) {
-        //   // 判断是否有前一个状态值,有的话执行
-        //   //没有前一个状态
-
-        //   //有前一个状态
-
-        //   // 横杆前状态在上位时,横杆中位移动,探头在右边
+      // //正在执行时
 
-        //   // 横杆前状态在中位时,横杆下位移动,探头在左边
+      // // 判断上中下是否都为0
+      // if(selectData['poleIncipient'] == 0 && selectData['poleMiddle'] == 0 && selectData['poleNether'] == 0) {
+      //   // 判断是否有前一个状态值,有的话执行
+      //   //没有前一个状态
 
-        //   // 横杆前状态在下位时,横杆上位移动,探头在中间
+      //   //有前一个状态
 
-        // }else{
-        //   // 判断当前动画停在固定位置
-        //   if(selectData['poleIncipient'] == 1) {
-        //     // 滑杆停在上面,探头在中间
+      //   // 横杆前状态在上位时,横杆中位移动,探头在右边
 
-        //   }else if (selectData['poleMiddle'] == 1) {
-        //     // 滑杆停在中间面,初始探头在右边
+      //   // 横杆前状态在中位时,横杆下位移动,探头在左边
 
-        //   } else if (selectData['poleNether'] == 1) {
-        //     // 滑杆停在下面,初始探头在左边
+      //   // 横杆前状态在下位时,横杆上位移动,探头在中间
 
-        //   }
-        // }
-      } else {
-        // if(selectData['poleIncipient'] == 1){
-        //   deviceRunState = ''
-        //   tanTouRunState = ''
-        // }
-      }
-    }
+      // }else{
+      //   // 判断当前动画停在固定位置
+      //   if(selectData['poleIncipient'] == 1) {
+      //     // 滑杆停在上面,探头在中间
 
-    if (selectData.deviceType == 'windrect_rect') {
-      if (selectData['apparatusRun'] == 1) {
-        const flag = selectData.sign == '0' ? 'center' : selectData.sign == 1 ? 'down' : selectData.sign == 2 ? 'up' : null;
-        if (flag) play(flag);
-      } else {
-        const flag = selectData.sign == 1 ? 'center' : selectData.sign == 2 ? 'down' : selectData.sign == '0' ? 'up' : null;
-        if (flag) play(flag, true);
-      }
-    }
+      //   }else if (selectData['poleMiddle'] == 1) {
+      //     // 滑杆停在中间面,初始探头在右边
 
-    if (selectData.deviceType == 'windrect_ds') {
-      if (selectData['apparatusRun'] == 1 && selectData['sign'] == 2) {
-        if (!deviceRunState) {
-          deviceRunState = 'start';
-          play('down');
-        }
-      } else if (selectData['apparatusRun'] == 0 && selectData['sign'] == 0 && deviceRunState == 'start') {
-        deviceRunState = '';
-        play('up');
-      }
-    }
-  }
+      //   } else if (selectData['poleNether'] == 1) {
+      //     // 滑杆停在下面,初始探头在左边
 
-  // 自测动画方法
-  function testPlay(flag) {
-    if (selectData.deviceType == 'windrect_rect') {
-      setTimeout(() => {
-        play('center');
-      }, 0);
-      setTimeout(() => {
-        play('down');
-      }, 4000);
-      setTimeout(() => {
-        play('up');
-      }, 10000);
-    }
-    if (selectData.deviceType == 'windrect_normal') {
-      setTimeout(() => {
-        play('up');
-      }, 0);
-      setTimeout(() => {
-        play('center');
-      }, 10000);
-      setTimeout(() => {
-        play('down');
-      }, 18000);
-      setTimeout(() => {
-        play('up');
-      }, 21000);
-    }
-    if (selectData.deviceType == 'windrect_ds') {
-      play('moni');
+      //   }
+      // }
+    } else {
+      // if(selectData['poleIncipient'] == 1){
+      //   deviceRunState = ''
+      //   tanTouRunState = ''
+      // }
     }
   }
 
-  function clearPlay() {
-    modalType.value = 'autoClear';
-    modalIsShow.value = true;
-    if (globalConfig?.simulatedPassword) {
-      controlDevice('', modalType.value);
+  if (selectData.deviceType == 'windrect_rect') {
+    if (selectData['apparatusRun'] == 1) {
+      const flag = selectData.sign == '0' ? 'center' : selectData.sign == 1 ? 'down' : selectData.sign == 2 ? 'up' : null;
+      if (flag) play(flag);
+    } else {
+      const flag = selectData.sign == 1 ? 'center' : selectData.sign == 2 ? 'down' : selectData.sign == '0' ? 'up' : null;
+      if (flag) play(flag, true);
     }
   }
 
-  function startRun() {
-    modalType.value = 'sing';
-    modalIsShow.value = true;
-    if (globalConfig?.simulatedPassword) {
-      controlDevice('', modalType.value);
-    }
-  }
-  // 切换检测数据
-  async function getSelectRow(selectRow, index) {
-    if (selectRow) {
-      loading.value = true;
-      selectRowIndex.value = index;
-      Object.assign(selectData, selectRow);
-      let type = '';
-      if (selectRow['modelType']) {
-        type = selectRow['modelType'];
-        debugger;
-      } else {
-        if (selectRow.deviceType.startsWith('windrect_rect')) {
-          type = 'lmWindRect';
-        }
-        if (selectRow.deviceType.startsWith('windrect_normal')) {
-          type = 'zdWindRect';
-        }
-        if (selectRow.deviceType.startsWith('windrect_rect_single')) {
-          type = 'lmWindSide';
-        }
-        if (selectRow.deviceType.startsWith('windrect_ds')) {
-          type = 'dsWindRect_move';
-          // type = 'duisheFixed';
-        }
-        if (selectRow.deviceType.startsWith('windrect_ds_four')) {
-          //windrect_ds_two
-          type = 'dsWindRect_four';
-        }
-        if (selectRow.deviceType.startsWith('windrect_ds_two')) {
-          type = 'dsWindRect_two';
-        }
-        if (selectRow.deviceType.startsWith('windrect_ds_sut') || selectRow.deviceType.startsWith('windrect_muti')) {
-          type = 'duisheFixed';
-        }
-        if (
-          selectRow.deviceType.startsWith('windrect_dd') ||
-          selectRow.deviceType == 'windrect_safety' ||
-          selectRow.deviceType == 'windrect_sensor'
-        ) {
-          type = 'ddWindSide';
-        }
+  if (selectData.deviceType == 'windrect_ds') {
+    if (selectData['apparatusRun'] == 1 && selectData['sign'] == 2) {
+      if (!deviceRunState) {
+        deviceRunState = 'start';
+        play('down');
       }
-
-      // const type = selectRowIndex.value >= 1 ? 'lmWindRect' : selectRowIndex.value <= 3 ? 'zdWindRect' : 'dsWindRect';
-      await setModelType(type);
-      loading.value = false;
+    } else if (selectData['apparatusRun'] == 0 && selectData['sign'] == 0 && deviceRunState == 'start') {
       deviceRunState = '';
-      tanTouRunState = '';
-      await getCamera(selectRow.deviceID, playerRef.value);
+      play('up');
     }
   }
-
-  /* 一键测风 */
-  function handleOk() {
-    modalType.value = 'multiple';
-    modalIsShow.value = true;
-    if (globalConfig?.simulatedPassword) {
-      controlDevice('', modalType.value);
-    }
+}
+
+// 自测动画方法
+function testPlay(flag) {
+  if (selectData.deviceType == 'windrect_rect') {
+    setTimeout(() => {
+      play('center');
+    }, 0);
+    setTimeout(() => {
+      play('down');
+    }, 4000);
+    setTimeout(() => {
+      play('up');
+    }, 10000);
   }
-
-  /* 打开一键测风弹窗 */
-  function openModel() {
-    setModalProps({ visible: true });
+  if (selectData.deviceType == 'windrect_normal') {
+    setTimeout(() => {
+      play('up');
+    }, 0);
+    setTimeout(() => {
+      play('center');
+    }, 10000);
+    setTimeout(() => {
+      play('down');
+    }, 18000);
+    setTimeout(() => {
+      play('up');
+    }, 21000);
   }
-
-  function resetHandle() {
-    modalType.value = 'resetWind';
-    modalIsShow.value = true;
+  if (selectData.deviceType == 'windrect_ds') {
+    play('moni');
   }
+}
 
-  function exportExcel(id) {
-    exportXls({ testid: id });
+function clearPlay() {
+  modalType.value = 'autoClear';
+  modalIsShow.value = true;
+  if (globalConfig?.simulatedPassword) {
+    controlDevice('', modalType.value);
   }
+}
 
-  /* 关闭一键测风弹窗 */
-  function handleCancel() {
-    setModalProps({ visible: false });
-    modalTable.value.clearSelectedRowKeys();
+function startRun() {
+  modalType.value = 'sing';
+  modalIsShow.value = true;
+  if (globalConfig?.simulatedPassword) {
+    controlDevice('', modalType.value);
   }
+}
+// 切换检测数据
+async function getSelectRow(selectRow, index) {
+  if (selectRow) {
+    loading.value = true;
+    selectRowIndex.value = index;
+    Object.assign(selectData, selectRow);
+    let type = '';
+    if (selectRow['modelType']) {
+      type = selectRow['modelType'];
+      // debugger;
+    } else {
+      if (selectRow.deviceType.startsWith('windrect_rect')) {
+        type = 'lmWindRect';
+      }
+      if (selectRow.deviceType.startsWith('windrect_normal')) {
+        type = 'zdWindRect';
+      }
+      if (selectRow.deviceType.startsWith('windrect_rect_single')) {
+        type = 'lmWindSide';
+      }
+      if (selectRow.deviceType.startsWith('windrect_ds')) {
+        type = 'dsWindRect_move';
+        // type = 'duisheFixed';
+      }
+      if (selectRow.deviceType.startsWith('windrect_ds_four')) {
+        //windrect_ds_two
+        type = 'dsWindRect_four';
+      }
+      if (selectRow.deviceType.startsWith('windrect_ds_two')) {
+        type = 'dsWindRect_two';
+      }
+      if (selectRow.deviceType.startsWith('windrect_ds_sut') || selectRow.deviceType.startsWith('windrect_muti')) {
+        type = 'duisheFixed';
+      }
+      if (selectRow.deviceType.startsWith('windrect_dd') || selectRow.deviceType == 'windrect_safety' || selectRow.deviceType == 'windrect_sensor') {
+        type = 'ddWindSide';
+      }
+    }
 
-  /* 关闭一键测风控制*/
-  function handleCancelControl() {
-    modalIsShow.value = false;
+    // const type = selectRowIndex.value >= 1 ? 'lmWindRect' : selectRowIndex.value <= 3 ? 'zdWindRect' : 'dsWindRect';
+    await setModelType(type);
+    loading.value = false;
+    deviceRunState = '';
+    tanTouRunState = '';
+    await getCamera(selectRow.deviceID, playerRef.value);
   }
-
-  function controlDevice(passWord, type) {
-    try {
-      if (type == 'sing') {
-        testWind({
-          ids: [selectData.deviceID],
-          maxnum: 1000,
-          windnum: 1,
-          password: passWord || globalConfig?.simulatedPassword,
-        }).then((res) => {
-          if (res && res.success === false) {
-            message.error(res.message);
+}
+
+/* 一键测风 */
+function handleOk() {
+  modalType.value = 'multiple';
+  modalIsShow.value = true;
+  if (globalConfig?.simulatedPassword) {
+    controlDevice('', modalType.value);
+  }
+}
+
+/* 打开一键测风弹窗 */
+function openModel() {
+  setModalProps({ visible: true });
+}
+
+function resetHandle() {
+  modalType.value = 'resetWind';
+  modalIsShow.value = true;
+}
+
+function exportExcel(id) {
+  exportXls({ testid: id });
+}
+
+/* 关闭一键测风弹窗 */
+function handleCancel() {
+  setModalProps({ visible: false });
+  modalTable.value.clearSelectedRowKeys();
+}
+
+/* 关闭一键测风控制*/
+function handleCancelControl() {
+  modalIsShow.value = false;
+}
+
+function controlDevice(passWord, type) {
+  try {
+    if (type == 'sing') {
+      testWind({
+        ids: [selectData.deviceID],
+        maxnum: 1000,
+        windnum: 1,
+        password: passWord || globalConfig?.simulatedPassword,
+      }).then((res) => {
+        if (res && res.success === false) {
+          message.error(res.message);
+        } else {
+          if (globalConfig.History_Type == 'remote') {
+            message.success('指令已下发至生产管控平台成功!');
           } else {
-            if (globalConfig.History_Type == 'remote') {
-              message.success('指令已下发至生产管控平台成功!');
-            } else {
-              message.success('指令已下发成功!');
-            }
+            message.success('指令已下发成功!');
           }
-          modalIsShow.value = false;
-        });
-      } else if (type == 'multiple') {
-        const ids = toRaw(modalTable.value.selectedRowKeys);
-        testWind({
-          ids: ids,
-          maxnum: 1000,
-          windnum: modalTable.value.selectedRowKeys.length,
-          password: passWord || globalConfig?.simulatedPassword,
-        }).then((res) => {
-          if (res && res.success === false) {
-            message.error(res.message);
+        }
+        modalIsShow.value = false;
+      });
+    } else if (type == 'multiple') {
+      const ids = toRaw(modalTable.value.selectedRowKeys);
+      testWind({
+        ids: ids,
+        maxnum: 1000,
+        windnum: modalTable.value.selectedRowKeys.length,
+        password: passWord || globalConfig?.simulatedPassword,
+      }).then((res) => {
+        if (res && res.success === false) {
+          message.error(res.message);
+        } else {
+          if (globalConfig.History_Type == 'remote') {
+            message.success('指令已下发至生产管控平台成功!');
           } else {
-            if (globalConfig.History_Type == 'remote') {
-              message.success('指令已下发至生产管控平台成功!');
-            } else {
-              message.success('指令已下发成功!');
-            }
+            message.success('指令已下发成功!');
           }
-          modalIsShow.value = false;
-          setModalProps({ visible: false });
-          modalTable.value.clearSelectedRowKeys();
-        });
-      } else if (type == 'autoClear') {
-        const data = {
-          deviceid: selectData.deviceID,
-          devicetype: selectData.deviceType,
-          paramcode: 'autoClear',
-          value: null,
-          password: passWord || globalConfig?.simulatedPassword,
-          masterComputer: selectData.masterComputer,
-        };
-        deviceControlApi(data).then((res) => {
-          // 模拟时开启
-          if (res.success) {
-            if (globalConfig.History_Type == 'remote') {
-              message.success('指令已下发至生产管控平台成功!');
-            } else {
-              message.success('指令已下发成功!');
-            }
+        }
+        modalIsShow.value = false;
+        setModalProps({ visible: false });
+        modalTable.value.clearSelectedRowKeys();
+      });
+    } else if (type == 'autoClear') {
+      const data = {
+        deviceid: selectData.deviceID,
+        devicetype: selectData.deviceType,
+        paramcode: 'autoClear',
+        value: null,
+        password: passWord || globalConfig?.simulatedPassword,
+        masterComputer: selectData.masterComputer,
+      };
+      deviceControlApi(data).then((res) => {
+        // 模拟时开启
+        if (res.success) {
+          if (globalConfig.History_Type == 'remote') {
+            message.success('指令已下发至生产管控平台成功!');
           } else {
-            message.error(res.message);
+            message.success('指令已下发成功!');
           }
-          modalIsShow.value = false;
-        });
-      } else if (type == 'resetWind') {
-        resetWind({}).then((res: any) => {
-          message.info(res);
-        });
+        } else {
+          message.error(res.message);
+        }
         modalIsShow.value = false;
-      }
-    } catch (error) {
-      message.error('测风失败,请联系管理员。。。');
+      });
+    } else if (type == 'resetWind') {
+      resetWind({}).then((res: any) => {
+        message.info(res);
+      });
       modalIsShow.value = false;
     }
+  } catch (error) {
+    message.error('测风失败,请联系管理员。。。');
+    modalIsShow.value = false;
   }
+}
 
-  /** 避灾路线上的测风装置 */
-  async function getPathList() {
-    const pathArr = await pathList({});
-    criticalPathList.value = pathArr.records.filter((item) => {
-      return item.strsystype == 3;
-    });
-  }
-
-  /* 根据路线选择测风装置 */
-  function selectCriticalPath(pathId) {
-    deviceList({ deviceType: 'wind', sysId: pathId }).then((res) => {
-      const ids: string[] = [];
-      res.records.forEach((item) => {
-        ids.push(item.id);
-      });
-      if (modalTable.value) modalTable.value.setSelectedRowKeys(ids);
-    });
-  }
-
-  function deviceEdit(e: Event, type: string, record) {
-    e.stopPropagation();
-    openModal(true, {
-      type,
-      deviceId: record['deviceID'],
-    });
-  }
-
-  onBeforeMount(() => {
-    getPathList();
+/** 避灾路线上的测风装置 */
+async function getPathList() {
+  const pathArr = await pathList({});
+  criticalPathList.value = pathArr.records.filter((item) => {
+    return item.strsystype == 3;
   });
-
-  onMounted(async () => {
-    // const playerDom = document.getElementById('cf-player1')?.getElementsByClassName('vjs-tech')[0];
-    // loading.value = true;
-    // mountedThree(playerDom).then(async () => {
-    //   getMonitor(true);
-    //   // loading.value = false;
-    // });
-    const { query } = unref(currentRoute);
-    if (query['deviceType']) deviceType.value = query['deviceType'] as string;
-    loading.value = true;
-    mountedThree(null).then(async () => {
-      await getMonitor(true);
-      loading.value = false;
+}
+
+/* 根据路线选择测风装置 */
+function selectCriticalPath(pathId) {
+  deviceList({ deviceType: 'wind', sysId: pathId }).then((res) => {
+    const ids: string[] = [];
+    res.records.forEach((item) => {
+      ids.push(item.id);
     });
+    if (modalTable.value) modalTable.value.setSelectedRowKeys(ids);
   });
+}
 
-  onUnmounted(() => {
-    removeCamera();
-    if (timer) {
-      clearTimeout(timer);
-      timer = undefined;
-    }
-    destroy();
+function deviceEdit(e: Event, type: string, record) {
+  e.stopPropagation();
+  openModal(true, {
+    type,
+    deviceId: record['deviceID'],
   });
-</script>
-<style scoped lang="less">
-  @import '/@/design/theme.less';
-  @import '/@/design/vent/modal.less';
-  @ventSpace: zxm;
+}
+
+onBeforeMount(() => {
+  getPathList();
+});
+
+onMounted(async () => {
+  // const playerDom = document.getElementById('cf-player1')?.getElementsByClassName('vjs-tech')[0];
+  // loading.value = true;
+  // mountedThree(playerDom).then(async () => {
+  //   getMonitor(true);
+  //   // loading.value = false;
+  // });
+  const { query } = unref(currentRoute);
+  if (query['deviceType']) deviceType.value = query['deviceType'] as string;
+  loading.value = true;
+  mountedThree(null).then(async () => {
+    await getMonitor(true);
+    loading.value = false;
+  });
+});
 
-  :deep(.@{ventSpace}-tabs-tabpane-active) {
-    height: 100%;
+onUnmounted(() => {
+  removeCamera();
+  if (timer) {
+    clearTimeout(timer);
+    timer = undefined;
   }
-  .scene-box {
-    .bottom-tabs-box {
-      height: 350px;
-    }
+  destroy();
+});
+</script>
+<style scoped lang="less">
+@import '/@/design/theme.less';
+@import '/@/design/vent/modal.less';
+@ventSpace: zxm;
+
+:deep(.@{ventSpace}-tabs-tabpane-active) {
+  height: 100%;
+}
+.scene-box {
+  .bottom-tabs-box {
+    height: 350px;
   }
-  .head-line {
+}
+.head-line {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+  .button-box {
+    position: relative;
+    padding: 5px;
+    border: 1px transparent solid;
+    border-radius: 5px;
+    margin-left: 8px;
+    margin-right: 8px;
+    width: auto;
+    height: 34px;
+    border: 1px solid var(--vent-base-border);
     display: flex;
-    flex-direction: row;
-    justify-content: space-between;
-    .button-box {
-      position: relative;
-      padding: 5px;
-      border: 1px transparent solid;
-      border-radius: 5px;
-      margin-left: 8px;
-      margin-right: 8px;
-      width: auto;
-      height: 34px;
-      border: 1px solid var(--vent-base-border);
-      display: flex;
-      align-items: center;
-      justify-content: center;
-      color: var(--vent-font-color);
-      padding: 0 15px;
-      cursor: pointer;
-      pointer-events: auto;
-      &:hover {
-        background: var(--vent-device-manager-control-btn-hover);
-      }
-      &::before {
-        width: calc(100% - 6px);
-        height: 26px;
-        content: '';
-        position: absolute;
-        top: 3px;
-        right: 0;
-        left: 3px;
-        bottom: 0;
-        z-index: -1;
-        border-radius: inherit; /*important*/
-        background: var(--vent-device-manager-control-btn);
-      }
+    align-items: center;
+    justify-content: center;
+    color: var(--vent-font-color);
+    padding: 0 15px;
+    cursor: pointer;
+    pointer-events: auto;
+    &:hover {
+      background: var(--vent-device-manager-control-btn-hover);
+    }
+    &::before {
+      width: calc(100% - 6px);
+      height: 26px;
+      content: '';
+      position: absolute;
+      top: 3px;
+      right: 0;
+      left: 3px;
+      bottom: 0;
+      z-index: -1;
+      border-radius: inherit; /*important*/
+      background: var(--vent-device-manager-control-btn);
     }
   }
-  :deep(.@{ventSpace}-picker-datetime-panel) {
-    height: 200px !important;
-    overflow-y: auto !important;
-  }
+}
+:deep(.@{ventSpace}-picker-datetime-panel) {
+  height: 200px !important;
+  overflow-y: auto !important;
+}
 </style>

+ 3 - 0
src/views/vent/monitorManager/windrectMonitor/windrect.api.ts

@@ -11,6 +11,7 @@ enum Api {
   cameraList = '/safety/ventanalyCamera/list',
   cameraAddrList = '/monitor/camera/info',
   resetWind = '/safety/ventanalyCommand/resettestwind',
+  getRegulation = '/monitor/getDeviceRegulation',
 }
 /**
  * 导出api
@@ -56,3 +57,5 @@ export const cameraAddrList = (params) => defHttp.post({ url: Api.cameraAddrList
 export const cameraList = (params) => defHttp.get({ url: Api.cameraList, params });
 
 export const exportXls = (params) => defHttp.post({ url: Api.importExcel, params });
+
+export const getRegulation = () => defHttp.post({ url: Api.getRegulation });