feat(projects): 工作台部分组件调成真实数据
This commit is contained in:
@@ -11,12 +11,10 @@ export type WorkbenchModuleKey =
|
||||
| 'myExecution' // B8 · 我负责的执行
|
||||
| 'productSnapshot' // F24 · 产品深度快照(对象快照 / 当前对象切换)
|
||||
| 'teamLoad' // C13 · 团队负载(管理者)
|
||||
| 'myWeekWorklog' // D16 · 工时(含「我的工时 / 团队工时」两 tab,原 C12 teamWorklog 已并入)
|
||||
| 'noticeNotification'; // E22 · 公告 + 通知摘要
|
||||
| 'myWeekWorklog'; // D16 · 工时(含「我的工时 / 团队工时」两 tab,原 C12 teamWorklog 已并入)
|
||||
|
||||
// 扩展:action(动作型 widget)、snapshot(对象快照型 widget,需指定一个对象)
|
||||
export type WorkbenchModuleCategory = 'personal' | 'manager' | 'tool' | 'action' | 'snapshot';
|
||||
export type WorkbenchColumnId = 'left' | 'right';
|
||||
|
||||
export interface WorkbenchModuleMeta {
|
||||
key: WorkbenchModuleKey;
|
||||
@@ -25,17 +23,17 @@ export interface WorkbenchModuleMeta {
|
||||
icon: string;
|
||||
category: WorkbenchModuleCategory;
|
||||
defaultVisible: boolean;
|
||||
defaultColumn: WorkbenchColumnId;
|
||||
defaultOrder: number;
|
||||
/** 默认网格位置与尺寸(12 栅格)。hidden 项的 x/y 仅作占位,show 时动态找空位。 */
|
||||
defaultGrid: { x: number; y: number; w: number; h: number; minW: number; minH: number };
|
||||
}
|
||||
|
||||
const placeholder = markRaw({ render: () => null });
|
||||
|
||||
// 默认布局(2026-05-27 调整,对应 WORKBENCH_LAYOUT_VERSION=3):
|
||||
// left: myTodo(1) → myExecution(2)
|
||||
// right: shortcut(1) → myProject(2) → myWeekWorklog(3) → teamLoad(4)
|
||||
// hidden: projectHealth, noticeNotification, productSnapshot
|
||||
// (noticeNotification 隐藏原因:公告搬到 banner、通知归全局头部铃铛)
|
||||
// 默认布局(2026-06-01 固化用户实拍布局,对应 WORKBENCH_LAYOUT_VERSION=5):
|
||||
// 左列(x=0 w=7):myTodo(y=0 h=25) → myWeekWorklog(y=25 h=22)
|
||||
// 右列(x=7 w=5):shortcut(y=0 h=11) → myProject(y=11 h=17) → myExecution(y=28 h=19)
|
||||
// 底部满宽(x=0 w=12):teamLoad(y=47 h=16)
|
||||
// hidden(x/y 为占位,show 时动态落到网格底部):projectHealth、productSnapshot
|
||||
const registry: WorkbenchModuleMeta[] = [
|
||||
{
|
||||
key: 'myTodo',
|
||||
@@ -44,8 +42,8 @@ const registry: WorkbenchModuleMeta[] = [
|
||||
icon: 'mdi:clipboard-text-clock-outline',
|
||||
category: 'personal',
|
||||
defaultVisible: true,
|
||||
defaultColumn: 'left',
|
||||
defaultOrder: 1
|
||||
// minH 24 ≈ 608px:保证至少完整展示 5 条待办(头部 124 + 5×71 列表 + 余量)
|
||||
defaultGrid: { x: 0, y: 0, w: 7, h: 25, minW: 5, minH: 24 }
|
||||
},
|
||||
{
|
||||
key: 'myExecution',
|
||||
@@ -54,8 +52,7 @@ const registry: WorkbenchModuleMeta[] = [
|
||||
icon: 'mdi:flag-checkered',
|
||||
category: 'personal',
|
||||
defaultVisible: true,
|
||||
defaultColumn: 'left',
|
||||
defaultOrder: 2
|
||||
defaultGrid: { x: 7, y: 28, w: 5, h: 19, minW: 4, minH: 15 }
|
||||
},
|
||||
{
|
||||
key: 'shortcut',
|
||||
@@ -64,8 +61,7 @@ const registry: WorkbenchModuleMeta[] = [
|
||||
icon: 'mdi:rocket-launch-outline',
|
||||
category: 'tool',
|
||||
defaultVisible: true,
|
||||
defaultColumn: 'right',
|
||||
defaultOrder: 1
|
||||
defaultGrid: { x: 7, y: 0, w: 5, h: 11, minW: 3, minH: 10 }
|
||||
},
|
||||
{
|
||||
key: 'myProject',
|
||||
@@ -74,8 +70,7 @@ const registry: WorkbenchModuleMeta[] = [
|
||||
icon: 'mdi:briefcase-outline',
|
||||
category: 'personal',
|
||||
defaultVisible: true,
|
||||
defaultColumn: 'right',
|
||||
defaultOrder: 2
|
||||
defaultGrid: { x: 7, y: 11, w: 5, h: 17, minW: 5, minH: 17 }
|
||||
},
|
||||
{
|
||||
key: 'myWeekWorklog',
|
||||
@@ -84,8 +79,7 @@ const registry: WorkbenchModuleMeta[] = [
|
||||
icon: 'mdi:timer-outline',
|
||||
category: 'personal',
|
||||
defaultVisible: true,
|
||||
defaultColumn: 'right',
|
||||
defaultOrder: 3
|
||||
defaultGrid: { x: 0, y: 25, w: 7, h: 22, minW: 6, minH: 18 }
|
||||
},
|
||||
{
|
||||
key: 'teamLoad',
|
||||
@@ -94,8 +88,7 @@ const registry: WorkbenchModuleMeta[] = [
|
||||
icon: 'mdi:scale-balance',
|
||||
category: 'manager',
|
||||
defaultVisible: true,
|
||||
defaultColumn: 'right',
|
||||
defaultOrder: 4
|
||||
defaultGrid: { x: 0, y: 47, w: 12, h: 16, minW: 4, minH: 15 }
|
||||
},
|
||||
// === 默认隐藏(用户可从 widget 库拖回) ===
|
||||
{
|
||||
@@ -105,18 +98,7 @@ const registry: WorkbenchModuleMeta[] = [
|
||||
icon: 'mdi:heart-pulse',
|
||||
category: 'manager',
|
||||
defaultVisible: false,
|
||||
defaultColumn: 'right',
|
||||
defaultOrder: 10
|
||||
},
|
||||
{
|
||||
key: 'noticeNotification',
|
||||
component: placeholder,
|
||||
displayName: '公告 + 通知',
|
||||
icon: 'mdi:bullhorn-outline',
|
||||
category: 'tool',
|
||||
defaultVisible: false,
|
||||
defaultColumn: 'right',
|
||||
defaultOrder: 11
|
||||
defaultGrid: { x: 0, y: 0, w: 5, h: 12, minW: 4, minH: 9 }
|
||||
},
|
||||
{
|
||||
key: 'productSnapshot',
|
||||
@@ -125,8 +107,7 @@ const registry: WorkbenchModuleMeta[] = [
|
||||
icon: 'mdi:image-area-close',
|
||||
category: 'snapshot',
|
||||
defaultVisible: false,
|
||||
defaultColumn: 'left',
|
||||
defaultOrder: 41
|
||||
defaultGrid: { x: 0, y: 0, w: 6, h: 14, minW: 4, minH: 10 }
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user