Commit fcc0d0da by 李伟康

fix(approval-chain-preview): 修复审批链预览的连接线错位问题

调整节点连接线的定位样式与布局顺序,确保连接线正确连接相邻审批节点
1 parent 2c3be24c
Pipeline #361 for fcc0d0da failed in 0 seconds
...@@ -85,11 +85,13 @@ function NodeLine({ status }: { status: ChainNodeStatus }) { ...@@ -85,11 +85,13 @@ function NodeLine({ status }: { status: ChainNodeStatus }) {
return ( return (
<div <div
style={{ style={{
flex: 1, position: 'absolute',
top: 15,
left: '70%',
width: '60%',
height: 2, height: 2,
background: bg, background: bg,
alignSelf: 'center', zIndex: 0,
marginTop: -16,
}} }}
/> />
); );
...@@ -160,9 +162,25 @@ export function ApprovalChainPreview({ ...@@ -160,9 +162,25 @@ export function ApprovalChainPreview({
> >
<div style={{ display: 'flex', padding: '20px 8px 8px' }}> <div style={{ display: 'flex', padding: '20px 8px 8px' }}>
{finalNodes.map((n, i) => ( {finalNodes.map((n, i) => (
<div key={i} style={{ flex: 1, display: 'flex', position: 'relative' }}> <div
key={i}
style={{
flex: 1,
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
position: 'relative',
}}
>
{i < finalNodes.length - 1 && <NodeLine status={n.status} />}
<div <div
style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', flex: 1 }} style={{
position: 'relative',
zIndex: 1,
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
}}
> >
<NodeIcon status={n.status} index={i} /> <NodeIcon status={n.status} index={i} />
<div <div
...@@ -200,7 +218,6 @@ export function ApprovalChainPreview({ ...@@ -200,7 +218,6 @@ export function ApprovalChainPreview({
</div> </div>
)} )}
</div> </div>
{i < finalNodes.length - 1 && <NodeLine status={finalNodes[i].status} />}
</div> </div>
))} ))}
</div> </div>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!