Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug report]group嵌套group,子group的children丢失 #803

Closed
Jack-rainbow opened this issue Oct 8, 2022 · 4 comments
Closed

[Bug report]group嵌套group,子group的children丢失 #803

Jack-rainbow opened this issue Oct 8, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@Jack-rainbow
Copy link

Jack-rainbow commented Oct 8, 2022

问题描述

  1. 问题触发条件
    参考x6使用addChild方法,加入关联关系(子group节点-abc),然后拖入节点(q),发现节点(q)并为拖入到子group内(abc)
  2. 期望的表现
    group内的group的children也正常拥有节点id
  3. 实际的表现
    image
    image

复现demo源码地址
https://codesandbox.io/s/festive-scott-xif2no

复现demo链接地址
https://xif2no.csb.app/

复现demo拖入节点情况
image

复现demo的json数据

{"nodes":[{"id":"fc4a8753-9aac-46c5-8e9b-bc79a3063917","type":"loop","x":263,"y":229,"properties":{"nodeSize":{"width":436,"height":286}},"children":["2d458e61-e23c-437f-b6ba-d39b6dd854b3","2202af2a-d594-46bb-9176-6381fe6052de","990718e3-d978-4458-af79-ff43473f0307","9c5b397b-3962-4c12-ab94-f3eabbbcdd76"]},{"id":"2202af2a-d594-46bb-9176-6381fe6052de","type":"rect","x":115,"y":141,"properties":{},"text":{"x":115,"y":141,"value":"普通节点"}},{"id":"2d458e61-e23c-437f-b6ba-d39b6dd854b3","type":"loop","x":320,"y":250,"properties":{},"children":[]},{"id":"9c5b397b-3962-4c12-ab94-f3eabbbcdd76","type":"rect","x":361,"y":238,"properties":{},"text":{"x":361,"y":238,"value":"普通节点"}},{"id":"990718e3-d978-4458-af79-ff43473f0307","type":"rect","x":253,"y":210.67361068725586,"properties":{},"text":{"x":253,"y":210.67361068725586,"value":"普通节点"}}],"edges":[]}

参考地址*

1.https://x6.antv.vision/zh/examples/node/group#collapsable
2.http://logic-flow.org/guide/extension/component-group.html

版本*

"@logicflow/core": "1.1.27"
"@logicflow/extension": "1.1.27"

@Jack-rainbow Jack-rainbow changed the title [Bug report]logicflow的group嵌套group如何实现? [Bug report]logicflow的group嵌套group的children丢失 Oct 8, 2022
@Jack-rainbow Jack-rainbow changed the title [Bug report]logicflow的group嵌套group的children丢失 [Bug report]group嵌套group,子group的children丢失 Oct 14, 2022
@towersxu
Copy link
Collaborator

我刚试了一下,如果把groupA拖入groupB,groupA内部的子节点还是属于groupA,这个是没问题的。现在是把一个新的节点C,想要拖入groupB, 这个时候发现只能拖入groupB。你是说的这个问题是吧?

@towersxu towersxu added the bug Something isn't working label Oct 17, 2022
@Jack-rainbow
Copy link
Author

Jack-rainbow commented Oct 17, 2022

我刚试了一下,如果把groupA拖入groupB,groupA内部的子节点还是属于groupA,这个是没问题的。现在是把一个新的节点C,想要拖入groupB, 这个时候发现只能拖入groupB。

——————————
把groupA拖入groupB,groupA内部的子节点还是属于groupA,这个是没问题的。现在是把一个新的节点C,想要拖入groupB, 这个时候发现groupB里边的children为空,发现新节点C并未真实拖入groupB的chilren而是 拖入了groupA的children里边。

——————
根本原因:新节点c 拖入groupB的时候并未识别到groupB是一个群组。

@towersxu
Copy link
Collaborator

目前group嵌套和重合确实没处理,稍后加一个,新节点拖入group时,会拖入到最"上"方的group。

@Jack-rainbow
Copy link
Author

目前group嵌套和重合确实没处理,稍后加一个,新节点拖入group时,会拖入到最"上"方的group。

了解。那就辛苦大佬了。

yhlchao added a commit that referenced this issue Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants