ScenarioUI
场景 UI 配置,定义布局、面板、菜单、状态栏和仪表盘卡片。
typescript
interface ScenarioUI {
layout: UILayout
panels: PanelDescriptor[]
sidebarItems: SidebarItem[]
statusBarItems: StatusBarItem[]
defaultSidePanel?: string
welcomeMessage?: string
welcomeMessageZh?: string
showSidebar?: boolean
widgetCards?: ScenarioWidgetCard[]
}
interface PanelDescriptor {
id: string
component: string
region: 'primary' | 'secondary' | 'auxiliary' | 'bottom' | 'overlay'
defaultVisible: boolean
resizable: boolean
minWidth?: number
maxWidth?: number
minHeight?: number
maxHeight?: number
}
interface SidebarItem {
id: string
icon: string
label: string
labelZh: string
component: string
position: number
/** 宽屏模式:设为 true 时面板占据主内容区,侧边栏自动收起 */
wideMode?: boolean
}
interface StatusBarItem {
id: string
icon: string
label: string
labelZh: string
position: number
}
/**
* 场景仪表盘卡片
*/
interface ScenarioWidgetCard {
/** 卡片唯一 id,格式:`<scenarioId>:<cardName>` */
id: string
/** lucide 图标名 */
icon: string
/** 英文标题 */
label: string
/** 中文标题 */
labelZh: string
/** 英文描述(可选) */
description?: string
/** 中文描述(可选) */
descriptionZh?: string
/** 刷新优先级:'core'(15s)或 'enhanced'(60s,默认) */
tier?: 'core' | 'enhanced'
/** 预览组件名(对应 getComponents() 的 key) */
previewComponent: string
}
