|
@@ -43,10 +43,10 @@
|
|
|
</a-space>
|
|
</a-space>
|
|
|
</template>
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
- import { inRange } from 'lodash-es';
|
|
|
|
|
|
|
+ import { defaultTo, inRange } from 'lodash-es';
|
|
|
import { getFormattedText } from '../../hooks/helper';
|
|
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 { get } from 'lodash-es';
|
|
|
// import { computed } from 'vue';
|
|
// import { computed } from 'vue';
|
|
@@ -63,13 +63,16 @@
|
|
|
// defineEmits(['click']);
|
|
// defineEmits(['click']);
|
|
|
|
|
|
|
|
// 判断val是否在low、high指定的范围内
|
|
// 判断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 { y, directions } = useScroll(container); // 当前滚动位置(响应式)
|
|
|
|
|
|
|
|
// const STEP = 234;
|
|
// const STEP = 234;
|