From ac4714ed07f4eed5ace242c36f5be283655bd8d0 Mon Sep 17 00:00:00 2001 From: mike Date: Wed, 4 Nov 2026 10:00:04 +0800 Subject: [PATCH] Update App.jsx via upload script - 2026-11-04 09:59:55 --- App.jsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/App.jsx b/App.jsx index 2deba01..eb1c246 100644 --- a/App.jsx +++ b/App.jsx @@ -6739,6 +6739,9 @@ function WebImageList({ draft, set, onNotify, field, max, label, cover, tall, ac const images = Array.isArray(draft[field]) ? draft[field] : []; const [uploading, setUploading] = useState(false); const [dragIdx, setDragIdx] = useState(null); + // 最新的图片列表:上一批还在上传时又选了一批,两批传完都要保留(不能用开始上传时的旧列表覆盖) + const latest = useRef({ id: draft.id, images }); + latest.current = { id: draft.id, images }; async function handlePick(fileList) { const picked = Array.from(fileList || []); @@ -6756,7 +6759,9 @@ function WebImageList({ draft, set, onNotify, field, max, label, cover, tall, ac if (onNotify) onNotify(`${f.name} 上传失败,请重试`); } } - set({ [field]: [...images, ...added] }); + // 上传期间切到了别的模板 / 产品:latest 已经是别的记录,用开始时的列表 + const base = latest.current.id === draft.id ? latest.current.images : images; + set({ [field]: [...base, ...added.filter(f => !base.includes(f))] }); setUploading(false); }