feat(tree,menu,docs): 对接目录树三类数据并中文化文档
This commit is contained in:
@@ -5,8 +5,6 @@
|
||||
import { Engine, type EngineOptions, type ModelLoadOptions } from '../components/engine';
|
||||
import { BaseManager } from '../core/base-manager';
|
||||
import { RightKeyManager } from './right-key-manager';
|
||||
import { infoMenuButton } from '../components/menu/buttons/info';
|
||||
import { homeMenuButton } from '../components/menu/buttons/home';
|
||||
import type { MeasureMode } from '../types/measure';
|
||||
import type { SectionBoxRange } from '../components/section-box-panel/types';
|
||||
import type { MenuItemConfig } from '../components/menu/item';
|
||||
@@ -56,31 +54,96 @@ export class EngineManager extends BaseManager {
|
||||
const items: MenuItemConfig[] = [];
|
||||
|
||||
if (selected) {
|
||||
// 1. 构件详情
|
||||
items.push({
|
||||
id: 'componentDetail',
|
||||
label: 'menu.componentDetail',
|
||||
group: 'component',
|
||||
order: 1,
|
||||
divider: true,
|
||||
onClick: () => {
|
||||
const registry = ManagerRegistry.getInstance();
|
||||
registry.componentDetail?.show(selected.url, selected.id);
|
||||
registry.componentDetail?.show();
|
||||
this.rightKey?.hide();
|
||||
}
|
||||
});
|
||||
|
||||
// 2. 隐藏选中构件
|
||||
items.push({
|
||||
id: 'hideSelected',
|
||||
label: 'menu.hideSelected',
|
||||
group: 'component',
|
||||
order: 2,
|
||||
onClick: () => {
|
||||
console.log('[Menu] 隐藏选中构件 - 暂未实现');
|
||||
this.rightKey?.hide();
|
||||
}
|
||||
});
|
||||
|
||||
// 3. 半透明选中构件
|
||||
items.push({
|
||||
id: 'transparentSelected',
|
||||
label: 'menu.transparentSelected',
|
||||
group: 'component',
|
||||
order: 3,
|
||||
onClick: () => {
|
||||
console.log('[Menu] 半透明选中构件 - 暂未实现');
|
||||
this.rightKey?.hide();
|
||||
}
|
||||
});
|
||||
|
||||
// 4. 隔离选中构件(带子菜单)
|
||||
items.push({
|
||||
id: 'isolateSelected',
|
||||
label: 'menu.isolateSelected',
|
||||
group: 'component',
|
||||
order: 4,
|
||||
divider: true,
|
||||
children: [
|
||||
{
|
||||
id: 'hideOthers',
|
||||
label: 'menu.hideOthers',
|
||||
onClick: () => {
|
||||
console.log('[Menu] 隔离 - 其他构件隐藏 - 暂未实现');
|
||||
this.rightKey?.hide();
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'transparentOthers',
|
||||
label: 'menu.transparentOthers',
|
||||
onClick: () => {
|
||||
console.log('[Menu] 隔离 - 其他构件半透明 - 暂未实现');
|
||||
this.rightKey?.hide();
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
// 5. 剖切盒适应
|
||||
items.push({
|
||||
id: 'fitSectionBox',
|
||||
label: 'menu.fitSectionBox',
|
||||
group: 'component',
|
||||
order: 5,
|
||||
onClick: () => {
|
||||
console.log('[Menu] 剖切盒适应 - 暂未实现');
|
||||
this.rightKey?.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 6. 显示全部(始终显示)
|
||||
items.push({
|
||||
id: 'showAll',
|
||||
label: 'menu.showAll',
|
||||
group: 'component',
|
||||
order: 6,
|
||||
onClick: () => {
|
||||
console.log('[Menu] 显示全部 - 功能开发中');
|
||||
console.log('[Menu] 显示全部 - 暂未实现');
|
||||
this.rightKey?.hide();
|
||||
}
|
||||
});
|
||||
|
||||
items.push(infoMenuButton());
|
||||
items.push(homeMenuButton());
|
||||
|
||||
return items;
|
||||
});
|
||||
|
||||
@@ -370,6 +433,22 @@ export class EngineManager extends BaseManager {
|
||||
|
||||
// ==================== 结束:构件选中 ====================
|
||||
|
||||
// ==================== 模型树 ====================
|
||||
|
||||
public getTypeTreeData(): any[] {
|
||||
return this.engineInstance?.getTypeTreeData() ?? [];
|
||||
}
|
||||
|
||||
public getLevelTreeData(): any[] {
|
||||
return this.engineInstance?.getLevelTreeData() ?? [];
|
||||
}
|
||||
|
||||
public getMajorTreeData(): any[] {
|
||||
return this.engineInstance?.getMajorTreeData() ?? [];
|
||||
}
|
||||
|
||||
// ==================== 结束:模型树 ====================
|
||||
|
||||
/** 销毁引擎管理器 */
|
||||
public destroy(): void {
|
||||
if (this.engineInstance) {
|
||||
|
||||
Reference in New Issue
Block a user