添加测试信息
This commit is contained in:
@@ -132,8 +132,6 @@
|
||||
<button onclick="openTestDialog()">测试弹窗</button>
|
||||
<button onclick="openInfoDialog()">信息弹窗</button>
|
||||
<button onclick="openRedDialog()">警告弹窗</button>
|
||||
<button onclick="openTreeDialog()">树组件测试</button>
|
||||
<button onclick="openSimpleTreeDialog()">纯树测试</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -241,69 +239,6 @@
|
||||
});
|
||||
}
|
||||
|
||||
// --- 树组件测试 ---
|
||||
function openTreeDialog() {
|
||||
if (!engine || !engine.modelTree) return;
|
||||
|
||||
// 1. 构造树数据
|
||||
const treeData = [
|
||||
{
|
||||
id: 'root',
|
||||
label: 'tree.modelStruct',
|
||||
expanded: true,
|
||||
children: [
|
||||
{
|
||||
id: 'level-1',
|
||||
label: 'tree.floor1',
|
||||
expanded: true,
|
||||
children: [
|
||||
{ id: 'l1-wall', label: 'tree.wall', checked: true },
|
||||
{ id: 'l1-col', label: 'tree.column' },
|
||||
{ id: 'l1-win', label: 'tree.window' },
|
||||
{ id: 'l1-door', label: 'tree.door' }
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'level-2',
|
||||
label: 'tree.floor2',
|
||||
children: [
|
||||
{ id: 'l2-wall', label: 'tree.wall' },
|
||||
{ id: 'l2-col', label: 'tree.column' }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
// 2. 使用高级 API 直接显示
|
||||
engine.modelTree.showStructTree(treeData);
|
||||
}
|
||||
|
||||
// --- 纯树测试 (无复选框) ---
|
||||
function openSimpleTreeDialog() {
|
||||
if (!engine || !engine.modelTree) return;
|
||||
|
||||
// 简单数据
|
||||
const treeData = [
|
||||
{
|
||||
id: 'menu-root',
|
||||
label: 'menu.home',
|
||||
expanded: true,
|
||||
icon: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path></svg>',
|
||||
children: [
|
||||
{ id: 'm-info', label: 'menu.info' },
|
||||
{ id: 'm-struct', label: 'tree.modelStruct', children: [
|
||||
{ id: 'm-w', label: 'tree.wall' },
|
||||
{ id: 'm-c', label: 'tree.column' }
|
||||
]}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
// 使用高级 API
|
||||
engine.modelTree.showSimpleTree(treeData, 'Simple Tree');
|
||||
}
|
||||
|
||||
// --- 工具栏操作 ---
|
||||
function toggleToolbar() {
|
||||
if (!engine || !engine.toolbar) return;
|
||||
@@ -471,4 +406,4 @@
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user