diff --git a/frontend/src/shared/components/GeneralFeedbackDialog.vue b/frontend/src/shared/components/GeneralFeedbackDialog.vue index dcb25a87..11685830 100644 --- a/frontend/src/shared/components/GeneralFeedbackDialog.vue +++ b/frontend/src/shared/components/GeneralFeedbackDialog.vue @@ -13,7 +13,7 @@ * 成功提示由父组件处理。类型/模块提交的是当前语言的展示文案(后端按 ≤32 字符字符串存储)。 */ -import { computed, ref, watch } from 'vue'; +import { computed, reactive, ref, watch } from 'vue'; import { useI18n } from 'vue-i18n'; import { Loader2, Plus, X } from 'lucide-vue-next'; import { @@ -125,13 +125,16 @@ async function addImages(files: File[]): Promise { ElMessage.error(t('feedback.upload.maxSize', { size: MAX_FEEDBACK_IMAGE_SIZE_MB })); continue; } - // [STEP 4] 入队即占位(缩略图立即可见,uploading 态加遮罩),上传成功后才计入提交 - const item: PendingImage = { + // [STEP 4] 入队即占位(缩略图立即可见,uploading 态加遮罩),上传成功后才计入提交。 + // 必须用 reactive 包装后再入队:uploadFileAsset 的 await 之后对 item 的 assetNo/status 写入 + // 若发生在原始对象上,不经过数组内代理、不触发依赖更新,hasUploadingImage 的 computed + // 缓存永不失效 → 遮罩不消失且 canSubmit 永久为 false(提交按钮永远禁用)。 + const item = reactive({ assetNo: null, status: 'uploading', previewUrl: URL.createObjectURL(file), filename: file.name, - }; + }); images.value.push(item); try { const asset = await uploadFileAsset(file);