/** * 网页标签的名与章 —— 三面各有一套,多标签并开时一眼可辨「我在定义、在监控、还是在干活」。 * * 章随台面的**皮肤基调**走,不另造视觉: * 工作台 = 品牌蓝渐变圆角方 + 白色机器人(与左轨品牌章、登录页方章同源); * 设计中心 = 深靛底 + 路网(定义企业的流转 —— 与流程包区的靛色同源); * 运营中心 = 深色底 + 仪表(看企业今天跑得怎样 —— 驾驶舱的那支指针)。 * SVG 以 data: URI 内联 —— 不添静态资产,构建零配置。 */ const DESK_ICON = ` `; /** 设计中心:深靛底 + 路网 —— 线接着点,正是「连线即映射」 */ const DESIGN_ICON = ` `; /** 运营中心:深色底 + 仪表 —— 指针指着「今天跑得怎样」 */ const OPS_ICON = ` `; /** 三面各一套章名 —— `desk` 是工作台,另两个是治理的两个台面 */ export type TabSurface = 'desk' | 'design' | 'ops'; const IDENTITY: Readonly> = { desk: { title: 'JCAI 工作台', icon: DESK_ICON }, design: { title: 'JCAI 设计中心', icon: DESIGN_ICON }, ops: { title: 'JCAI 运营中心', icon: OPS_ICON }, }; /** 进哪面就挂哪套 —— 登录页也按 URL 归面,标签在登录前就叫对名字 */ export function applyTabIdentity(surface: TabSurface): void { const { title, icon } = IDENTITY[surface]; document.title = title; let link = document.querySelector('link[rel="icon"]'); if (link === null) { link = document.createElement('link'); link.rel = 'icon'; document.head.appendChild(link); } link.type = 'image/svg+xml'; link.href = 'data:image/svg+xml;utf8,' + encodeURIComponent(icon); }