Bläddra i källkod

[Style 0000] 优化首页风量监测样式

houzekong 3 dagar sedan
förälder
incheckning
6742e70a8e
1 ändrade filer med 11 tillägg och 8 borttagningar
  1. 11 8
      src/views/vent/home/configurable/components/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;