feat(ui): 任务文件上传加进度条 + 图片预览复用 img-viewer
- 面板上传改 XHR + onprogress:多文件并行,进度条显示总进度(已发字节/总字节) 1.2s 后自动收起,失败/成功分别 toast - 任务文件中的图片预览改用 openImageViewer (与消息里单击图片同一查看器) 支持双指缩放+拖动+双击放大,大图也能看完 - blob URL 通过 state.lastImgBlobUrl 缓存,新开图片时回收旧的避免泄漏 - 移除 fs-img-frame 配套样式(不再需要)
This commit is contained in:
@@ -343,6 +343,22 @@ footer { flex: none; padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0
|
||||
background: var(--active-soft); color: var(--active); cursor: pointer;
|
||||
}
|
||||
.files-panel-header .file-upload:active { background: var(--active); color: #fff; }
|
||||
/* 上传总进度条(header 中间,上传中显示) */
|
||||
.files-panel-progress {
|
||||
flex: 1; min-width: 0; height: 6px; margin: 0 10px;
|
||||
background: var(--surface); border-radius: 3px; overflow: hidden; position: relative;
|
||||
}
|
||||
.files-panel-progress .bar {
|
||||
height: 100%; width: 0;
|
||||
background: linear-gradient(90deg, var(--active) 0%, #6b8cff 100%);
|
||||
border-radius: 3px;
|
||||
transition: width .12s linear;
|
||||
}
|
||||
.files-panel-progress .pct {
|
||||
position: absolute; right: 0; top: 50%; transform: translateY(-50%);
|
||||
font-size: 10px; color: var(--gray); background: var(--page); padding: 0 4px; line-height: 1;
|
||||
white-space: nowrap; pointer-events: none;
|
||||
}
|
||||
.files-panel-header .file-upload svg {
|
||||
width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2;
|
||||
stroke-linecap: round; stroke-linejoin: round;
|
||||
|
||||
Reference in New Issue
Block a user