添加测试信息
This commit is contained in:
@@ -2,13 +2,15 @@ import { BimDialog } from '../components/dialog';
|
||||
import { BimInfoDialog } from '../components/dialog/bimInfoDialog';
|
||||
import type { DialogOptions } from '../components/dialog/index.type';
|
||||
import type { ThemeConfig } from '../themes/types';
|
||||
import { themeManager } from '../services/theme'; // 修正路径
|
||||
import { themeManager } from '../services/theme';
|
||||
import { BimComponent } from '../core/component';
|
||||
import type { BimEngine } from '../bim-engine';
|
||||
|
||||
/**
|
||||
* 弹窗管理器
|
||||
* 负责创建和管理应用中的各类弹窗。
|
||||
*/
|
||||
export class DialogManager {
|
||||
export class DialogManager extends BimComponent {
|
||||
/** 弹窗挂载的父容器 */
|
||||
private container: HTMLElement;
|
||||
/** 活跃的弹窗实例列表 */
|
||||
@@ -16,10 +18,22 @@ export class DialogManager {
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
* @param engine 引擎实例
|
||||
* @param container 弹窗挂载的目标容器
|
||||
*/
|
||||
constructor(container: HTMLElement) {
|
||||
constructor(engine: BimEngine, container: HTMLElement) {
|
||||
super(engine);
|
||||
this.container = container;
|
||||
|
||||
// 监听打开弹窗事件
|
||||
this.on('ui:open-dialog', (payload) => {
|
||||
// 这里可以根据 payload.id 做更复杂的逻辑,目前简单演示
|
||||
console.log('[DialogManager] Received open-dialog event:', payload);
|
||||
// 示例:如果 payload.id 是 'info',则打开 info dialog
|
||||
if (payload.id === 'info') {
|
||||
this.showInfoDialog();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,4 +80,9 @@ export class DialogManager {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public destroy() {
|
||||
this.activeDialogs.forEach(d => d.destroy());
|
||||
this.activeDialogs = [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user