From 332ae3c4cffde13362d792ca4fa2f923d955255f Mon Sep 17 00:00:00 2001 From: DXC Date: Thu, 4 Jun 2026 15:43:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E4=BF=A1=E6=81=AF=E9=A1=B5?= =?UTF-8?q?=EF=BC=9A=E4=BA=A7=E5=93=81=E5=9B=BE/=E8=AF=B4=E6=98=8E?= =?UTF-8?q?=E4=B9=A6=E4=B8=8A=E4=BC=A0=E5=90=8E=E9=A2=84=E8=A7=88=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=BF=AE=E5=A4=8D=20+=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=20Ctrl+V=20=E7=B2=98=E8=B4=B4=E8=93=9D=E5=AD=97=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - customUpload 改为手动 push:移除 onSuccess(res) 调用,规避 el-upload 2.13.1 handleSuccess 未从 res.data.url 提取 url 的问题 --- inventory-web/src/views/material/list.vue | 25 ++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/inventory-web/src/views/material/list.vue b/inventory-web/src/views/material/list.vue index 586653f..ca4b8f4 100644 --- a/inventory-web/src/views/material/list.vue +++ b/inventory-web/src/views/material/list.vue @@ -512,6 +512,7 @@ > +
支持将鼠标悬停于虚线框内通过 Ctrl+V 粘贴图片快速上传
@@ -565,6 +566,7 @@ > +
支持将鼠标悬停于虚线框内通过 Ctrl+V 粘贴图片快速上传
@@ -583,10 +585,10 @@ - + Preview Image - + - + - + f.raw === file) + if (staleIndex !== -1) targetList.value.splice(staleIndex, 1) + + // 手动构造带服务端 URL 的条目并 push,picture-card 即可正常渲染 + const fileObj = { name: newUrl.split('/').pop(), url: getImageUrl(newUrl) } + if (targetField === 'generalImage') { + fileListImage.value.push(fileObj) + } else { + fileListManual.value.push(fileObj) + } ElMessage.success('上传成功') - onSuccess(res) // el-upload v-model 自动更新 fileList,无需手动 push } else { ElMessage.error(res.msg || '上传失败'); onError(new Error(res.msg))