feat: add sticky progress bar for batch operations
批量下载、批量取消和批量删除操作添加固定在顶部的进度条。 使用 CSS sticky-top 确保进度条始终可见,无论滚动位置如何。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -77,9 +77,9 @@ export class ParseModalComp implements VanComponent {
|
||||
div({ class: `h5 modal-title` }, () => this.isDownloading.val ? '正在创建下载任务...' : (allFinish.val ? '批量下载' : '批量解析')),
|
||||
button({ class: `btn-close`, 'data-bs-dismiss': `modal` })
|
||||
),
|
||||
// 进度条固定在头部下方
|
||||
this.StickyProgress(),
|
||||
div({ class: `modal-body vstack gap-3`, tabIndex: -1, style: 'outline: none;' },
|
||||
this.ParseProgress(),
|
||||
this.DownloadProgress(),
|
||||
div({ class: 'vstack gap-2', hidden: () => this.errorList.val.length == 0 || !allFinish.val || this.isDownloading.val },
|
||||
div({ class: 'text-danger' }, () => `以下 ${this.errorList.val.length} 个视频解析失败`),
|
||||
() => div({ class: 'list-group' },
|
||||
@@ -218,6 +218,18 @@ export class ParseModalComp implements VanComponent {
|
||||
)
|
||||
}
|
||||
|
||||
/** 固定在顶部的进度条 */
|
||||
StickyProgress() {
|
||||
return div({
|
||||
class: 'sticky-top bg-body p-3 border-bottom',
|
||||
hidden: () => this.totalCount.val == this.finishCount.val && !this.isDownloading.val,
|
||||
style: 'z-index: 10;'
|
||||
},
|
||||
this.ParseProgress(),
|
||||
this.DownloadProgress(),
|
||||
)
|
||||
}
|
||||
|
||||
DownloadProgress() {
|
||||
return div({ class: 'vstack gap-3', hidden: () => !this.isDownloading.val },
|
||||
div({ class: 'text-center fs-5' }, () => `正在创建下载任务 (${this.downloadProgress.val}/${this.downloadTotal.val})`),
|
||||
|
||||
Reference in New Issue
Block a user