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