From d513c76cd6df22e123a8ae33153330f3cecf041a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E5=AE=81?= <1772105645@qq.com> Date: Wed, 20 May 2026 20:44:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=8F=91=E8=B5=B7?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E9=A1=B5=E9=9D=A2=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=8F=91=E8=B5=B7=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 /workflow/start 页面,卡片展示所有已发布且启用的流程定义 - 点击卡片即可直接发起流程,无需手动填写编码和变量 - 流程定义页面增加"发起"按钮 - 流程实例页面移除旧的发起表单,改为跳转到发起页 --- .../src/router/routes/modules/workflow.ts | 26 +- .../src/views/workflow/definitions/index.vue | 21 + .../src/views/workflow/history/index.vue | 102 ----- .../src/views/workflow/instances/index.vue | 50 +-- .../src/views/workflow/pending/index.vue | 219 ---------- .../src/views/workflow/start/index.vue | 94 +++++ .../src/views/workflow/tasks/index.vue | 374 ++++++++++++++++++ 7 files changed, 506 insertions(+), 380 deletions(-) delete mode 100644 apps/web-antd/src/views/workflow/history/index.vue delete mode 100644 apps/web-antd/src/views/workflow/pending/index.vue create mode 100644 apps/web-antd/src/views/workflow/start/index.vue create mode 100644 apps/web-antd/src/views/workflow/tasks/index.vue diff --git a/apps/web-antd/src/router/routes/modules/workflow.ts b/apps/web-antd/src/router/routes/modules/workflow.ts index d85fa15..95c08a6 100644 --- a/apps/web-antd/src/router/routes/modules/workflow.ts +++ b/apps/web-antd/src/router/routes/modules/workflow.ts @@ -10,6 +10,15 @@ const routes: RouteRecordRaw[] = [ name: 'Workflow', path: '/workflow', children: [ + { + name: 'WorkflowStart', + path: '/workflow/start', + component: () => import('#/views/workflow/start/index.vue'), + meta: { + icon: 'lucide:play-circle', + title: '发起流程', + }, + }, { name: 'WorkflowDefinitions', path: '/workflow/definitions', @@ -20,21 +29,12 @@ const routes: RouteRecordRaw[] = [ }, }, { - name: 'WorkflowPending', - path: '/workflow/pending', - component: () => import('#/views/workflow/pending/index.vue'), + name: 'WorkflowTasks', + path: '/workflow/tasks', + component: () => import('#/views/workflow/tasks/index.vue'), meta: { icon: 'lucide:clock', - title: '我的待办', - }, - }, - { - name: 'WorkflowHistory', - path: '/workflow/history', - component: () => import('#/views/workflow/history/index.vue'), - meta: { - icon: 'lucide:check-circle', - title: '我的已办', + title: '我的任务', }, }, { diff --git a/apps/web-antd/src/views/workflow/definitions/index.vue b/apps/web-antd/src/views/workflow/definitions/index.vue index 9cc9beb..21ed1ad 100644 --- a/apps/web-antd/src/views/workflow/definitions/index.vue +++ b/apps/web-antd/src/views/workflow/definitions/index.vue @@ -21,6 +21,7 @@ import { disableWorkflowDefinitionApi, getWorkflowDefinitionsApi, publishWorkflowDefinitionApi, + startWorkflowInstanceApi, updateWorkflowDefinitionApi, DefinitionStatus, type WorkflowDefinitionDto, @@ -146,6 +147,18 @@ async function handleDisable(id: string) { } } +async function handleStart(def: WorkflowDefinitionDto) { + try { + await startWorkflowInstanceApi({ + definitionCode: def.code, + title: def.name, + }); + message.success(`「${def.name}」流程已发起`); + } catch { + message.error('发起失败'); + } +} + async function handleDelete(id: string) { try { await deleteWorkflowDefinitionApi(id); @@ -177,6 +190,14 @@ onMounted(() => loadData());