支持缩略图加载,故事项新建调整
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user