Ver Fonte

Merge branch 'master' of http://39.97.59.228:8013/hrx/mky-vent-base

hongrunxia há 3 dias atrás
pai
commit
5224b447ac

+ 2 - 1
src/main.ts

@@ -66,9 +66,10 @@ async function bootstrap() {
 
   // 注册第三方组件
   await registerThirdComp(app);
-
+  // console.time('debug'); // 49842 ms - 13552 ms
   // 当路由准备好时再执行挂载( https://next.router.vuejs.org/api/#isready)
   await router.isReady();
+  // console.timeEnd('debug');
 
   initModalWorker();
 

+ 39 - 38
src/views/vent/home/configurable/components/content.vue

@@ -256,48 +256,49 @@
 <script lang="ts" setup>
   import { computed, defineAsyncComponent, ref } from 'vue';
   import { CommonItem, Config } from '../../../deviceManager/configurationTable/types';
-  import MiniBoard from './detail/MiniBoard.vue';
-  import TimelineList from './detail/TimelineList.vue';
-  import TimelineListNew from './detail/TimelineListNew.vue';
-  import CustomList from './detail/CustomList.vue';
-  import CustomGallery from './detail/CustomGallery.vue';
-  import ComplexList from './detail/ComplexList.vue';
-  import GalleryList from './detail/GalleryList.vue';
-  import CustomTable from './detail/CustomTable.vue';
-  import CustomChart from './detail/CustomChart.vue';
   import { clone } from 'lodash-es';
   import { getData, getFormattedText } from '../hooks/helper';
-  import BlastDelta from '../../../monitorManager/deviceMonitor/components/device/modal/blastDelta.vue';
-  import QHCurve from './preset/QHCurve.vue';
-  import MeasureDetail from './preset/MeasureDetail.vue';
-  import CustomTabs from './preset/CustomTabs.vue';
-  import AIChat from '/@/components/AIChat/MiniChat.vue';
-  import DeviceAlarm from './preset/DeviceAlarm.vue';
-  import SelectCs from './preset/SelectCs.vue';
-  import MiniBoardNew from './detail/MiniBoard-New.vue';
-  import Partition from './preset/partition.vue';
-  import SelectorDualChart from './preset/selectorDualChart.vue';
-  import RadioLabel from './preset/radioLabel.vue';
-  import ButtonList from './preset/buttonList.vue';
-  import NitrogenBtnList from './preset/nitrogenBtnList.vue';
-  import cardList from './preset/cardList.vue';
-  import generalList from './preset/generalList.vue';
-  import GateBoard from '../belt/components/detail/gateBoard.vue';
-  import fireGateBoard from '../belt/components/detail/fireGateBoard.vue';
-  import PersonPositioning from './preset/PersonPositioning.vue';
+
+  const MiniBoard = defineAsyncComponent(() => import('./detail/MiniBoard.vue'));
+  const TimelineList = defineAsyncComponent(() => import('./detail/TimelineList.vue'));
+  const TimelineListNew = defineAsyncComponent(() => import('./detail/TimelineListNew.vue'));
+  const CustomList = defineAsyncComponent(() => import('./detail/CustomList.vue'));
+  const CustomGallery = defineAsyncComponent(() => import('./detail/CustomGallery.vue'));
+  const ComplexList = defineAsyncComponent(() => import('./detail/ComplexList.vue'));
+  const GalleryList = defineAsyncComponent(() => import('./detail/GalleryList.vue'));
+  const CustomTable = defineAsyncComponent(() => import('./detail/CustomTable.vue'));
+  const CustomChart = defineAsyncComponent(() => import('./detail/CustomChart.vue'));
+  const BlastDelta = defineAsyncComponent(() => import('../../../monitorManager/deviceMonitor/components/device/modal/blastDelta.vue'));
+  const QHCurve = defineAsyncComponent(() => import('./preset/QHCurve.vue'));
+  const MeasureDetail = defineAsyncComponent(() => import('./preset/MeasureDetail.vue'));
+  const CustomTabs = defineAsyncComponent(() => import('./preset/CustomTabs.vue'));
+  const AIChat = defineAsyncComponent(() => import('/@/components/AIChat/MiniChat.vue'));
+  const DeviceAlarm = defineAsyncComponent(() => import('./preset/DeviceAlarm.vue'));
+  const SelectCs = defineAsyncComponent(() => import('./preset/SelectCs.vue'));
+  const MiniBoardNew = defineAsyncComponent(() => import('./detail/MiniBoard-New.vue'));
+  const Partition = defineAsyncComponent(() => import('./preset/partition.vue'));
+  const SelectorDualChart = defineAsyncComponent(() => import('./preset/selectorDualChart.vue'));
+  const RadioLabel = defineAsyncComponent(() => import('./preset/radioLabel.vue'));
+  const ButtonList = defineAsyncComponent(() => import('./preset/buttonList.vue'));
+  const NitrogenBtnList = defineAsyncComponent(() => import('./preset/nitrogenBtnList.vue'));
+  const cardList = defineAsyncComponent(() => import('./preset/cardList.vue'));
+  const generalList = defineAsyncComponent(() => import('./preset/generalList.vue'));
+  const GateBoard = defineAsyncComponent(() => import('../belt/components/detail/gateBoard.vue'));
+  const fireGateBoard = defineAsyncComponent(() => import('../belt/components/detail/fireGateBoard.vue'));
+  const PersonPositioning = defineAsyncComponent(() => import('./preset/PersonPositioning.vue'));
   // ==================== 新增皮带巷火灾监测组件 ====================
-  import SensorStatusPanel from './belt/SensorStatusPanel.vue';
-  import FireSensorAnalysis from './belt/FireSensorAnalysis.vue';
-  import WarningResultList from './belt/WarningResultList.vue';
-  import VehicleCOAnalysis from './belt/VehicleCOAnalysis.vue';
+  const SensorStatusPanel = defineAsyncComponent(() => import('./belt/SensorStatusPanel.vue'));
+  const FireSensorAnalysis = defineAsyncComponent(() => import('./belt/FireSensorAnalysis.vue'));
+  const WarningResultList = defineAsyncComponent(() => import('./belt/WarningResultList.vue'));
+  const VehicleCOAnalysis = defineAsyncComponent(() => import('./belt/VehicleCOAnalysis.vue'));
   // 首页组件
-  import CustomListBelt from './belt/CustomListBelt.vue';
-  import ComplexListBelt from './belt/ComplexListBelt.vue';
-  import ComplexList1Belt from './belt/ComplexList1Belt.vue';
-  import CustomTableBelt from './belt/CustomTableBelt.vue';
-  import SprayControl from './belt/SprayControl.vue';
-  import CameraList from './belt/CameraList.vue';
-  import CameraListTest from './belt/CameraListTest.vue';
+  const CustomListBelt = defineAsyncComponent(() => import('./belt/CustomListBelt.vue'));
+  const ComplexListBelt = defineAsyncComponent(() => import('./belt/ComplexListBelt.vue'));
+  const ComplexList1Belt = defineAsyncComponent(() => import('./belt/ComplexList1Belt.vue'));
+  const CustomTableBelt = defineAsyncComponent(() => import('./belt/CustomTableBelt.vue'));
+  const SprayControl = defineAsyncComponent(() => import('./belt/SprayControl.vue'));
+  const CameraList = defineAsyncComponent(() => import('./belt/CameraList.vue'));
+  const CameraListTest = defineAsyncComponent(() => import('./belt/CameraListTest.vue'));
 
   const SysWindCard = defineAsyncComponent(() => import('./preset/SysWindCard.vue'));
 

+ 11 - 8
src/views/vent/home/configurable/components/preset/SysWindCard.vue

@@ -43,10 +43,10 @@
   </a-space>
 </template>
 <script lang="ts" setup>
-  import { inRange } from 'lodash-es';
+  import { defaultTo, inRange } from 'lodash-es';
   import { getFormattedText } from '../../hooks/helper';
-  import { useEventListener, useScroll } from '@vueuse/core';
-  import { ref } from 'vue';
+  // import { useEventListener, useScroll } from '@vueuse/core';
+  // import { ref } from 'vue';
 
   // import { get } from 'lodash-es';
   // import { computed } from 'vue';
@@ -63,13 +63,16 @@
   //   defineEmits(['click']);
 
   // 判断val是否在low、high指定的范围内
-  function isOverLimit(val: string, low?: string, high?: string) {
-    const l = low ? parseFloat(low) : -Infinity;
-    const h = high ? parseFloat(high) : Infinity;
-    return !inRange(parseFloat(val), l, h);
+  function isOverLimit(val: string, low: string = '', high: string = '') {
+    const l = parseFloat(low);
+    const h = parseFloat(high);
+    const v = parseFloat(val);
+
+    console.log('debug rrr', defaultTo(v, 0), defaultTo(l, -Infinity), defaultTo(h, Infinity));
+    return !inRange(defaultTo(v, 0), defaultTo(l, -Infinity), defaultTo(h, Infinity));
   }
 
-  const container = ref<HTMLElement>();
+  // const container = ref<HTMLElement>();
   // const { y, directions } = useScroll(container); // 当前滚动位置(响应式)
 
   // const STEP = 234;