@hzab/flowlong-designer 0.2.5 → 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 CHANGED
@@ -1,3 +1,12 @@
1
+ # @hzab/flowlong-designer@1.0.1
2
+
3
+ fix:详情优化(节点可点击打开详情)
4
+
5
+ # @hzab/flowlong-designer@1.0.0
6
+
7
+ fix:审核人默认值为或签
8
+ fix:人员添加头像
9
+
1
10
  # @hzab/flowlong-designer@0.2.5
2
11
 
3
12
  fix:控制面板背景图片显示
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hzab/flowlong-designer",
3
- "version": "0.2.5",
3
+ "version": "1.0.1",
4
4
  "description": "自定义审批流配置组件",
5
5
  "main": "src",
6
6
  "scripts": {
@@ -34,7 +34,7 @@ export const typeDataEnum = {
34
34
  termAuto: false, //审批期限超时自动审批
35
35
  term: 0, //审批期限
36
36
  termMode: 1, //审批期限超时后执行类型
37
- examineMode: 2, //多人审批时审批方式
37
+ examineMode: 3, //多人审批时审批方式
38
38
  directorMode: 0, //连续主管审批方式
39
39
  },
40
40
  [NODE_TYPE.ccNode]: {
@@ -84,4 +84,8 @@
84
84
  .ant-btn+.ant-btn {
85
85
  margin-left: 12px;
86
86
  }
87
+ }
88
+
89
+ .disable-delete-button {
90
+ cursor: not-allowed;
87
91
  }
@@ -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={`${disable ? "node-wrap-box-disable" : "node-wrap-box"}`} onClick={onShow}>
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 }}
@@ -40,6 +40,6 @@ export const termModeOptions = [
40
40
  */
41
41
  export const examineModeOptions = [
42
42
  // { label: "按顺序依次审批", value: 1 },
43
- { label: "会签 (可同时审批,每个人必须审批通过)", value: 2 },
44
43
  { label: "或签 (有一人审批通过即可)", value: 3 },
44
+ { label: "会签 (可同时审批,每个人必须审批通过)", value: 2 },
45
45
  ];
@@ -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 type={type} onChange={onChange} value={value}></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({
@@ -64,6 +64,7 @@ const GroupUserSelectorModal = (props) => {
64
64
  searchQueryKey: "userName",
65
65
  labelKey: "name",
66
66
  valueKey: "userId",
67
+ imgKey: "avatar",
67
68
  };
68
69
  /**选择组件回显 */
69
70
  const groupUserSelectorValue = useMemo(() => {
@@ -91,13 +92,14 @@ const GroupUserSelectorModal = (props) => {
91
92
  return (
92
93
  <div>
93
94
  <Input
95
+ disabled={disabled}
94
96
  value={value?.deptUserLabel || null}
95
97
  readOnly
96
98
  onClick={() => {
97
99
  setOpen(true);
98
100
  }}
99
101
  placeholder="请点击编辑"
100
- style={{ cursor: "pointer" }}
102
+ style={!disabled ? { cursor: "pointer" } : {}}
101
103
  ></Input>
102
104
  <Modal
103
105
  title={titleMap[type]}
@@ -368,4 +368,10 @@
368
368
  margin-left: 12px;
369
369
  }
370
370
  }
371
+
372
+
373
+ }
374
+
375
+ .disable-delete-button {
376
+ cursor: not-allowed;
371
377
  }
@@ -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 || disable;
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
- <DeleteOutlined
314
- className="delete-btn"
315
- onClick={(e) => {
316
- e.stopPropagation();
317
- onTermDel(idx);
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="branch-delete-icon" />
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 className="branch-delete-icon" />
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}>添加条件组</Button>
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={`${disable ? "node-wrap-box-disable" : "node-wrap-box"}`} onClick={onShow}>
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