Skip to content

Commit 4f15989

Browse files
committed
fix flow scss
1 parent 07e9bc9 commit 4f15989

File tree

12 files changed

+133
-219
lines changed

12 files changed

+133
-219
lines changed
Lines changed: 101 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1+
/* 流程的背景色 */
2+
$flow-background-color: white;
3+
/* 流程的边框颜色 */
4+
$flow-box-shadow-color: rgb(228, 224, 219);
5+
6+
/* 抄送节点的颜色 */
7+
$flow-circulate-color: #61aa1f;
8+
/* 流程节点的颜色 */
9+
$flow-node-color: #6855ef;
10+
/* 结束节点的颜色 */
11+
$flow-over-color: #ea3f21;
12+
/* 开始节点的颜色 */
13+
$flow-start-color: #b1ad30;
14+
15+
/* 流程设计器的样式 */
116
.flow-design {
2-
border: 1px solid #ebeef5;
17+
border: 1px solid $flow-box-shadow-color;
318
transition: 0.3s;
419
padding: 15px 16px;
520
border-radius: 12px;
@@ -10,9 +25,91 @@
1025
height: 85vh;
1126
}
1227
}
13-
.lf-mini-map {
14-
border: none !important;
15-
box-shadow: 3px 0 10px 1px rgb(228, 224, 219);
28+
29+
30+
/* 流程节点的样式 */
31+
.flow-node {
32+
display: flex;
33+
align-items: center;
34+
max-height: 40px;
35+
border-radius: 12px;
36+
padding: 10px;
37+
position: relative;
38+
39+
.icon {
40+
margin-left: 10px;
41+
position: absolute;
42+
font-size: 16px;
43+
left: 0;
44+
}
45+
46+
.code {
47+
margin-left: 20px;
48+
font-size: 14px;
49+
color: #4a5e63;
50+
}
51+
52+
.title {
53+
margin-left: 5px;
54+
font-size: 14px;
55+
color: black;
56+
}
57+
58+
59+
.setting {
60+
margin-right: 10px;
61+
font-size: 14px;
62+
position: absolute;
63+
right: 0;
64+
}
65+
66+
67+
.state {
68+
margin-right: 10px;
69+
font-size: 14px;
70+
position: absolute;
71+
right: 0;
72+
}
73+
}
74+
75+
76+
.circulate-node {
77+
border: 1px solid $flow-circulate-color;
78+
.icon {
79+
color: $flow-circulate-color;
80+
}
81+
.setting {
82+
color: $flow-circulate-color;
83+
}
1684
}
1785

1886

87+
.node-node {
88+
border: 1px solid $flow-node-color;
89+
.icon {
90+
color: $flow-node-color;
91+
}
92+
.setting {
93+
color: $flow-node-color;
94+
}
95+
}
96+
97+
.over-node {
98+
border: 1px solid $flow-over-color;
99+
.icon {
100+
color: $flow-over-color;
101+
}
102+
.setting {
103+
color: $flow-over-color;
104+
}
105+
}
106+
107+
.start-node {
108+
border: 1px solid $flow-start-color;
109+
.icon {
110+
color: $flow-start-color;
111+
}
112+
.setting {
113+
color: $flow-start-color;
114+
}
115+
}

admin-pro-ui/src/components/flow/index.tsx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ interface FlowContextProps {
3131
export const FlowContext = React.createContext<FlowContextProps | null>(null);
3232

3333
const Flow: React.FC<FlowProps> = (props) => {
34+
35+
// 流程图背景颜色
36+
const FLOW_BACKGROUND_COLOR = '#f3f5f8';
37+
// 流程图的边颜色
38+
const FLOW_EDGE_COLOR = '#8f94e3';
39+
// 流程图的边宽度
40+
const FLOW_EDGE_STROKE_WIDTH = 1;
41+
3442
const container = useRef<HTMLDivElement>(null);
3543
const lfRef = useRef<LogicFlow>(null);
3644
const edgeType = props.edgeType || 'polyline';
@@ -61,7 +69,7 @@ const Flow: React.FC<FlowProps> = (props) => {
6169
container: container.current,
6270
...SilentConfig,
6371
background: {
64-
backgroundColor: '#f3f5f8'
72+
backgroundColor: FLOW_BACKGROUND_COLOR
6573
},
6674
plugins: [Menu, DndPanel, MiniMap, Snapshot],
6775
grid: false,
@@ -82,16 +90,16 @@ const Flow: React.FC<FlowProps> = (props) => {
8290

8391
lfRef.current.setTheme({
8492
bezier: {
85-
stroke: '#8f94e3',
86-
strokeWidth: 1,
93+
stroke: FLOW_EDGE_COLOR,
94+
strokeWidth: FLOW_EDGE_STROKE_WIDTH,
8795
},
8896
polyline: {
89-
stroke: '#8f94e3',
90-
strokeWidth: 1,
97+
stroke: FLOW_EDGE_COLOR,
98+
strokeWidth: FLOW_EDGE_STROKE_WIDTH,
9199
},
92100
line: {
93-
stroke: '#8f94e3',
94-
strokeWidth: 1,
101+
stroke: FLOW_EDGE_COLOR,
102+
strokeWidth: FLOW_EDGE_STROKE_WIDTH,
95103
},
96104
});
97105
lfRef.current.register(Start);

admin-pro-ui/src/components/flow/nodes/Circulate/index.scss

Lines changed: 0 additions & 49 deletions
This file was deleted.

admin-pro-ui/src/components/flow/nodes/Circulate/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {HtmlNode, HtmlNodeModel} from '@logicflow/core';
22
import React from "react";
33
import ReactDOM from "react-dom/client";
4-
import "./index.scss";
54
import {InboxOutlined, SettingFilled} from "@ant-design/icons";
65
import CirculateSettingPanel from "@/components/flow/nodes/panel/circulate";
76
import StateTag from "@/components/flow/nodes/panel/StateTag";
@@ -37,7 +36,7 @@ export const CirculateView: React.FC<CirculateProps> = (props) => {
3736
const state = props.properties?.state;
3837

3938
return (
40-
<div className="circulate-node">
39+
<div className="flow-node circulate-node">
4140
<InboxOutlined
4241
className={"icon"}
4342
/>

admin-pro-ui/src/components/flow/nodes/Node/index.scss

Lines changed: 0 additions & 49 deletions
This file was deleted.

admin-pro-ui/src/components/flow/nodes/Node/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {HtmlNode, HtmlNodeModel} from '@logicflow/core';
22
import React from "react";
33
import ReactDOM from "react-dom/client";
4-
import "./index.scss";
54
import {PlusCircleFilled, SettingFilled} from "@ant-design/icons";
65
import NodeSettingPanel from "@/components/flow/nodes/panel/node";
76
import StateTag from "@/components/flow/nodes/panel/StateTag";
@@ -38,7 +37,7 @@ export const NodeView: React.FC<NodeProps> = (props) => {
3837
const state = props.properties?.state;
3938

4039
return (
41-
<div className="node-node">
40+
<div className="flow-node node-node">
4241
<PlusCircleFilled
4342
className={"icon"}
4443
/>

admin-pro-ui/src/components/flow/nodes/Over/index.scss

Lines changed: 0 additions & 49 deletions
This file was deleted.

admin-pro-ui/src/components/flow/nodes/Over/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {HtmlNode, HtmlNodeModel} from '@logicflow/core';
22
import React from "react";
33
import ReactDOM from "react-dom/client";
4-
import "./index.scss";
54
import {CheckCircleFilled, SettingFilled} from "@ant-design/icons";
65
import OverSettingPanel from "@/components/flow/nodes/panel/over";
76
import StateTag from "@/components/flow/nodes/panel/StateTag";
@@ -37,7 +36,7 @@ export const OverView: React.FC<OverProps> = (props) => {
3736
const state = props.properties?.state;
3837

3938
return (
40-
<div className="over-node">
39+
<div className="flow-node over-node">
4140
<CheckCircleFilled
4241
className={"icon"}
4342
/>

0 commit comments

Comments
 (0)