@coding-flow/flow-mobile-approval 0.0.34 → 0.0.35

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: 'INITIATOR_SELECT' === operatorStatregy ? '发起人选择审批人' : '审批人选择审批人'
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coding-flow/flow-mobile-approval",
3
- "version": "0.0.34",
3
+ "version": "0.0.35",
4
4
  "description": "flow-engine pc mobile 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.34",
43
- "@coding-flow/flow-icons": "0.0.34",
44
- "@coding-flow/flow-core": "0.0.34",
45
- "@coding-flow/flow-approval-presenter": "0.0.34",
46
- "@coding-flow/flow-mobile-ui": "0.0.34",
47
- "@coding-flow/flow-mobile-form": "0.0.34"
42
+ "@coding-flow/flow-core": "0.0.35",
43
+ "@coding-flow/flow-types": "0.0.35",
44
+ "@coding-flow/flow-icons": "0.0.35",
45
+ "@coding-flow/flow-approval-presenter": "0.0.35",
46
+ "@coding-flow/flow-mobile-ui": "0.0.35",
47
+ "@coding-flow/flow-mobile-form": "0.0.35"
48
48
  },
49
49
  "devDependencies": {
50
- "@coding-flow/flow-types": "0.0.34"
50
+ "@coding-flow/flow-types": "0.0.35"
51
51
  },
52
52
  "scripts": {
53
53
  "build": "rslib build",