|
|
@ -21,6 +21,7 @@ import { |
|
|
|
onBeforeUnmount, |
|
|
|
onBeforeUnmount, |
|
|
|
provide, |
|
|
|
provide, |
|
|
|
useAttachment, |
|
|
|
useAttachment, |
|
|
|
|
|
|
|
useDebounceFn, |
|
|
|
useKanbanViewStoreOrThrow, |
|
|
|
useKanbanViewStoreOrThrow, |
|
|
|
useUndoRedo, |
|
|
|
useUndoRedo, |
|
|
|
} from '#imports' |
|
|
|
} from '#imports' |
|
|
@ -30,6 +31,8 @@ interface Attachment { |
|
|
|
url: string |
|
|
|
url: string |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const INFINITY_SCROLL_THRESHOLD = 100 |
|
|
|
|
|
|
|
|
|
|
|
const meta = inject(MetaInj, ref()) |
|
|
|
const meta = inject(MetaInj, ref()) |
|
|
|
|
|
|
|
|
|
|
|
const view = inject(ActiveViewInj, ref()) |
|
|
|
const view = inject(ActiveViewInj, ref()) |
|
|
@ -275,14 +278,14 @@ async function onMove(event: any, stackKey: string) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const kanbanListScrollHandler = async (e: any) => { |
|
|
|
const kanbanListScrollHandler = useDebounceFn(async (e: any) => { |
|
|
|
if (e.target.scrollTop + e.target.clientHeight >= e.target.scrollHeight) { |
|
|
|
if (e.target.scrollTop + e.target.clientHeight + INFINITY_SCROLL_THRESHOLD >= e.target.scrollHeight) { |
|
|
|
const stackTitle = e.target.getAttribute('data-stack-title') |
|
|
|
const stackTitle = e.target.getAttribute('data-stack-title') |
|
|
|
const pageSize = appInfo.defaultLimit || 25 |
|
|
|
const pageSize = appInfo.defaultLimit || 25 |
|
|
|
const page = Math.ceil(formattedData.value.get(stackTitle)!.length / pageSize) |
|
|
|
const page = Math.ceil(formattedData.value.get(stackTitle)!.length / pageSize) |
|
|
|
await loadMoreKanbanData(stackTitle, { offset: page * pageSize }) |
|
|
|
await loadMoreKanbanData(stackTitle, { offset: page * pageSize }) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const kanbanListRef = (kanbanListElement: HTMLElement) => { |
|
|
|
const kanbanListRef = (kanbanListElement: HTMLElement) => { |
|
|
|
if (kanbanListElement) { |
|
|
|
if (kanbanListElement) { |
|
|
|