From 41012b1b83f6f81a2df82d78fba9ffbc02147520 Mon Sep 17 00:00:00 2001 From: ThearchyHelios Date: Wed, 14 Oct 2026 08:54:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=9B=AE=E5=BD=95=E9=97=AD?= =?UTF-8?q?=E7=8E=AF=EF=BC=88=E5=89=8D=E7=AB=AF=EF=BC=89=E5=A4=8D=E6=9F=A5?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=EF=BC=9A=E5=AF=BC=E5=85=A5=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E9=87=8C=E8=B7=B3=E8=BF=87=E7=9A=84=E9=A1=B9=E5=86=99=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E4=B8=8A=E7=9A=84=E8=AF=B4=E6=B3=95=EF=BC=88=E3=80=8C?= =?UTF-8?q?=E5=88=97=20gate=5Fcode=20=E7=9A=84=E4=B8=AD=E6=96=87=E5=90=8D?= =?UTF-8?q?=E3=80=8D=EF=BC=89=EF=BC=8C=E5=85=B3=E8=81=94=E5=85=B3=E7=B3=BB?= =?UTF-8?q?=E7=85=A7=E7=BC=96=E5=8F=B7=E5=86=99=EF=BC=9Bcheck-catalog-loop?= =?UTF-8?q?=20=E5=88=87=E8=A7=86=E5=9B=BE=E7=9A=84=E9=82=A3=E4=B8=80?= =?UTF-8?q?=E6=9D=A1=E7=AD=89=E6=B8=85=E5=8D=95=E7=9C=9F=E7=9A=84=E6=8D=A2?= =?UTF-8?q?=E5=9B=9E=E6=9D=A5=E5=86=8D=E6=96=AD=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/catalog/TransferDialog.tsx | 10 ++++++++-- scripts/check-catalog-loop.mjs | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/catalog/TransferDialog.tsx b/frontend/src/pages/catalog/TransferDialog.tsx index 24ef09dc..f60eabdb 100644 --- a/frontend/src/pages/catalog/TransferDialog.tsx +++ b/frontend/src/pages/catalog/TransferDialog.tsx @@ -8,7 +8,7 @@ import { Modal, Notice, Spinner } from '../../components/ui' import { errorMessage } from '../../lib/errors' import { formatDateTime, formatNumber } from '../../lib/format' import { CATALOG_TRANSFER_TEXT as T } from '../../lib/terms' -import { patchValueText } from '../../run/catalogPatch' +import { patchTarget, patchValueText, patchWhere } from '../../run/catalogPatch' // =========================================================================== // 导入数据目录(数据目录页的「导入目录」):选文件 → 预览(只读:对上了哪些表,各有几项新增、更新、保留、冲突、跳过, @@ -30,6 +30,12 @@ interface Chosen { const COUNT_KEYS = ['add', 'update', 'keep', 'conflicts', 'skipped'] as const +/** 跳过的那一项写成界面上的说法(「列 gate_code 的中文名」);关联关系只有编号,照原样写 */ +const pathText = (path: string) => { + const t = patchTarget(path) + return t && t.kind !== 'relation' ? patchWhere({ path, before: null, after: null }) : path +} + export function ImportDialog({ sourceId, onClose, onImported }: { sourceId: string onClose: () => void @@ -245,7 +251,7 @@ function ReportView({ report, done = false }: { report: CatalogImportReport; don diff --git a/scripts/check-catalog-loop.mjs b/scripts/check-catalog-loop.mjs index 400e22bb..30828f0e 100644 --- a/scripts/check-catalog-loop.mjs +++ b/scripts/check-catalog-loop.mjs @@ -941,7 +941,7 @@ await section('审阅队列 · 视图、顺序与原因、筛选、进度', asyn check('表清单的概览里也有「打开审阅队列」', queueText === '打开审阅队列' && await until(async () => new URL(page.url()).searchParams.get('view') === 'review' && (await page.locator('[data-catalog-view-tab="review"]').getAttribute('aria-selected')) === 'true'), `${queueText} · ${page.url()}`) await page.locator('[data-catalog-view-tab="review"]').press('ArrowLeft') - check('视图标签可以用方向键切换', await until(async () => !new URL(page.url()).searchParams.get('view')) + check('视图标签可以用方向键切换', await until(async () => !new URL(page.url()).searchParams.get('view') && page.locator('[data-catalog-list]').isVisible()) && await page.evaluate(() => document.activeElement?.getAttribute('data-catalog-view-tab') === 'list')) await shot(page, 'catalog-review') await cleanCopy(page, '审阅队列') @@ -1072,7 +1072,7 @@ await section('导出导入 · 导出文件、导入先预览再写入', async ( const conflict = await textOf(dlg.locator('[data-import-conflict]')) check('……冲突逐条列出:位置、文件中的值、这里的值、原因', conflict.includes('表的中文名') && conflict.includes('入园流水') && conflict.includes('入园记录') && conflict.includes('这里已确认,以这里为准'), conflict) - check('……跳过的写原因,对不上的表列出来', (await textOf(dlg.locator('[data-import-skipped]'))).includes('表结构里没有列 gate_code') + check('……跳过的写界面上的说法和原因,对不上的表列出来', (await textOf(dlg.locator('[data-import-skipped]'))).includes('列 gate_code 的中文名:表结构里没有列 gate_code') && (await textOf(dlg.locator('[data-import-unmatched]'))).includes('legacy_tickets')) check('……起草要求:这里已有,保留不覆盖', (await textOf(dlg.locator('[data-import-guidance-action]'))).includes('保留这个数据源现有的')) check('……预览不写库', count(sent, /catalog\/import$/) === 0)