提交 | 用户 | 时间
|
3e359e
|
1 |
import { TimeUnitType, ApproveType, APPROVE_TYPE } from './consts' |
H |
2 |
|
|
3 |
// 获取条件节点默认的名称 |
|
4 |
export const getDefaultConditionNodeName = (index: number, defaultFlow: boolean | undefined): string => { |
|
5 |
if (defaultFlow) { |
|
6 |
return '其它情况' |
|
7 |
} |
|
8 |
return '条件' + (index + 1) |
|
9 |
} |
|
10 |
|
|
11 |
// 获取包容分支条件节点默认的名称 |
|
12 |
export const getDefaultInclusiveConditionNodeName = (index: number, defaultFlow: boolean | undefined): string => { |
|
13 |
if (defaultFlow) { |
|
14 |
return '其它情况' |
|
15 |
} |
|
16 |
return '包容条件' + (index + 1) |
|
17 |
} |
|
18 |
|
|
19 |
export const convertTimeUnit = (strTimeUnit: string) => { |
|
20 |
if (strTimeUnit === 'M') { |
|
21 |
return TimeUnitType.MINUTE |
|
22 |
} |
|
23 |
if (strTimeUnit === 'H') { |
|
24 |
return TimeUnitType.HOUR |
|
25 |
} |
|
26 |
if (strTimeUnit === 'D') { |
|
27 |
return TimeUnitType.DAY |
|
28 |
} |
|
29 |
return TimeUnitType.HOUR |
|
30 |
} |
|
31 |
|
|
32 |
export const getApproveTypeText = (approveType: ApproveType): string => { |
|
33 |
let approveTypeText = '' |
|
34 |
APPROVE_TYPE.forEach((item) => { |
|
35 |
if (item.value === approveType) { |
|
36 |
approveTypeText = item.label |
|
37 |
return |
|
38 |
} |
|
39 |
}) |
|
40 |
return approveTypeText |
|
41 |
} |