From 8dddb72328fbe19a87f27b79edb1b33e0d9782d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Wed, 5 Aug 2026 15:55:11 +0800 Subject: [PATCH] =?UTF-8?q?fix(cargo-type):=20=E4=BC=98=E5=8C=96=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E5=A4=B1=E8=B4=A5=E5=8E=9F=E5=9B=A0=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除导入失败原因中的“第N行”前缀,简化信息展示 - 失败原因编号从字母改为数字序号,提升可读性 - 备注超长提示编号改为数字编号,保持格式统一 - 保留导入失败原因列标红及列宽自动换行等已有样式调整 --- .workbuddy/memory/2026-08-05.md | 8 ++++++++ src/views/base/cargo-type.vue | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.workbuddy/memory/2026-08-05.md b/.workbuddy/memory/2026-08-05.md index bf0162b..ab7071e 100644 --- a/.workbuddy/memory/2026-08-05.md +++ b/.workbuddy/memory/2026-08-05.md @@ -10,3 +10,11 @@ 2. `vite.config.mjs` 的 `server.proxy['/api']` target 改为 `http://172.16.203.228:8000`,并去掉 `rewrite` 去掉 `/api` 的逻辑(保留 `/api` 前缀,对齐 openresty 期望路径)。 - 注意:改 `.env` / `vite.config.mjs` 后必须重启 `npm run dev`(Vite 启动时加载环境变量,运行中改动不会热更新)。 - 若确需直连绝对地址(如生产/部署):必须让后端 CORS 把 Allow-Origin 改为具体前端域名(blade-gateway 的 CorsConfig 用 `setAllowedOriginPatterns` 或显式域名),不可用 `*` 配合 credentials。 + +## 调整:货物类型导入失败原因展示格式 + +- 文件:`src/views/base/cargo-type.vue` +- 修改 `decorateCargoTypeFailDetail`: + - 移除「第N行:」前缀; + - 失败原因编号从 `A. B. C.` 改为 `1. 2. 3.`; + - 备注超长兜底提示也同步使用数字编号。 diff --git a/src/views/base/cargo-type.vue b/src/views/base/cargo-type.vue index 12cccaf..3ac0806 100644 --- a/src/views/base/cargo-type.vue +++ b/src/views/base/cargo-type.vue @@ -162,7 +162,7 @@ const CARGO_TYPE_FAIL_COL_WIDTH = { /** * 加工后端返回的导入失败明细 Excel: - * - 「导入失败原因」列按 A. B. C. 编号列出,多条以分号隔开 + * - 「导入失败原因」列按 1. 2. 3. 编号列出,多条以分号隔开 * - 每个错误后追加对应规则说明,仅失败原因列标红 * - 适当加宽各列、原因列自动换行,避免内容拥挤 */ @@ -199,7 +199,7 @@ export const decorateCargoTypeFailDetail = async workbook => { .filter(Boolean); if (parts.length === 0) return; const decorated = parts.map((part, index) => { - const label = `${String.fromCharCode(65 + index)}.`; // A. B. C. + const label = `${index + 1}.`; // 1. 2. 3. const rule = CARGO_TYPE_FAIL_RULES.find(r => part.includes(r.match)); if (rule) { // 规则说明若已包含在错误文本中则不再重复拼接 @@ -214,10 +214,10 @@ export const decorateCargoTypeFailDetail = async workbook => { row.getCell(remarkCol).value == null ? '' : row.getCell(remarkCol).value ).trim(); if (remarkVal.length > 200 && !decorated.some(d => d.includes('备注不能超过200字'))) { - decorated.push(`${String.fromCharCode(65 + decorated.length)}.备注不能超过200字`); + decorated.push(`${decorated.length + 1}.备注不能超过200字`); } } - reasonCell.value = `第${rowNumber}行:${decorated.join(';')}`; + reasonCell.value = decorated.join(';'); // 仅操作 G 列:黑色字体、无背景填充,其余列保持后端原样 reasonCell.fill = { type: 'pattern', pattern: 'none' }; reasonCell.font = { color: { argb: 'FF000000' } };