Commit f90733fe authored by wuyongsheng's avatar wuyongsheng

fix: 锚点优化

parent 94e1a524
...@@ -397,7 +397,6 @@ const Flow = (props: IProps) => { ...@@ -397,7 +397,6 @@ const Flow = (props: IProps) => {
: setInSideBatchNodeId(id); : setInSideBatchNodeId(id);
onBatchClick && onBatchClick(id); onBatchClick && onBatchClick(id);
setInSideFlowNodeId(""); setInSideFlowNodeId("");
document.getElementById(`point${id}`)?.scrollIntoView(true);
}, },
[onBatchClick, setSelectedBatchNodeId] [onBatchClick, setSelectedBatchNodeId]
); );
...@@ -406,12 +405,14 @@ const Flow = (props: IProps) => { ...@@ -406,12 +405,14 @@ const Flow = (props: IProps) => {
const onNodeClick = (e: any, node: Node) => { const onNodeClick = (e: any, node: Node) => {
tasks?.forEach((item) => { tasks?.forEach((item) => {
if (item.id === node.id) { if (item.id === node.id) {
if (item.type !== "BATCH") { if (item.type === "BATCH") {
setNodeIdFun(node.id);
} else {
setInSideFlowNodeId(node.id); setInSideFlowNodeId(node.id);
setInSideBatchNodeId(""); setInSideBatchNodeId("");
setSelectedBatchNodeId && setSelectedBatchNodeId(""); setSelectedBatchNodeId && setSelectedBatchNodeId("");
} }
setNodeIdFun(node.id); document.getElementById(`point${node.id}`)?.scrollIntoView(true);
} }
}); });
if (onFlowNodeClick) { if (onFlowNodeClick) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment