fix node height

This commit is contained in:
zhandouxiaojiji committed 2021-01-19 10:08:35 +08:00
1 parent dd3f2e0fb4
commit c36c3a618c
2 files changed
+7 -4

No files matched your search

+1
View File
@@ -57,6 +57,7 @@ npm run dist # 编译exe可执行文件
+ 右键菜单
+ 面板拖拽新建节点
+ 变量自动补全
+ 设置面板
## About
目前编辑器还处于非常简陋的阶段,有问题可以联系作者(QQ1013299930),本项目将长期维护,望前端大佬们多提点~
+6 -4
View File
@@ -55,12 +55,14 @@ export const calcTreeNodeSize = (treeNode: GraphNodeModel) => {
var height = 40;
const updateHeight = (obj: any) => {
if (Array.isArray(obj) || (obj && Object.keys(obj).length > 0)) {
height += 30;
const { str, line } = toBreakWord(`参数:${JSON.stringify(obj)}`, 35);
console.log("line", str, line);
height += 20 * line;
}
};
updateHeight(treeNode.conf.args);
updateHeight(treeNode.conf.input);
updateHeight(treeNode.conf.output);
updateHeight(treeNode.args);
updateHeight(treeNode.input);
updateHeight(treeNode.output);
return [200, height];
};