@hzab/flowlong-designer 1.0.6 → 1.0.7-beta
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.tsx +183 -26
- package/src/components/NodeWrap/Nodes/Approver/options.ts +46 -45
- package/src/components/NodeWrap/Nodes/Branch/components/Field/index.tsx +59 -39
- package/src/components/NodeWrap/Nodes/Branch/components/GroupUserSelectorModal/index.tsx +134 -134
- package/src/components/NodeWrap/Nodes/Branch/index.tsx +19 -0
- package/src/components/NodeWrap/Nodes/Send/index.tsx +561 -416
- package/src/components/NodeWrap/Nodes/Send/options.ts +46 -45
- package/src/components/NodeWrap/components/SignatureConfiguration/index.less +1 -1
- package/src/components/NodeWrap/components/SignatureConfiguration/index.tsx +30 -21
- package/src/index.tsx +182 -182
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -16,6 +16,13 @@ export const Approver = (props) => {
|
|
|
16
16
|
nodeName: "",
|
|
17
17
|
setType: undefined,
|
|
18
18
|
nodeAssigneeList: [],
|
|
19
|
+
extendConfig: {
|
|
20
|
+
directorWorkAddr: false,
|
|
21
|
+
directorLevel: undefined,
|
|
22
|
+
approvalEnd: undefined,
|
|
23
|
+
isChecked: false,
|
|
24
|
+
directorUsers: [],
|
|
25
|
+
},
|
|
19
26
|
directorMode: undefined,
|
|
20
27
|
termAuto: false,
|
|
21
28
|
examineLevel: undefined,
|
|
@@ -36,7 +43,17 @@ export const Approver = (props) => {
|
|
|
36
43
|
|
|
37
44
|
function onShow() {
|
|
38
45
|
setDrawer(true);
|
|
39
|
-
|
|
46
|
+
const newValue = JSON.parse(JSON.stringify(modelValue));
|
|
47
|
+
const { extendConfig } = newValue;
|
|
48
|
+
if (extendConfig?.directorWorkAddr || extendConfig?.directorUsers?.length > 0) {
|
|
49
|
+
newValue.extendConfig.isChecked = true;
|
|
50
|
+
if (extendConfig.directorWorkAddr) {
|
|
51
|
+
newValue.extendConfig.approvalEnd = 1; // 直到驻点队长
|
|
52
|
+
} else {
|
|
53
|
+
newValue.extendConfig.approvalEnd = 2; // 直到指定用户
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
setForm(newValue);
|
|
40
57
|
}
|
|
41
58
|
|
|
42
59
|
function onNodeDel(e) {
|
|
@@ -72,6 +89,18 @@ export const Approver = (props) => {
|
|
|
72
89
|
return "连续多级主管";
|
|
73
90
|
} else if (nodeConf.setType == 9) {
|
|
74
91
|
return "驻点队长";
|
|
92
|
+
} else if (nodeConf.setType == 20) {
|
|
93
|
+
let users = "";
|
|
94
|
+
if (
|
|
95
|
+
nodeConf.extendConfig &&
|
|
96
|
+
nodeConf.extendConfig.directorUsers &&
|
|
97
|
+
nodeConf.extendConfig.directorUsers.length > 0
|
|
98
|
+
) {
|
|
99
|
+
users = nodeConf.extendConfig.directorUsers.map((item) => item.name).join("、");
|
|
100
|
+
}
|
|
101
|
+
return `发起人向上的第${nodeConf.extendConfig?.directorLevel}级主管 ${
|
|
102
|
+
nodeConf.extendConfig?.directorWorkAddr ? "直到驻点队长" : users ? "直到" + users : ""
|
|
103
|
+
}`;
|
|
75
104
|
}
|
|
76
105
|
}
|
|
77
106
|
|
|
@@ -92,16 +121,24 @@ export const Approver = (props) => {
|
|
|
92
121
|
}
|
|
93
122
|
|
|
94
123
|
function onDrawerSave() {
|
|
95
|
-
signatureConfigurationRef.current.form.validateFields().then((
|
|
124
|
+
signatureConfigurationRef.current.form.validateFields().then(() => {
|
|
125
|
+
const { extendConfig } = form;
|
|
96
126
|
const newValue = {
|
|
97
127
|
...form,
|
|
98
|
-
extendConfig: {
|
|
99
|
-
needSign: res?.needSign, //当前节点需要签名
|
|
100
|
-
needConfirm: res?.needConfirm, //当前节点需要二次确认
|
|
101
|
-
confirmTxt: res?.confirmTxt,
|
|
102
|
-
usePreSign: res?.usePreSign,
|
|
103
|
-
},
|
|
104
128
|
};
|
|
129
|
+
if (!extendConfig.isChecked) {
|
|
130
|
+
newValue.extendConfig.directorUsers = [];
|
|
131
|
+
newValue.extendConfig.directorWorkAddr = false;
|
|
132
|
+
} else {
|
|
133
|
+
if (extendConfig.approvalEnd == 2) {
|
|
134
|
+
newValue.extendConfig.directorWorkAddr = false;
|
|
135
|
+
} else {
|
|
136
|
+
newValue.extendConfig.directorWorkAddr = true;
|
|
137
|
+
newValue.extendConfig.directorUsers = [];
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
delete newValue.extendConfig.approvalEnd;
|
|
141
|
+
delete newValue.extendConfig.isChecked;
|
|
105
142
|
setForm(newValue);
|
|
106
143
|
// 强制更新数据
|
|
107
144
|
onChange && onChange(newValue);
|
|
@@ -194,6 +231,7 @@ export const Approver = (props) => {
|
|
|
194
231
|
name="approverForm"
|
|
195
232
|
labelCol={{ span: 8 }}
|
|
196
233
|
wrapperCol={{ span: 16 }}
|
|
234
|
+
preserve={false}
|
|
197
235
|
initialValues={form}
|
|
198
236
|
autoComplete="off"
|
|
199
237
|
>
|
|
@@ -206,7 +244,20 @@ export const Approver = (props) => {
|
|
|
206
244
|
setForm((f) => {
|
|
207
245
|
// 清空 人员、角色 列表数组
|
|
208
246
|
f.nodeAssigneeList = [];
|
|
247
|
+
f.extendConfig = {
|
|
248
|
+
...f.extendConfig,
|
|
249
|
+
directorWorkAddr: false,
|
|
250
|
+
directorLevel: undefined,
|
|
251
|
+
approvalEnd: undefined,
|
|
252
|
+
isChecked: false,
|
|
253
|
+
directorUsers: [],
|
|
254
|
+
};
|
|
209
255
|
f.setType = val;
|
|
256
|
+
if (val == 20) {
|
|
257
|
+
f.examineMode = 1;
|
|
258
|
+
} else {
|
|
259
|
+
f.examineMode = undefined;
|
|
260
|
+
}
|
|
210
261
|
return { ...f };
|
|
211
262
|
});
|
|
212
263
|
}}
|
|
@@ -214,8 +265,108 @@ export const Approver = (props) => {
|
|
|
214
265
|
/>
|
|
215
266
|
</Form.Item>
|
|
216
267
|
|
|
217
|
-
{form.setType ===
|
|
218
|
-
|
|
268
|
+
{form.setType === 20 ? (
|
|
269
|
+
<>
|
|
270
|
+
<Form.Item label="审批截止至发起人向上的第" name={["extendConfig", "directorLevel"]} key={form.setType}>
|
|
271
|
+
<Select
|
|
272
|
+
disabled={readOnly}
|
|
273
|
+
className={`${readOnly ? "readonly-select" : ""}`}
|
|
274
|
+
onSelect={(val) => {
|
|
275
|
+
setForm((f) => {
|
|
276
|
+
// 清空 人员、角色 列表数组
|
|
277
|
+
f.extendConfig = {
|
|
278
|
+
...f.extendConfig,
|
|
279
|
+
directorLevel: val,
|
|
280
|
+
};
|
|
281
|
+
return { ...f };
|
|
282
|
+
});
|
|
283
|
+
}}
|
|
284
|
+
options={[
|
|
285
|
+
{
|
|
286
|
+
label: "第1级主管",
|
|
287
|
+
value: 1,
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
label: "第2级主管",
|
|
291
|
+
value: 2,
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
label: "第3级主管",
|
|
295
|
+
value: 3,
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
label: "第4级主管",
|
|
299
|
+
value: 4,
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
label: "第5级主管",
|
|
303
|
+
value: 5,
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
label: "第6级主管",
|
|
307
|
+
value: 6,
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
label: "第7级主管",
|
|
311
|
+
value: 7,
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
label: "第8级主管",
|
|
315
|
+
value: 8,
|
|
316
|
+
},
|
|
317
|
+
]}
|
|
318
|
+
/>
|
|
319
|
+
</Form.Item>
|
|
320
|
+
<Form.Item
|
|
321
|
+
label={
|
|
322
|
+
<>
|
|
323
|
+
<Checkbox
|
|
324
|
+
disabled={readOnly}
|
|
325
|
+
className={`${readOnly ? "readonly-select" : ""}`}
|
|
326
|
+
onChange={(e) =>
|
|
327
|
+
setForm((f) => {
|
|
328
|
+
f.extendConfig = { ...f.extendConfig, isChecked: e.target.checked };
|
|
329
|
+
return { ...f };
|
|
330
|
+
})
|
|
331
|
+
}
|
|
332
|
+
checked={form?.extendConfig?.isChecked || false}
|
|
333
|
+
/>
|
|
334
|
+
 审批终点为
|
|
335
|
+
</>
|
|
336
|
+
}
|
|
337
|
+
name={["extendConfig", "approvalEnd"]}
|
|
338
|
+
>
|
|
339
|
+
<Select
|
|
340
|
+
disabled={readOnly}
|
|
341
|
+
className={`${readOnly ? "readonly-select" : ""}`}
|
|
342
|
+
onSelect={(val) => {
|
|
343
|
+
setForm((f) => {
|
|
344
|
+
f.extendConfig = {
|
|
345
|
+
...f.extendConfig,
|
|
346
|
+
approvalEnd: val,
|
|
347
|
+
};
|
|
348
|
+
return { ...f };
|
|
349
|
+
});
|
|
350
|
+
}}
|
|
351
|
+
options={[
|
|
352
|
+
{
|
|
353
|
+
label: "驻点队长",
|
|
354
|
+
value: 1,
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
label: "指定人员",
|
|
358
|
+
value: 2,
|
|
359
|
+
},
|
|
360
|
+
]}
|
|
361
|
+
/>
|
|
362
|
+
</Form.Item>
|
|
363
|
+
</>
|
|
364
|
+
) : null}
|
|
365
|
+
{form.setType === 1 || (form.setType === 20 && form.extendConfig?.approvalEnd == 2) ? (
|
|
366
|
+
<Form.Item
|
|
367
|
+
label="选择成员"
|
|
368
|
+
name={form.setType === 20 ? ["extendConfig", "directorUsers"] : "nodeAssigneeList"}
|
|
369
|
+
>
|
|
219
370
|
{readOnly ? null : (
|
|
220
371
|
<Button
|
|
221
372
|
type="primary"
|
|
@@ -223,11 +374,15 @@ export const Approver = (props) => {
|
|
|
223
374
|
onClick={() =>
|
|
224
375
|
selectorCtx.setSelectHandler(
|
|
225
376
|
1,
|
|
226
|
-
form.nodeAssigneeList,
|
|
377
|
+
form.setType === 20 ? form.extendConfig.directorUsers : form.nodeAssigneeList,
|
|
227
378
|
(selected) => {
|
|
228
379
|
setForm((f) => {
|
|
229
380
|
// 设置 人员、角色 列表数组
|
|
230
|
-
|
|
381
|
+
if (form.setType === 20) {
|
|
382
|
+
f.extendConfig.directorUsers = selected;
|
|
383
|
+
} else {
|
|
384
|
+
f.nodeAssigneeList = selected;
|
|
385
|
+
}
|
|
231
386
|
return { ...f };
|
|
232
387
|
});
|
|
233
388
|
},
|
|
@@ -240,7 +395,7 @@ export const Approver = (props) => {
|
|
|
240
395
|
)}
|
|
241
396
|
|
|
242
397
|
<div className="tags-list">
|
|
243
|
-
{form.nodeAssigneeList?.map((user, idx) => {
|
|
398
|
+
{(form.setType === 20 ? form.extendConfig.directorUsers : form.nodeAssigneeList)?.map((user, idx) => {
|
|
244
399
|
return (
|
|
245
400
|
<Tag
|
|
246
401
|
key={user.id || idx}
|
|
@@ -406,19 +561,21 @@ export const Approver = (props) => {
|
|
|
406
561
|
</>
|
|
407
562
|
) : null}
|
|
408
563
|
*/}
|
|
409
|
-
|
|
410
|
-
<
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
564
|
+
{form.setType !== 20 ? (
|
|
565
|
+
<Form.Item label="多人审批时审批方式" name="examineMode">
|
|
566
|
+
<Radio.Group
|
|
567
|
+
options={examineModeOptions}
|
|
568
|
+
value={form.examineMode}
|
|
569
|
+
style={readOnly ? { pointerEvents: "none" } : {}}
|
|
570
|
+
onChange={(e) => {
|
|
571
|
+
setForm((f) => {
|
|
572
|
+
form.examineMode = e.target.value;
|
|
573
|
+
return { ...f };
|
|
574
|
+
});
|
|
575
|
+
}}
|
|
576
|
+
/>
|
|
577
|
+
</Form.Item>
|
|
578
|
+
) : null}
|
|
422
579
|
</Form>
|
|
423
580
|
<SignatureConfiguration
|
|
424
581
|
ref={signatureConfigurationRef}
|
|
@@ -1,45 +1,46 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 审批人员类型
|
|
3
|
-
*/
|
|
4
|
-
export const setTypeOptions = [
|
|
5
|
-
{ label: "指定成员", value: 1 },
|
|
6
|
-
{ label: "部门经理", value: 2 },
|
|
7
|
-
{ label: "角色", value: 3 },
|
|
8
|
-
// { label: "发起人自选", value: 4 },
|
|
9
|
-
// { label: "发起人自己", value: 5 },
|
|
10
|
-
// { label: "连续多级主管", value: 7 },
|
|
11
|
-
{ label: "驻点队长", value: 9 },
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
{ label: "
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
{ label: "
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
{ label: "
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
{ label: "
|
|
44
|
-
{ label: "
|
|
45
|
-
|
|
1
|
+
/**
|
|
2
|
+
* 审批人员类型
|
|
3
|
+
*/
|
|
4
|
+
export const setTypeOptions = [
|
|
5
|
+
{ label: "指定成员", value: 1 },
|
|
6
|
+
{ label: "部门经理", value: 2 },
|
|
7
|
+
{ label: "角色", value: 3 },
|
|
8
|
+
// { label: "发起人自选", value: 4 },
|
|
9
|
+
// { label: "发起人自己", value: 5 },
|
|
10
|
+
// { label: "连续多级主管", value: 7 },
|
|
11
|
+
{ label: "驻点队长", value: 9 },
|
|
12
|
+
{ label: "连续多级直接主管", value: 20 },
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 发起人自选
|
|
17
|
+
*/
|
|
18
|
+
export const selectModeOptions = [
|
|
19
|
+
{ label: "自选一个人", value: 1 },
|
|
20
|
+
{ label: "自选多个人", value: 2 },
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 连续主管审批终点
|
|
25
|
+
*/
|
|
26
|
+
export const directorModeOptions = [
|
|
27
|
+
{ label: "直到最上层主管", value: 0 },
|
|
28
|
+
{ label: "自定义审批终点", value: 1 },
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 审批期限超时后执行
|
|
33
|
+
*/
|
|
34
|
+
export const termModeOptions = [
|
|
35
|
+
{ label: "自动通过", value: 0 },
|
|
36
|
+
{ label: "自动拒绝", value: 1 },
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* 多人审批时审批方式
|
|
41
|
+
*/
|
|
42
|
+
export const examineModeOptions = [
|
|
43
|
+
// { label: "按顺序依次审批", value: 1 },
|
|
44
|
+
{ label: "或签 (有一人审批通过即可)", value: 3 },
|
|
45
|
+
{ label: "会签 (可同时审批,每个人必须审批通过)", value: 2 },
|
|
46
|
+
];
|
|
@@ -1,39 +1,59 @@
|
|
|
1
|
-
import { Input, InputNumber } from "antd";
|
|
2
|
-
import GroupUserSelectorModal from "../GroupUserSelectorModal";
|
|
3
|
-
|
|
4
|
-
interface FormMapProps {
|
|
5
|
-
type: string;
|
|
6
|
-
onChange?: (v: any) => void;
|
|
7
|
-
value?: any;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
readOnly?: boolean;
|
|
10
|
-
}
|
|
11
|
-
const Field = (props: FormMapProps) => {
|
|
12
|
-
const { type, onChange, value, disabled, readOnly } = props;
|
|
13
|
-
return (
|
|
14
|
-
<>
|
|
15
|
-
{["day", "hour"].includes(type) && (
|
|
16
|
-
<Input
|
|
17
|
-
readOnly={readOnly}
|
|
18
|
-
disabled={disabled}
|
|
19
|
-
value={value}
|
|
20
|
-
placeholder="值"
|
|
21
|
-
type="number"
|
|
22
|
-
onChange={(e) => {
|
|
23
|
-
onChange(e.target.value);
|
|
24
|
-
}}
|
|
25
|
-
></Input>
|
|
26
|
-
)}
|
|
27
|
-
{["dept", "assignee"].includes(type) && (
|
|
28
|
-
<GroupUserSelectorModal
|
|
29
|
-
type={type}
|
|
30
|
-
onChange={onChange}
|
|
31
|
-
value={value}
|
|
32
|
-
disabled={disabled}
|
|
33
|
-
readOnly={readOnly}
|
|
34
|
-
></GroupUserSelectorModal>
|
|
35
|
-
)}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
1
|
+
import { Input, InputNumber, Select } from "antd";
|
|
2
|
+
import GroupUserSelectorModal from "../GroupUserSelectorModal";
|
|
3
|
+
|
|
4
|
+
interface FormMapProps {
|
|
5
|
+
type: string;
|
|
6
|
+
onChange?: (v: any) => void;
|
|
7
|
+
value?: any;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
readOnly?: boolean;
|
|
10
|
+
}
|
|
11
|
+
const Field = (props: FormMapProps) => {
|
|
12
|
+
const { type, onChange, value, disabled, readOnly } = props;
|
|
13
|
+
return (
|
|
14
|
+
<>
|
|
15
|
+
{["day", "hour"].includes(type) && (
|
|
16
|
+
<Input
|
|
17
|
+
readOnly={readOnly}
|
|
18
|
+
disabled={disabled}
|
|
19
|
+
value={value}
|
|
20
|
+
placeholder="值"
|
|
21
|
+
type="number"
|
|
22
|
+
onChange={(e) => {
|
|
23
|
+
onChange(e.target.value);
|
|
24
|
+
}}
|
|
25
|
+
></Input>
|
|
26
|
+
)}
|
|
27
|
+
{["dept", "assignee"].includes(type) && (
|
|
28
|
+
<GroupUserSelectorModal
|
|
29
|
+
type={type}
|
|
30
|
+
onChange={onChange}
|
|
31
|
+
value={value}
|
|
32
|
+
disabled={disabled}
|
|
33
|
+
readOnly={readOnly}
|
|
34
|
+
></GroupUserSelectorModal>
|
|
35
|
+
)}
|
|
36
|
+
{["userType"].includes(type) && (
|
|
37
|
+
<Select
|
|
38
|
+
value={value}
|
|
39
|
+
disabled={disabled}
|
|
40
|
+
placeholder="请选择"
|
|
41
|
+
options={[
|
|
42
|
+
{
|
|
43
|
+
label: "保安",
|
|
44
|
+
value: 1,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: "职员",
|
|
48
|
+
value: 2,
|
|
49
|
+
},
|
|
50
|
+
]}
|
|
51
|
+
onSelect={(value) => {
|
|
52
|
+
onChange(value);
|
|
53
|
+
}}
|
|
54
|
+
/>
|
|
55
|
+
)}
|
|
56
|
+
</>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
export default Field;
|