From f739e1e031f9812d9fc25c449ef6f07947d593f5 Mon Sep 17 00:00:00 2001 From: AN <1983933789@qq.com> Date: Wed, 3 Sep 2025 14:31:50 +0800 Subject: [PATCH] =?UTF-8?q?feat(projects):=20=E6=B5=81=E7=A8=8B=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=B7=BB=E5=8A=A0=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E7=AD=89=E6=8B=93=E5=B1=95=E5=AD=97=E6=AE=B5=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B5=81=E7=A8=8B=E5=88=86=E7=B1=BB=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflow/flow-category-select.vue | 7 +- src/constants/workflow.ts | 8 ++ src/typings/api/workflow.api.d.ts | 14 +++- .../modules/definition-operate-drawer.vue | 80 +++++++++++++++++-- .../spel/modules/spel-operate-drawer.vue | 2 +- 5 files changed, 99 insertions(+), 12 deletions(-) diff --git a/src/components/workflow/flow-category-select.vue b/src/components/workflow/flow-category-select.vue index 3511956b..e8388cd2 100644 --- a/src/components/workflow/flow-category-select.vue +++ b/src/components/workflow/flow-category-select.vue @@ -15,6 +15,7 @@ defineProps(); const rawValue = defineModel('value', { required: false }); const options = defineModel('options', { required: false, default: [] }); +const expandedKeys = defineModel('expandedKeys', { required: false, default: [] }); const attrs: TreeSelectProps = useAttrs(); const { loading, startLoading, endLoading } = useLoading(); @@ -34,6 +35,10 @@ async function getCategoryList() { const { error, data } = await fetchGetCategoryTree(); if (error) return; options.value = data; + // 设置默认展开的节点 + if (data?.length && !expandedKeys.value.length) { + expandedKeys.value = [data[0].id]; + } endLoading(); } @@ -43,13 +48,13 @@ getCategoryList(); diff --git a/src/constants/workflow.ts b/src/constants/workflow.ts index b59e2e31..82f02a75 100644 --- a/src/constants/workflow.ts +++ b/src/constants/workflow.ts @@ -73,6 +73,14 @@ export const workflowNodeTypeRecord: Record = { + CLASSICS: '经典模式', + MIMIC: '仿钉钉模式' +}; + +export const definitionDesignerModeOptions = transformRecordToOption(definitionDesignerModeRecord); + /** activity status */ export const workflowActivityStatusRecord: Record = { 0: '挂起', diff --git a/src/typings/api/workflow.api.d.ts b/src/typings/api/workflow.api.d.ts index c64916c3..29bd124f 100644 --- a/src/typings/api/workflow.api.d.ts +++ b/src/typings/api/workflow.api.d.ts @@ -122,6 +122,9 @@ declare namespace Api { /** 工作流发布状态 */ type WorkflowPublishStatus = 0 | 1 | 9; + /** 设计器模式 */ + type DefinitionDesignerMode = 'CLASSICS' | 'MIMIC'; + /** definition */ type Definition = Common.CommonTenantRecord<{ /** 主键id */ @@ -139,17 +142,19 @@ declare namespace Api { /** 是否发布(0未发布 1已发布 9失效) */ isPublish: WorkflowPublishStatus; /** 审批表单是否自定义(Y是 N否) */ - formCustom: string; + formCustom: Api.Common.YesOrNoStatus; /** 审批表单路径 */ formPath: string; /** 流程激活状态(0挂起 1激活) */ - activityStatus: number; + activityStatus: WorkflowActivityStatus; /** 监听器类型 */ listenerType: string; /** 监听器路径 */ listenerPath: string; /** 业务详情 存业务表对象json字符串 */ ext: string; + /** 设计器模式 */ + modelValue: DefinitionDesignerMode; /** 删除标志 */ delFlag: string; }>; @@ -161,7 +166,10 @@ declare namespace Api { /** definition operate params */ type DefinitionOperateParams = CommonType.RecordNullable< - Pick + Pick< + Api.Workflow.Definition, + 'id' | 'flowCode' | 'flowName' | 'category' | 'formPath' | 'formCustom' | 'modelValue' | 'ext' + > >; /** definition list */ diff --git a/src/views/workflow/process-definition/modules/definition-operate-drawer.vue b/src/views/workflow/process-definition/modules/definition-operate-drawer.vue index b91ff61e..a205f08a 100644 --- a/src/views/workflow/process-definition/modules/definition-operate-drawer.vue +++ b/src/views/workflow/process-definition/modules/definition-operate-drawer.vue @@ -1,8 +1,10 @@