fix(ui): remove duplicate function implementations in TaskCenter
scrollToBottom and handleScroll were defined twice (verbatim), causing TS2393 duplicate implementation errors now surfaced by vue-tsc 2.x.
This commit is contained in:
@@ -240,31 +240,6 @@ function selectTask(taskId: string) {
|
||||
void loadLogs(taskId)
|
||||
}
|
||||
|
||||
function scrollToBottom() {
|
||||
if (!autoScroll.value) return
|
||||
|
||||
nextTick(() => {
|
||||
if (logContainerRef.value) {
|
||||
logContainerRef.value.scrollTop = logContainerRef.value.scrollHeight
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function handleScroll() {
|
||||
if (!logContainerRef.value) return
|
||||
|
||||
const { scrollTop, scrollHeight, clientHeight } = logContainerRef.value
|
||||
const distanceFromBottom = scrollHeight - scrollTop - clientHeight
|
||||
|
||||
// 距离底部小于 50px 时认为在底部,恢复自动滚动
|
||||
if (distanceFromBottom < 50) {
|
||||
autoScroll.value = true
|
||||
} else if (distanceFromBottom > 100) {
|
||||
// 用户向上滚动超过 100px 时暂停自动滚动
|
||||
autoScroll.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function refreshCurrent() {
|
||||
void loadTasks()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user