From c313693ecbaa40f1b5c11bebaa5c1b1aa6e5175f Mon Sep 17 00:00:00 2001 From: shaohuzhang1 Date: Mon, 24 Jun 2024 19:33:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=94=9A=E7=82=B9=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/workflow/common/app-node.ts | 64 +++++++++++++++++++++--------- 1 file changed, 45 insertions(+), 19 deletions(-) diff --git a/ui/src/workflow/common/app-node.ts b/ui/src/workflow/common/app-node.ts index 078dc5153..fcfca2a54 100644 --- a/ui/src/workflow/common/app-node.ts +++ b/ui/src/workflow/common/app-node.ts @@ -54,13 +54,11 @@ class AppNode extends HtmlResize.view { getAnchorShape(anchorData: any) { const { x, y, type } = anchorData let isConnect = false - let isLeft = false + if (type == 'left') { isConnect = this.props.graphModel.edges.some((edge) => edge.targetAnchorId == anchorData.id) - isLeft = true } else { isConnect = this.props.graphModel.edges.some((edge) => edge.sourceAnchorId == anchorData.id) - isLeft = false } return lh( @@ -68,25 +66,53 @@ class AppNode extends HtmlResize.view { { ...anchorData, x: x - 10, - y: y - 10, - width: 20, - height: 20 + y: y - 9, + width: 24, + height: 24 }, [ lh('div', { - className: [ - 'node-anchor', - isConnect ? 'is-connect' : '', - isLeft ? 'node-anchor-left' : 'node-anchor-right' - ] - .filter((item) => item) - .join(' ') - }), - lh( - 'style', - {}, - '.node-anchor{height:20px;width:20px;border: 2px solid #3370FF;border-radius: 50%;box-sizing: border-box;}' - ) + dangerouslySetInnerHTML: { + __html: isConnect + ? ` + + + + + + + + + + + + + + + + + + ` + : ` + + + + + + + + + + + + + + + + + ` + } + }) ] ) }