From a1d7e81859f554f3a53680cc35f0f49bf1f77098 Mon Sep 17 00:00:00 2001
From: wwf <1971391498@qq.com>
Date: 星期四, 14 五月 2026 14:37:02 +0800
Subject: [PATCH] 导入项目
---
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.8.0