Skip to content

Commit c071206

Browse files
author
昔梦
committed
fix:条件节点和并行节点样式修复
1 parent 1c14042 commit c071206

File tree

6 files changed

+37
-23
lines changed

6 files changed

+37
-23
lines changed

packages/x-flow/src/nodes/node-parallel/ParallelBuildInNodeWidget.tsx

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { useStore } from '../../hooks/useStore';
88
import { uuid } from '../../utils';
99
import './index.less';
1010

11-
1211
export default memo((props: any) => {
1312
const {
1413
data,
@@ -38,13 +37,21 @@ export default memo((props: any) => {
3837

3938
const renderTitle = (item, index) => {
4039
const defTitle = item?.title || `事件${index}`;
41-
const title = parallelExtra?.titleKey
42-
? item[parallelExtra?.titleKey]
43-
: defTitle;
40+
// const title = parallelExtra?.titleKey
41+
// ? item[parallelExtra?.titleKey]
42+
// : defTitle;
43+
const title = item[parallelExtra?.titleKey] ?? defTitle;
4444
return (
4545
<div className="item-header">
4646
<div className="item-title">
47-
{title && <TextEllipsis text={title} rows={1} type="paragraph" />}
47+
{title && (
48+
<TextEllipsis
49+
text={title}
50+
// rows={1}
51+
// type="paragraph"
52+
className="item-content-in"
53+
/>
54+
)}
4855
</div>
4956
<SourceHandle
5057
position={position}
@@ -73,9 +80,13 @@ export default memo((props: any) => {
7380
{CustomNodeWidget ? (
7481
<CustomNodeWidget data={item} index={index} />
7582
) : (
76-
<>
77-
{value && <TextEllipsis text={value} rows={5} type="paragraph" />}
78-
</>
83+
<div>
84+
{value && (
85+
<div className="item-content-in">
86+
<TextEllipsis text={value} rows={5} type="paragraph" />
87+
</div>
88+
)}
89+
</div>
7990
)}
8091
</div>
8192
);

packages/x-flow/src/nodes/node-parallel/index.less

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@
4343
}
4444

4545
.item-handle {
46-
right: -12px;
46+
right: -11px;
47+
top: 9px;
48+
49+
.xflow-node-add-box {
50+
right: 4px;
51+
}
4752
}
4853
}
4954

@@ -67,6 +72,7 @@
6772

6873
.node-parallel-bottom-item {
6974
width: 100px;
75+
7076
.item-header {
7177
.item-title {
7278
text-align: center;
@@ -77,8 +83,9 @@
7783
margin-bottom: 0;
7884
}
7985
}
86+
8087
.item-handle {
81-
bottom: -4px;
88+
top: 0px;
8289
}
8390
}
8491
}

packages/x-flow/src/nodes/node-parallel/setting/index.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,10 @@ interface INodeSwitchSettingPorps {
1212
const schema: Schema = {
1313
type: 'object',
1414
displayType:'row',
15-
// span: 24,
1615
properties: {
1716
list: {
1817
type: 'array',
1918
widget: 'simpleList',
20-
// display: 'block',
21-
// min: 2,
22-
default:[{},{}],
2319
props: {
2420
hideCopy: true,
2521
hideMove: true,

packages/x-flow/src/nodes/node-switch/SwitchBuildInNodeWidget.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ export default memo((props: any) => {
3232

3333
const renderTitle = (item, index) => {
3434
const defTitle = item?.title || `条件${index}`;
35-
const title = switchExtra?.titleKey
36-
? item[switchExtra?.titleKey]
37-
: defTitle;
35+
// const title = switchExtra?.titleKey
36+
// ? item[switchExtra?.titleKey]
37+
// : defTitle;
38+
const title = item[switchExtra?.titleKey] ?? defTitle;
3839
return (
3940
<div className="item-header">
4041
<div className="item-title">{title}</div>
@@ -66,9 +67,9 @@ export default memo((props: any) => {
6667
{CustomNodeWidget ? (
6768
<CustomNodeWidget data={item} index={index} />
6869
) : (
69-
<>
70-
{value && <TextEllipsis text={value} rows={5} type="paragraph" />}
71-
</>
70+
<div>
71+
{value && <div className='item-content-in'><TextEllipsis text={value} rows={5} type="paragraph" /></div>}
72+
</div>
7273
)}
7374
</div>
7475
);

packages/x-flow/src/nodes/node-switch/index.less

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@
3434
.item-title {
3535
text-align: right;
3636
font-weight: 600;
37+
padding-right: 5px;
3738
}
3839

3940
.item-handle {
40-
right: -16px;
41+
right: -12px;
4142
}
4243
}
4344

packages/x-flow/src/nodes/node-switch/setting/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ const schema: Schema = {
1818
type: 'array',
1919
widget: 'simpleList',
2020
display: 'block',
21-
min: 1,
22-
default:[{}],
2321
props: {
2422
hideCopy: true,
2523
hideMove: true,

0 commit comments

Comments
 (0)