This commit is contained in:
2025-09-03 17:28:50 +08:00
parent 9d9224d6ad
commit d26db2d321
4 changed files with 1098 additions and 116 deletions

View File

@ -482,8 +482,6 @@ const exportTemplate = async () => {
};
const importTemplate = async (files, fileList) => {
// 导入表格数据
console.log(fileList);
const file = fileList[0].raw; // 获取原始文件对象
const reader = new FileReader();
let obj = {
@ -512,17 +510,18 @@ const importTemplate = async (files, fileList) => {
return;
}
let arr = [];
// 判断form.documents 是否对象
jsonData.forEach((item, index) => {
if (item[obj.id]) {
arr.push({
id: Date.now() + index,
catalogueName: item[obj.name],
catalogueName: item[obj.fliename],
remark: item[obj.remark],
userId: item[obj.id]
});
}
});
form.documents = form.documents.concat(arr);
form.documents = arr;
uploadRef.value.clearFiles();
console.log(arr);
} catch (err) {}