From 67aabe1ef73656f32c23047694115a465a8dc48d Mon Sep 17 00:00:00 2001 From: mk <2403457699@qq.com> Date: Mon, 17 Feb 2025 14:42:43 +0800 Subject: [PATCH] =?UTF-8?q?bug#1870=E6=99=BA=E8=83=BD=E5=A1=AB=E8=A1=A8?= =?UTF-8?q?=E6=97=B6=E6=97=A0=E6=B3=95=E6=8C=89=E5=AD=97=E6=AE=B5=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E5=88=B0=E7=9B=B8=E5=BA=94=E7=9A=84=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../smartExcel/cpts/excel-upload-data.vue | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/views/modules/base/smartExcel/cpts/excel-upload-data.vue b/src/views/modules/base/smartExcel/cpts/excel-upload-data.vue index 3cc4a6ae0..8bd140cae 100644 --- a/src/views/modules/base/smartExcel/cpts/excel-upload-data.vue +++ b/src/views/modules/base/smartExcel/cpts/excel-upload-data.vue @@ -236,11 +236,28 @@ export default { } }, async checkExtractExcelHead() { - const columnMateStr = this.currentTable[0].data[0] - .filter(item => item && item.v != null) - .map(item => item.v) - .join(';'); - + let columnMateStr = ''; + let foundFirstValue = false; // 标记是否找到第一个有效值 + for (let item of this.currentTable[0].data[0]) { + if (!foundFirstValue) { + // 还没有遇到有效值,继续拼接空值 + if (!item || item.v === '') { + columnMateStr += '空;'; // 空值拼接"空" + } else { + columnMateStr += item.v + ';'; // 第一个有效值拼接 + foundFirstValue = true; // 标记已经找到第一个有效值 + } + } else { + // 遇到第一个空值时停止拼接 + if (!item || item.v === '') { + break; // 停止后续处理 + } else { + columnMateStr += item.v + ';'; // 继续拼接有效值 + } + } + } + // 去掉最后一个多余的分号 + columnMateStr = columnMateStr.slice(0, -1); const url = "/actual/base/intelligentImportData/extractImportHead"; let params = { importCategory: this.formData1.importCategory,