From f9b459a3fefd5fab0ee8e19268adb9d9eadab2a7 Mon Sep 17 00:00:00 2001 From: dengzedong <dengzedong@email> Date: 星期二, 17 十二月 2024 18:16:58 +0800 Subject: [PATCH] 预测项setting的值修改最大输入长度为1000 --- src/components/SimpleProcessDesignerV2/src/utils.ts | 41 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 41 insertions(+), 0 deletions(-) diff --git a/src/components/SimpleProcessDesignerV2/src/utils.ts b/src/components/SimpleProcessDesignerV2/src/utils.ts new file mode 100644 index 0000000..8e715b4 --- /dev/null +++ b/src/components/SimpleProcessDesignerV2/src/utils.ts @@ -0,0 +1,41 @@ +import { TimeUnitType, ApproveType, APPROVE_TYPE } from './consts' + +// 获取条件节点默认的名称 +export const getDefaultConditionNodeName = (index: number, defaultFlow: boolean | undefined): string => { + if (defaultFlow) { + return '其它情况' + } + return '条件' + (index + 1) +} + +// 获取包容分支条件节点默认的名称 +export const getDefaultInclusiveConditionNodeName = (index: number, defaultFlow: boolean | undefined): string => { + if (defaultFlow) { + return '其它情况' + } + return '包容条件' + (index + 1) +} + +export const convertTimeUnit = (strTimeUnit: string) => { + if (strTimeUnit === 'M') { + return TimeUnitType.MINUTE + } + if (strTimeUnit === 'H') { + return TimeUnitType.HOUR + } + if (strTimeUnit === 'D') { + return TimeUnitType.DAY + } + return TimeUnitType.HOUR +} + +export const getApproveTypeText = (approveType: ApproveType): string => { + let approveTypeText = '' + APPROVE_TYPE.forEach((item) => { + if (item.value === approveType) { + approveTypeText = item.label + return + } + }) + return approveTypeText +} -- Gitblit v1.9.3