|
|
@@ -67,15 +67,14 @@ export default {
|
|
|
methods: {
|
|
|
onOpen() {
|
|
|
this.$nextTick(() => {
|
|
|
- // 总是使用行ID调用接口获取附件列表
|
|
|
if (this.rowData && this.rowData.id) {
|
|
|
const id = this.rowData.id;
|
|
|
getIqcInspectionDataDetailForPda({ id: id }).then((res) => {
|
|
|
console.log("打印一下返回的数据", res);
|
|
|
if (res.code === 0 && res.data) {
|
|
|
- // 处理后端返回的数据,生成符合FileUpload组件要求的fileList
|
|
|
const urlList = res.data.urlList || [];
|
|
|
const fileIds = res.data.fileIds || [];
|
|
|
+
|
|
|
this.$refs.fileUpload.fileList = urlList.map((url, index) => {
|
|
|
// 清理URL中的额外空格和括号
|
|
|
const cleanUrl = url.trim().replace(/[`]/g, "");
|
|
|
@@ -85,20 +84,16 @@ export default {
|
|
|
lastSlashIndex !== -1
|
|
|
? cleanUrl.substring(lastSlashIndex + 1)
|
|
|
: cleanUrl;
|
|
|
- console.log("打印一下fileName", fileName);
|
|
|
return {
|
|
|
- // name: fileName,
|
|
|
+ id: fileIds[index] || "", // 关键修复:直接设置 id 字段
|
|
|
+ name: { fileId: fileIds[index] || "" }, // 兼容 handleDelete 中的 name.fileId
|
|
|
sysName: fileName,
|
|
|
- url: {
|
|
|
- fileId: fileIds[index] || "",
|
|
|
- url: cleanUrl,
|
|
|
- },
|
|
|
+ url: cleanUrl, // url 直接存字符串,不包对象
|
|
|
};
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
- // 暂时使用传入的fileList作为后备
|
|
|
this.$refs.fileUpload.fileList = this.fileList;
|
|
|
}
|
|
|
this.$refs.fileUpload.isUploadShow = this.isUploadShow;
|