Archived
三面拆分⑫:UI 打磨 —— 补 10 枚缺失图标,蓝图改因果链,台账收成一个模块
图标注册表缺 arrow-left-right/columns/table/tag 等 10 名,用到即渲染成空 SVG —— 补齐; 蓝图四库改真箭头相连的因果链节点卡(卡即入口,删重复的入库段); 驾驶舱终态分布改五色堆叠条;运营数据收成左轨一枚「台账」,域下沉为 2-3 字短名页签 (受理→寻源→定价→议价→替代→共享,按流程序),进模块自动落首域。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KeDBx2PHLavbURXB8LJJ7m
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* 数据域短名 —— 字典命中给人读名,字典外回落键尾段:轨上永远有个能认的名字。
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { domainShort, sortDomains } from '../domains.ts';
|
||||
|
||||
describe('domainShort', () => {
|
||||
it('已知域给 2-3 字人读名', () => {
|
||||
expect(domainShort('quote_intake')).toBe('受理');
|
||||
expect(domainShort('quote_sourcing')).toBe('寻源');
|
||||
expect(domainShort('shared')).toBe('共享');
|
||||
});
|
||||
|
||||
it('未知域回落到键的最后一段,超长截 4 字符', () => {
|
||||
expect(domainShort('warehouse_ops')).toBe('ops');
|
||||
expect(domainShort('some_verylongtail')).toBe('very');
|
||||
expect(domainShort('solo')).toBe('solo');
|
||||
});
|
||||
});
|
||||
|
||||
describe('sortDomains —— 左轨按流程走向排', () => {
|
||||
it('已知域按业务序,未知域殿后', () => {
|
||||
expect(sortDomains(['shared', 'quote_pricing', 'zzz_custom', 'quote_intake'])).toEqual([
|
||||
'quote_intake',
|
||||
'quote_pricing',
|
||||
'shared',
|
||||
'zzz_custom',
|
||||
]);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* 数据域的人读短名 —— 左轨一枚钮只放得下 2-3 个字。
|
||||
*
|
||||
* 域键是活动的复合键(`quote_intake`),给人看要翻译;
|
||||
* 字典之外的域回落到键的最后一段(截 4 字符)—— 新装的活动没配短名时,轨上先有个能认的名字。
|
||||
*/
|
||||
export const DOMAIN_SHORT: Readonly<Record<string, string>> = {
|
||||
quote_intake: '受理',
|
||||
quote_sourcing: '寻源',
|
||||
quote_pricing: '定价',
|
||||
quote_negotiate: '议价',
|
||||
quote_alternative: '替代',
|
||||
shared: '共享',
|
||||
};
|
||||
|
||||
/** 业务序:受理 → 寻源 → 定价 → 议价 → 替代 → 共享 —— 左轨按流程走向排,不按字母 */
|
||||
const DOMAIN_ORDER = ['quote_intake', 'quote_sourcing', 'quote_pricing', 'quote_negotiate', 'quote_alternative', 'shared'];
|
||||
|
||||
export function sortDomains(domains: readonly string[]): string[] {
|
||||
return [...domains].sort((a, b) => {
|
||||
const ia = DOMAIN_ORDER.indexOf(a);
|
||||
const ib = DOMAIN_ORDER.indexOf(b);
|
||||
// 字典外的域排在已知域之后,彼此按键序稳定
|
||||
if (ia === -1 && ib === -1) return a.localeCompare(b);
|
||||
if (ia === -1) return 1;
|
||||
if (ib === -1) return -1;
|
||||
return ia - ib;
|
||||
});
|
||||
}
|
||||
|
||||
export function domainShort(domain: string): string {
|
||||
const hit = DOMAIN_SHORT[domain];
|
||||
if (hit !== undefined) return hit;
|
||||
const tail = domain.split('_').at(-1) ?? domain;
|
||||
return tail.length <= 4 ? tail : tail.slice(0, 4);
|
||||
}
|
||||
@@ -54,7 +54,7 @@ export const ZONES: ReadonlyArray<{ key: GovZone; label: string; icon: string }>
|
||||
{ key: 'cockpit', label: '驾驶舱', icon: 'gauge' },
|
||||
{ key: 'tasks', label: '任务', icon: 'activity' },
|
||||
{ key: 'people', label: '员工', icon: 'users' },
|
||||
{ key: 'ledgers', label: '台账', icon: 'database' },
|
||||
{ key: 'ledgers', label: '台账', icon: 'table' },
|
||||
{ key: 'knowledge', label: '知识库', icon: 'layers' },
|
||||
{ key: 'system', label: '系统', icon: 'settings' },
|
||||
];
|
||||
@@ -75,9 +75,9 @@ export const ZM: Readonly<Record<GovZone, { title: string; desc: string; accent:
|
||||
},
|
||||
ledgers: {
|
||||
title: '台账管理',
|
||||
icon: 'database',
|
||||
icon: 'table',
|
||||
accent: 'linear-gradient(140deg,#245bdb,#16307a)',
|
||||
desc: '行数据 · 版本 · 引用——域的 schema 在设计中心改,这里做运营动作。导航按数据域动态生成:设计侧一发布新域,运营侧自动长出一位。',
|
||||
desc: '行数据 · 版本 · 引用——域的结构在设计中心改,这里做运营动作。域即页签,随数据域发布生长:设计侧一发布新域,台账里自动多一个域页签。',
|
||||
},
|
||||
knowledge: {
|
||||
title: '知识库',
|
||||
@@ -157,7 +157,7 @@ export const TABS: Readonly<Record<GovZone, ReadonlyArray<{ key: string; label:
|
||||
{ key: 'roles', label: '岗位授权', ico: 'key' },
|
||||
{ key: 'groups', label: '工作组', ico: 'users' },
|
||||
],
|
||||
ledgers: [],
|
||||
ledgers: [], // 动态:页签即数据域(短名呈现),由壳层按已发布域生成
|
||||
knowledge: [{ key: 'layers', label: '活动记忆', ico: 'layers' }],
|
||||
system: [
|
||||
{ key: 'llm', label: 'LLM 实例', ico: 'cpu' },
|
||||
|
||||
Reference in New Issue
Block a user