Skip to content

Commit a71db67

Browse files
committed
backup
1 parent 63487d4 commit a71db67

File tree

3 files changed

+84
-1
lines changed

3 files changed

+84
-1
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import { PlusOutlined } from "@ant-design/icons"
2+
import { memo } from "react"
3+
import { styled } from "styled-components"
4+
5+
const AddButtonBox = styled.div`
6+
width: 240px;
7+
display: -webkit-inline-box;
8+
display: -ms-inline-flexbox;
9+
display: inline-flex;
10+
-ms-flex-negative: 0;
11+
flex-shrink: 0;
12+
-webkit-box-flex: 1;
13+
-ms-flex-positive: 1;
14+
position: relative;
15+
&:before {
16+
content: "";
17+
position: absolute;
18+
top: 0;
19+
left: 0;
20+
right: 0;
21+
bottom: 0;
22+
z-index: -1;
23+
margin: auto;
24+
width: 2px;
25+
height: 100%;
26+
background-color: #cacaca
27+
}
28+
`
29+
30+
const Button = styled.div`
31+
user-select: none;
32+
width: 240px;
33+
padding: 20px 0 32px;
34+
display: flex;
35+
-webkit-box-pack: center;
36+
justify-content: center;
37+
flex-shrink: 0;
38+
-webkit-box-flex: 1;
39+
flex-grow: 1;
40+
.btn {
41+
//display: flex;
42+
//justify-content: center;
43+
//align-items: center;
44+
padding-left: 4.5px;
45+
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, .1);
46+
width: 30px;
47+
height: 30px;
48+
background: #3296fa;
49+
border-radius: 50%;
50+
position: relative;
51+
border: none;
52+
line-height: 28px;
53+
-webkit-transition: all .3s cubic-bezier(.645, .045, .355, 1);
54+
transition: all .3s cubic-bezier(.645, .045, .355, 1);
55+
cursor: pointer;
56+
color:#fff;
57+
font-size: 20px;
58+
&:hover {
59+
transform: scale(1.3);
60+
box-shadow: 0 13px 27px 0 rgba(0, 0, 0, .1)
61+
}
62+
&:active {
63+
transform: none;
64+
background: #1e83e9;
65+
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, .1)
66+
}
67+
}
68+
`
69+
70+
export const AddButton = memo(() => {
71+
return (
72+
<AddButtonBox className="add-node-button-box">
73+
<Button>
74+
<div className="btn">
75+
<PlusOutlined />
76+
</div>
77+
</Button>
78+
</AddButtonBox>
79+
)
80+
})

src/workflow-editor/nodes/StartNode/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { memo } from "react"
22
import { useStartNode } from "../../hooks/useStartNode"
33
import { NodeContent, NodeTitle, NodeWrap, NodeWrapBox } from "../styled"
4+
import { AddButton } from "../AddButton"
45

56
export const StartNode = memo(() => {
67
const { startNode } = useStartNode()
@@ -14,6 +15,7 @@ export const StartNode = memo(() => {
1415
所有人
1516
</NodeContent>
1617
</NodeWrapBox>
18+
<AddButton />
1719
</NodeWrap>
1820
)
1921
})

src/workflow-editor/nodes/styled/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ export const NodeWrapBox = styled.div`
1919
width: 220px;
2020
min-height: 72px;
2121
flex-shrink: 0;
22-
background: #fff;
22+
background: ${props => props.theme.token?.colorBgContainer};
23+
border: solid ${props => props.theme.mode === "dark" ? "1px" : 0} ${props => props.theme?.token?.colorBorder};
2324
border-radius: 4px;
2425
cursor: pointer;
2526
&:after{

0 commit comments

Comments
 (0)