Skip to content

Commit 7043dea

Browse files
committed
【功能优化】替换 iconfont 图标
1 parent 1cb0691 commit 7043dea

File tree

8 files changed

+88
-27
lines changed

8 files changed

+88
-27
lines changed

src/components/SimpleProcessDesignerV2/src/NodeHandler.vue

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,26 @@
4040
<div class="handler-item-text">包容分支</div>
4141
</div>
4242
<div class="handler-item" @click="addNode(NodeType.DELAY_TIMER_NODE)">
43-
<!-- TODO @芋艿 需要更换一下iconfont的图标 -->
44-
<div class="handler-item-icon copy">
45-
<span class="iconfont icon-size icon-copy"></span>
43+
<div class="handler-item-icon delay">
44+
<span class="iconfont icon-size icon-delay"></span>
4645
</div>
4746
<div class="handler-item-text">延迟器</div>
4847
</div>
4948
<div class="handler-item" @click="addNode(NodeType.ROUTER_BRANCH_NODE)">
50-
<!-- TODO @芋艿 需要更换一下iconfont的图标 -->
51-
<div class="handler-item-icon copy">
52-
<span class="iconfont icon-size icon-copy"></span>
49+
<div class="handler-item-icon router">
50+
<span class="iconfont icon-size icon-router"></span>
5351
</div>
5452
<div class="handler-item-text">路由分支</div>
5553
</div>
56-
</div>
54+
<!-- TODO 触发器
55+
<div class="handler-item" @click="addNode(NodeType.TRIGGER_NODE)">
56+
<div class="handler-item-icon trigger">
57+
<span class="iconfont icon-size icon-trigger"></span>
58+
</div>
59+
<div class="handler-item-text">触发器</div>
60+
</div>
61+
-->
62+
</div>
5763
<template #reference>
5864
<div class="add-icon"><Icon icon="ep:plus" /></div>
5965
</template>
@@ -263,6 +269,16 @@ const addNode = (type: number) => {
263269
}
264270
emits('update:childNode', data)
265271
}
272+
if (type === NodeType.TRIGGER_NODE) {
273+
const data: SimpleFlowNode = {
274+
id: 'Activity_' + generateUUID(),
275+
name: NODE_DEFAULT_NAME.get(NodeType.ROUTER_BRANCH_NODE) as string,
276+
showText: '',
277+
type: NodeType.TRIGGER_NODE,
278+
childNode: props.childNode
279+
}
280+
emits('update:childNode', data)
281+
}
266282
}
267283
</script>
268284

