@coding-flow/flow-pc-approval 0.0.9 → 0.0.11

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.
@@ -10,6 +10,13 @@ const AddAuditAction = (props)=>{
10
10
  const [form] = Form.useForm();
11
11
  const actionPresenter = context.getPresenter().getFlowActionPresenter();
12
12
  const [modalVisible, setModalVisible] = react.useState(false);
13
+ const actionRef = react.useRef(null);
14
+ const handlerOK = ()=>{
15
+ if (actionRef.current) return void actionRef.current.onValidate().then((res)=>{
16
+ if (res) form.submit();
17
+ });
18
+ form.submit();
19
+ };
13
20
  const handleSubmit = (params)=>{
14
21
  actionPresenter.action(action.id, params).then((res)=>{
15
22
  if (res.success) {
@@ -34,9 +41,13 @@ const AddAuditAction = (props)=>{
34
41
  /*#__PURE__*/ jsx(Modal, {
35
42
  title: "加签审批",
36
43
  open: modalVisible,
44
+ maskClosable: false,
45
+ mask: {
46
+ closable: false
47
+ },
37
48
  onCancel: ()=>setModalVisible(false),
38
49
  onOk: ()=>{
39
- form.submit();
50
+ handlerOK();
40
51
  },
41
52
  children: /*#__PURE__*/ jsx(Form, {
42
53
  form: form,
@@ -54,7 +65,9 @@ const AddAuditAction = (props)=>{
54
65
  message: '加签人员不能为空'
55
66
  }
56
67
  ],
57
- children: /*#__PURE__*/ jsx(AddAuditView, {})
68
+ children: /*#__PURE__*/ jsx(AddAuditView, {
69
+ action: actionRef
70
+ })
58
71
  })
59
72
  })
60
73
  })
@@ -10,6 +10,13 @@ const DelegateAction = (props)=>{
10
10
  const [form] = Form.useForm();
11
11
  const actionPresenter = context.getPresenter().getFlowActionPresenter();
12
12
  const [modalVisible, setModalVisible] = react.useState(false);
13
+ const actionRef = react.useRef(null);
14
+ const handlerOK = ()=>{
15
+ if (actionRef.current) return void actionRef.current.onValidate().then((res)=>{
16
+ if (res) form.submit();
17
+ });
18
+ form.submit();
19
+ };
13
20
  const handleSubmit = (params)=>{
14
21
  actionPresenter.action(action.id, params).then((res)=>{
15
22
  if (res.success) {
@@ -36,7 +43,7 @@ const DelegateAction = (props)=>{
36
43
  open: modalVisible,
37
44
  onCancel: ()=>setModalVisible(false),
38
45
  onOk: ()=>{
39
- form.submit();
46
+ handlerOK();
40
47
  },
41
48
  children: /*#__PURE__*/ jsx(Form, {
42
49
  form: form,
@@ -54,7 +61,9 @@ const DelegateAction = (props)=>{
54
61
  message: '委派人员不能为空'
55
62
  }
56
63
  ],
57
- children: /*#__PURE__*/ jsx(DelegateView, {})
64
+ children: /*#__PURE__*/ jsx(DelegateView, {
65
+ action: actionRef
66
+ })
58
67
  })
59
68
  })
60
69
  })
@@ -31,6 +31,13 @@ const PassAction = (props)=>{
31
31
  }
32
32
  });
33
33
  };
34
+ const actionRef = react.useRef(null);
35
+ const handlerOK = ()=>{
36
+ if (actionRef.current) return void actionRef.current.onValidate().then((res)=>{
37
+ if (res) form.submit();
38
+ });
39
+ form.submit();
40
+ };
34
41
  const adviceRules = state.flow?.adviceRequired ? [
35
42
  {
36
43
  required: state.flow?.adviceRequired || false,
@@ -54,9 +61,13 @@ const PassAction = (props)=>{
54
61
  title: "审批通过",
55
62
  open: modalVisible,
56
63
  destroyOnHidden: true,
64
+ maskClosable: false,
65
+ mask: {
66
+ closable: false
67
+ },
57
68
  onCancel: ()=>setModalVisible(false),
58
69
  onOk: ()=>{
59
- form.submit();
70
+ handlerOK();
60
71
  },
61
72
  children: /*#__PURE__*/ jsxs(Form, {
62
73
  form: form,
@@ -85,7 +96,8 @@ const PassAction = (props)=>{
85
96
  }
86
97
  ],
87
98
  children: /*#__PURE__*/ jsx(SignKeyView, {
88
- current: currentOperator
99
+ current: currentOperator,
100
+ action: actionRef
89
101
  })
90
102
  })
91
103
  ]
@@ -40,6 +40,10 @@ const RejectAction = (props)=>{
40
40
  /*#__PURE__*/ jsx(Modal, {
41
41
  title: "审批拒绝",
42
42
  open: modalVisible,
43
+ maskClosable: false,
44
+ mask: {
45
+ closable: false
46
+ },
43
47
  onCancel: ()=>setModalVisible(false),
44
48
  onOk: ()=>{
45
49
  form.submit();
@@ -10,6 +10,13 @@ const ReturnAction = (props)=>{
10
10
  const [form] = Form.useForm();
11
11
  const actionPresenter = context.getPresenter().getFlowActionPresenter();
12
12
  const [modalVisible, setModalVisible] = react.useState(false);
13
+ const actionRef = react.useRef(null);
14
+ const handlerOK = ()=>{
15
+ if (actionRef.current) return void actionRef.current.onValidate().then((res)=>{
16
+ if (res) form.submit();
17
+ });
18
+ form.submit();
19
+ };
13
20
  const handleSubmit = (params)=>{
14
21
  actionPresenter.action(action.id, params).then((res)=>{
15
22
  if (res.success) {
@@ -34,9 +41,13 @@ const ReturnAction = (props)=>{
34
41
  /*#__PURE__*/ jsx(Modal, {
35
42
  title: "退回审批",
36
43
  open: modalVisible,
44
+ maskClosable: false,
45
+ mask: {
46
+ closable: false
47
+ },
37
48
  onCancel: ()=>setModalVisible(false),
38
49
  onOk: ()=>{
39
- form.submit();
50
+ handlerOK();
40
51
  },
41
52
  children: /*#__PURE__*/ jsx(Form, {
42
53
  form: form,
@@ -54,7 +65,9 @@ const ReturnAction = (props)=>{
54
65
  message: '退回节点不能为空'
55
66
  }
56
67
  ],
57
- children: /*#__PURE__*/ jsx(ReturnView, {})
68
+ children: /*#__PURE__*/ jsx(ReturnView, {
69
+ action: actionRef
70
+ })
58
71
  })
59
72
  })
60
73
  })
@@ -9,6 +9,13 @@ const TransferAction = (props)=>{
9
9
  const { context } = useApprovalContext();
10
10
  const [form] = Form.useForm();
11
11
  const actionPresenter = context.getPresenter().getFlowActionPresenter();
12
+ const actionRef = react.useRef(null);
13
+ const handlerOK = ()=>{
14
+ if (actionRef.current) return void actionRef.current.onValidate().then((res)=>{
15
+ if (res) form.submit();
16
+ });
17
+ form.submit();
18
+ };
12
19
  const [modalVisible, setModalVisible] = react.useState(false);
13
20
  const handleSubmit = (params)=>{
14
21
  actionPresenter.action(action.id, params).then((res)=>{
@@ -34,9 +41,13 @@ const TransferAction = (props)=>{
34
41
  /*#__PURE__*/ jsx(Modal, {
35
42
  title: "转办审批",
36
43
  open: modalVisible,
44
+ maskClosable: false,
45
+ mask: {
46
+ closable: false
47
+ },
37
48
  onCancel: ()=>setModalVisible(false),
38
49
  onOk: ()=>{
39
- form.submit();
50
+ handlerOK();
40
51
  },
41
52
  children: /*#__PURE__*/ jsx(Form, {
42
53
  form: form,
@@ -54,7 +65,9 @@ const TransferAction = (props)=>{
54
65
  message: '转办人员不能为空'
55
66
  }
56
67
  ],
57
- children: /*#__PURE__*/ jsx(TransferView, {})
68
+ children: /*#__PURE__*/ jsx(TransferView, {
69
+ action: actionRef
70
+ })
58
71
  })
59
72
  })
60
73
  })
@@ -7,12 +7,20 @@ const ManualView = (props)=>{
7
7
  const [visible, setVisible] = react.useState(true);
8
8
  const ManualViewComponent = ViewBindPlugin.getInstance().get(ManualViewPluginKey);
9
9
  const [form] = Form.useForm();
10
- const handleOk = (value)=>{
10
+ const handlerFinish = (value)=>{
11
11
  props.onChange(value?.manualNodeId || '');
12
12
  setVisible(false);
13
13
  };
14
+ const actionRef = react.useRef(null);
15
+ const handlerOK = ()=>{
16
+ if (actionRef.current) return void actionRef.current.onValidate().then((res)=>{
17
+ if (res) form.submit();
18
+ });
19
+ form.submit();
20
+ };
14
21
  if (ManualViewComponent) return /*#__PURE__*/ jsx(ManualViewComponent, {
15
- ...props
22
+ ...props,
23
+ action: actionRef
16
24
  });
17
25
  return /*#__PURE__*/ jsx(Modal, {
18
26
  title: "请选择下级节点",
@@ -21,11 +29,11 @@ const ManualView = (props)=>{
21
29
  destroyOnHidden: true,
22
30
  onCancel: ()=>setVisible(false),
23
31
  onOk: ()=>{
24
- form.submit();
32
+ handlerOK();
25
33
  },
26
34
  children: /*#__PURE__*/ jsx(Form, {
27
35
  form: form,
28
- onFinish: handleOk,
36
+ onFinish: handlerFinish,
29
37
  layout: "vertical",
30
38
  children: /*#__PURE__*/ jsx(Form.Item, {
31
39
  name: "manualNodeId",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coding-flow/flow-pc-approval",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "flow-engine pc form approval components",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -39,15 +39,15 @@
39
39
  "dayjs": "^1.11.19",
40
40
  "immer": "^11.1.3",
41
41
  "react-redux": "^9.2.0",
42
- "@coding-flow/flow-types": "0.0.9",
43
- "@coding-flow/flow-icons": "0.0.9",
44
- "@coding-flow/flow-approval-presenter": "0.0.9",
45
- "@coding-flow/flow-core": "0.0.9",
46
- "@coding-flow/flow-pc-ui": "0.0.9",
47
- "@coding-flow/flow-pc-form": "0.0.9"
42
+ "@coding-flow/flow-approval-presenter": "0.0.11",
43
+ "@coding-flow/flow-pc-ui": "0.0.11",
44
+ "@coding-flow/flow-pc-form": "0.0.11",
45
+ "@coding-flow/flow-types": "0.0.11",
46
+ "@coding-flow/flow-icons": "0.0.11",
47
+ "@coding-flow/flow-core": "0.0.11"
48
48
  },
49
49
  "devDependencies": {
50
- "@coding-flow/flow-types": "0.0.9"
50
+ "@coding-flow/flow-types": "0.0.11"
51
51
  },
52
52
  "scripts": {
53
53
  "build": "rslib build",