初始化:质量数据分析平台源码

This commit is contained in:
2026-10-22 15:58:57 +08:00
commit 1e8a655adc
280 changed files with 43922 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
export const workspaceThemes = [
{ id: 'light', name: '浅蓝', primary: '#607AE1', soft: '#EEF1FF', background: '#F3F5FA', hover: '#F5F6FF', muted: '#B0BCEE', metricGrid: '#9BAAC0', metricGridHead: '#7F91AA' },
{ id: 'soft', name: '柔蓝', primary: '#5078AE', soft: '#E7EFF9', background: '#EDF2F8', hover: '#F0F5FB', muted: '#A7BDD9', metricGrid: '#98AAC0', metricGridHead: '#7C91AA' },
{ id: 'deep', name: '深蓝', primary: '#34578F', soft: '#DFE8F5', background: '#E5EBF3', hover: '#E9EFF8', muted: '#99AFCD', metricGrid: '#94A7C0', metricGridHead: '#7188A7' },
{ id: 'bright', name: '亮蓝', primary: '#008CF6', soft: '#E3F2FF', background: '#EFF7FC', hover: '#EDF8FF', muted: '#8DC7F4', metricGrid: '#96ADC3', metricGridHead: '#7697B3' },
{ id: 'classic', name: '经典蓝', primary: '#4472C4', soft: '#E7EFFB', background: '#F0F4FA', hover: '#EEF3FC', muted: '#A1B9E2', metricGrid: '#95A8BF', metricGridHead: '#788EAA' },
{ id: 'dark', name: '夜间黑', primary: '#8AA7FF', soft: '#202C49', background: '#0E1420', hover: '#202B3E', muted: '#516A9A', metricGrid: '#45566D', metricGridHead: '#5B6D85' },
] as const;
export type WorkspaceTheme = (typeof workspaceThemes)[number];
export type WorkspaceThemeId = WorkspaceTheme['id'];
export const workspaceThemeStorageKey = 'quality-workbench-theme';
export function getWorkspaceTheme(themeId: string | null | undefined): WorkspaceTheme {
return workspaceThemes.find(theme => theme.id === themeId) ?? workspaceThemes[0];
}
export function getStoredWorkspaceThemeId(): WorkspaceThemeId {
try {
return getWorkspaceTheme(window.localStorage.getItem(workspaceThemeStorageKey)).id;
} catch {
return workspaceThemes[0].id;
}
}