feat: 修复 textNode Label 宽度自适应问题

- 修改 TextNodeModel.ts,动态设置 Label 的 labelWidth 和坐标
- Label 宽度现在跟随节点宽度变化(节点宽度 - 20px)
- 设置 Label 坐标与节点坐标一致,确保 Label 可见
- 限制每个节点只允许一个 Label(isMultiple: false)
- 移除全局 labelWidth 配置,让每个节点自己控制
- 支持文本自动换行(textOverflowMode: wrap)
- 处理数组格式的旧数据兼容性

相关文件:
- src/components/flow/nodes/common/TextNodeModel.ts
- src/components/flow/FlowEditor.vue
- docs/1management/plan.md
This commit is contained in:
2026-02-17 17:19:46 +08:00
parent 777fc2c944
commit 9136f8e84b
3 changed files with 139 additions and 50 deletions

View File

@@ -702,9 +702,8 @@ onMounted(() => {
plugins: [Menu, Label, Snapshot, SelectionSelect, MiniMap, Control],
pluginsOptions: {
label: {
isMultiple: true,
maxCount: 3,
labelWidth: 80,
isMultiple: false, // 每个节点只允许一个 label
// 不设置全局 labelWidth让每个节点自己控制
// textOverflowMode -> 'ellipsis' | 'wrap' | 'clip' | 'nowrap' | 'default'
textOverflowMode: 'wrap',
},