@coding-flow/flow-mobile-approval 0.0.34 → 0.0.37
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.
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { ProcessNode } from "@coding-flow/flow-types";
|
|
2
3
|
export interface FlowNodeHistoryAction {
|
|
3
4
|
refresh: () => void;
|
|
4
5
|
}
|
|
5
6
|
interface FlowNodeHistoryProps {
|
|
6
7
|
actionRef?: React.Ref<FlowNodeHistoryAction>;
|
|
7
8
|
}
|
|
9
|
+
export declare const getOperatorTitle: (node: ProcessNode) => string | undefined;
|
|
8
10
|
export declare const FlowNodeHistory: React.FC<FlowNodeHistoryProps>;
|
|
9
11
|
export {};
|
|
@@ -4,6 +4,12 @@ import { useApprovalContext } from "@coding-flow/flow-approval-presenter";
|
|
|
4
4
|
import { Empty, Steps } from "antd-mobile";
|
|
5
5
|
import { FlowOperatorItem, getNodeStatus } from "./flow-time-node.js";
|
|
6
6
|
const { Step } = Steps;
|
|
7
|
+
const getOperatorTitle = (node)=>{
|
|
8
|
+
const operatorStatregy = node.operatorStrategy;
|
|
9
|
+
if ('INITIATOR_SELECT' === operatorStatregy) return '发起人选择审批人';
|
|
10
|
+
if ('APPROVER_SELECT' === operatorStatregy) return '审批人选择审批人';
|
|
11
|
+
if ('NO_OPERATOR' === operatorStatregy) return node.nodeName;
|
|
12
|
+
};
|
|
7
13
|
const FlowNodeHistory = (props)=>{
|
|
8
14
|
const { context } = useApprovalContext();
|
|
9
15
|
const [processNodes, setProcessNodes] = react.useState([]);
|
|
@@ -28,10 +34,10 @@ const FlowNodeHistory = (props)=>{
|
|
|
28
34
|
children: processNodes.map((node)=>{
|
|
29
35
|
const operators = node.operators || [];
|
|
30
36
|
const operatorStatregy = node.operatorStrategy;
|
|
31
|
-
if ('INITIATOR_SELECT' === operatorStatregy || 'APPROVER_SELECT' === operatorStatregy) return /*#__PURE__*/ jsx(Step, {
|
|
37
|
+
if ('INITIATOR_SELECT' === operatorStatregy || 'APPROVER_SELECT' === operatorStatregy || 'NO_OPERATOR' === operatorStatregy) return /*#__PURE__*/ jsx(Step, {
|
|
32
38
|
title: node.nodeName,
|
|
33
39
|
description: /*#__PURE__*/ jsx(Fragment, {
|
|
34
|
-
children:
|
|
40
|
+
children: getOperatorTitle(node)
|
|
35
41
|
}),
|
|
36
42
|
status: getNodeStatus(node)
|
|
37
43
|
});
|
|
@@ -51,4 +57,4 @@ const FlowNodeHistory = (props)=>{
|
|
|
51
57
|
})
|
|
52
58
|
});
|
|
53
59
|
};
|
|
54
|
-
export { FlowNodeHistory };
|
|
60
|
+
export { FlowNodeHistory, getOperatorTitle };
|
|
@@ -23,6 +23,10 @@ const OperatorSelectView = (props)=>{
|
|
|
23
23
|
props.onChange(result);
|
|
24
24
|
setVisible(false);
|
|
25
25
|
};
|
|
26
|
+
const initialValues = props.options.reduce((acc, option)=>{
|
|
27
|
+
if (option.operators && option.operators.length > 0) acc[option.id] = option.operators.map((o)=>o.userId).join(',');
|
|
28
|
+
return acc;
|
|
29
|
+
}, {});
|
|
26
30
|
return /*#__PURE__*/ jsx(PopupModal, {
|
|
27
31
|
open: visible,
|
|
28
32
|
onClose: ()=>{
|
|
@@ -36,9 +40,13 @@ const OperatorSelectView = (props)=>{
|
|
|
36
40
|
form: form,
|
|
37
41
|
layout: "vertical",
|
|
38
42
|
onFinish: handleFinish,
|
|
39
|
-
|
|
43
|
+
initialValues: initialValues,
|
|
44
|
+
children: props.options.map((option)=>{
|
|
45
|
+
const rangeHint = option.operators && option.operators.length > 0 ? `可选:${option.operators.map((o)=>`${o.name}(${o.userId})`).join('、')}` : void 0;
|
|
46
|
+
return /*#__PURE__*/ jsx(Form.Item, {
|
|
40
47
|
name: option.id,
|
|
41
48
|
label: `${option.name} - 操作人`,
|
|
49
|
+
extra: rangeHint,
|
|
42
50
|
rules: [
|
|
43
51
|
{
|
|
44
52
|
required: true,
|
|
@@ -48,7 +56,8 @@ const OperatorSelectView = (props)=>{
|
|
|
48
56
|
children: /*#__PURE__*/ jsx(Input, {
|
|
49
57
|
placeholder: "请输入操作人ID,多个用逗号分隔"
|
|
50
58
|
})
|
|
51
|
-
}, option.id)
|
|
59
|
+
}, option.id);
|
|
60
|
+
})
|
|
52
61
|
})
|
|
53
62
|
});
|
|
54
63
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coding-flow/flow-mobile-approval",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.37",
|
|
4
4
|
"description": "flow-engine pc mobile approval components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -39,15 +39,19 @@
|
|
|
39
39
|
"dayjs": "^1.11.19",
|
|
40
40
|
"immer": "^11.1.3",
|
|
41
41
|
"react-redux": "^9.2.0",
|
|
42
|
-
"@coding-flow/flow-
|
|
43
|
-
"@coding-flow/flow-icons": "0.0.
|
|
44
|
-
"@coding-flow/flow-
|
|
45
|
-
"@coding-flow/flow-
|
|
46
|
-
"@coding-flow/flow-mobile-ui": "0.0.
|
|
47
|
-
"@coding-flow/flow-mobile-form": "0.0.
|
|
42
|
+
"@coding-flow/flow-core": "0.0.37",
|
|
43
|
+
"@coding-flow/flow-icons": "0.0.37",
|
|
44
|
+
"@coding-flow/flow-approval-presenter": "0.0.37",
|
|
45
|
+
"@coding-flow/flow-types": "0.0.37",
|
|
46
|
+
"@coding-flow/flow-mobile-ui": "0.0.37",
|
|
47
|
+
"@coding-flow/flow-mobile-form": "0.0.37"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@coding-flow/flow-types": "0.0.
|
|
50
|
+
"@coding-flow/flow-types": "0.0.37",
|
|
51
|
+
"@coding-flow/flow-core": "0.0.37",
|
|
52
|
+
"@coding-flow/flow-approval-presenter": "0.0.37",
|
|
53
|
+
"@coding-flow/flow-mobile-ui": "0.0.37",
|
|
54
|
+
"@coding-flow/flow-mobile-form": "0.0.37"
|
|
51
55
|
},
|
|
52
56
|
"scripts": {
|
|
53
57
|
"build": "rslib build",
|