src/components/SimpleProcessDesignerV2/src/consts.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ export enum NodeType {
2828
*/
2929
DELAY_TIMER_NODE = 14,
3030

31+
/**
32+
* 触发器节点
33+
*/
34+
TRIGGER_NODE = 15,
35+
3136
/**
3237
* 条件节点
3338
*/
@@ -498,6 +503,7 @@ NODE_DEFAULT_TEXT.set(NodeType.CONDITION_NODE, '请设置条件')
498503
NODE_DEFAULT_TEXT.set(NodeType.START_USER_NODE, '请设置发起人')
499504
NODE_DEFAULT_TEXT.set(NodeType.DELAY_TIMER_NODE, '请设置延迟器')
500505
NODE_DEFAULT_TEXT.set(NodeType.ROUTER_BRANCH_NODE, '请设置路由节点')
506+
NODE_DEFAULT_TEXT.set(NodeType.TRIGGER_NODE, '请设置触发器')
501507

502508
export const NODE_DEFAULT_NAME = new Map<number, string>()
503509
NODE_DEFAULT_NAME.set(NodeType.USER_TASK_NODE, '审批人')
@@ -506,6 +512,7 @@ NODE_DEFAULT_NAME.set(NodeType.CONDITION_NODE, '条件')
506512
NODE_DEFAULT_NAME.set(NodeType.START_USER_NODE, '发起人')
507513
NODE_DEFAULT_NAME.set(NodeType.DELAY_TIMER_NODE, '延迟器')
508514
NODE_DEFAULT_NAME.set(NodeType.ROUTER_BRANCH_NODE, '路由分支')
515+
NODE_DEFAULT_NAME.set(NodeType.TRIGGER_NODE, '触发器')
509516

510517
// 候选人策略。暂时不从字典中取。 后续可能调整。控制显示顺序
511518
export const CANDIDATE_STRATEGY: DictDataVO[] = [

src/components/SimpleProcessDesignerV2/src/nodes/DelayTimerNode.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
>
1111
<div class="node-title-container">
1212
<!-- TODO @芋艿 需要更换图标 -->
13-
<div class="node-title-icon copy-task"><span class="iconfont icon-copy"></span></div>
13+
<div class="node-title-icon delay-node"><span class="iconfont icon-delay"></span></div>
1414
<input
1515
v-if="!readonly && showInput"
1616
type="text"

src/components/SimpleProcessDesignerV2/src/nodes/RouterNode.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
]"
1010
>
1111
<div class="node-title-container">
12-
<!-- TODO @芋艿 需要更换一下iconfont的图标 -->
13-
<div class="node-title-icon copy-task">
14-
<span class="iconfont icon-copy"></span>
12+
<div class="node-title-icon router-node">
13+
<span class="iconfont icon-router"></span>
1514
</div>
1615
<input
1716
v-if="!readonly && showInput"
Binary file not shown.
Binary file not shown.
Binary file not shown.

src/components/SimpleProcessDesignerV2/theme/simple-process-designer.scss

Lines changed: 55 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -113,18 +113,21 @@
113113

114114
// 节点连线气泡卡片样式
115115
.handler-item-wrapper {
116+
width: 320px;
116117
display: flex;
118+
flex-wrap: wrap;
117119
cursor: pointer;
118120

119121
.handler-item {
120122
display: flex;
121123
flex-direction: column;
122124
align-items: center;
125+
margin-top: 12px;
123126
}
124127

125128
.handler-item-icon {
126-
width: 60px;
127-
height: 60px;
129+
width: 50px;
130+
height: 50px;
128131
background: #fff;
129132
border: 1px solid #e2e2e2;
130133
border-radius: 50%;
@@ -138,13 +141,14 @@
138141

139142
.icon-size {
140143
font-size: 25px;
141-
line-height: 60px;
144+
line-height: 50px;
142145
}
143146
}
144147

145148
.approve {
146149
color: #ff943e;
147150
}
151+
148152
.copy {
149153
color: #3296fa;
150154
}
@@ -161,6 +165,18 @@
161165
color: #345da2;
162166
}
163167

168+
.delay {
169+
color: #e47470;
170+
}
171+
172+
.trigger {
173+
color: #3373d2;
174+
}
175+
176+
.router {
177+
color: #ca3a31
178+
}
179+
164180
.handler-item-text {
165181
margin-top: 4px;
166182
width: 80px;
@@ -266,6 +282,18 @@
266282
&.start-user {
267283
color: #676565;
268284
}
285+
286+
&.delay-node {
287+
color: #e47470;
288+
}
289+
290+
&.trigger-node {
291+
color: #3373d2;
292+
}
293+
294+
&.router-node {
295+
color: #ca3a31
296+
}
269297
}
270298

271299
.node-title {
@@ -711,45 +739,56 @@
711739

712740
// iconfont 样式
713741
@font-face {
714-
font-family: 'iconfont'; /* Project id 4495938 */
715-
src:
716-
url('iconfont.woff2?t=1724339470412') format('woff2'),
717-
url('iconfont.woff?t=1724339470412') format('woff'),
718-
url('iconfont.ttf?t=1724339470412') format('truetype');
742+
font-family: "iconfont"; /* Project id 4495938 */
743+
src: url('iconfont.woff2?t=1737639517142') format('woff2'),
744+
url('iconfont.woff?t=1737639517142') format('woff'),
745+
url('iconfont.ttf?t=1737639517142') format('truetype');
719746
}
720747

721748
.iconfont {
722-
font-family: 'iconfont' !important;
749+
font-family: "iconfont" !important;
723750
font-size: 16px;
724751
font-style: normal;
725752
-webkit-font-smoothing: antialiased;
726753
-moz-osx-font-smoothing: grayscale;
727754
}
728755

756+
.icon-trigger:before {
757+
content: "\e6d3";
758+
}
759+
760+
.icon-router:before {
761+
content: "\e6b2";
762+
}
763+
764+
.icon-delay:before {
765+
content: "\e600";
766+
}
767+
729768
.icon-start-user:before {
730-
content: '\e679';
769+
content: "\e679";
731770
}
732771

733772
.icon-inclusive:before {
734-
content: '\e602';
773+
content: "\e602";
735774
}
736775

737776
.icon-copy:before {
738-
content: '\e7eb';
777+
content: "\e7eb";
739778
}
740779

741780
.icon-handle:before {
742-
content: '\e61c';
781+
content: "\e61c";
743782
}
744783

745784
.icon-exclusive:before {
746-
content: '\e717';
785+
content: "\e717";
747786
}
748787

749788
.icon-approve:before {
750-
content: '\e715';
789+
content: "\e715";
751790
}
752791

753792
.icon-parallel:before {
754-
content: '\e688';
793+
content: "\e688";
755794
}

0 commit comments

Comments
 (0)