From 9f37d489e9721a999bd3c92f3dfceb86473287d2 Mon Sep 17 00:00:00 2001 From: icssoa <2570063477@qq.com> Date: Fri, 2 Jun 2023 16:22:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/extend/excel/import-btn.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/extend/excel/import-btn.vue b/src/modules/extend/excel/import-btn.vue index 1169887..abd911f 100644 --- a/src/modules/extend/excel/import-btn.vue +++ b/src/modules/extend/excel/import-btn.vue @@ -139,14 +139,14 @@ function onUpload(raw: File, _: any, { next }: any) { let data = ""; if (ext == "csv") { - const detected = chardet.detect(new Uint8Array(event.target.result)); + const detected: any = chardet.detect(new Uint8Array(event.target.result)); const decoder = new TextDecoder(detected); data = decoder.decode(event.target.result); } else { data = event.target.result; } - const workbook = XLSX.read(data, { type: "binary" }); + const workbook = XLSX.read(data, { type: "binary", raw: ext == "csv" }); let json: any[] = []; for (const sheet in workbook.Sheets) {