瀏覽代碼

Merge branch 'master' of http://182.92.126.35:3000/hrx/mky-vent-base

lxh 9 月之前
父節點
當前提交
2e60415dac
共有 35 個文件被更改,包括 558 次插入797 次删除
  1. 二進制
      public/model/glft/ztfj/ztfj-xj_2024-06-20.glb
  2. 二進制
      src/assets/images/home-container/configurable/model_original_title_bg.png
  3. 二進制
      src/assets/images/home-container/configurable/model_original_title_bg_expand.png
  4. 12 14
      src/hooks/web/useSso.ts
  5. 1 1
      src/utils/threejs/main.worker.ts
  6. 3 2
      src/views/vent/deviceManager/comment/warningTabel/BaseModal.vue
  7. 2 0
      src/views/vent/deviceManager/comment/warningTabel/BaseModal1.vue
  8. 1 0
      src/views/vent/deviceManager/comment/warningTabel/index3.vue
  9. 1 0
      src/views/vent/deviceManager/comment/warningTabel/warning.data.ts
  10. 1 1
      src/views/vent/deviceManager/configurationTable/configuration.api.ts
  11. 89 7
      src/views/vent/deviceManager/configurationTable/types.ts
  12. 1 1
      src/views/vent/home/colliery/index.vue
  13. 0 113
      src/views/vent/home/configurable/components/AirVolumeMonitor.vue
  14. 0 178
      src/views/vent/home/configurable/components/DeviceWarning.vue
  15. 0 43
      src/views/vent/home/configurable/components/SubVentilate.vue
  16. 0 38
      src/views/vent/home/configurable/components/Ventilate.vue
  17. 0 105
      src/views/vent/home/configurable/components/VentilateAnalysis.vue
  18. 0 44
      src/views/vent/home/configurable/components/VentilateControl.vue
  19. 0 125
      src/views/vent/home/configurable/components/WorkSurface.vue
  20. 13 17
      src/views/vent/home/configurable/components/enhanced/moduleBottom.vue
  21. 6 11
      src/views/vent/home/configurable/components/enhanced/moduleLeft.vue
  22. 6 11
      src/views/vent/home/configurable/components/enhanced/moduleRight.vue
  23. 0 47
      src/views/vent/home/configurable/components/moduleBasic.vue
  24. 44 0
      src/views/vent/home/configurable/components/moduleEnhanced.vue
  25. 37 0
      src/views/vent/home/configurable/components/moduleOriginal.vue
  26. 93 0
      src/views/vent/home/configurable/components/original/moduleBottom.vue
  27. 95 0
      src/views/vent/home/configurable/components/original/moduleLeft.vue
  28. 30 9
      src/views/vent/home/configurable/hooks/useInit.ts
  29. 97 11
      src/views/vent/home/configurable/index.vue
  30. 4 2
      src/views/vent/monitorManager/mainFanMonitor/main.threejs.ts
  31. 5 5
      src/views/vent/monitorManager/mainFanMonitor/mainWind.xj.threejs.ts
  32. 5 5
      src/views/vent/monitorManager/nitrogen/index.vue
  33. 2 1
      src/views/vent/monitorManager/safetyMonitor/index.vue
  34. 7 3
      src/views/vent/monitorManager/windrectMonitor/index.vue
  35. 3 3
      src/views/vent/performance/comment/CADModal.vue

二進制
public/model/glft/ztfj/ztfj-xj_2024-06-20.glb


二進制
src/assets/images/home-container/configurable/model_original_title_bg.png


二進制
src/assets/images/home-container/configurable/model_original_title_bg_expand.png


+ 12 - 14
src/hooks/web/useSso.ts

@@ -18,23 +18,21 @@ export function useSso() {
       const ticket = getUrlParam('ticket');
       if (!token) {
         if (ticket) {
-          await validateCasLogin({
-            ticket: ticket,
-            service: locationUrl,
-          })
-            .then((res) => {
-              redirect = false;
-              const userStore = useUserStore();
-              userStore.setToken(res.token);
-              return userStore.afterLoginAction(true, {});
-            })
-            .catch(() => {
-              redirect = true;
-              window.location.href = globSetting.casBaseUrl + '/login?service=' + encodeURIComponent(locationUrl);
+          try {
+            const res = await validateCasLogin({
+              ticket: ticket,
+              service: locationUrl,
             });
+            const userStore = useUserStore();
+            userStore.setToken(res.token);
+            redirect = true;
+            await userStore.afterLoginAction(true, {});
+          } catch (e) {
+            redirect = true;
+            window.location.href = globSetting.casBaseUrl + '/login?service=' + encodeURIComponent(locationUrl);
+          }
         } else {
           if (window.location.search == '?type=noCas') {
-            redirect = false;
           } else {
             window.location.href = globSetting.casBaseUrl + '/login?service=' + encodeURIComponent(locationUrl);
             redirect = true;

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

@@ -54,7 +54,7 @@ export function initModalWorker() {
     'ztfj/fbm_2023-06-02.glb',
     'ztfj/ztfj-fc_2023-06-02.glb',
     'ztfj/ztfj_2023-12-12.glb',
-    'ztfj/ztfj-xj_2024-06-20.glb',
+    'ztfj/ztfj-xj_2024-07-12.glb',
     'fire/laneway_2024-03-04.glb',
     'fire/laneway-device_2024-03-19.glb',
     'fire/chamber_2023-06-02.glb',

+ 3 - 2
src/views/vent/deviceManager/comment/warningTabel/BaseModal.vue

@@ -4,7 +4,7 @@
       <template #monitor="{ model, field }">
         <div class="vent-flex-row-between">
           <Select ref="selectRef" disabled v-model:value="pointData" :options="option" style="width: calc(100% - 65px)" />
-          <a-button class="vent-margin-b-5" type="primary" @click="selectPoint(model['deviceType'])" style="position: absolute; right: 0; top: 1px"
+          <a-button class="vent-margin-b-5" type="primary" @click="selectPoint(model['strtype'])" style="position: absolute; right: 0; top: 1px"
             >选择</a-button
           >
         </div>
@@ -71,7 +71,8 @@
         }
       });
       pointData.value = [data.record['monitorId']];
-      await setFieldsValue({ relId: data.record['relId'] || data.record['id'], monitorId: '' });
+      const relId = data.isUpdate ? data.record['relId'] : data.record['relId'] || data.record['id'];
+      await setFieldsValue({ relId, monitorId: '' });
     }
   });
 

+ 2 - 0
src/views/vent/deviceManager/comment/warningTabel/BaseModal1.vue

@@ -50,6 +50,7 @@
     isUpdate.value = unref(data.isUpdate);
     title.value = unref(data.title);
     await resetFields();
+    debugger;
     if (data.isUpdate) {
       await setFieldsValue({ ...data.record });
       pointData.value = [data.record['monitorId']];
@@ -63,6 +64,7 @@
       //   }
       // })
     } else if (data.record) {
+      // 新增
       await setFieldsValue({ relId: data.record['relId'] || data.record['id'], monitorId: '' });
     }
   });

+ 1 - 0
src/views/vent/deviceManager/comment/warningTabel/index3.vue

