@coding-flow/flow-pc-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.
@@ -6,6 +6,7 @@ export declare const getStatusConfig: (status: "completed" | "current" | "pendin
6
6
  icon: import("react/jsx-runtime").JSX.Element;
7
7
  };
8
8
  export declare const getNodeStatus: (node: ProcessNode) => "completed" | "current" | "pending";
9
+ export declare const getOperatorTitle: (node: ProcessNode) => string | undefined;
9
10
  interface FlowTimeNodeProps {
10
11
  node: ProcessNode;
11
12
  }
@@ -47,6 +47,12 @@ const getNodeStatus = (node)=>{
47
47
  if ('PROCESSING' === node.approveState) return 'current';
48
48
  return 'pending';
49
49
  };
50
+ const getOperatorTitle = (node)=>{
51
+ const operatorStatregy = node.operatorStrategy;
52
+ if ('INITIATOR_SELECT' === operatorStatregy) return '发起人选择审批人';
53
+ if ('APPROVER_SELECT' === operatorStatregy) return '审批人选择审批人';
54
+ if ('NO_OPERATOR' === operatorStatregy) return node.nodeName;
55
+ };
50
56
  const FlowOperatorItem = (props)=>{
51
57
  const operator = props.operator;
52
58
  const approveState = props.approveState;
@@ -105,7 +111,7 @@ const FlowTimeNode = (props)=>{
105
111
  const node = props.node;
106
112
  const operators = node.operators || [];
107
113
  const operatorStatregy = node.operatorStrategy;
108
- if ('INITIATOR_SELECT' === operatorStatregy || 'APPROVER_SELECT' === operatorStatregy) return /*#__PURE__*/ jsxs("div", {
114
+ if ('INITIATOR_SELECT' === operatorStatregy || 'APPROVER_SELECT' === operatorStatregy || 'NO_OPERATOR' === operatorStatregy) return /*#__PURE__*/ jsxs("div", {
109
115
  style: {
110
116
  display: 'flex',
111
117
  flexDirection: 'column',
@@ -141,7 +147,7 @@ const FlowTimeNode = (props)=>{
141
147
  style: {
142
148
  fontSize: 12
143
149
  },
144
- children: 'INITIATOR_SELECT' === operatorStatregy ? '发起人选择审批人' : '审批人选择审批人'
150
+ children: getOperatorTitle(node)
145
151
  })
146
152
  ]
147
153
  });
@@ -183,4 +189,4 @@ const FlowTimeNode = (props)=>{
183
189
  ]
184
190
  });
185
191
  };
186
- export { FlowTimeNode, getNodeStatus, getStatusConfig };
192
+ export { FlowTimeNode, getNodeStatus, getOperatorTitle, getStatusConfig };
@@ -22,6 +22,10 @@ const OperatorSelectView = (props)=>{
22
22
  props.onChange(result);
23
23
  setVisible(false);
24
24
  };
25
+ const initialValues = props.options.reduce((acc, option)=>{
26
+ if (option.operators && option.operators.length > 0) acc[option.id] = option.operators.map((o)=>o.userId).join(',');
27
+ return acc;
28
+ }, {});
25
29
  return /*#__PURE__*/ jsx(Modal, {
26
30
  title: "请选择操作人",
27
31
  width: "40%",
@@ -38,9 +42,13 @@ const OperatorSelectView = (props)=>{
38
42
  form: form,
39
43
  onFinish: handleFinish,
40
44
  layout: "vertical",
41
- children: props.options.map((option)=>/*#__PURE__*/ jsx(Form.Item, {
45
+ initialValues: initialValues,
46
+ children: props.options.map((option)=>{
47
+ const rangeHint = option.operators && option.operators.length > 0 ? `可选:${option.operators.map((o)=>`${o.name}(${o.userId})`).join('、')}` : void 0;
48
+ return /*#__PURE__*/ jsx(Form.Item, {
42
49
  name: option.id,
43
50
  label: `${option.name} - 操作人`,
51
+ extra: rangeHint,
44
52
  rules: [
45
53
  {
46
54
  required: true,
@@ -50,7 +58,8 @@ const OperatorSelectView = (props)=>{
50
58
  children: /*#__PURE__*/ jsx(Input, {
51
59
  placeholder: "请输入操作人ID,多个用逗号分隔"
52
60
  })
53
- }, option.id))
61
+ }, option.id);
62
+ })
54
63
  })
55
64
  });
56
65
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coding-flow/flow-pc-approval",
3
- "version": "0.0.34",
3
+ "version": "0.0.37",
4
4
  "description": "flow-engine pc form 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-core": "0.0.34",
43
- "@coding-flow/flow-types": "0.0.34",
44
- "@coding-flow/flow-icons": "0.0.34",
45
- "@coding-flow/flow-approval-presenter": "0.0.34",
46
- "@coding-flow/flow-pc-ui": "0.0.34",
47
- "@coding-flow/flow-pc-form": "0.0.34"
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-pc-ui": "0.0.37",
47
+ "@coding-flow/flow-pc-form": "0.0.37"
48
48
  },
49
49
  "devDependencies": {
50
- "@coding-flow/flow-types": "0.0.34"
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-pc-ui": "0.0.37",
54
+ "@coding-flow/flow-pc-form": "0.0.37"
51
55
  },
52
56
  "scripts": {
53
57
  "build": "rslib build",