@@ -127,11 +146,19 @@
+
+
--
Gitee
From a5c533bff034ffd4e7b87ea9b33dcdb0ef6e4828 Mon Sep 17 00:00:00 2001
From: lizhixian <18210040298@163.com>
Date: Fri, 21 Mar 2025 10:24:16 +0800
Subject: [PATCH 04/11] =?UTF-8?q?feat=EF=BC=9A=20=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=E6=A1=88=E4=BE=8B=E6=B5=81=E7=A8=8B=EF=BC=8C=E4=B8=9A=E5=8A=A1?=
=?UTF-8?q?=E8=A1=A8=E5=8D=95=E5=8F=91=E8=B5=B7=E6=97=B6=E9=80=89=E6=8B=A9?=
=?UTF-8?q?=E5=AE=A1=E6=89=B9=E4=BA=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/bpm/oa/leave/create.vue | 175 +++++++++++++++++-------------
1 file changed, 97 insertions(+), 78 deletions(-)
diff --git a/src/views/bpm/oa/leave/create.vue b/src/views/bpm/oa/leave/create.vue
index 4160fb038..b0d66f4a2 100644
--- a/src/views/bpm/oa/leave/create.vue
+++ b/src/views/bpm/oa/leave/create.vue
@@ -1,70 +1,75 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
- 确 定
-
-
-
-
-
-
+
+
+
+
+
+ 确 定
+
+
+
+
+
+
+
+
+
--
Gitee
From 913c995562ecbb826d0db2f0041b888d5795fa11 Mon Sep 17 00:00:00 2001
From: lizhixian <18210040298@163.com>
Date: Fri, 21 Mar 2025 11:48:13 +0800
Subject: [PATCH 05/11] =?UTF-8?q?feat=EF=BC=9A=E5=A2=9E=E5=8A=A0=E6=A1=88?=
=?UTF-8?q?=E4=BE=8B=E6=B5=81=E7=A8=8B=EF=BC=8C=E4=B8=9A=E5=8A=A1=E8=A1=A8?=
=?UTF-8?q?=E5=8D=95=E5=8F=91=E8=B5=B7=E6=97=B6=E9=80=89=E6=8B=A9=E5=AE=A1?=
=?UTF-8?q?=E6=89=B9=E4=BA=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/bpm/oa/leave/create.vue | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/src/views/bpm/oa/leave/create.vue b/src/views/bpm/oa/leave/create.vue
index b0d66f4a2..2bd2aa741 100644
--- a/src/views/bpm/oa/leave/create.vue
+++ b/src/views/bpm/oa/leave/create.vue
@@ -138,12 +138,12 @@ const submitForm = async () => {
// 新增 ====== begin ========
/** 获取审批详情 */
-const getApprovalDetail = async (row: any) => {
+const getApprovalDetail = async () => {
try {
const data = await ProcessInstanceApi.getApprovalDetail({
- processDefinitionId: row.id,
+ processDefinitionId: processDefinitionId.value,
activityId: NodeId.START_USER_NODE_ID,
- processVariablesStr: row.processVariablesStr // 解决 GET 无法传递对象的问题,后端 String 再转 JSON
+ processVariablesStr: JSON.stringify({ day: daysDifference() }) // 解决 GET 无法传递对象的问题,后端 String 再转 JSON
})
if (!data) {
@@ -178,6 +178,13 @@ const getApprovalDetail = async (row: any) => {
const selectUserConfirm = (id: string, userList: any[]) => {
startUserSelectAssignees.value[id] = userList?.map((item: any) => item.id)
}
+
+// 计算天数差
+const daysDifference = () => {
+ const oneDay = 24 * 60 * 60 * 1000 // 一天的毫秒数
+ const diffTime = Math.abs(Number(formData.value.endTime) - Number(formData.value.startTime))
+ return Math.floor(diffTime / oneDay)
+}
// 新增 ====== end ========
/** 初始化 */
@@ -194,15 +201,12 @@ onMounted(async () => {
processDefinitionId.value = processDefinitionDetail.id
startUserSelectTasks.value = processDefinitionDetail.startUserSelectTasks
// 新增 ====== begin ========
- // 查询流程预测节点
- getApprovalDetail({
- id: processDefinitionId.value,
- processVariablesStr: JSON.stringify(formData.value)
- })
+ // 加载最新的审批详情,主要用于节点预测
+ getApprovalDetail()
// 新增 ====== end ========
})
// 新增 ====== begin ========
-/** 预测流程节点会因为输入的参数值而产生新的预测结果值,所以需重新预测一次 */
+/** 预测流程节点会因为输入的参数值而产生新的预测结果值,所以需重新预测一次, formData.value可改成实际业务中的特定字段 */
watch(
formData.value,
(newValue, oldValue) => {
@@ -213,11 +217,8 @@ watch(
// 记录之前的节点审批人
tempStartUserSelectAssignees.value = startUserSelectAssignees.value
startUserSelectAssignees.value = {}
- // 加载最新的审批详情
- getApprovalDetail({
- id: processDefinitionId.value,
- processVariablesStr: JSON.stringify(newValue) // 解决 GET 无法传递对象的问题,后端 String 再转 JSON
- })
+ // 加载最新的审批详情,主要用于节点预测
+ getApprovalDetail()
}
},
{
--
Gitee
From a186806456cbf625196e42ff39fd216aba9c0ec0 Mon Sep 17 00:00:00 2001
From: YunaiV
Date: Sun, 23 Mar 2025 07:54:42 +0800
Subject: [PATCH 06/11] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E4=BC=98?=
=?UTF-8?q?=E5=8C=96=E3=80=91BPM=EF=BC=9AOA=20=E8=AF=B7=E5=81=87=E7=95=8C?=
=?UTF-8?q?=E9=9D=A2?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/bpm/oa/leave/create.vue | 72 ++++++++++++++++---------------
1 file changed, 37 insertions(+), 35 deletions(-)
diff --git a/src/views/bpm/oa/leave/create.vue b/src/views/bpm/oa/leave/create.vue
index 2bd2aa741..cf4a13e2a 100644
--- a/src/views/bpm/oa/leave/create.vue
+++ b/src/views/bpm/oa/leave/create.vue
@@ -1,8 +1,8 @@
-
-
-
+
+
+
- 确 定
+
+ 确 定
+
-
-
-
+
+
+
+
+
+
+
-
-
-
-
+
+
+
--
Gitee
From 7508eb5998b1c14ee598258e6aa151f890201fb1 Mon Sep 17 00:00:00 2001
From: YunaiV
Date: Sun, 23 Mar 2025 08:58:04 +0800
Subject: [PATCH 07/11] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BF=AE?=
=?UTF-8?q?=E5=A4=8D=E3=80=91BPM=EF=BC=9A=E5=88=9B=E5=BB=BA=E6=B5=81?=
=?UTF-8?q?=E7=A8=8B-SIMPLE=E8=AE=BE=E8=AE=A1=E5=99=A8-=E5=A4=9A=E4=B8=AA?=
=?UTF-8?q?=E6=9D=A1=E4=BB=B6=E6=97=B6-=E6=9C=80=E6=96=B0=E7=9A=84?=
=?UTF-8?q?=E6=9D=A1=E4=BB=B6=E4=BC=9A=E8=A6=86=E7=9B=96=E4=B8=8A=E5=B1=82?=
=?UTF-8?q?=E6=89=80=E6=9C=89=E7=9A=84=E6=9D=A1=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../SimpleProcessDesignerV2/src/NodeHandler.vue | 5 +++--
.../src/nodes-config/TriggerNodeConfig.vue | 11 ++++++-----
.../src/nodes-config/components/Condition.vue | 3 ++-
.../nodes-config/components/ConditionDialog.vue | 7 ++++---
.../src/nodes/ExclusiveNode.vue | 14 +++++++++++---
.../src/nodes/InclusiveNode.vue | 14 +++++++++++---
6 files changed, 37 insertions(+), 17 deletions(-)
diff --git a/src/components/SimpleProcessDesignerV2/src/NodeHandler.vue b/src/components/SimpleProcessDesignerV2/src/NodeHandler.vue
index 25e4ed74f..439ea9803 100644
--- a/src/components/SimpleProcessDesignerV2/src/NodeHandler.vue
+++ b/src/components/SimpleProcessDesignerV2/src/NodeHandler.vue
@@ -91,6 +91,7 @@ import {
DEFAULT_CONDITION_GROUP_VALUE
} from './consts'
import { generateUUID } from '@/utils'
+import { cloneDeep } from 'lodash-es'
defineOptions({
name: 'NodeHandler'
@@ -184,7 +185,7 @@ const addNode = (type: number) => {
conditionSetting: {
defaultFlow: false,
conditionType: ConditionType.RULE,
- conditionGroups: DEFAULT_CONDITION_GROUP_VALUE
+ conditionGroups: cloneDeep(DEFAULT_CONDITION_GROUP_VALUE)
}
},
{
@@ -242,7 +243,7 @@ const addNode = (type: number) => {
conditionSetting: {
defaultFlow: false,
conditionType: ConditionType.RULE,
- conditionGroups: DEFAULT_CONDITION_GROUP_VALUE
+ conditionGroups: cloneDeep(DEFAULT_CONDITION_GROUP_VALUE)
}
},
{
diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue
index 19e59438f..2baac8d2e 100644
--- a/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue
+++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue
@@ -254,6 +254,7 @@ import {
import { useWatchNode, useDrawer, useNodeName, useFormFields, getConditionShowText } from '../node'
import HttpRequestSetting from './components/HttpRequestSetting.vue'
import ConditionDialog from './components/ConditionDialog.vue'
+import { cloneDeep } from 'lodash-es'
const { proxy } = getCurrentInstance() as any
defineOptions({
@@ -290,7 +291,7 @@ const configForm = ref({
},
formSettings: [
{
- conditionGroups: DEFAULT_CONDITION_GROUP_VALUE,
+ conditionGroups: cloneDeep(DEFAULT_CONDITION_GROUP_VALUE),
updateFormFields: {},
deleteFields: []
}
@@ -346,7 +347,7 @@ const changeTriggerType = () => {
? originalSetting.formSettings
: [
{
- conditionGroups: DEFAULT_CONDITION_GROUP_VALUE,
+ conditionGroups: cloneDeep(DEFAULT_CONDITION_GROUP_VALUE),
updateFormFields: {},
deleteFields: []
}
@@ -361,7 +362,7 @@ const changeTriggerType = () => {
? originalSetting.formSettings
: [
{
- conditionGroups: DEFAULT_CONDITION_GROUP_VALUE,
+ conditionGroups: cloneDeep(DEFAULT_CONDITION_GROUP_VALUE),
updateFormFields: undefined,
deleteFields: []
}
@@ -374,7 +375,7 @@ const changeTriggerType = () => {
/** 添加新的修改表单设置 */
const addFormSetting = () => {
configForm.value.formSettings!.push({
- conditionGroups: DEFAULT_CONDITION_GROUP_VALUE,
+ conditionGroups: cloneDeep(DEFAULT_CONDITION_GROUP_VALUE),
updateFormFields: {},
deleteFields: []
})
@@ -509,7 +510,7 @@ const showTriggerNodeConfig = (node: SimpleFlowNode) => {
},
formSettings: node.triggerSetting.formSettings || [
{
- conditionGroups: DEFAULT_CONDITION_GROUP_VALUE,
+ conditionGroups: cloneDeep(DEFAULT_CONDITION_GROUP_VALUE),
updateFormFields: {},
deleteFields: []
}
diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/components/Condition.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/components/Condition.vue
index 366908489..7ef092d93 100644
--- a/src/components/SimpleProcessDesignerV2/src/nodes-config/components/Condition.vue
+++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/components/Condition.vue
@@ -154,6 +154,7 @@ import {
} from '../../consts'
import { BpmModelFormType } from '@/utils/constants'
import { useFormFieldsAndStartUser } from '../../node'
+import { cloneDeep } from 'lodash-es'
const props = defineProps({
modelValue: {
@@ -196,7 +197,7 @@ const formRef = ref() // 表单 Ref
const changeConditionType = () => {
if (condition.value.conditionType === ConditionType.RULE) {
if (!condition.value.conditionGroups) {
- condition.value.conditionGroups = DEFAULT_CONDITION_GROUP_VALUE
+ condition.value.conditionGroups = cloneDeep(DEFAULT_CONDITION_GROUP_VALUE)
}
}
}
diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/components/ConditionDialog.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/components/ConditionDialog.vue
index 9d6260d5d..79816c689 100644
--- a/src/components/SimpleProcessDesignerV2/src/nodes-config/components/ConditionDialog.vue
+++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/components/ConditionDialog.vue
@@ -1,5 +1,5 @@
-
+