@@ -131,6 +131,7 @@
   const [register, { openModal, closeModal }] = useModal();
 
   function handleOpen(flag?, record?) {
+    debugger;
     if (record) {
       if (flag == 'update') {
         openModal(true, {

+ 1 - 0
src/views/vent/deviceManager/comment/warningTabel/warning.data.ts

@@ -436,6 +436,7 @@ export const monitorWarningFormSchemas = (param) =>
           labelField: 'strname',
           valueField: 'id',
           onChange: (e, option) => {
+            debugger;
             if (option) formModel['strtype'] = option['strtype'];
           },
         };

+ 1 - 1
src/views/vent/deviceManager/configurationTable/configuration.api.ts

@@ -15,7 +15,7 @@ enum Api {
  * @param params
  */
 export function list(params: any): Promise<{ records: Config[] }> {
-  return defHttp.post({ url: Api.list, params: _.omitBy(params, _.isNil) }).then((result) => {
+  return defHttp.post({ url: Api.list, params: _.omitBy(params, _.isNil) }, { joinParamsToUrl: true }).then((result) => {
     result.records.forEach((item) => {
       parseModuleData(item);
     });

+ 89 - 7
src/views/vent/deviceManager/configurationTable/types.ts

@@ -5,14 +5,96 @@ export interface Config {
   moduleData: ModuleData;
   showStyle: ShowStyle;
 }
+/**
+ * 模块的配置
+ *
+ * 该配置将描述本模块的基础样式,应该展示哪些内容,应该如何排布主要元素
+ *
+ * 配置中有几项常用的配置,以下是其说明:
+ *
+ * 假设模块依赖的数据为:`{ f1Val: 2555 }`
+ *
+ * `formatter`该配置是用于自定义展示文本的,应配合`prop`使用。
+ *
+ * 使用示例:formatter:`前缀${}后缀`; prop:`f1Val`。则对应的文本将是`前缀f1Val后缀`
+ *
+ */
 export interface ModuleData {
-  header?: Record<string, string>;
-  main?: Record<string, string>;
-  chart?: Record<string, string>;
+  header: {
+    show: boolean;
+    /** 是否展示左侧的选择框 */
+    showSelector: boolean;
+    /** 是否展示右侧插槽 */
+    showSlot: boolean;
+    /** 左侧选择框的配置 */
+    selector: {
+      /** 图标,具体支持的输入种类请联系技术人员 */
+      icon?: string;
+      formatter?: string;
+      prop: string;
+    };
+    /** 右侧插槽的配置 */
+    slot: {
+      /** 图标,具体支持的输入种类请联系技术人员 */
+      icon?: string;
+      formatter?: string;
+      prop: string;
+    };
+  };
+  background: {
+    show: boolean;
+    /** 背景资源的类型 */
+    type: 'image' | 'vedio';
+    /** 背景资源的链接 */
+    link: string;
+  };
+  /** 模块的布局,使用规定的枚举组合为一个数组,代表着从上到下所应展示的元素 */
+  layout: ('board' | 'list' | 'chart')[];
+  /** 展示牌元素 */
+  board?: {
+    /** 展示牌说明内容 */
+    label: string;
+    /** 展示牌预设的背景类型 */
+    type: 'A' | 'B' | 'C' | 'D';
+    /** 展示牌布局,决定是哪部分内容在上方 */
+    layout: 'value-top' | 'label-top';
+    formatter?: string;
+    prop: string;
+  }[];
+  /** 列表元素 */
+  list?: {
+    color: string;
+    /** 列表项说明内容 */
+    label: string;
+    formatter?: string;
+    prop: string;
+  }[];
+  /** 图表元素 */
+  chart?: {
+    /** 图表通用类型,一个类型对应一种图表预设 */
+    type: 'pie' | 'bar' | 'line';
+    /** 读取数据时的基础路径,例如如果图表依赖一个数组,那么该项应设置能读取到该数组的路径。例如:readData.history */
+    readFrom: string;
+    /** 排序依据,该项应配置为`readFrom`指向的数据中的可读项。例如:createTime */
+    sortBy?: string;
+    /** 排序规则,desc降序,asc升序 */
+    order?: 'desc' | 'asc';
+    /** 图表x轴配置(若有),例如:{ prop: 'strInstallPos' } */
+    xAxis?: {
+      formatter?: string;
+      prop: string;
+    }[];
+    /** 图表y轴配置(若有),例如:['风量', '风速'] */
+    yAxis?: string[];
+    /** 图表各系列配置,一个系列应对应一个数据维度,例如:[{ label: '风量', prop: 'f1Val' }] */
+    series: { label: string; prop: string }[];
+  }[];
 }
 export interface ShowStyle {
-  size?: string;
-  version?: string;
-  position?: string;
-  charttype?: string;
+  /** 模块的宽高 */
+  size: string;
+  /** 模块的版本,分新版及旧版,只要有一个模块指定为旧版,那么整个页面风格将变更为旧版 */
+  version: 'original' | 'enhanced';
+  /** 模块的位置,即定位 */
+  position: string;
 }

+ 1 - 1
src/views/vent/home/colliery/index.vue

@@ -118,7 +118,7 @@
   let warnData = ref<any>([]); //预警数据
   let deviceData = ref<any>({}); //设备监测数据
   let navList = reactive([
-    { name: '总风量(m³/min)', isShow: true, valList: [] },
+    { name: '总风量(m³/min)', isShow: true, valList: [] },
     { name: '需风量(m³/min)', isShow: true, valList: [] },
     // { name: '有效风量(m³/min)', isShow: true, valList: [] },
     { name: '等积孔(m²)', isShow: true, valList: [] },

+ 0 - 113
src/views/vent/home/configurable/components/AirVolumeMonitor.vue

@@ -1,113 +0,0 @@
-<!-- eslint-disable vue/multi-word-component-names -->
-<template>
-  <ModuleBasic :title="config.moduleName" :version="config.showStyle?.version" :size="config.showStyle?.size" :position="config.showStyle?.position">
-    <!-- <CostumeHeader :api="fetchOptions" @change="selectDeviceByID">
-    <div class="w-200px flex flex-items-center">
-      <RightCircleOutlined class="w-30px" />
-      <div class="flex-grow-1">
-        {{ selectedDevice.strinstallpos }}
-      </div>
-    </div>
-  </CostumeHeader> -->
-    <PictorialBar :option="chartOption" series-prop-type="y" x-axis-prop-type="x" :chart-data="chartData" height="100%" />
-    <!-- <div class="flex justify-around mt-10px">
-    <MiniBoard v-for="item in configs" :key="item.prop" :label="item.label" :value="selectedDevice[item.prop]" />
-  </div> -->
-  </ModuleBasic>
-</template>
-<script lang="ts" setup>
-  import { computed, onMounted, ref } from 'vue';
-  import PictorialBar from '/@/components/chart/PictorialBar.vue';
-  import { EChartsOption, graphic } from 'echarts';
-  import { useInitScene } from '../hooks/useInit';
-  import _ from 'lodash-es';
-  import { get } from '../../billboard/utils';
-  import ModuleBasic from './moduleBasic.vue';
-  // import mapComponent from './components/3Dmap/index.vue';
-
-  // 设备类别,是个枚举 TODO: 将手动换为自动获取类别
-  const devicekind = 'sys_wind';
-
-  const config = ref({
-    moduleName: '矿井风量实时监测',
-    moduleData: {
-      chart: {
-        x: 'stationname',
-        y: 'readData.m3',
-      },
-    },
-    showStyle: {
-      size: 'width:1000px;height:280px;',
-      position: 'left:460px;top:640px;',
-      version: 'enhanced',
-    },
-  });
-  // const { config: remoteConfig, fetchConfig } = useInitConfig(devicekind);
-  const { scene, fetchScene } = useInitScene(devicekind);
-
-  const chartData = computed(() => {
-    return scene.value.map((ele) => {
-      return {
-        x: get(ele, get(config.value, 'moduleData.chart.x', 'x')),
-        y: get(ele, get(config.value, 'moduleData.chart.y', 'y')),
-      };
-    });
-  });
-
-  onMounted(() => {
-    // fetchConfig();
-    fetchScene();
-  });
-
-  // 图表的配置项
-  const chartOption: EChartsOption = {
-    grid: {
-      top: 50,
-      height: 150,
-    },
-    yAxis: {
-      splitLine: {
-        lineStyle: {
-          color: '#ffffff',
-          opacity: 0.3,
-        },
-      },
-    },
-    legend: { show: false },
-    series: [
-      {
-        type: 'pictorialBar',
-        name: 'pictorial element',
-        symbol: 'circle',
-        symbolPosition: 'end',
-        symbolSize: [16, 16],
-        symbolOffset: [0, -8],
-        itemStyle: {
-          color: '#66ffff',
-        },
-        data: [],
-      },
-      {
-        name: 'reference bar',
-        type: 'bar',
-        silent: true,
-        itemStyle: {
-          color: new graphic.LinearGradient(0, 0, 0, 1, [
-            { offset: 0, color: '#66ffff' },
-            { offset: 0.2, color: '#66ffff' },
-            { offset: 1, color: '#66ffff22' },
-          ]),
-        },
-        tooltip: {
-          show: false,
-        },
-        barWidth: 8,
-        data: [],
-      },
-    ],
-    textStyle: {
-      color: '#fff',
-    },
-  };
-</script>
-<style scoped></style>

+ 0 - 178
src/views/vent/home/configurable/components/DeviceWarning.vue

@@ -1,178 +0,0 @@
-<!-- eslint-disable vue/multi-word-component-names -->
-<template>
-  <ModuleBasic :title="config.moduleName" :version="config.showStyle?.version" :size="config.showStyle?.size" :position="config.showStyle?.position">
-    <CostumeHeader>
-      <template #select>
-        <!-- 填写空的div以覆盖默认的选择框 -->
-        <div></div>
-      </template>
-      <div class="w-200px flex flex-items-center">
-        <RightCircleOutlined class="w-30px" />
-        <div v-for="(label, prop) in config.moduleData.header" :key="prop" class="flex-grow-1">
-          {{ label }}
-          <span> {{ get(scene, prop) }}条 </span>
-        </div>
-      </div>
-    </CostumeHeader>
-    <div class="timeline">
-      <div v-for="(item, i) in warns" :key="`svvhccdw-${i}`" class="flex items-center timeline-item">
-        <div class="timeline-item__icon" :class="`timeline-item__icon_${item.color}`"></div>
-        <div class="timeline-item__dot"></div>
-        <div class="timeline-item__label">{{ item.label }}</div>
-        <div :class="`timeline-item__value_${item.color}`">{{ item.count }}</div>
-      </div>
-      <div class="timeline-component"></div>
-    </div>
-  </ModuleBasic>
-</template>
-<script lang="ts" setup>
-  import { computed, onMounted, ref } from 'vue';
-  // import { list as cfgList } from '@/views/vent/deviceManager/configurationTable/configuration.api';
-  // import { list } from '@/views/vent/deviceManager/deviceTable/device.api';
-  import ModuleBasic from './moduleBasic.vue';
-  import CostumeHeader from './CostumeHeader.vue';
-  import { RightCircleOutlined } from '@ant-design/icons-vue';
-  import { useInitScene } from '../hooks/useInit';
-  import { get } from '../../billboard/utils';
-  import _ from 'lodash-es';
-  // import MiniBoard from './MiniBoard.vue';
-  // import mapComponent from './components/3Dmap/index.vue';
-
-  // 设备类别,是个枚举 TODO: 将手动换为自动获取类别
-  const devicekind = 'warn';
-
-  // const configs = ref<{ prop: string; label: string }[]>([]);
-  // function fetchConfig() {
-  //   cfgList({
-  //     deviceType: 'devicekind',
-  //   }).then(({ records }) => {
-  //     const moduleData = JSON.parse(records[0]?.moduleData);
-  //     configs.value = Object.keys(moduleData).map((k) => {
-  //       return {
-  //         prop: k,
-  //         label: moduleData[k],
-  //       };
-  //     });
-  //   });
-  // }
-  const config = ref({
-    moduleName: '设备告警',
-    moduleData: {
-      header: {
-        'netstatus.val': '网络断开',
-      },
-      main: {
-        'red.val': '严重',
-        'orange.val': '非常严重',
-        'yellow.val': '较严重',
-        'blue.val': '一般严重',
-        'alarm.val': '报警',
-      },
-    },
-    showStyle: {
-      size: 'width:450px;height:280px;',
-      position: 'right:0px;top:640px;',
-      version: 'enhanced',
-    },
-  });
-  // const { config: remoteConfig, fetchConfig } = useInitConfig(devicekind);
-  const { scene, fetchScene } = useInitScene(devicekind);
-
-  const warns = computed(() => {
-    const colors = ['red', 'orange', 'yellow', 'green', 'blue'];
-    let i = -1;
-    return _.map(config.value.moduleData.main || [], (label, prop) => {
-      i += 1;
-      return {
-        label,
-        count: get(scene, prop),
-        color: colors[i],
-      };
-    });
-  });
-
-  onMounted(() => {
-    fetchScene();
-    // fetchConfig();
-  });
-</script>
-<style lang="less" scoped>
-  @import '@/design/vent/color.less';
-
-  .timeline-item {
-    height: 20%;
-  }
-  .timeline-item__icon_red {
-    background-image: url('@/assets/images/home-container/configurable/warn_icon_5.png');
-  }
-  .timeline-item__icon_orange {
-    background-image: url('@/assets/images/home-container/configurable/warn_icon_4.png');
-  }
-  .timeline-item__icon_yellow {
-    background-image: url('@/assets/images/home-container/configurable/warn_icon_3.png');
-  }
-  .timeline-item__icon_green {
-    background-image: url('@/assets/images/home-container/configurable/warn_icon_2.png');
-  }
-  .timeline-item__icon_blue {
-    background-image: url('@/assets/images/home-container/configurable/warn_icon_1.png');
-  }
-  .timeline-item__icon {
-    width: 33px;
-    height: 35px;
-    margin-left: 50px;
-    background-repeat: no-repeat;
-    background-position: center center;
-  }
-  .timeline-item__dot {
-    width: 10px;
-    height: 10px;
-    margin-left: 70px;
-    background-color: @vent-gas-primary-bg;
-    border-radius: 5px;
-    position: relative;
-  }
-  .timeline-item__dot::before {
-    content: '';
-    position: absolute;
-    top: -3px;
-    left: -3px;
-    width: 16px;
-    height: 16px;
-    border-radius: 8px;
-    border: 1px solid @vent-gas-tab-border;
-  }
-  .timeline-item__label {
-    width: 100px;
-    margin-left: 70px;
-  }
-  .timeline-item__value_red {
-    color: red;
-  }
-  .timeline-item__value_orange {
-    color: orange;
-  }
-  .timeline-item__value_yellow {
-    color: yellow;
-  }
-  .timeline-item__value_green {
-    color: yellowgreen;
-  }
-  .timeline-item__value_blue {
-    color: lightblue;
-  }
-
-  .timeline {
-    height: 220px;
-    padding: 5px;
-    position: relative;
-  }
-  .timeline-component {
-    position: absolute;
-    width: 2px;
-    height: 180px;
-    top: 20px;
-    left: 162px;
-    background-image: @vent-configurable-home-timeline;
-  }
-</style>

+ 0 - 43
src/views/vent/home/configurable/components/SubVentilate.vue

@@ -1,43 +0,0 @@
-<template>
-  <ModuleBasic :title="config.moduleName" :version="config.showStyle?.version" :size="config.showStyle?.size" :position="config.showStyle?.position">
-    <CostumeHeader v-model:value="selectedDeviceID" :options="options">
-      <div class="w-200px flex flex-items-center">
-        <RightCircleOutlined class="w-30px" />
-        <div class="flex-grow-1">
-          {{ selectedDevice.strinstallpos }}
-        </div>
-      </div>
-    </CostumeHeader>
-    <div class="flex justify-around mt-10px">
-      <MiniBoard
-        v-for="(label, prop) in config.moduleData?.main"
-        :key="`vhccsv-${prop}`"
-        :label="label"
-        :value="get(selectedDevice, prop)"
-        type="A"
-      />
-    </div>
-  </ModuleBasic>
-</template>
-<script lang="ts" setup>
-  import { onMounted } from 'vue';
-  import ModuleBasic from './moduleBasic.vue';
-  import CostumeHeader from './CostumeHeader.vue';
-  import { RightCircleOutlined } from '@ant-design/icons-vue';
-  import MiniBoard from './MiniBoard.vue';
-  import { useInitConfig, useInitDevices } from '../hooks/useInit';
-  import { get } from '../../billboard/utils';
-  // import mapComponent from './components/3Dmap/index.vue';
-
-  // 设备类别,是个枚举 TODO: 将手动换为自动获取类别
-  const devicekind = 'fanlocal';
-
-  const { config, fetchConfig } = useInitConfig(devicekind);
-  const { options, selectedDevice, selectedDeviceID, fetchDevices } = useInitDevices(devicekind);
-
-  onMounted(() => {
-    fetchConfig();
-    fetchDevices();
-  });
-</script>
-<style scoped></style>

+ 0 - 38
src/views/vent/home/configurable/components/Ventilate.vue

@@ -1,38 +0,0 @@
-<!-- eslint-disable vue/multi-word-component-names -->
-<template>
-  <ModuleBasic :title="config.moduleName" :version="config.showStyle?.version" :size="config.showStyle?.size" :position="config.showStyle?.position">
-    <CostumeHeader v-model:value="selectedDeviceID" :options="options">
-      <div class="w-200px flex flex-items-center">
-        <RightCircleOutlined class="w-30px" />
-        <div class="flex-grow-1">
-          {{ selectedDevice.strinstallpos }}
-        </div>
-      </div>
-    </CostumeHeader>
-    <div class="flex justify-around mt-10px">
-      <MiniBoard v-for="(label, prop) in config.moduleData?.main" :key="`vhccv-${prop}`" :label="label" :value="get(selectedDevice, prop)" type="C" />
-    </div>
-  </ModuleBasic>
-</template>
-<script lang="ts" setup>
-  import { onMounted } from 'vue';
-  import ModuleBasic from './moduleBasic.vue';
-  import CostumeHeader from './CostumeHeader.vue';
-  import { RightCircleOutlined } from '@ant-design/icons-vue';
-  import MiniBoard from './MiniBoard.vue';
-  import { useInitConfig, useInitDevices } from '../hooks/useInit';
-  import { get } from '../../billboard/utils';
-  // import mapComponent from './components/3Dmap/index.vue';
-
-  // 设备类别,是个枚举 TODO: 将手动换为自动获取类别
-  const devicekind = 'fanmain';
-
-  const { config, fetchConfig } = useInitConfig(devicekind);
-  const { options, selectedDevice, selectedDeviceID, fetchDevices } = useInitDevices(devicekind);
-
-  onMounted(() => {
-    fetchConfig();
-    fetchDevices();
-  });
-</script>
-<style scoped></style>

+ 0 - 105
src/views/vent/home/configurable/components/VentilateAnalysis.vue

@@ -1,105 +0,0 @@
-<!-- eslint-disable vue/multi-word-component-names -->
-<template>
-  <ModuleBasic :title="config.moduleName" :version="config.showStyle?.version" :size="config.showStyle?.size" :position="config.showStyle?.position">
-    <CostumeHeader v-model:value="selectedDeviceID" :options="options">
-      <!-- <div class="w-200px flex flex-items-center">
-      <RightCircleOutlined class="w-30px" />
-      <div class="flex-grow-1">
-        {{ selectedDevice.strinstallpos }}
-      </div>
-    </div> -->
-    </CostumeHeader>
-    <Pie :option="chartOption" :chart-data="chartData" height="140px" />
-    <div class="flex justify-around mt-10px">
-      <MiniBoard
-        v-for="(label, prop) in config.moduleData?.main"
-        :key="`vhccva-${prop}`"
-        :label="label"
-        :value="get(selectedDevice, prop)"
-        layout="label-top"
-        type="D"
-      />
-    </div>
-  </ModuleBasic>
-</template>
-<script lang="ts" setup>
-  import CostumeHeader from './CostumeHeader.vue';
-  import { computed, onMounted, ref } from 'vue';
-  import Pie from '/@/components/chart/Pie.vue';
-  import { EChartsOption } from 'echarts';
-  import { useInitDevices } from '../hooks/useInit';
-  import { get } from '../../billboard/utils';
-  import _ from 'lodash-es';
-  import MiniBoard from './MiniBoard.vue';
-  import ModuleBasic from './moduleBasic.vue';
-  // import mapComponent from './components/3Dmap/index.vue';
-
-  // 设备类别,是个枚举 TODO: 将手动换为自动获取类别
-  const devicekind = 'sys_majorpath';
-
-  const config = ref({
-    moduleName: '关键通风路线', // 通风系统监测与分析
-    moduleData: {
-      main: {
-        // m3_total: '总风量',
-        // drag_total: '总阻力',
-        // dengjikong: '等积孔',
-        'majorpath.drag_1': '阻力1',
-        'majorpath.drag_2': '阻力2',
-        'majorpath.drag_3': '阻力3',
-      },
-      chart: {
-        'majorpath.drag_1': '阻力1',
-        'majorpath.drag_2': '阻力2',
-        'majorpath.drag_3': '阻力3',
-      },
-    },
-    showStyle: {
-      size: 'width:450px;height:280px;',
-      position: 'right:0px;top:60px;',
-      version: 'enhanced',
-    },
-  });
-  // const { config: remoteConfig, fetchConfig } = useInitConfig(devicekind);
-  const { options, selectedDevice, selectedDeviceID, fetchDevices } = useInitDevices(devicekind);
-
-  onMounted(() => {
-    // fetchConfig();
-    fetchDevices();
-  });
-
-  const chartData = computed(() => {
-    return _.map(config.value.moduleData?.chart || [], (label, prop) => {
-      return {
-        value: parseInt(get(selectedDevice.value, prop, 0)),
-        name: label,
-      };
-    });
-  });
-
-  onMounted(() => {});
-
-  // 图表配置项
-  const chartOption: EChartsOption = {
-    series: [
-      {
-        type: 'pie',
-        radius: ['50%', '75%'],
-        center: ['50%', '55%'],
-        data: [],
-        labelLine: { show: false },
-        label: {
-          show: false,
-          // formatter: '{b} \n ({d}%)',
-          // color: '#B1B9D3',
-        },
-        itemStyle: {
-          shadowBlur: 20,
-          shadowColor: '#259bcf',
-        },
-      },
-    ],
-    color: ['#d9a1ff', '#00d1ff', '#82fe78'],
-  };
-</script>
-<style scoped></style>

+ 0 - 44
src/views/vent/home/configurable/components/VentilateControl.vue

@@ -1,44 +0,0 @@
-<!-- eslint-disable vue/multi-word-component-names -->
-<template>
-  <ModuleBasic :title="config.moduleName" :version="config.showStyle?.version" :size="config.showStyle?.size" :position="config.showStyle?.position">
-    <!-- <CostumeHeader v-model:value="selectedDeviceID" :options="options">
-      <template #select>
-        <div></div>
-      </template>
-      <div> </div>
-    </CostumeHeader> -->
-    <!-- <div class="flex justify-around mt-10px">
-    <MiniBoard v-for="item in configs" :key="item.prop" :label="item.label" :value="selectedDevice[item.prop]" />
-  </div> -->
-  </ModuleBasic>
-</template>
-<script lang="ts" setup>
-  import { onMounted, ref } from 'vue';
-  // import CostumeHeader from './CostumeHeader.vue';
-  // import { RightCircleOutlined } from '@ant-design/icons-vue';
-  import ModuleBasic from './moduleBasic.vue';
-  // import MiniBoard from './MiniBoard.vue';
-  // import { useInitDevices } from '../hooks/useInit';
-  // import { get } from '../../billboard/utils';
-  // import mapComponent from './components/3Dmap/index.vue';
-
-  // 设备类别,是个枚举 TODO: 将手动换为自动获取类别
-  // const devicekind = 'fanlocal';
-
-  const config = ref({
-    moduleName: '通风设施远程控制',
-    showStyle: {
-      size: 'width:450px;height:280px;',
-      position: 'left:0;top:640px;',
-      version: 'enhanced',
-    },
-  });
-  // const { configs, fetchConfig } = useInitConfig(devicekind);
-  // const { options, selectedDevice, selectedDeviceID, fetchDevices } = useInitDevices(devicekind);
-
-  onMounted(() => {
-    // fetchConfig();
-    // fetchDevices();
-  });
-</script>
-<style scoped></style>

+ 0 - 125
src/views/vent/home/configurable/components/WorkSurface.vue

@@ -1,125 +0,0 @@
-<!-- eslint-disable vue/multi-word-component-names -->
-<template>
-  <ModuleBasic :title="config.moduleName" :version="config.showStyle?.version" :size="config.showStyle?.size" :position="config.showStyle?.position">
-    <CostumeHeader v-model:value="selectedDeviceID" :options="options">
-      <!-- <div class="w-200px flex flex-items-center">
-      <RightCircleOutlined class="w-30px" />
-      <div class="flex-grow-1">
-        {{ selectedDevice.strinstallpos }}
-      </div>
-    </div> -->
-    </CostumeHeader>
-    <LineMulti
-      :option="chartOption"
-      :prop-type-arr="propTypeArr"
-      x-axis-prop-type="time"
-      :chart-data="chartData"
-      height="140px"
-      class="worksurface-chart"
-    />
-    <div class="flex justify-around">
-      <MiniBoard
-        v-for="(label, prop) in config.moduleData?.main"
-        :key="`vhccws-${prop}`"
-        :label="label"
-        :value="get(selectedDevice, prop)"
-        layout="label-top"
-        type="B"
-      />
-    </div>
-  </ModuleBasic>
-</template>
-<script lang="ts" setup>
-  import LineMulti from '/@/components/chart/LineMulti.vue';
-  import CostumeHeader from './CostumeHeader.vue';
-  import { computed, onMounted, ref } from 'vue';
-  import { EChartsOption } from 'echarts';
-  import { useInitDevices } from '../hooks/useInit';
-  import { get } from '../../billboard/utils';
-  import _ from 'lodash-es';
-  import MiniBoard from './MiniBoard.vue';
-  import ModuleBasic from './moduleBasic.vue';
-  // import mapComponent from './components/3Dmap/index.vue';
-
-  // 设备类别,是个枚举 TODO: 将手动换为自动获取类别
-  const devicekind = 'sys_surface_caimei';
-
-  const config = ref({
-    moduleName: '采煤工作面智能管控',
-    moduleData: {
-      main: {
-        jin: '进风',
-        hui: '回风',
-        xufengliang: '需风量',
-      },
-      // 这里的配置比较特殊,需要配置为数据中 history 对象下的取值路径。无法针对 x 轴进行配置
-      // 例如数据为 { history: [ jin: 10 ] },那么需要配置为 jin
-      chart: {
-        hui: '回风量',
-        jin: '进风量',
-      },
-    },
-    showStyle: {
-      size: 'width:450px;height:280px;',
-      position: 'right:0px;top:350px;',
-      version: 'enhanced',
-    },
-  });
-  // const { config: remoteConfig, fetchConfig } = useInitConfig(devicekind);
-  const { options, selectedDevice, selectedDeviceID, fetchDevices } = useInitDevices(devicekind);
-
-  onMounted(() => {
-    // fetchConfig();
-    fetchDevices();
-  });
-
-  const chartData = computed(() => {
-    return selectedDevice.value.history || [];
-  });
-
-  const propTypeArr = computed(() => {
-    const map = new Map();
-    if (config.value.moduleData?.chart) {
-      _.forEach(config.value.moduleData?.chart || [], (label, prop) => {
-        map.set(prop, label);
-      });
-    }
-    return map;
-  });
-
-  // 图表相关
-  const chartOption: EChartsOption = {
-    legend: {
-      top: 10,
-      right: 10,
-      textStyle: {
-        color: '#fff',
-      },
-    },
-    grid: {
-      top: 35,
-      height: 80,
-    },
-    yAxis: {
-      type: 'value',
-      splitLine: {
-        lineStyle: {
-          color: '#fff',
-          opacity: 0.3,
-        },
-      },
-    },
-    textStyle: {
-      color: '#fff',
-    },
-    backgroundColor: '#081f33',
-    // backgroundColor: '#0091ff12',
-  };
-</script>
-<style scoped lang="less">
-  @import '@/design/vent/color.less';
-
-  .worksurface-chart {
-    border: 1px solid @vent-configurable-home-light-border;
-  }
-</style>

+ 13 - 17
src/views/vent/home/configurable/components/moduleBottom.vue → src/views/vent/home/configurable/components/enhanced/moduleBottom.vue

@@ -1,34 +1,30 @@
 <template>
-  <div class="module-bottom">
+  <Transition class="module-bottom">
     <!-- 正常展示模块时 -->
-    <div class="module-content">
+    <div v-if="visible" class="module-content">
       <div class="module-content__title__expand">
-        <span class="action-btn" :class="{ 'show-btn': !moduleShown }" @click="toggleModuleShown"></span>
+        <span class="action-btn close-btn" @click="closeModel"></span>
         {{ title }}
       </div>
-      <Transition>
-        <div v-if="moduleShown" class="module-slot">
-          <slot></slot>
-        </div>
-      </Transition>
+      <div class="module-slot">
+        <slot></slot>
+      </div>
     </div>
     <!-- 隐藏模块时 -->
     <!-- <div v-else class="w-100%">
-      <div class="module-content__title__expand">
-        <span class="action-btn" @click="showModel"></span>
+      <div class="module-content__title">
+        <span class="action-btn show-btn" @click="showModel"></span>
         {{ title }}
       </div>
     </div> -->
-  </div>
+  </Transition>
 </template>
 <script lang="ts" setup>
-  import { ref } from 'vue';
-
-  defineProps<{ title: string }>();
-  const moduleShown = ref(true);
+  defineProps<{ title: string; visible: boolean }>();
+  const emit = defineEmits(['update:visible']);
 
-  function toggleModuleShown() {
-    moduleShown.value = !moduleShown.value;
+  function closeModel() {
+    emit('update:visible', false);
   }
 </script>
 <style lang="less" scoped>

+ 6 - 11
src/views/vent/home/configurable/components/moduleLeft.vue → src/views/vent/home/configurable/components/enhanced/moduleLeft.vue

@@ -1,7 +1,7 @@
 <template>
   <Transition class="module-left">
     <!-- 正常展示模块时 -->
-    <div v-if="moduleShown" class="module-content">
+    <div v-if="visible" class="module-content">
       <div class="module-content__title__expand">
         <span class="action-btn close-btn" @click="closeModel"></span>
         {{ title }}
@@ -11,25 +11,20 @@
       </div>
     </div>
     <!-- 隐藏模块时 -->
-    <div v-else class="w-100%">
+    <!-- <div v-else class="w-100%">
       <div class="module-content__title">
         <span class="action-btn show-btn" @click="showModel"></span>
         {{ title }}
       </div>
-    </div>
+    </div> -->
   </Transition>
 </template>
 <script lang="ts" setup>
-  import { ref } from 'vue';
-
-  defineProps<{ title: string }>();
-  const moduleShown = ref(true);
+  defineProps<{ title: string; visible: boolean }>();
+  const emit = defineEmits(['update:visible']);
 
   function closeModel() {
-    moduleShown.value = false;
-  }
-  function showModel() {
-    moduleShown.value = true;
+    emit('update:visible', false);
   }
 </script>
 <style lang="less" scoped>

+ 6 - 11
src/views/vent/home/configurable/components/moduleRight.vue → src/views/vent/home/configurable/components/enhanced/moduleRight.vue

@@ -1,7 +1,7 @@
 <template>
   <Transition class="module-right">
     <!-- 正常展示模块时 -->
-    <div v-if="moduleShown" class="module-content">
+    <div v-if="visible" class="module-content">
       <div class="module-content__title__expand">
         <span class="action-btn close-btn" @click="closeModel"></span>
         {{ title }}
@@ -11,25 +11,20 @@
       </div>
     </div>
     <!-- 隐藏模块时 -->
-    <div v-else class="w-100%">
+    <!-- <div v-else class="w-100%">
       <div class="module-content__title">
         <span class="action-btn show-btn" @click="showModel"></span>
         {{ title }}
       </div>
-    </div>
+    </div> -->
   </Transition>
 </template>
 <script lang="ts" setup>
-  import { ref } from 'vue';
-
-  defineProps<{ title: string }>();
-  const moduleShown = ref(true);
+  defineProps<{ title: string; visible: boolean }>();
+  const emit = defineEmits(['update:visible']);
 
   function closeModel() {
-    moduleShown.value = false;
-  }
-  function showModel() {
-    moduleShown.value = true;
+    emit('update:visible', false);
   }
 </script>
 <style lang="less" scoped>

+ 0 - 47
src/views/vent/home/configurable/components/moduleBasic.vue

@@ -1,47 +0,0 @@
-<template>
-  <component :is="getModuleComponent(position, version)" :style="style" :title="title">
-    <slot></slot>
-  </component>
-</template>
-<script lang="ts" setup>
-  import ModuleLeft from './moduleLeft.vue';
-  import ModuleRight from './moduleRight.vue';
-  import ModuleBottom from './moduleBottom.vue';
-  import { computed } from 'vue';
-
-  const props = withDefaults(
-    defineProps<{
-      title?: string;
-      position?: string;
-      size?: string;
-      version?: string;
-    }>(),
-    {
-      title: '',
-      position: '',
-      version: '',
-      size: '',
-    }
-  );
-
-  const style = computed(() => {
-    return props.size + props.position;
-  });
-
-  // 根据配置里的定位判断应该使用哪个module组件
-  function getModuleComponent(position, version) {
-    if (version === 'original') {
-      return ModuleLeft; // TODO:改为返回旧版的module组件
-    }
-    if (position.includes('left:0')) {
-      return ModuleLeft;
-    }
-    if (position.includes('right:0')) {
-      return ModuleRight;
-    }
-    if (position.includes('bottom:0')) {
-      return ModuleBottom;
-    }
-    return ModuleLeft; // TODO:改为返回旧版的module组件
-  }
-</script>

+ 44 - 0
src/views/vent/home/configurable/components/moduleEnhanced.vue

@@ -0,0 +1,44 @@
+<template>
+  <component
+    :is="getModuleComponent(showStyle.position)"
+    :style="style"
+    :title="moduleName"
+    :visible="visible"
+    @update:visible="$emit('update:visible', $event)"
+  >
+    <slot></slot>
+  </component>
+</template>
+<script lang="ts" setup>
+  import ModuleLeft from './enhanced/moduleLeft.vue';
+  import ModuleRight from './enhanced/moduleRight.vue';
+  import ModuleBottom from './enhanced/moduleBottom.vue';
+  import { computed } from 'vue';
+  import { ModuleData, ShowStyle } from '../../../deviceManager/configurationTable/types';
+
+  const props = defineProps<{
+    showStyle: ShowStyle;
+    moduleData: ModuleData;
+    moduleName: string;
+    visible: boolean;
+  }>();
+  defineEmits(['update:visible']);
+
+  const style = computed(() => {
+    return props.showStyle.size + props.showStyle.position;
+  });
+
+  // 根据配置里的定位判断应该使用哪个module组件
+  function getModuleComponent(position) {
+    if (position.includes('left:0')) {
+      return ModuleLeft;
+    }
+    if (position.includes('right:0')) {
+      return ModuleRight;
+    }
+    if (position.includes('bottom:0')) {
+      return ModuleBottom;
+    }
+    return ModuleLeft; //
+  }
+</script>

+ 37 - 0
src/views/vent/home/configurable/components/moduleOriginal.vue

@@ -0,0 +1,37 @@
+<template>
+  <component
+    :is="getModuleComponent(showStyle.position)"
+    :style="style"
+    :title="moduleName"
+    :visible="visible"
+    @update:visible="$emit('update:visible', $event)"
+  >
+    <slot></slot>
+  </component>
+</template>
+<script lang="ts" setup>
+  import ModuleLeft from './original/moduleLeft.vue';
+  import ModuleBottom from './original/moduleBottom.vue';
+  import { computed } from 'vue';
+  import { ModuleData, ShowStyle } from '../../../deviceManager/configurationTable/types';
+
+  const props = defineProps<{
+    showStyle: ShowStyle;
+    moduleData: ModuleData;
+    moduleName: string;
+    visible: boolean;
+  }>();
+  defineEmits(['update:visible']);
+
+  const style = computed(() => {
+    return props.showStyle.size + props.showStyle.position;
+  });
+
+  // 根据配置里的定位判断应该使用哪个module组件
+  function getModuleComponent(position) {
+    if (position.includes('bottom:0')) {
+      return ModuleBottom;
+    }
+    return ModuleLeft;
+  }
+</script>

+ 93 - 0
src/views/vent/home/configurable/components/original/moduleBottom.vue

@@ -0,0 +1,93 @@
+<template>
+  <Transition class="module-bottom">
+    <!-- 正常展示模块时 -->
+    <div v-if="visible" class="module-content">
+      <div class="module-content__title__expand">
+        <span class="action-btn close-btn" @click="closeModel"></span>
+        {{ title }}
+      </div>
+      <div class="module-slot">
+        <slot></slot>
+      </div>
+    </div>
+    <!-- 隐藏模块时 -->
+    <!-- <div v-else class="w-100%">
+      <div class="module-content__title">
+        <span class="action-btn show-btn" @click="showModel"></span>
+        {{ title }}
+      </div>
+    </div> -->
+  </Transition>
+</template>
+<script lang="ts" setup>
+  defineProps<{ title: string; visible: boolean }>();
+  const emit = defineEmits(['update:visible']);
+
+  function closeModel() {
+    emit('update:visible', false);
+  }
+</script>
+<style lang="less" scoped>
+  .module-bottom {
+    --bg-height: 33px;
+    color: #fff;
+    box-sizing: border-box;
+
+    .module-content {
+      width: 100%;
+      height: 100%;
+    }
+
+    .module-content__title__expand {
+      width: 100%;
+      height: var(--bg-height);
+      background: url('@/assets/images/home-container/configurable/model_original_title_bg_expand.png') no-repeat;
+      background-size: 100% 100%;
+      position: relative;
+      text-align: left;
+      padding: 4px 0 0 5%;
+    }
+
+    // .module-content__title {
+    //   width: 50%;
+    //   height: var(--bg-height);
+    //   background: url('../../../../../assets/images/home-container/configurable/model_bottom_title_bg.png') no-repeat;
+    //   background-size: 100% 100%;
+    //   position: relative;
+    //   text-align: left;
+    //   padding-left: 5%;
+    // }
+
+    // 固定在父容器右上角的按钮图标
+    // .action-btn {
+    //   width: 18px;
+    //   height: 18px;
+    //   background: url('../../../../../assets/images/home-container/configurable/expand.svg') no-repeat center;
+    //   position: absolute;
+    //   left: 0;
+    //   top: 0;
+    // }
+    // .show-btn {
+    //   transform: rotate(-90deg);
+    // }
+
+    .module-slot {
+      height: calc(100% - 33px);
+      width: 100%;
+      backdrop-filter: blur(5px);
+      background-color: #6ad6ff1c;
+    }
+  }
+
+  // Transition动画相关
+  .v-enter-active,
+  .v-leave-active {
+    transition: all 0.3s ease;
+  }
+
+  .v-enter-from,
+  .v-leave-to {
+    opacity: 0;
+    transform: translateY(-33px);
+  }
+</style>

+ 95 - 0
src/views/vent/home/configurable/components/original/moduleLeft.vue

@@ -0,0 +1,95 @@
+<template>
+  <Transition class="module-left">
+    <!-- 正常展示模块时 -->
+    <div v-if="visible" class="module-content">
+      <div class="module-content__title__expand">
+        <span class="action-btn close-btn" @click="closeModel"></span>
+        {{ title }}
+      </div>
+      <div class="module-slot">
+        <slot></slot>
+      </div>
+    </div>
+    <!-- 隐藏模块时 -->
+    <!-- <div v-else class="w-100%">
+      <div class="module-content__title">
+        <span class="action-btn show-btn" @click="showModel"></span>
+        {{ title }}
+      </div>
+    </div> -->
+  </Transition>
+</template>
+<script lang="ts" setup>
+  defineProps<{ title: string; visible: boolean }>();
+  const emit = defineEmits(['update:visible']);
+
+  function closeModel() {
+    emit('update:visible', false);
+  }
+</script>
+<style lang="less" scoped>
+  .module-left {
+    --bg-height: 33px;
+    color: #fff;
+    box-sizing: border-box;
+
+    .module-content {
+      width: 100%;
+      height: 100%;
+    }
+
+    .module-content__title__expand {
+      width: 100%;
+      height: var(--bg-height);
+      background: url('@/assets/images/home-container/configurable/model_original_title_bg.png') no-repeat;
+      background-size: 100% 100%;
+      position: relative;
+      text-align: right;
+      padding: 4px 10% 0 0;
+    }
+
+    // .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: 100%;
+      backdrop-filter: blur(5px);
+      background-color: #6ad6ff1c;
+    }
+  }
+
+  // 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>

+ 30 - 9
src/views/vent/home/configurable/hooks/useInit.ts

@@ -5,19 +5,40 @@ import { Config } from '@/views/vent/deviceManager/configurationTable/types';
 import { getHomeData } from '../configurable.api';
 // import mapComponent from './components/3Dmap/index.vue';
 
-export function useInitConfig(deviceType: string) {
-  function fetchConfig() {
-    cfgList({
-      deviceType,
-    }).then(({ records }) => {
-      config.value = records[0];
+// export function useInitConfig(deviceType: string) {
+//   function fetchConfig() {
+//     cfgList({
+//       deviceType,
+//     }).then(({ records }) => {
+//       config.value = records[0];
+//     });
+//   }
+//   const config = ref<Partial<Config>>({});
+
+//   return {
+//     fetchConfig,
+//     config,
+//   };
+// }
+
+export function useInitConfigs() {
+  const configs = ref<Config[]>([]);
+  const isOriginal = computed(() => {
+    return configs.value.some((c) => {
+      return c.showStyle.version === 'original';
+    });
+  });
+
+  function fetchConfigs() {
+    cfgList({}).then(({ records }) => {
+      configs.value = records;
     });
   }
-  const config = ref<Partial<Config>>({});
 
   return {
-    fetchConfig,
-    config,
+    fetchConfigs,
+    configs,
+    isOriginal,
   };
 }
 

+ 97 - 11
src/views/vent/home/configurable/index.vue

@@ -4,7 +4,7 @@
     <div class="top-bg">
       <div class="main-title">{{ mainTitle }}</div>
     </div>
-    <a-dropdown class="module-dropdown" :trigger="['click']" placement="bottomRight">
+    <a-dropdown class="module-dropdown" :class="{ 'module-dropdown-original': isOriginal }" :trigger="['click']" placement="bottomRight">
       <a class="ant-dropdown-link" @click.prevent>
         全矿井通风检测
         <CaretDownOutlined />
@@ -14,29 +14,106 @@
       </template>
     </a-dropdown>
     <!-- 采用定位方式以避免出现各个模块隐藏时其他模块下移的问题 -->
-    <SubVentilate />
+
+    <!-- <SubVentilate />
     <Ventilate />
     <VentilateControl />
     <AirVolumeMonitor />
     <VentilateAnalysis />
     <WorkSurface />
-    <DeviceWarning />
+    <DeviceWarning /> -->
+    <div v-if="isOriginal"> </div>
+    <div v-else>
+      <ModuleEnhanced v-for="cfg in configs" :key="cfg.deviceType" v-bind="cfg" :visible="visible" />
+    </div>
   </div>
 </template>
 <script lang="ts" setup>
-  import { ref } from 'vue';
-  import SubVentilate from './components/SubVentilate.vue';
-  import Ventilate from './components/Ventilate.vue';
+  import { onMounted, ref } from 'vue';
+  // import SubVentilate from './components/SubVentilate.vue';
+  // import Ventilate from './components/Ventilate.vue';
   import { CaretDownOutlined } from '@ant-design/icons-vue';
-  import VentilateControl from './components/VentilateControl.vue';
-  import AirVolumeMonitor from './components/AirVolumeMonitor.vue';
-  import VentilateAnalysis from './components/VentilateAnalysis.vue';
-  import WorkSurface from './components/WorkSurface.vue';
-  import DeviceWarning from './components/DeviceWarning.vue';
+  // import VentilateControl from './components/VentilateControl.vue';
+  // import AirVolumeMonitor from './components/AirVolumeMonitor.vue';
+  // import VentilateAnalysis from './components/VentilateAnalysis.vue';
+  // import WorkSurface from './components/WorkSurface.vue';
+  // import DeviceWarning from './components/DeviceWarning.vue';
   import MonitorCenter from './components/MonitorCenter.vue';
+  // import { useInitConfigs } from './hooks/useInit';
+  import { Config } from '../../deviceManager/configurationTable/types';
+  import ModuleEnhanced from './components/moduleEnhanced.vue';
   // import mapComponent from './components/3Dmap/index.vue';
 
   const mainTitle = ref('智能通风管控系统');
+
+  // const moduleCodes = ['fanlocal', 'fanmain' /** 'vc', 'ar', 'va', 'ws', 'dw' */];
+
+  const configs = ref<Config[]>([
+    {
+      deviceType: 'fanlocal',
+      moduleName: '测试局扇',
+      pageType: '',
+      moduleData: {
+        header: {
+          show: true,
+          showSelector: true,
+          showSlot: true,
+          selector: {
+            icon: 'SwapOutlined',
+            prop: 'strInstallPos',
+          },
+          slot: {
+            icon: 'SwapOutlined',
+            prop: 'strInstallPos',
+          },
+        },
+        background: {
+          show: false,
+          type: 'vedio',
+          link: '',
+        },
+        layout: ['board', 'chart'],
+        board: [
+          {
+            label: '风量',
+            type: 'A',
+            layout: 'value-top',
+            prop: 'f1Val',
+          },
+          {
+            label: '风速',
+            type: 'A',
+            layout: 'value-top',
+            prop: 'f2Val',
+          },
+        ],
+        chart: [
+          {
+            type: 'line',
+            readFrom: 'readData.history',
+            xAxis: [{ prop: 'strInstallPos' }],
+            yAxis: ['风量', '风速'],
+            series: [
+              { label: '风量', prop: 'f1Val' },
+              { label: '风速', prop: 'f2Val' },
+            ],
+          },
+        ],
+      },
+      showStyle: {
+        size: 'width:450px;height:280px;',
+        version: 'enhanced',
+        position: 'top:60px;left:0;',
+      },
+    },
+  ]);
+  const isOriginal = false;
+  const visible = ref(true);
+  // const { configs, isOriginal, fetchConfigs } = useInitConfigs();
+
+  onMounted(() => {
+    // fetchConfigs();
+  });
 </script>
 <style lang="less" scoped>
   @font-face {
@@ -93,5 +170,14 @@
       top: 70px;
       right: 460px;
     }
+    .module-dropdown-original {
+      padding: 10px;
+      background-image: linear-gradient(to bottom, #036886, #072a40);
+      border-bottom: 2px solid #3df6ff;
+      color: #fff;
+      position: absolute;
+      top: 70px;
+      right: 460px;
+    }
   }
 </style>

+ 4 - 2
src/views/vent/monitorManager/mainFanMonitor/main.threejs.ts

@@ -216,8 +216,10 @@ export const playAnimate = async (selectData, duration?) => {
 
   if (modalType === 'mainWindRect') {
     mainObj = mainWindObj;
+    // bgGroup.visible = true;
   } else if (modalType === 'mainXjWindRect') {
     mainObj = mainXjWindObj;
+    // bgGroup.visible = false;
   }
 
   if (selectData && mainObj) {
@@ -337,12 +339,12 @@ export const setModelType = (type) => {
       setTimeout(async () => {
         resolve(null);
         // const position = mainWindObj.group.position;
-        const position = new THREE.Vector3(-0.45, 0.84, -10.35);
+        const position = new THREE.Vector3(12.96, 23.17, -23.16);
         const oldCameraPosition = { x: -332.39, y: 283.47, z: 438.61 };
         await animateCamera(
           oldCameraPosition,
           { x: -3.41, y: -29.01, z: 8.84 },
-          { x: -1.23, y: 75.15, z: 118.36 },
+          { x: 12.09, y: 105.51, z: 119.45 },
           { x: position.x, y: position.y, z: position.z },
           model,
           0.8

+ 5 - 5
src/views/vent/monitorManager/mainFanMonitor/mainWind.xj.threejs.ts

@@ -60,8 +60,8 @@ class mainXjWindRect {
         const mainCSS3D = new CSS3DObject(element);
         mainCSS3D.name = 'monitorText1';
         mainCSS3D.scale.set(0.09, 0.09, 0.09);
-        mainCSS3D.position.set(worldPosition.x + 34, worldPosition.y - 5, worldPosition.z - 35);
-        mainCSS3D.lookAt(worldPosition.x + 34, worldPosition.y + 5, worldPosition.z + 2);
+        mainCSS3D.position.set(worldPosition.x + 34, worldPosition.y - 35, worldPosition.z - 35);
+        mainCSS3D.lookAt(worldPosition.x + 34, worldPosition.y - 30, worldPosition.z + 2);
         this.group.add(mainCSS3D);
       }
     }
@@ -73,8 +73,8 @@ class mainXjWindRect {
         const mainCSS3D = new CSS3DObject(element);
         mainCSS3D.name = 'monitorText2';
         mainCSS3D.scale.set(0.09, 0.09, 0.09);
-        mainCSS3D.position.set(worldPosition.x + 34, worldPosition.y - 5, worldPosition.z - 20);
-        mainCSS3D.lookAt(worldPosition.x + 34, worldPosition.y + 5, worldPosition.z + 2);
+        mainCSS3D.position.set(worldPosition.x + 34, worldPosition.y - 35, worldPosition.z - 20);
+        mainCSS3D.lookAt(worldPosition.x + 34, worldPosition.y - 30, worldPosition.z + 2);
         this.group.add(mainCSS3D);
       }
     }
@@ -688,7 +688,7 @@ class mainXjWindRect {
         ztfjModal.position.set(4.64, 4.11, 1.52);
         this.group?.add(gltf[0].children[0]);
         // this.group?.position.set(4.77, 3.63, 0.63);
-        this.group?.position.set(-0.44, 19.88, 22.37);
+        this.group?.position.set(-0.44, 47.32, 22.37);
         this.initSmokeMass();
         await this.setSmokePosition();
 

+ 5 - 5
src/views/vent/monitorManager/nitrogen/index.vue

@@ -39,11 +39,11 @@
       pathName: 'yfj_history',
       isHover: false,
     },
-    {
-      title: '操作历史记录',
-      pathName: 'yfj_handler_history',
-      isHover: false,
-    },
+    // {
+    //   title: '操作历史记录',
+    //   pathName: 'yfj_handler_history',
+    //   isHover: false,
+    // },
     {
       title: '故障诊断历史记录',
       pathName: 'yfj_faultRecord',

+ 2 - 1
src/views/vent/monitorManager/safetyMonitor/index.vue

@@ -175,7 +175,8 @@
             :chartsColumns="chartsColumnsreal" chartsType="" :option="echartsOption" />
         </div> -->
       </a-tab-pane>
-      <a-tab-pane key="3" tab="报警历史">
+
+      <a-tab-pane key="3" tab="报警历史" v-if="!hasPermission('safety:hideWarning')">
         <div class="tab-item">
           <AlarmHistoryTable
             ref="alarmHistoryTable"

+ 7 - 3
src/views/vent/monitorManager/windrectMonitor/index.vue

@@ -615,9 +615,8 @@
   }
 
   function resetHandle() {
-    resetWind({}).then((res: any) => {
-      message.info(res);
-    });
+    modalType.value = 'resetWind';
+    modalIsShow.value = true;
   }
 
   function exportExcel(id) {
@@ -688,6 +687,11 @@
           }
           modalIsShow.value = false;
         });
+      } else if (type == 'resetWind') {
+        resetWind({}).then((res: any) => {
+          message.info(res);
+        });
+        modalIsShow.value = false;
       }
     } catch (error) {
       message.error('测风失败,请联系管理员。。。');

+ 3 - 3
src/views/vent/performance/comment/CADModal.vue

@@ -35,7 +35,7 @@
   import { onMounted } from 'vue';
   import CADViewer from '/@/views/vent/performance/fileDetail/commen/CADViewer.vue';
   import { useGlobSetting } from '/@/hooks/setting';
-  import { AUTO_LOGIN_URL_QUERY } from '/@/router/constant';
+  import { AUTO_LOGIN_URL_QUERY, SKIP_SSO_URL_QUERY } from '/@/router/constant';
 
   const { sysOrgCode } = useGlobSetting();
   // 不是布尔台的使用 mxcad 模式,是布尔台的使用 iframe 模式以避免“法律风险”
@@ -58,9 +58,9 @@
       filename.value = record.fileName;
     } else {
       // 当以 iframe 模式运行时,origin 在生产模式下需要指向本项目公司端所部署的地址
-      const origin = import.meta.env.PROD ? 'http://10.224.104.150:8092' : window.location.origin;
+      const origin = import.meta.env.PROD ? 'http://10.248.235.101:8092' : window.location.origin;
       // const origin = import.meta.env.DEV ? 'http://182.92.126.35:8092' : window.location.origin;
-      iframesrc.value = `${origin}/fileManager/cad-viewer?${AUTO_LOGIN_URL_QUERY.key}=${AUTO_LOGIN_URL_QUERY.val}&id=${record.id}&filename=${record.fileName}`;
+      iframesrc.value = `${origin}/fileManager/cad-viewer?${SKIP_SSO_URL_QUERY.key}=${SKIP_SSO_URL_QUERY.val}&${AUTO_LOGIN_URL_QUERY.key}=${AUTO_LOGIN_URL_QUERY.val}&id=${record.id}&filename=${record.fileName}`;
     }
   });