@hzab/flowlong-designer 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/src/components/NodeWrap/Nodes/Approver/index.less +4 -0
- package/src/components/NodeWrap/Nodes/Approver/index.tsx +4 -6
- package/src/components/NodeWrap/Nodes/Branch/components/Field/index.tsx +9 -2
- package/src/components/NodeWrap/Nodes/Branch/components/GroupUserSelectorModal/index.tsx +3 -2
- package/src/components/NodeWrap/Nodes/Branch/index.less +6 -0
- package/src/components/NodeWrap/Nodes/Branch/index.tsx +31 -16
- package/src/components/NodeWrap/Nodes/Send/index.tsx +4 -6
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -33,9 +33,6 @@ export const Approver = (props) => {
|
|
|
33
33
|
const nodeTitleRef = useRef();
|
|
34
34
|
|
|
35
35
|
function onShow() {
|
|
36
|
-
if (disable) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
36
|
setDrawer(true);
|
|
40
37
|
setForm(JSON.parse(JSON.stringify(modelValue)));
|
|
41
38
|
}
|
|
@@ -119,7 +116,7 @@ export const Approver = (props) => {
|
|
|
119
116
|
return (
|
|
120
117
|
<div className="approver-wrap">
|
|
121
118
|
<div className="node-wrap">
|
|
122
|
-
<div className=
|
|
119
|
+
<div className="node-wrap-box" onClick={onShow}>
|
|
123
120
|
<div className="title" style={{ background: "#ff943e" }}>
|
|
124
121
|
<UserOutlined />
|
|
125
122
|
<span>{modelValue?.nodeName}</span>
|
|
@@ -155,7 +152,7 @@ export const Approver = (props) => {
|
|
|
155
152
|
) : (
|
|
156
153
|
<div className="drawer-title">
|
|
157
154
|
{form.nodeName || "审批人设置"}
|
|
158
|
-
<EditOutlined className="node-wrap-drawer__title-edit" onClick={onEditTitle} />
|
|
155
|
+
{!disable && <EditOutlined className="node-wrap-drawer__title-edit" onClick={onEditTitle} />}
|
|
159
156
|
</div>
|
|
160
157
|
)}
|
|
161
158
|
</div>
|
|
@@ -166,7 +163,7 @@ export const Approver = (props) => {
|
|
|
166
163
|
getContainer="body"
|
|
167
164
|
footer={
|
|
168
165
|
<div className="approver-drawer-footer">
|
|
169
|
-
<Button type="primary" onClick={onDrawerSave}>
|
|
166
|
+
<Button type="primary" onClick={onDrawerSave} disabled={disable}>
|
|
170
167
|
保存
|
|
171
168
|
</Button>
|
|
172
169
|
<Button onClick={onDrawerClose}>取消</Button>
|
|
@@ -174,6 +171,7 @@ export const Approver = (props) => {
|
|
|
174
171
|
}
|
|
175
172
|
>
|
|
176
173
|
<Form
|
|
174
|
+
disabled={disable}
|
|
177
175
|
ref={formRef}
|
|
178
176
|
name="approverForm"
|
|
179
177
|
labelCol={{ span: 8 }}
|
|
@@ -5,13 +5,15 @@ interface FormMapProps {
|
|
|
5
5
|
type: string;
|
|
6
6
|
onChange?: (v: any) => void;
|
|
7
7
|
value?: any;
|
|
8
|
+
disabled?: boolean;
|
|
8
9
|
}
|
|
9
10
|
const Field = (props: FormMapProps) => {
|
|
10
|
-
const { type, onChange, value } = props;
|
|
11
|
+
const { type, onChange, value, disabled } = props;
|
|
11
12
|
return (
|
|
12
13
|
<>
|
|
13
14
|
{["day", "hour"].includes(type) && (
|
|
14
15
|
<Input
|
|
16
|
+
disabled={disabled}
|
|
15
17
|
value={value}
|
|
16
18
|
placeholder="值"
|
|
17
19
|
type="number"
|
|
@@ -21,7 +23,12 @@ const Field = (props: FormMapProps) => {
|
|
|
21
23
|
></Input>
|
|
22
24
|
)}
|
|
23
25
|
{["dept", "assignee"].includes(type) && (
|
|
24
|
-
<GroupUserSelectorModal
|
|
26
|
+
<GroupUserSelectorModal
|
|
27
|
+
type={type}
|
|
28
|
+
onChange={onChange}
|
|
29
|
+
value={value}
|
|
30
|
+
disabled={disabled}
|
|
31
|
+
></GroupUserSelectorModal>
|
|
25
32
|
)}
|
|
26
33
|
</>
|
|
27
34
|
);
|
|
@@ -12,7 +12,7 @@ const titleMap = {
|
|
|
12
12
|
assignee: "用户",
|
|
13
13
|
};
|
|
14
14
|
const GroupUserSelectorModal = (props) => {
|
|
15
|
-
const { type, onChange, value = [] } = props;
|
|
15
|
+
const { type, onChange, value = [], disabled } = props;
|
|
16
16
|
const [open, setOpen] = useState(false);
|
|
17
17
|
const groupUserSelectorRef = useRef(null);
|
|
18
18
|
const deptModel = new DataModel({
|
|
@@ -92,13 +92,14 @@ const GroupUserSelectorModal = (props) => {
|
|
|
92
92
|
return (
|
|
93
93
|
<div>
|
|
94
94
|
<Input
|
|
95
|
+
disabled={disabled}
|
|
95
96
|
value={value?.deptUserLabel || null}
|
|
96
97
|
readOnly
|
|
97
98
|
onClick={() => {
|
|
98
99
|
setOpen(true);
|
|
99
100
|
}}
|
|
100
101
|
placeholder="请点击编辑"
|
|
101
|
-
style={{ cursor: "pointer" }}
|
|
102
|
+
style={!disabled ? { cursor: "pointer" } : {}}
|
|
102
103
|
></Input>
|
|
103
104
|
<Modal
|
|
104
105
|
title={titleMap[type]}
|
|
@@ -213,6 +213,9 @@ export const Branch = (props) => {
|
|
|
213
213
|
setForm((f) => ({ ...f }));
|
|
214
214
|
}
|
|
215
215
|
function deleteConditionList(conditionList, idx) {
|
|
216
|
+
if (disable) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
216
219
|
conditionList.splice(idx, 1);
|
|
217
220
|
setForm((f) => ({ ...f }));
|
|
218
221
|
}
|
|
@@ -279,7 +282,7 @@ export const Branch = (props) => {
|
|
|
279
282
|
添加条件
|
|
280
283
|
</Button>
|
|
281
284
|
{nodeConfig?.conditionNodes?.map((item, idx) => {
|
|
282
|
-
const conditionDisable = idx == nodeConfig.conditionNodes?.length - 1
|
|
285
|
+
const conditionDisable = idx == nodeConfig.conditionNodes?.length - 1;
|
|
283
286
|
|
|
284
287
|
return (
|
|
285
288
|
<div className="col-box" key={idx}>
|
|
@@ -309,15 +312,16 @@ export const Branch = (props) => {
|
|
|
309
312
|
<div className="title">
|
|
310
313
|
<span className="node-title">{item.nodeName}</span>
|
|
311
314
|
<span className="priority-title">优先级{item.priorityLevel}</span>
|
|
312
|
-
{!conditionDisable
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
e
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
315
|
+
{!conditionDisable ||
|
|
316
|
+
(!disable && (
|
|
317
|
+
<DeleteOutlined
|
|
318
|
+
className="delete-btn"
|
|
319
|
+
onClick={(e) => {
|
|
320
|
+
e.stopPropagation();
|
|
321
|
+
onTermDel(idx);
|
|
322
|
+
}}
|
|
323
|
+
/>
|
|
324
|
+
))}
|
|
321
325
|
</div>
|
|
322
326
|
<div className="content">
|
|
323
327
|
{toText(nodeConfig, idx) ? (
|
|
@@ -400,14 +404,14 @@ export const Branch = (props) => {
|
|
|
400
404
|
) : (
|
|
401
405
|
<div className="drawer-title">
|
|
402
406
|
{form.nodeName || "条件设置"}
|
|
403
|
-
<EditOutlined className="node-wrap-drawer__title-edit" onClick={onEditTitle} />
|
|
407
|
+
{!disable && <EditOutlined className="node-wrap-drawer__title-edit" onClick={onEditTitle} />}
|
|
404
408
|
</div>
|
|
405
409
|
)}
|
|
406
410
|
</div>
|
|
407
411
|
}
|
|
408
412
|
footer={
|
|
409
413
|
<>
|
|
410
|
-
<Button type="primary" onClick={onDrawerSave}>
|
|
414
|
+
<Button type="primary" onClick={onDrawerSave} disabled={disable}>
|
|
411
415
|
保存
|
|
412
416
|
</Button>
|
|
413
417
|
<Button onClick={onDrawerClose}>取消</Button>
|
|
@@ -424,10 +428,13 @@ export const Branch = (props) => {
|
|
|
424
428
|
<span>条件组 {conditionGroupIdx + 1}</span>
|
|
425
429
|
<div
|
|
426
430
|
onClick={() => {
|
|
431
|
+
if (disable) {
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
427
434
|
deleteConditionGroup(conditionGroupIdx);
|
|
428
435
|
}}
|
|
429
436
|
>
|
|
430
|
-
<DeleteOutlined className=
|
|
437
|
+
<DeleteOutlined className={`branch-delete-icon ${disable ? "disable-delete-button" : ""}`} />
|
|
431
438
|
</div>
|
|
432
439
|
</div>
|
|
433
440
|
|
|
@@ -446,12 +453,15 @@ export const Branch = (props) => {
|
|
|
446
453
|
<div className="condition-relation">
|
|
447
454
|
<span>{idx == 0 ? "当" : "且"}</span>
|
|
448
455
|
<div onClick={() => deleteConditionList(conditionGroup, idx)}>
|
|
449
|
-
<DeleteOutlined
|
|
456
|
+
<DeleteOutlined
|
|
457
|
+
className={`branch-delete-icon ${disable ? "disable-delete-button" : ""}`}
|
|
458
|
+
/>
|
|
450
459
|
</div>
|
|
451
460
|
</div>
|
|
452
461
|
<div className="condition-content">
|
|
453
462
|
<div className="condition-content-box">
|
|
454
463
|
<Select
|
|
464
|
+
disabled={disable}
|
|
455
465
|
value={condition.label}
|
|
456
466
|
options={descOption}
|
|
457
467
|
className="condition-content-box-item"
|
|
@@ -470,6 +480,7 @@ export const Branch = (props) => {
|
|
|
470
480
|
}}
|
|
471
481
|
></Select>
|
|
472
482
|
<Select
|
|
483
|
+
disabled={disable}
|
|
473
484
|
options={conditionOption}
|
|
474
485
|
value={condition.field}
|
|
475
486
|
onChange={(e) => {
|
|
@@ -485,6 +496,7 @@ export const Branch = (props) => {
|
|
|
485
496
|
placeholder="条件字段"
|
|
486
497
|
/>
|
|
487
498
|
<Select
|
|
499
|
+
disabled={disable}
|
|
488
500
|
value={condition.operator}
|
|
489
501
|
onChange={(val) => {
|
|
490
502
|
condition.operator = val;
|
|
@@ -496,6 +508,7 @@ export const Branch = (props) => {
|
|
|
496
508
|
className="condition-content-box-item"
|
|
497
509
|
></Select>
|
|
498
510
|
<Field
|
|
511
|
+
disabled={disable}
|
|
499
512
|
value={fieldValue}
|
|
500
513
|
type={condition.field}
|
|
501
514
|
onChange={(e) => {
|
|
@@ -517,7 +530,7 @@ export const Branch = (props) => {
|
|
|
517
530
|
})}
|
|
518
531
|
</div>
|
|
519
532
|
<div className="sub-content">
|
|
520
|
-
<Button type="primary" onClick={() => onConditionAdd(conditionGroup)}>
|
|
533
|
+
<Button type="primary" onClick={() => onConditionAdd(conditionGroup)} disabled={disable}>
|
|
521
534
|
添加条件
|
|
522
535
|
</Button>
|
|
523
536
|
</div>
|
|
@@ -525,7 +538,9 @@ export const Branch = (props) => {
|
|
|
525
538
|
</div>
|
|
526
539
|
);
|
|
527
540
|
})}
|
|
528
|
-
<Button onClick={onConditionGroupAdd}
|
|
541
|
+
<Button onClick={onConditionGroupAdd} disabled={disable}>
|
|
542
|
+
添加条件组
|
|
543
|
+
</Button>
|
|
529
544
|
</Drawer>
|
|
530
545
|
</div>
|
|
531
546
|
);
|
|
@@ -33,9 +33,6 @@ export const Approver = (props) => {
|
|
|
33
33
|
const nodeTitleRef = useRef();
|
|
34
34
|
|
|
35
35
|
function onShow() {
|
|
36
|
-
if (disable) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
36
|
setDrawer(true);
|
|
40
37
|
setForm(JSON.parse(JSON.stringify(modelValue)));
|
|
41
38
|
}
|
|
@@ -121,7 +118,7 @@ export const Approver = (props) => {
|
|
|
121
118
|
return (
|
|
122
119
|
<div className="approver-wrap">
|
|
123
120
|
<div className="node-wrap">
|
|
124
|
-
<div className={
|
|
121
|
+
<div className={"node-wrap-box"} onClick={onShow}>
|
|
125
122
|
<div className="title send-title">
|
|
126
123
|
<UserOutlined />
|
|
127
124
|
<span>{modelValue?.nodeName}</span>
|
|
@@ -157,7 +154,7 @@ export const Approver = (props) => {
|
|
|
157
154
|
) : (
|
|
158
155
|
<div className="drawer-title">
|
|
159
156
|
{form.nodeName || "审批人设置"}
|
|
160
|
-
<EditOutlined className="node-wrap-drawer__title-edit" onClick={onEditTitle} />
|
|
157
|
+
{!disable && <EditOutlined className="node-wrap-drawer__title-edit" onClick={onEditTitle} />}
|
|
161
158
|
</div>
|
|
162
159
|
)}
|
|
163
160
|
</div>
|
|
@@ -168,7 +165,7 @@ export const Approver = (props) => {
|
|
|
168
165
|
getContainer="body"
|
|
169
166
|
footer={
|
|
170
167
|
<div className="approver-drawer-footer">
|
|
171
|
-
<Button type="primary" onClick={onDrawerSave}>
|
|
168
|
+
<Button type="primary" onClick={onDrawerSave} disabled={disable}>
|
|
172
169
|
保存
|
|
173
170
|
</Button>
|
|
174
171
|
<Button onClick={onDrawerClose}>取消</Button>
|
|
@@ -182,6 +179,7 @@ export const Approver = (props) => {
|
|
|
182
179
|
wrapperCol={{ span: 16 }}
|
|
183
180
|
initialValues={form}
|
|
184
181
|
autoComplete="off"
|
|
182
|
+
disabled={disable}
|
|
185
183
|
>
|
|
186
184
|
<Form.Item label="审批人员类型" name="setType">
|
|
187
185
|
<Select
|