From 78896060b2feae5def311aa596dee7ff8bfd1b5c Mon Sep 17 00:00:00 2001 From: "douboer@gmail.com" Date: Sat, 14 Feb 2026 11:01:22 +0800 Subject: [PATCH] update at 2026-02-14 11:01:22 --- miniapp/pages/index/index.wxml | 17 ++++++++++------- miniapp/utils/sankey.js | 6 +++++- src/core/parser.ts | 6 +++++- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/miniapp/pages/index/index.wxml b/miniapp/pages/index/index.wxml index 9116040..9e3e540 100644 --- a/miniapp/pages/index/index.wxml +++ b/miniapp/pages/index/index.wxml @@ -9,7 +9,7 @@ - {{uploadMessage}} + {{uploadMessage}} @@ -74,15 +74,15 @@ - {{buildError}} - {{parseError}} + {{buildError}} + {{parseError}} - + 未加载文件,暂无列信息 @@ -155,13 +155,15 @@ - - {{item}} + + {{item}} - @版权说明:星程社所有,反馈邮箱:douboer@gmail.com + + @版权说明:星程社所有,反馈邮箱:douboer@gmail.com + @@ -170,6 +172,7 @@ class="theme-list" scroll-y enhanced + enable-flex show-scrollbar="true" scroll-top="{{themeListScrollTop}}" scroll-with-animation diff --git a/miniapp/utils/sankey.js b/miniapp/utils/sankey.js index 9b50056..8687812 100644 --- a/miniapp/utils/sankey.js +++ b/miniapp/utils/sankey.js @@ -251,7 +251,11 @@ function parseXlsxBuffer(buffer) { throw new Error('当前环境未启用 xlsx 解析,请先在开发者工具执行“构建 npm”'); } - const workbook = xlsx.read(buffer, { type: 'array' }); + const workbook = xlsx.read(buffer, { + type: 'array', + // 兼容部分旧版 xls 在小程序环境下的中文 codepage 解析。 + codepage: 936 + }); const firstSheetName = workbook.SheetNames[0]; if (!firstSheetName) { throw new Error('Excel 文件中没有工作表'); diff --git a/src/core/parser.ts b/src/core/parser.ts index 9026ac3..3e64178 100644 --- a/src/core/parser.ts +++ b/src/core/parser.ts @@ -82,7 +82,11 @@ export function parseCsvText(csvText: string): RawTable { * 解析 xlsx 的二进制数据。 */ export function parseXlsxBuffer(buffer: ArrayBuffer): RawTable { - const workbook = XLSX.read(buffer, { type: 'array' }); + const workbook = XLSX.read(buffer, { + type: 'array', + // 兼容部分旧版 xls 在浏览器环境下的中文 codepage 解析。 + codepage: 936 + }); const firstSheetName = workbook.SheetNames[0]; if (!firstSheetName) {