From d2954776a58c3cc055aa0d634513a4e7d2e954d2 Mon Sep 17 00:00:00 2001
From: LesanOuO <1960681385@qq.com>
Date: Sat, 25 Jan 2025 09:42:19 +0800
Subject: [PATCH 01/18] =?UTF-8?q?feat:=20=E6=9B=B4=E6=94=B9HttpRequestPara?=
=?UTF-8?q?m=E7=9B=B8=E5=85=B3=E5=91=BD=E5=90=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../SimpleProcessDesignerV2/src/consts.ts | 16 ++++++++--------
.../SimpleProcessDesignerV2/src/node.ts | 14 +++++++-------
.../components/HttpRequestParamSetting.vue | 18 +++++++++---------
.../components/UserTaskListener.vue | 3 +--
4 files changed, 25 insertions(+), 26 deletions(-)
diff --git a/src/components/SimpleProcessDesignerV2/src/consts.ts b/src/components/SimpleProcessDesignerV2/src/consts.ts
index d4e59155..4f66a271 100644
--- a/src/components/SimpleProcessDesignerV2/src/consts.ts
+++ b/src/components/SimpleProcessDesignerV2/src/consts.ts
@@ -246,15 +246,15 @@ export type AssignEmptyHandler = {
export type ListenerHandler = {
enable: boolean
path?: string
- header?: ListenerParam[]
- body?: ListenerParam[]
+ header?: HttpRequestParam[]
+ body?: HttpRequestParam[]
}
-export type ListenerParam = {
+export type HttpRequestParam = {
key: string
type: number
value: string
}
-export enum ListenerParamTypeEnum {
+export enum BpmHttpRequestParamTypeEnum {
/**
* 固定值
*/
@@ -264,7 +264,7 @@ export enum ListenerParamTypeEnum {
*/
FROM_FORM = 2
}
-export const LISTENER_MAP_TYPES = [
+export const BPM_HTTP_REQUEST_PARAM_TYPES = [
{
value: 1,
label: '固定值'
@@ -710,7 +710,7 @@ export type RouterSetting = {
conditionGroups: ConditionGroup
}
-// ==================== 触发器相关定义 ====================
+// ==================== 触发器相关定义 ====================
/**
* 触发器节点结构定义
*/
@@ -736,9 +736,9 @@ export type HttpRequestTriggerSetting = {
// 请求 URL
url: string
// 请求头参数设置
- header?: ListenerParam[] // TODO 需要重命名一下
+ header?: HttpRequestParam[]
// 请求体参数设置
- body?: ListenerParam[]
+ body?: HttpRequestParam[]
}
export const TRIGGER_TYPES: DictDataVO[] = [
diff --git a/src/components/SimpleProcessDesignerV2/src/node.ts b/src/components/SimpleProcessDesignerV2/src/node.ts
index eba4c7ef..76932088 100644
--- a/src/components/SimpleProcessDesignerV2/src/node.ts
+++ b/src/components/SimpleProcessDesignerV2/src/node.ts
@@ -14,7 +14,7 @@ import {
AssignStartUserHandlerType,
AssignEmptyHandlerType,
FieldPermissionType,
- ListenerParam
+ HttpRequestParam
} from './consts'
import { parseFormFields } from '@/components/FormCreate/src/utils'
@@ -139,20 +139,20 @@ export type UserTaskFormType = {
taskCreateListenerEnable?: boolean
taskCreateListenerPath?: string
taskCreateListener?: {
- header: ListenerParam[],
- body: ListenerParam[]
+ header: HttpRequestParam[],
+ body: HttpRequestParam[]
}
taskAssignListenerEnable?: boolean
taskAssignListenerPath?: string
taskAssignListener?: {
- header: ListenerParam[],
- body: ListenerParam[]
+ header: HttpRequestParam[],
+ body: HttpRequestParam[]
}
taskCompleteListenerEnable?: boolean
taskCompleteListenerPath?: string
taskCompleteListener?:{
- header: ListenerParam[],
- body: ListenerParam[]
+ header: HttpRequestParam[],
+ body: HttpRequestParam[]
}
signEnable: boolean
reasonRequire: boolean
diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/components/HttpRequestParamSetting.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/components/HttpRequestParamSetting.vue
index 1c86e21a..cea45327 100644
--- a/src/components/SimpleProcessDesignerV2/src/nodes-config/components/HttpRequestParamSetting.vue
+++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/components/HttpRequestParamSetting.vue
@@ -16,7 +16,7 @@
@@ -47,7 +47,7 @@
}"
>
@@ -86,7 +86,7 @@
@@ -117,7 +117,7 @@
}"
>
@@ -141,7 +141,7 @@
From e726c1dcbaba3d11c8cae66c2651deee722da6a8 Mon Sep 17 00:00:00 2001
From: YunaiV
Date: Sat, 25 Jan 2025 17:16:48 +0800
Subject: [PATCH 05/18] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E8=AF=84?=
=?UTF-8?q?=E5=AE=A1=E3=80=91Bpm=EF=BC=9A=E6=95=B0=E6=8D=AE=E6=8A=A5?=
=?UTF-8?q?=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/bpm/processInstance/report/index.vue | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/views/bpm/processInstance/report/index.vue b/src/views/bpm/processInstance/report/index.vue
index 54bdd522..75753e51 100644
--- a/src/views/bpm/processInstance/report/index.vue
+++ b/src/views/bpm/processInstance/report/index.vue
@@ -106,7 +106,7 @@
>
- {{ scope.row.variables.find(variable => variable.key === item.field)?.value }}
+ {{ scope.row.variables.find((variable) => variable.key === item.field)?.value }}
@@ -157,6 +157,7 @@ const getList = async () => {
const data = await ProcessInstanceApi.getProcessInstanceReportPage(queryParams)
list.value = data.pageResult.list
total.value = data.pageResult.total
+ // TODO @lesan:不确定,能不能通过 processDefinitionId 获取流程定义哈,从而拿到 formFields;
formFieldsList.value = data.formFields
} finally {
loading.value = false
From 410e257a471e1020f1b32828de9d920478d8eb19 Mon Sep 17 00:00:00 2001
From: YunaiV
Date: Sat, 25 Jan 2025 17:57:09 +0800
Subject: [PATCH 06/18] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BC=98?=
=?UTF-8?q?=E5=8C=96=E3=80=91Bpm=EF=BC=9A=E6=B5=81=E7=A8=8B=E5=88=86?=
=?UTF-8?q?=E7=B1=BB=E7=BB=B4=E6=8A=A4=E6=97=B6=EF=BC=8C=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=20description?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/bpm/category/CategoryForm.vue | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/views/bpm/category/CategoryForm.vue b/src/views/bpm/category/CategoryForm.vue
index 9c24b3ef..defd7607 100644
--- a/src/views/bpm/category/CategoryForm.vue
+++ b/src/views/bpm/category/CategoryForm.vue
@@ -13,6 +13,9 @@
+
+
+
{
id: undefined,
name: undefined,
code: undefined,
+ description: undefined,
status: CommonStatusEnum.ENABLE,
sort: undefined
}
From 5f5ae354d2ba6d94967f4f38de8677996935c3ff Mon Sep 17 00:00:00 2001
From: YunaiV
Date: Sat, 25 Jan 2025 18:03:41 +0800
Subject: [PATCH 07/18] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BF=AE?=
=?UTF-8?q?=E5=A4=8D=E3=80=91system=EF=BC=9A=E8=8F=9C=E5=8D=95=E7=AE=A1?=
=?UTF-8?q?=E7=90=86=E5=88=97=E8=A1=A8=EF=BC=8C=E8=99=9A=E6=8B=9F=20table?=
=?UTF-8?q?=20=E7=9A=84=E5=91=8A=E8=AD=A6=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/system/menu/index.vue | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue
index 41658c63..3ca05a37 100644
--- a/src/views/system/menu/index.vue
+++ b/src/views/system/menu/index.vue
@@ -162,6 +162,7 @@ const columns: Column[] = [
cellRenderer: ({ rowData }) => {
return h(
'div',
+ {},
[
hasPermission(['system:menu:update']) &&
h(
@@ -171,7 +172,7 @@ const columns: Column[] = [
type: 'primary',
onClick: () => openForm('update', rowData.id)
},
- '修改'
+ () => '修改'
),
hasPermission(['system:menu:create']) &&
h(
@@ -181,7 +182,7 @@ const columns: Column[] = [
type: 'primary',
onClick: () => openForm('create', undefined, rowData.id)
},
- '新增'
+ () => '新增'
),
hasPermission(['system:menu:delete']) &&
h(
@@ -191,7 +192,7 @@ const columns: Column[] = [
type: 'danger',
onClick: () => handleDelete(rowData.id)
},
- '删除'
+ () => '删除'
)
].filter(Boolean)
)
From 00dfe00d4692a9406f1fea803585fa45ec1dd33b Mon Sep 17 00:00:00 2001
From: LesanOuO <1960681385@qq.com>
Date: Sun, 26 Jan 2025 11:07:16 +0800
Subject: [PATCH 08/18] =?UTF-8?q?feat:=20BPM-=E6=95=B0=E6=8D=AE=E6=8A=A5?=
=?UTF-8?q?=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/bpm/processInstance/index.ts | 4 --
.../bpm/processInstance/report/index.vue | 61 ++++++++++++++-----
2 files changed, 47 insertions(+), 18 deletions(-)
diff --git a/src/api/bpm/processInstance/index.ts b/src/api/bpm/processInstance/index.ts
index 32cadc2c..9a99a91e 100644
--- a/src/api/bpm/processInstance/index.ts
+++ b/src/api/bpm/processInstance/index.ts
@@ -60,10 +60,6 @@ export const getProcessInstanceManagerPage = async (params: any) => {
return await request.get({ url: '/bpm/process-instance/manager-page', params })
}
-export const getProcessInstanceReportPage = async (params: any) => {
- return await request.get({ url: '/bpm/process-instance/report-page', params })
-}
-
export const createProcessInstance = async (data) => {
return await request.post({ url: '/bpm/process-instance/create', data: data })
}
diff --git a/src/views/bpm/processInstance/report/index.vue b/src/views/bpm/processInstance/report/index.vue
index 75753e51..57a5f349 100644
--- a/src/views/bpm/processInstance/report/index.vue
+++ b/src/views/bpm/processInstance/report/index.vue
@@ -66,6 +66,22 @@
class="!w-240px"
/>
+
+
+
+
搜索
重置
@@ -98,7 +114,7 @@
:formatter="dateFormatter"
/>
- {{ scope.row.variables.find((variable) => variable.key === item.field)?.value }}
+ {{ scope.row.formVariables[item.field] ?? '' }}
@@ -124,28 +140,28 @@ import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime'
import * as ProcessInstanceApi from '@/api/bpm/processInstance'
import * as UserApi from '@/api/system/user'
+import * as DefinitionApi from '@/api/bpm/definition'
+import { parseFormFields } from '@/components/FormCreate/src/utils'
defineOptions({ name: 'BpmProcessInstanceReport' })
-const router = useRouter() // 路由
-const { query } = useRoute() // 查询参数
-const message = useMessage() // 消息弹窗
-const { t } = useI18n() // 国际化
+const { query } = useRoute()
const loading = ref(true) // 列表的加载中
const total = ref(0) // 列表的总页数
const list = ref([]) // 列表的数据
-const formFieldsList = ref([])
+const formFields = ref()
+const processDefinitionId = query.processDefinitionId as string
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
startUserId: undefined,
name: '',
- processDefinitionId: query.processDefinitionId,
processDefinitionKey: query.processDefinitionKey,
status: undefined,
createTime: [],
- endTime: []
+ endTime: [],
+ formFieldsParams: {}
})
const queryFormRef = ref() // 搜索的表单
const userList = ref([]) // 用户列表
@@ -154,16 +170,31 @@ const userList = ref([]) // 用户列表
const getList = async () => {
loading.value = true
try {
- const data = await ProcessInstanceApi.getProcessInstanceReportPage(queryParams)
- list.value = data.pageResult.list
- total.value = data.pageResult.total
- // TODO @lesan:不确定,能不能通过 processDefinitionId 获取流程定义哈,从而拿到 formFields;
- formFieldsList.value = data.formFields
+ let queryParamsClone = { ...queryParams }
+ queryParamsClone.formFieldsParams = JSON.stringify(queryParamsClone.formFieldsParams)
+ const data = await ProcessInstanceApi.getProcessInstanceManagerPage(queryParamsClone)
+ list.value = data.list
+ total.value = data.total
} finally {
loading.value = false
}
}
+const getProcessDefinition = async () => {
+ const processDefinition = await DefinitionApi.getProcessDefinition(processDefinitionId)
+ formFields.value = parseFormCreateFields(processDefinition.formFields)
+}
+
+const parseFormCreateFields = (formFields?: string[]) => {
+ const result: Array> = []
+ if (formFields) {
+ formFields.forEach((fieldStr: string) => {
+ parseFormFields(JSON.parse(fieldStr), result)
+ })
+ }
+ return result
+}
+
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
@@ -173,11 +204,13 @@ const handleQuery = () => {
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
+ queryFormRef.value.formFieldsParams = {}
handleQuery()
}
/** 初始化 **/
onMounted(async () => {
+ await getProcessDefinition()
await getList()
userList.value = await UserApi.getSimpleUserList()
})
From 475385bd4309be225b11d7214d7f33a3d3eb109a Mon Sep 17 00:00:00 2001
From: jason <2667446@qq.com>
Date: Sun, 26 Jan 2025 13:14:16 +0800
Subject: [PATCH 09/18] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E6=96=B0?=
=?UTF-8?q?=E5=A2=9E=E3=80=91Http=20=E8=AF=B7=E6=B1=82=E8=A7=A6=E5=8F=91?=
=?UTF-8?q?=E5=99=A8=EF=BC=8C=E5=A2=9E=E5=8A=A0=E8=BF=94=E5=9B=9E=E5=80=BC?=
=?UTF-8?q?=E8=AE=BE=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../SimpleProcessDesignerV2/src/consts.ts | 12 +--
.../SimpleProcessDesignerV2/src/node.ts | 20 ++++-
.../src/nodes-config/TriggerNodeConfig.vue | 90 +++++++++++++++++--
.../components/HttpRequestParamSetting.vue | 15 ++--
4 files changed, 119 insertions(+), 18 deletions(-)
diff --git a/src/components/SimpleProcessDesignerV2/src/consts.ts b/src/components/SimpleProcessDesignerV2/src/consts.ts
index 4f66a271..7f982c41 100644
--- a/src/components/SimpleProcessDesignerV2/src/consts.ts
+++ b/src/components/SimpleProcessDesignerV2/src/consts.ts
@@ -371,13 +371,13 @@ export enum TimeUnitType {
/**
* 条件节点设置结构定义,用于条件节点
*/
-export type ConditionSetting = {
+export type ConditionSetting = {
// 条件类型
- conditionType?: ConditionType,
+ conditionType?: ConditionType
// 条件表达式
- conditionExpression?: string,
+ conditionExpression?: string
// 条件组
- conditionGroups?: ConditionGroup,
+ conditionGroups?: ConditionGroup
// 是否默认的条件
defaultFlow?: boolean
}
@@ -726,7 +726,7 @@ export enum TriggerTypeEnum {
/**
* 发送 HTTP 请求触发器
*/
- HTTP_REQUEST = 1,
+ HTTP_REQUEST = 1
}
/**
@@ -739,6 +739,8 @@ export type HttpRequestTriggerSetting = {
header?: HttpRequestParam[]
// 请求体参数设置
body?: HttpRequestParam[]
+ // 请求响应设置
+ response?: Record[]
}
export const TRIGGER_TYPES: DictDataVO[] = [
diff --git a/src/components/SimpleProcessDesignerV2/src/node.ts b/src/components/SimpleProcessDesignerV2/src/node.ts
index 76932088..23e3c52d 100644
--- a/src/components/SimpleProcessDesignerV2/src/node.ts
+++ b/src/components/SimpleProcessDesignerV2/src/node.ts
@@ -14,7 +14,8 @@ import {
AssignStartUserHandlerType,
AssignEmptyHandlerType,
FieldPermissionType,
- HttpRequestParam
+ HttpRequestParam,
+ ProcessVariableEnum
} from './consts'
import { parseFormFields } from '@/components/FormCreate/src/utils'
@@ -106,13 +107,28 @@ export function useFormFieldsPermission(defaultPermission: FieldPermissionType)
}
}
/**
- * @description 获取表单的字段
+ * @description 获取流程表单的字段。
*/
export function useFormFields() {
const formFields = inject[>('formFields', ref([])) // 流程表单字段
return parseFormCreateFields(unref(formFields))
}
+/**
+ * @description 获取流程表单的字段和发起人字段
+ */
+export function useFormFieldsAndStartUser() {
+ const injectFormFields = inject][>('formFields', ref([])) // 流程表单字段
+ const formFields = parseFormCreateFields(unref(injectFormFields))
+ // 添加发起人
+ formFields.unshift({
+ field: ProcessVariableEnum.START_USER_ID,
+ title: '发起人',
+ required: true
+ })
+ return formFields
+}
+
export type UserTaskFormType = {
candidateStrategy: CandidateStrategy
approveMethod: ApproveMethodType
diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue
index ce5e82e1..e29278dd 100644
--- a/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue
+++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue
@@ -35,6 +35,7 @@
/>
]
+
@@ -46,14 +47,79 @@
:closable="false"
/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 添加一行
+
+
@@ -68,7 +134,7 @@
From 79a53412d69ac45291fd5aaef0b07895b4a63e9c Mon Sep 17 00:00:00 2001
From: YunaiV
Date: Sun, 26 Jan 2025 13:35:07 +0800
Subject: [PATCH 10/18] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E8=AF=84?=
=?UTF-8?q?=E5=AE=A1=E3=80=91Bpm=EF=BC=9A=E6=95=B0=E6=8D=AE=E6=8A=A5?=
=?UTF-8?q?=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/SimpleProcessDesignerV2/src/node.ts | 12 +++++++-----
src/views/bpm/processInstance/report/index.vue | 10 ++++++++--
2 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/src/components/SimpleProcessDesignerV2/src/node.ts b/src/components/SimpleProcessDesignerV2/src/node.ts
index 23e3c52d..407fd483 100644
--- a/src/components/SimpleProcessDesignerV2/src/node.ts
+++ b/src/components/SimpleProcessDesignerV2/src/node.ts
@@ -106,14 +106,16 @@ export function useFormFieldsPermission(defaultPermission: FieldPermissionType)
getNodeConfigFormFields
}
}
+
/**
- * @description 获取流程表单的字段。
+ * @description 获取流程表单的字段
*/
export function useFormFields() {
const formFields = inject[>('formFields', ref([])) // 流程表单字段
return parseFormCreateFields(unref(formFields))
}
+// TODO @芋艿:后续需要把各种类似 useFormFieldsPermission 的逻辑,抽成一个通用方法。
/**
* @description 获取流程表单的字段和发起人字段
*/
@@ -155,19 +157,19 @@ export type UserTaskFormType = {
taskCreateListenerEnable?: boolean
taskCreateListenerPath?: string
taskCreateListener?: {
- header: HttpRequestParam[],
+ header: HttpRequestParam[]
body: HttpRequestParam[]
}
taskAssignListenerEnable?: boolean
taskAssignListenerPath?: string
taskAssignListener?: {
- header: HttpRequestParam[],
+ header: HttpRequestParam[]
body: HttpRequestParam[]
}
taskCompleteListenerEnable?: boolean
taskCompleteListenerPath?: string
- taskCompleteListener?:{
- header: HttpRequestParam[],
+ taskCompleteListener?: {
+ header: HttpRequestParam[]
body: HttpRequestParam[]
}
signEnable: boolean
diff --git a/src/views/bpm/processInstance/report/index.vue b/src/views/bpm/processInstance/report/index.vue
index 57a5f349..ae0bd172 100644
--- a/src/views/bpm/processInstance/report/index.vue
+++ b/src/views/bpm/processInstance/report/index.vue
@@ -72,7 +72,7 @@
:label="item.title"
:prop="item.field"
>
-
+
-
+
{{ scope.row.formVariables[item.field] ?? '' }}
+
{
}
}
+/** 获取流程定义 */
const getProcessDefinition = async () => {
const processDefinition = await DefinitionApi.getProcessDefinition(processDefinitionId)
formFields.value = parseFormCreateFields(processDefinition.formFields)
}
+/** 解析表单字段 */
const parseFormCreateFields = (formFields?: string[]) => {
const result: Array> = []
if (formFields) {
@@ -210,8 +213,11 @@ const resetQuery = () => {
/** 初始化 **/
onMounted(async () => {
+ // 获取流程定义,用于 table column 的展示
await getProcessDefinition()
+ // 获取流程列表
await getList()
+ // 获取用户列表
userList.value = await UserApi.getSimpleUserList()
})
From bd48210d7fd75a6ae15893bf815e84c8077538e7 Mon Sep 17 00:00:00 2001
From: YunaiV
Date: Sun, 26 Jan 2025 14:13:04 +0800
Subject: [PATCH 11/18] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E8=AF=84?=
=?UTF-8?q?=E5=AE=A1=E3=80=91Bpm=EF=BC=9A=E6=95=B0=E6=8D=AE=E6=8A=A5?=
=?UTF-8?q?=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/router/modules/remaining.ts | 12 ++++++++++++
src/views/bpm/model/CategoryDraggableModel.vue | 5 ++++-
src/views/bpm/processInstance/report/index.vue | 8 +++++---
3 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts
index 4b177ae8..a5a7e449 100644
--- a/src/router/modules/remaining.ts
+++ b/src/router/modules/remaining.ts
@@ -307,6 +307,18 @@ const remainingRouter: AppRouteRecordRaw[] = [
activityId: route.query.activityId
})
},
+ {
+ path: 'process-instance/report',
+ component: () => import('@/views/bpm/processInstance/report/index.vue'),
+ name: 'BpmProcessInstanceReport',
+ meta: {
+ noCache: true,
+ hidden: true,
+ canTo: true,
+ title: '数据报表',
+ activeMenu: '/bpm/manager/model'
+ }
+ },
{
path: 'oa/leave/create',
component: () => import('@/views/bpm/oa/leave/create.vue'),
diff --git a/src/views/bpm/model/CategoryDraggableModel.vue b/src/views/bpm/model/CategoryDraggableModel.vue
index 1a8c37a8..0b097847 100644
--- a/src/views/bpm/model/CategoryDraggableModel.vue
+++ b/src/views/bpm/model/CategoryDraggableModel.vue
@@ -194,7 +194,10 @@
报表
diff --git a/src/views/bpm/processInstance/report/index.vue b/src/views/bpm/processInstance/report/index.vue
index ae0bd172..a7ab685c 100644
--- a/src/views/bpm/processInstance/report/index.vue
+++ b/src/views/bpm/processInstance/report/index.vue
@@ -171,9 +171,10 @@ const userList = ref([]) // 用户列表
const getList = async () => {
loading.value = true
try {
- let queryParamsClone = { ...queryParams }
- queryParamsClone.formFieldsParams = JSON.stringify(queryParamsClone.formFieldsParams)
- const data = await ProcessInstanceApi.getProcessInstanceManagerPage(queryParamsClone)
+ const data = await ProcessInstanceApi.getProcessInstanceManagerPage({
+ ...queryParams,
+ formFieldsParams: JSON.stringify(queryParams.formFieldsParams)
+ })
list.value = data.list
total.value = data.total
} finally {
@@ -205,6 +206,7 @@ const handleQuery = () => {
}
/** 重置按钮操作 */
+// TODO @lesan:动态表单的 search ,无法重置的样子
const resetQuery = () => {
queryFormRef.value.resetFields()
queryFormRef.value.formFieldsParams = {}
From 503a35f44e78c92310463836b91bdcdc66ae0eab Mon Sep 17 00:00:00 2001
From: jason <2667446@qq.com>
Date: Sun, 26 Jan 2025 14:34:23 +0800
Subject: [PATCH 12/18] =?UTF-8?q?=E3=80=90=E7=BC=BA=E9=99=B7=E4=BF=AE?=
=?UTF-8?q?=E5=A4=8D=E3=80=91=E5=BB=B6=E8=BF=9F=E5=99=A8=E8=8A=82=E7=82=B9?=
=?UTF-8?q?=E5=90=8D=E7=A7=B0=E4=BF=AE=E5=A4=8D=E9=97=AE=E9=A2=98=EF=BC=8C?=
=?UTF-8?q?=E5=BB=B6=E8=BF=9F=E5=99=A8=E8=8A=82=E7=82=B9=E9=AB=98=E4=BA=AE?=
=?UTF-8?q?=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/nodes-config/ConditionNodeConfig.vue | 20 ++++---------------
.../src/nodes-config/DelayTimerNodeConfig.vue | 1 +
.../src/nodes-config/TriggerNodeConfig.vue | 1 +
.../src/nodes-config/components/Condition.vue | 18 +++++------------
.../detail/ProcessInstanceSimpleViewer.vue | 10 ++++++++++
5 files changed, 21 insertions(+), 29 deletions(-)
diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue
index 93e3795a..e9b387a7 100644
--- a/src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue
+++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue
@@ -47,10 +47,9 @@ import {
SimpleFlowNode,
ConditionType,
COMPARISON_OPERATORS,
- ProcessVariableEnum
} from '../consts'
import { getDefaultConditionNodeName } from '../utils'
-import { useFormFields } from '../node'
+import { useFormFieldsAndStartUser } from '../node'
import Condition from './components/Condition.vue'
const message = useMessage() // 消息弹窗
defineOptions({
@@ -176,23 +175,12 @@ const getShowText = (): string => {
}
return showText
}
-
-const fieldsInfo = useFormFields()
-/** 条件规则可选择的表单字段 */
-const fieldOptions = computed(() => {
- const fieldsCopy = fieldsInfo.slice()
- // 固定添加发起人 ID 字段
- fieldsCopy.unshift({
- field: ProcessVariableEnum.START_USER_ID,
- title: '发起人',
- required: true
- })
- return fieldsCopy
-})
+// 流程表单字段和发起人字段
+const fieldOptions = useFormFieldsAndStartUser()
/** 获取字段名称 */
const getFieldTitle = (field: string) => {
- const item = fieldOptions.value.find((item) => item.field === field)
+ const item = fieldOptions.find((item) => item.field === field)
return item?.title
}
diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/DelayTimerNodeConfig.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/DelayTimerNodeConfig.vue
index 27a351b8..741796d3 100644
--- a/src/components/SimpleProcessDesignerV2/src/nodes-config/DelayTimerNodeConfig.vue
+++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/DelayTimerNodeConfig.vue
@@ -124,6 +124,7 @@ const saveConfig = async () => {
if (!valid) return false
const showText = getShowText()
if (!showText) return false
+ currentNode.value.name = nodeName.value!
currentNode.value.showText = showText
if (configForm.value.delayType === DelayTypeEnum.FIXED_TIME_DURATION) {
currentNode.value.delaySetting = {
diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue
index e29278dd..b6697a7c 100644
--- a/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue
+++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue
@@ -192,6 +192,7 @@ const saveConfig = async () => {
if (!valid) return false
const showText = getShowText()
if (!showText) return false
+ currentNode.value.name = nodeName.value!
currentNode.value.showText = showText
currentNode.value.triggerSetting = configForm.value
settingVisible.value = false
diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/components/Condition.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/components/Condition.vue
index e86ac2da..d7216546 100644
--- a/src/components/SimpleProcessDesignerV2/src/nodes-config/components/Condition.vue
+++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/components/Condition.vue
@@ -138,11 +138,10 @@ import {
COMPARISON_OPERATORS,
CONDITION_CONFIG_TYPES,
ConditionType,
- DEFAULT_CONDITION_GROUP_VALUE,
- ProcessVariableEnum
+ DEFAULT_CONDITION_GROUP_VALUE
} from '../../consts'
import { BpmModelFormType } from '@/utils/constants'
-import { useFormFields } from '../../node'
+import { useFormFieldsAndStartUser } from '../../node'
const props = defineProps({
modelValue: {
@@ -170,17 +169,10 @@ const conditionConfigTypes = computed(() => {
}
})
})
+
/** 条件规则可选择的表单字段 */
-const fieldOptions = computed(() => {
- const fieldsCopy = useFormFields().slice()
- // 固定添加发起人 ID 字段
- fieldsCopy.unshift({
- field: ProcessVariableEnum.START_USER_ID,
- title: '发起人',
- required: true
- })
- return fieldsCopy
-})
+const fieldOptions = useFormFieldsAndStartUser()
+
// 表单校验规则
const formRules = reactive({
conditionType: [{ required: true, message: '配置方式不能为空', trigger: 'blur' }],
diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue b/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue
index 0694ab8a..69fd7014 100644
--- a/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue
+++ b/src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue
@@ -114,6 +114,16 @@ const setSimpleModelNodeTaskStatus = (
simpleModel.activityStatus = TaskStatusEnum.NOT_START
}
}
+ // 触发器节点
+ if (simpleModel.type === NodeType.TRIGGER_NODE) {
+ // 触发器节点,只有通过和未执行状态
+ if (finishedActivityIds.includes(simpleModel.id)) {
+ simpleModel.activityStatus = TaskStatusEnum.APPROVE
+ } else {
+ simpleModel.activityStatus = TaskStatusEnum.NOT_START
+ }
+ }
+
// 条件节点对应 SequenceFlow
if (simpleModel.type === NodeType.CONDITION_NODE) {
// 条件节点,只有通过和未执行状态
From 5e801a8e6370587ec6a4eb8b07310e3b9431d8f2 Mon Sep 17 00:00:00 2001
From: jason <2667446@qq.com>
Date: Sun, 26 Jan 2025 17:35:02 +0800
Subject: [PATCH 13/18] =?UTF-8?q?fix:=20=E3=80=90=E5=8A=9F=E8=83=BD?=
=?UTF-8?q?=E4=BF=AE=E5=A4=8D=E3=80=91=E8=87=AA=E5=AE=9A=E4=B9=89=E6=A0=87?=
=?UTF-8?q?=E9=A2=98=E3=80=82=E6=B5=81=E7=A8=8B=E5=8F=91=E8=B5=B7=E4=BA=BA?=
=?UTF-8?q?=E7=AD=89=E8=AE=BE=E7=BD=AE=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/bpm/model/form/ExtraSettings.vue | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/views/bpm/model/form/ExtraSettings.vue b/src/views/bpm/model/form/ExtraSettings.vue
index 182218e3..d9eb1c61 100644
--- a/src/views/bpm/model/form/ExtraSettings.vue
+++ b/src/views/bpm/model/form/ExtraSettings.vue
@@ -216,16 +216,16 @@ const formFieldOptions4Title = computed(() => {
})
// 固定添加发起人 ID 字段
cloneFormField.unshift({
- label: ProcessVariableEnum.PROCESS_DEFINITION_NAME,
- value: '流程名称'
+ label: '流程名称',
+ value: ProcessVariableEnum.PROCESS_DEFINITION_NAME
})
cloneFormField.unshift({
- label: ProcessVariableEnum.START_TIME,
- value: '发起时间'
+ label: '发起时间',
+ value: ProcessVariableEnum.START_TIME
})
cloneFormField.unshift({
- label: ProcessVariableEnum.START_USER_ID,
- value: '发起人'
+ label: '发起人',
+ value: ProcessVariableEnum.START_USER_ID
})
return cloneFormField
})
From 5d2605fcaea396c3a9db1cc7e2d47f8128088830 Mon Sep 17 00:00:00 2001
From: LesanOuO <1960681385@qq.com>
Date: Mon, 27 Jan 2025 09:34:15 +0800
Subject: [PATCH 14/18] =?UTF-8?q?fix:=20=E4=BB=A3=E7=A0=81=E8=AF=84?=
=?UTF-8?q?=E5=AE=A1=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../bpm/processInstance/report/index.vue | 55 ++++++++++++++++++-
1 file changed, 52 insertions(+), 3 deletions(-)
diff --git a/src/views/bpm/processInstance/report/index.vue b/src/views/bpm/processInstance/report/index.vue
index a7ab685c..939c0bde 100644
--- a/src/views/bpm/processInstance/report/index.vue
+++ b/src/views/bpm/processInstance/report/index.vue
@@ -125,7 +125,27 @@
{{ scope.row.formVariables[item.field] ?? '' }}
-
+
+
+
+ 详情
+
+
+ 取消
+
+
+
{
}
/** 重置按钮操作 */
-// TODO @lesan:动态表单的 search ,无法重置的样子
const resetQuery = () => {
queryFormRef.value.resetFields()
- queryFormRef.value.formFieldsParams = {}
+ queryParams.formFieldsParams = {}
handleQuery()
}
+/** 查看详情 */
+const handleDetail = (row) => {
+ router.push({
+ name: 'BpmProcessInstanceDetail',
+ query: {
+ id: row.id
+ }
+ })
+}
+
+/** 取消按钮操作 */
+const handleCancel = async (row) => {
+ // 二次确认
+ const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
+ confirmButtonText: t('common.ok'),
+ cancelButtonText: t('common.cancel'),
+ inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
+ inputErrorMessage: '取消原因不能为空'
+ })
+ // 发起取消
+ await ProcessInstanceApi.cancelProcessInstanceByAdmin(row.id, value)
+ message.success('取消成功')
+ // 刷新列表
+ await getList()
+}
+
/** 初始化 **/
onMounted(async () => {
// 获取流程定义,用于 table column 的展示
From 9c2619851a652c4e25a087015bae0e022e7aa606 Mon Sep 17 00:00:00 2001
From: zws <447643445@qq.com>
Date: Thu, 6 Feb 2025 09:09:08 +0800
Subject: [PATCH 15/18] =?UTF-8?q?feat:=20=E8=AE=BE=E8=AE=A1=E5=99=A8?=
=?UTF-8?q?=E5=AE=A1=E6=89=B9=E8=8A=82=E7=82=B9=E8=AE=BE=E7=BD=AE=20?=
=?UTF-8?q?=E5=BC=80=E5=90=AF=E4=B8=8B=E6=8B=89=E8=BF=87=E6=BB=A4=E6=96=B9?=
=?UTF-8?q?=E4=BE=BF=E9=80=89=E6=8B=A9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/nodes-config/UserTaskNodeConfig.vue | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue
index ced8c8fd..013e2cbd 100644
--- a/src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue
+++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue
@@ -61,7 +61,7 @@
label="指定角色"
prop="roleIds"
>
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
Date: Thu, 6 Feb 2025 09:09:45 +0800
Subject: [PATCH 16/18] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=20=E8=AE=BE?=
=?UTF-8?q?=E8=AE=A1=E5=99=A8=E5=AE=A1=E6=89=B9=E8=8A=82=E7=82=B9=E8=AE=BE?=
=?UTF-8?q?=E7=BD=AE=E5=8E=86=E5=8F=B2=E6=95=B0=E6=8D=AE=E6=97=A0=E7=9B=91?=
=?UTF-8?q?=E5=90=AC=E5=99=A8=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/nodes-config/UserTaskNodeConfig.vue | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue
index 013e2cbd..ca55e3b9 100644
--- a/src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue
+++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue
@@ -760,22 +760,22 @@ const showUserTaskNodeConfig = (node: SimpleFlowNode) => {
getNodeConfigFormFields(node.fieldsPermission)
// 5. 监听器
// 5.1 创建任务
- configForm.value.taskCreateListenerEnable = node.taskCreateListener!.enable
- configForm.value.taskCreateListenerPath = node.taskCreateListener!.path
+ configForm.value.taskCreateListenerEnable = node.taskCreateListener?.enable
+ configForm.value.taskCreateListenerPath = node.taskCreateListener?.path
configForm.value.taskCreateListener = {
header: node.taskCreateListener?.header ?? [],
body: node.taskCreateListener?.body ?? []
}
// 5.2 指派任务
- configForm.value.taskAssignListenerEnable = node.taskAssignListener!.enable
- configForm.value.taskAssignListenerPath = node.taskAssignListener!.path
+ configForm.value.taskAssignListenerEnable = node.taskAssignListener?.enable
+ configForm.value.taskAssignListenerPath = node.taskAssignListener?.path
configForm.value.taskAssignListener = {
header: node.taskAssignListener?.header ?? [],
body: node.taskAssignListener?.body ?? []
}
// 5.3 完成任务
- configForm.value.taskCompleteListenerEnable = node.taskCompleteListener!.enable
- configForm.value.taskCompleteListenerPath = node.taskCompleteListener!.path
+ configForm.value.taskCompleteListenerEnable = node.taskCompleteListener?.enable
+ configForm.value.taskCompleteListenerPath = node.taskCompleteListener?.path
configForm.value.taskCompleteListener = {
header: node.taskCompleteListener?.header ?? [],
body: node.taskCompleteListener?.body ?? []
From e32fc81df6c2b8214d784cc1a01b1a3d274b1ca1 Mon Sep 17 00:00:00 2001
From: jason <2667446@qq.com>
Date: Fri, 7 Feb 2025 22:50:53 +0800
Subject: [PATCH 17/18] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E6=96=B0?=
=?UTF-8?q?=E5=A2=9E=E3=80=91=E6=96=B0=E5=A2=9E=E4=BF=AE=E6=94=B9=E8=A1=A8?=
=?UTF-8?q?=E5=8D=95=E6=95=B0=E6=8D=AE=E8=A7=A6=E5=8F=91=E5=99=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../SimpleProcessDesignerV2/src/consts.ts | 20 ++-
.../src/nodes-config/TriggerNodeConfig.vue | 124 +++++++++++++++++-
2 files changed, 135 insertions(+), 9 deletions(-)
diff --git a/src/components/SimpleProcessDesignerV2/src/consts.ts b/src/components/SimpleProcessDesignerV2/src/consts.ts
index 7f982c41..d9b374b6 100644
--- a/src/components/SimpleProcessDesignerV2/src/consts.ts
+++ b/src/components/SimpleProcessDesignerV2/src/consts.ts
@@ -716,7 +716,8 @@ export type RouterSetting = {
*/
export type TriggerSetting = {
type: TriggerTypeEnum
- httpRequestSetting: HttpRequestTriggerSetting
+ httpRequestSetting?: HttpRequestTriggerSetting
+ normalFormSetting?: NormalFormTriggerSetting
}
/**
@@ -726,7 +727,11 @@ export enum TriggerTypeEnum {
/**
* 发送 HTTP 请求触发器
*/
- HTTP_REQUEST = 1
+ HTTP_REQUEST = 1,
+ /**
+ * 更新流程表单触发器
+ */
+ UPDATE_NORMAL_FORM = 2
}
/**
@@ -743,6 +748,15 @@ export type HttpRequestTriggerSetting = {
response?: Record[]
}
+/**
+ * 流程表单触发器配置结构定义
+ */
+export type NormalFormTriggerSetting = {
+ // 更新表单字段
+ updateFormFields?: Record
+}
+
export const TRIGGER_TYPES: DictDataVO[] = [
- { label: 'HTTP 请求', value: TriggerTypeEnum.HTTP_REQUEST }
+ { label: 'HTTP 请求', value: TriggerTypeEnum.HTTP_REQUEST },
+ { label: '修改表单数据', value: TriggerTypeEnum.UPDATE_NORMAL_FORM }
]
diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue
index b6697a7c..5c3c05b0 100644
--- a/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue
+++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/TriggerNodeConfig.vue
@@ -83,7 +83,7 @@
>
]
+
+
修改表单设置
+
+
+
+ updateFormFieldKey(key, newKey)"
+ placeholder="请选择表单字段"
+ :disabled="key !== ''"
+ >
+
+
+
+
+
的值设置为
+
+
+
+
+
+
+
+
+
+
+
+
+ 添加修改字段
+
+
@@ -146,6 +204,7 @@ const props = defineProps({
required: true
}
})
+const message = useMessage() // 消息弹窗
// 抽屉配置
const { settingVisible, closeDrawer, openDrawer } = useDrawer()
// 当前节点
@@ -167,10 +226,28 @@ const configForm = ref({
header: [],
body: [],
response: []
- }
+ },
+ normalFormSetting: { updateFormFields: {} }
})
// 流程表单字段
-const formFieldOptions = useFormFields()
+const formFields = useFormFields()
+
+// 可选的修改的表单字段
+const optionalUpdateFormFields = computed(() => {
+ const usedFields = Object.keys(configForm.value.normalFormSetting?.updateFormFields || {})
+ return formFields.map((field) => ({
+ title: field.title,
+ field: field.field,
+ disabled: usedFields.includes(field.field)
+ }))
+})
+
+const updateFormFieldKey = (oldKey: string, newKey: string) => {
+ if (!configForm.value.normalFormSetting?.updateFormFields) return
+ const value = configForm.value.normalFormSetting.updateFormFields[oldKey]
+ delete configForm.value.normalFormSetting.updateFormFields[oldKey]
+ configForm.value.normalFormSetting.updateFormFields[newKey] = value
+}
/** 添加 HTTP 请求返回值设置项*/
const addHttpResponseSetting = (responseSetting: Record[]) => {
@@ -185,6 +262,19 @@ const deleteHttpResponseSetting = (responseSetting: Record[], in
responseSetting.splice(index, 1)
}
+/** 添加修改表单设置项 */
+const addFormFieldSetting = () => {
+ if (configForm.value.normalFormSetting!.updateFormFields === undefined) {
+ configForm.value.normalFormSetting!.updateFormFields = {}
+ }
+ configForm.value.normalFormSetting!.updateFormFields[''] = undefined
+}
+/** 删除修改表单设置项 */
+const deleteFormFieldSetting = (key: string) => {
+ if (!configForm.value.normalFormSetting?.updateFormFields) return
+ delete configForm.value.normalFormSetting.updateFormFields[key]
+}
+
/** 保存配置 */
const saveConfig = async () => {
if (!formRef) return false
@@ -194,15 +284,29 @@ const saveConfig = async () => {
if (!showText) return false
currentNode.value.name = nodeName.value!
currentNode.value.showText = showText
+ if (configForm.value.type === TriggerTypeEnum.HTTP_REQUEST) {
+ configForm.value.normalFormSetting = undefined
+ }
+ if (configForm.value.type === TriggerTypeEnum.UPDATE_NORMAL_FORM) {
+ configForm.value.httpRequestSetting = undefined
+ }
currentNode.value.triggerSetting = configForm.value
settingVisible.value = false
return true
}
+
/** 获取节点展示内容 */
const getShowText = (): string => {
let showText = ''
if (configForm.value.type === TriggerTypeEnum.HTTP_REQUEST) {
- showText = `${configForm.value.httpRequestSetting.url}`
+ showText = `${configForm.value.httpRequestSetting?.url}`
+ } else if (configForm.value.type === TriggerTypeEnum.UPDATE_NORMAL_FORM) {
+ const updatefields = Object.keys(configForm.value.normalFormSetting?.updateFormFields || {})
+ if (updatefields.length === 0) {
+ message.warning('请设置修改表单字段')
+ } else {
+ showText = '修改表单数据'
+ }
}
return showText
}
@@ -211,8 +315,16 @@ const getShowText = (): string => {
const showTriggerNodeConfig = (node: SimpleFlowNode) => {
nodeName.value = node.name
if (node.triggerSetting) {
- configForm.value.type = node.triggerSetting.type
- configForm.value.httpRequestSetting = node.triggerSetting.httpRequestSetting
+ configForm.value = {
+ type: node.triggerSetting.type,
+ httpRequestSetting: node.triggerSetting.httpRequestSetting || {
+ url: '',
+ header: [],
+ body: [],
+ response: []
+ },
+ normalFormSetting: node.triggerSetting.normalFormSetting || { updateFormFields: {} }
+ }
}
}
From 60af2c6e7e5c30bfbd0f988b8a7405125d8cbbd6 Mon Sep 17 00:00:00 2001
From: YunaiV
Date: Sun, 9 Feb 2025 06:56:04 +0800
Subject: [PATCH 18/18] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E8=AF=84?=
=?UTF-8?q?=E5=AE=A1=E3=80=91BPM=EF=BC=9A=E8=A7=A6=E5=8F=91=E5=99=A8=20-?=
=?UTF-8?q?=20=E8=A1=A8=E5=8D=95=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/SimpleProcessDesignerV2/src/consts.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/components/SimpleProcessDesignerV2/src/consts.ts b/src/components/SimpleProcessDesignerV2/src/consts.ts
index d9b374b6..f0614eef 100644
--- a/src/components/SimpleProcessDesignerV2/src/consts.ts
+++ b/src/components/SimpleProcessDesignerV2/src/consts.ts
@@ -731,7 +731,7 @@ export enum TriggerTypeEnum {
/**
* 更新流程表单触发器
*/
- UPDATE_NORMAL_FORM = 2
+ UPDATE_NORMAL_FORM = 2 // TODO @jason:FORM_UPDATE?
}
/**