fix: 优化排序媒体图片预览
This commit is contained in:
@@ -157,6 +157,7 @@
|
||||
- 客户端主题变量收敛(2026-07-05):进一步把客户端顶部栏、卡片阴影、正品验证背景、工具按钮 hover、溯源页分隔/时间轴/占位色等主题变量统一迁入 `apps/client/src/styles.css` 的 `:root`、`prefers-color-scheme: dark`、`data-theme=light/dark`。`Trace.vue` 不再保留局部深色覆盖,顶部栏和语言/主题按钮直接使用全局变量,修复手动或系统夜间模式下顶部栏仍显示浅色的问题。
|
||||
- 客户端基础信息字段排版(2026-07-05):溯源详情页基础信息字段行由 flex 改为 grid,标签列桌面端固定 132px、窄屏 118px,值列自适应;标签单行省略、值列加粗并允许换行,避免“创作年代 / 出品时间”等长标签把字段行撑乱或与值错位。
|
||||
- 图片预览滚轮缩放兜底(2026-07-05):后台和客户端共用的 `openMediaViewer` 在 PhotoSwipe `wheel` 事件中补充自定义缩放处理,拦截默认滚轮行为并按鼠标位置缩放当前图片;缩放上限至少放宽到初始比例 6 倍或 4 倍,避免认证文件、较小证书图等因 PhotoSwipe 默认上限判断导致鼠标滚轮看似无法放大。视频项仍通过 `isZoomable()` 自动跳过。
|
||||
- 后台排序媒体预览分流(2026-07-05):`MediaSorter` 用于作品主图和溯源节点媒体排序上传;点击图片时现在只把图片项传入 PhotoSwipe 预览队列,打开样式与认证文件等图片预览保持一致,避免混入视频项影响图片查看体验。点击视频仍沿用原有媒体预览逻辑。
|
||||
|
||||
## 当前代码基准与注意事项
|
||||
|
||||
|
||||
@@ -117,11 +117,21 @@ function remove(i: number) {
|
||||
emit('update:modelValue', list.value.filter((_, idx) => idx !== i));
|
||||
}
|
||||
|
||||
function toViewerItem(m: MediaItem) {
|
||||
return { url: m.url || m.key, name: m.name || m.key, type: m.type };
|
||||
}
|
||||
|
||||
function preview(index: number) {
|
||||
void openMediaViewer(
|
||||
list.value.map((m) => ({ url: m.url || m.key, name: m.name || m.key, type: m.type })),
|
||||
index,
|
||||
);
|
||||
const current = list.value[index];
|
||||
if (!current) return;
|
||||
if (isVideo(current)) {
|
||||
void openMediaViewer(list.value.map(toViewerItem), index);
|
||||
return;
|
||||
}
|
||||
|
||||
const imageList = list.value.filter((m) => !isVideo(m));
|
||||
const imageIndex = imageList.findIndex((m) => m === current);
|
||||
void openMediaViewer(imageList.map(toViewerItem), Math.max(imageIndex, 0));
|
||||
}
|
||||
|
||||
const dragIndex = ref<number | null>(null);
|
||||
|
||||
Reference in New Issue
Block a user