From a0f2e9a557646a2bf892f0095e9ebaf8dcb00c17 Mon Sep 17 00:00:00 2001 From: ThearchyHelios Date: Sun, 4 Oct 2026 02:02:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=9B=AE=E5=BD=95=20F2b=20/?= =?UTF-8?q?=20C10=EF=BC=9A=E6=B8=85=E5=8D=95=E9=87=8C=E6=B2=A1=E5=A1=AB?= =?UTF-8?q?=E4=B8=AD=E6=96=87=E5=90=8D=E7=9A=84=E8=A1=A8=EF=BC=8C=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E7=9B=B4=E6=8E=A5=E5=86=99=E8=A1=A8=E5=90=8D=EF=BC=88?= =?UTF-8?q?=E6=AD=A3=E6=96=87=E9=A2=9C=E8=89=B2=E3=80=81=E5=8A=A0=E7=B2=97?= =?UTF-8?q?=EF=BC=89=EF=BC=8C=E3=80=8C=E6=9C=AA=E5=A1=AB=E5=86=99=E4=B8=AD?= =?UTF-8?q?=E6=96=87=E5=90=8D=E3=80=8D=E9=99=8D=E4=B8=BA=E4=B8=8B=E4=B8=80?= =?UTF-8?q?=E8=A1=8C=E7=9A=84=E6=B7=A1=E8=89=B2=E6=8F=90=E7=A4=BA=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E4=B8=80=E5=B1=8F=E5=87=A0=E5=8D=81=E8=A1=8C?= =?UTF-8?q?=E5=90=8C=E4=B8=80=E5=8F=A5=E8=AF=9D=E8=AE=A4=E4=B8=8D=E5=87=BA?= =?UTF-8?q?=E6=98=AF=E5=93=AA=E5=BC=A0=E8=A1=A8=EF=BC=9B=E8=A1=A5=E6=A3=80?= =?UTF-8?q?=E6=9F=A5=E8=84=9A=E6=9C=AC=E7=9A=84=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/TableIndex.tsx | 13 ++++++++----- scripts/check-catalog.mjs | 10 ++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/frontend/src/pages/catalog/TableIndex.tsx b/frontend/src/pages/catalog/TableIndex.tsx index f4ca1415..d8e3cb71 100644 --- a/frontend/src/pages/catalog/TableIndex.tsx +++ b/frontend/src/pages/catalog/TableIndex.tsx @@ -12,7 +12,8 @@ import type { ListFilter, ListSort } from './model' // =========================================================================== // 表清单(数据目录页的左栏):搜索、按审阅进度筛选、排序、多选后批量起草。 -// 一行两层:上面是中文名和各状态的项数,下面是表名、类型、关联数和使用次数。键盘:↑↓ 在行之间移动, +// 一行两层:上面是中文名和各状态的项数,下面是表名、类型、关联数和使用次数;还没填中文名的表上面直接写表名, +// 下面淡淡地写「未填写中文名」——一屏几十行「未填写中文名」认不出是哪张表。键盘:↑↓ 在行之间移动, // Home / End 到两头,Enter 打开;复选框按住 Shift 点选可以连选一段。 // =========================================================================== @@ -224,15 +225,17 @@ const Row = memo(function Row({ row: r, index, active, checked, onToggle, onOpen data-catalog-open-row="" > - - {r.label ?? CT.noLabel} - + {r.label + ? {r.label} + : {r.table_name}} {progress === 'none' ? {CT.noCatalog} : } - {r.table_name} + {r.label + ? {r.table_name} + : {CT.noLabel}} {r.kind && · {CATALOG_KIND_LABEL[r.kind] ?? r.kind}} {r.is_view && · {CT.view}} {r.relations > 0 && · {CT.relationCount(r.relations)}} diff --git a/scripts/check-catalog.mjs b/scripts/check-catalog.mjs index 39b233fc..5b3a7d9d 100644 --- a/scripts/check-catalog.mjs +++ b/scripts/check-catalog.mjs @@ -537,6 +537,16 @@ await section('数据目录 · 表清单的排序与筛选', async () => { check('……读屏念得出各状态的项数', (await page.locator('[data-catalog-row="visits"] .sr-only').allInnerTexts()).join('|').includes(`推断 ${c.proposed} 项`)) check('没有目录的表写「没有目录」、中文名写「未填写中文名」', (await page.locator('[data-catalog-row="gates"]').innerText()).includes('没有目录') && (await page.locator('[data-catalog-row="gates"] [data-row-label]').innerText()) === '未填写中文名') + // 没填中文名的表:标题就是表名,「未填写中文名」降为下一行的淡色提示;填了的照旧中文名作标题、表名在下一行 + const titleOf = (name) => page.locator(`[data-catalog-row="${name}"] [data-row-title]`).evaluate((el) => ({ + text: el.innerText, weight: Number(getComputedStyle(el).fontWeight), color: getComputedStyle(el).color, + hint: getComputedStyle(el.closest('[data-catalog-row]').querySelector('[data-row-no-label]') ?? el).color, + })) + const gatesTitle = await titleOf('gates') + const visitsTitle = await titleOf('visits') + check('没填中文名:标题写表名、用正文的颜色和字重,「未填写中文名」是淡色的次要提示', gatesTitle.text === 'gates' && gatesTitle.weight >= 500 + && gatesTitle.color === visitsTitle.color && gatesTitle.hint !== gatesTitle.color, JSON.stringify(gatesTitle)) + check('填了中文名:标题写中文名', visitsTitle.text === '入园记录') await cleanCopy(page, '表清单') await shot(page, 'catalog-list')