支持缩略图加载,故事项新建调整

This commit is contained in:
jiangh277
2025-08-06 18:41:32 +08:00
parent 141e8d9818
commit 182a58d0db
11 changed files with 448 additions and 229 deletions

View File

@@ -77,6 +77,16 @@ const GridView: FC<GridViewProps> = ({
[imageList, onPreview, onDownload, onDelete],
);
// 根据视图模式确定图像 URL
const getImageUrl = (instanceId: string) => {
// 小图模式使用低分辨率图像
if (viewMode === 'small') {
return `/file/image-low-res/${instanceId}`;
}
// 其他模式使用原图
return `/file/image/${instanceId}`;
};
return (
<div
className={viewMode === 'small' ? 'small-grid-view' : 'large-grid-view'}
@@ -96,7 +106,7 @@ const GridView: FC<GridViewProps> = ({
style={{
width: imageSize.width,
height: imageSize.height,
backgroundImage: `url(/file/image/${item.instanceId})`,
backgroundImage: `url(${getImageUrl(item.instanceId)})`,
backgroundSize: 'cover',
backgroundPosition: 'center',
backgroundRepeat: 'no-repeat',