Merge branch 'main' of http://18.167.251.121:10003/aidlab/FiDA_Front
This commit is contained in:
@@ -170,7 +170,7 @@
|
||||
/** 点击节点 */
|
||||
const clickNode = (event) => {
|
||||
let node = event.node
|
||||
stateManager.showNodeConnections(node.id)
|
||||
// stateManager.showNodeConnections(node.id)
|
||||
}
|
||||
/** 删除节点 */
|
||||
const deleteNode = (id) => {
|
||||
|
||||
@@ -54,6 +54,7 @@ export class NodeManager {
|
||||
return current.data.createIndexPosition > max.data.createIndexPosition ? current : max
|
||||
}, superiorGenerateNodes[0])
|
||||
const snode = superiorID ? this.stateManager.flowManager.getNodeById(superiorID) : this.stateManager.flowManager.getLastNode();
|
||||
console.log(snode)
|
||||
const id = options.id || createId()
|
||||
const positionX = options.positionX || 0
|
||||
const positionY = options.positionY || 0
|
||||
@@ -65,10 +66,14 @@ export class NodeManager {
|
||||
{
|
||||
x: endGenerateNode.position.x + positionX,
|
||||
y: endGenerateNode.position.y + positionY + this.ranksep + 200
|
||||
} :
|
||||
} : snode ?
|
||||
{
|
||||
x: snode.position.x + snode.dimensions.width + this.nodesep + positionX,
|
||||
y: snode.position.y + positionY
|
||||
} :
|
||||
{
|
||||
x: positionX,
|
||||
y: positionY
|
||||
}
|
||||
)
|
||||
const data = options?.data || {}
|
||||
|
||||
@@ -111,7 +111,7 @@ export class StateManager {
|
||||
|
||||
}
|
||||
/** 设置激活节点 */
|
||||
setActiveNodeID(id: string) { this.activeNodeID.value = id }
|
||||
setActiveNodeID(id: string) { this.activeNodeID.value = id;this.showNodeConnections(id) }
|
||||
/** 添加节点 */
|
||||
addNode(node: NodesItem) {
|
||||
this.nodes.value.push(node);
|
||||
@@ -222,8 +222,9 @@ export class StateManager {
|
||||
|
||||
/** 显示指定子节点和父节点连接线,隐藏父节点和其他子节点链接线, */
|
||||
showNodeConnections(id: string) {
|
||||
if(!id) return
|
||||
const node = this.getNodeById(id)
|
||||
if(!node.data.superiorID) return
|
||||
if(!node?.data?.superiorID) return
|
||||
this.nodes.value.forEach((nodeItem) => {
|
||||
if(node.data.superiorID === nodeItem.data.superiorID && nodeItem.id == id) {
|
||||
nodeItem.data.isActive = true
|
||||
|
||||
@@ -226,10 +226,9 @@ defineExpose({push})
|
||||
margin-bottom: 2rem;
|
||||
background-color: #ffffff;
|
||||
cursor: pointer;
|
||||
pointer-events: none;
|
||||
display: none;
|
||||
&.active{
|
||||
background-color: #f5f5f5;
|
||||
pointer-events: auto;
|
||||
display: flex;
|
||||
}
|
||||
&:hover{
|
||||
background-color: #f5f5f5;
|
||||
|
||||
Reference in New Issue
Block a user