修改文件路徑:src\views\customer\list\index.vue 第1038行的importExcelData導入方法修改成下面這個樣子
importExcelData(arrRes) {
// 提取表頭
const [thead, ...rows] = arrRes;
const data = [];
// 過濾掉全為空字符串的行,并轉換為對象格式
rows.forEach((row) => {
const isAllEmpty = row.every((cell) => cell.trim() === '');
if (!isAllEmpty) {
const rowData = {};
row.forEach((cell, index) => {
rowData[thead[index]] = cell;
});
data.push(rowData);
}
});
// 調用導入 API 并更新表格數據
customerImport(this.types, data).then(() => {
this.getTableData('');
});
}
},