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)