diff --git a/components.d.ts b/components.d.ts index b124c6f..393e90d 100644 --- a/components.d.ts +++ b/components.d.ts @@ -11,7 +11,9 @@ export {} /* prettier-ignore */ declare module 'vue' { export interface GlobalComponents { + 2: typeof import('./src/components/virtual-scroller/VirtualScroller copy 2.vue')['default'] Canvas: typeof import('./src/components/canvas/index.vue')['default'] + copy: typeof import('./src/components/virtual-scroller/VirtualScroller copy.vue')['default'] DialogBox: typeof import('./src/components/dialogBox/index.vue')['default'] ElButton: typeof import('element-plus/es')['ElButton'] ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] diff --git a/src/components/virtual-scroller/VirtualScroller.vue b/src/components/virtual-scroller/VirtualScroller.vue index 85f8a37..55f5a2b 100644 --- a/src/components/virtual-scroller/VirtualScroller.vue +++ b/src/components/virtual-scroller/VirtualScroller.vue @@ -202,20 +202,22 @@ const visibleRange = computed(() => { } offset = startOffset + endIndex = startIndex for (let i = startIndex; i < computedData.value.length; i++) { const cachedHeight = itemHeights.value.get(i) const height = cachedHeight !== undefined ? cachedHeight : props.estimatedHeight - if (offset >= currentScrollTop + viewportHeight) { + offset += height + + if (offset > currentScrollTop + viewportHeight) { endIndex = Math.min(computedData.value.length - 1, i + bufferCount) break } - offset += height endIndex = i } - return { start: startIndex, end: endIndex, offset: startOffset } + return { start: Math.min(startIndex, endIndex), end: Math.max(startIndex, endIndex), offset: startOffset } }) const visibleItems = computed(() => { diff --git a/src/config/runninghub/index.js b/src/config/runninghub/index.js index 3e58cfe..527a381 100644 --- a/src/config/runninghub/index.js +++ b/src/config/runninghub/index.js @@ -16,7 +16,9 @@ export async function Playload(data) { nodeInfoList.push(json.nodeInfoList[key.name]) } } - json.nodeInfoList.index.fieldValue = data.imgs.length - 1 + if (json.nodeInfoList.index) { + json.nodeInfoList.index.fieldValue = data.imgs.length - 1 + } } if (Array.isArray(data.params)) {