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());