feat(v1.3.0): 图片编辑器(裁剪/旋转/图像大小/调色) + 批量水印 + AI生图 + 收藏体系 + 图片新窗口打开按钮 + 合拼拼图 + 返回顶部
This commit is contained in:
1 parent
e345456abf
commit
94ac94436c
46 files changed
+6521
-114
No files matched your search
@@ -28,11 +28,13 @@ export const useImageDelete = () => {
|
||||
* 快速删除(乐观更新,立即响应)
|
||||
*/
|
||||
const handleQuickDelete = useCallback(async () => {
|
||||
const items = selectedImages.length > 0
|
||||
? selectedImages.map(img => ({ type: 'file', path: img.path }))
|
||||
: selectedImage
|
||||
? [{ type: 'file', path: selectedImage.path }]
|
||||
: [];
|
||||
// 并集:selectedImages(ctrl/shift 多选)∪ selectedImage(普通单击)
|
||||
// 否则「先单击一张再 ctrl 多选」时会漏删单击那张
|
||||
const union = [...selectedImages];
|
||||
if (selectedImage && !union.some(img => img.path === selectedImage.path)) {
|
||||
union.push(selectedImage);
|
||||
}
|
||||
const items = union.map(img => ({ type: 'file', path: img.path }));
|
||||
|
||||
if (items.length === 0) return;
|
||||
|
||||
|
||||
Reference in new issue
Block a user