From 81449ea77a8e0d12c0016d163583dae5fe23e1f1 Mon Sep 17 00:00:00 2001 From: AN <1983933789@qq.com> Date: Mon, 23 Jun 2025 22:35:44 +0800 Subject: [PATCH] =?UTF-8?q?feat-wip(projects):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=B9=B2=E9=A2=84=EF=BC=8C=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ry-select.vue => flow-category-select.vue} | 2 +- .../custom/workflow/flow-drawer.vue | 84 +++++++++++ .../custom/workflow/flow-intervene-modal.vue | 40 +++++ ...modal.vue => flow-task-approval-modal.vue} | 2 +- .../custom/workflow/leave-edit/index.vue | 141 +++++++++--------- src/typings/api/workflow.api.d.ts | 3 + src/typings/components.d.ts | 9 +- .../workflow/task/all-task-waiting/index.vue | 40 +++-- 8 files changed, 232 insertions(+), 89 deletions(-) rename src/components/custom/workflow/{workflow-category-select.vue => flow-category-select.vue} (96%) create mode 100644 src/components/custom/workflow/flow-drawer.vue create mode 100644 src/components/custom/workflow/flow-intervene-modal.vue rename src/components/custom/workflow/{workflow-task-apply-modal.vue => flow-task-approval-modal.vue} (98%) diff --git a/src/components/custom/workflow/workflow-category-select.vue b/src/components/custom/workflow/flow-category-select.vue similarity index 96% rename from src/components/custom/workflow/workflow-category-select.vue rename to src/components/custom/workflow/flow-category-select.vue index d75e43a7..3511956b 100644 --- a/src/components/custom/workflow/workflow-category-select.vue +++ b/src/components/custom/workflow/flow-category-select.vue @@ -5,7 +5,7 @@ import { useLoading } from '@sa/hooks'; import { fetchGetCategoryTree } from '@/service/api/workflow'; import { isNull } from '@/utils/common'; -defineOptions({ name: 'WorkflowCategorySelect' }); +defineOptions({ name: 'FlowCategorySelect' }); interface Props { [key: string]: any; diff --git a/src/components/custom/workflow/flow-drawer.vue b/src/components/custom/workflow/flow-drawer.vue new file mode 100644 index 00000000..d173b697 --- /dev/null +++ b/src/components/custom/workflow/flow-drawer.vue @@ -0,0 +1,84 @@ + + + + + diff --git a/src/components/custom/workflow/flow-intervene-modal.vue b/src/components/custom/workflow/flow-intervene-modal.vue new file mode 100644 index 00000000..4bafa4f9 --- /dev/null +++ b/src/components/custom/workflow/flow-intervene-modal.vue @@ -0,0 +1,40 @@ + + + diff --git a/src/components/custom/workflow/workflow-task-apply-modal.vue b/src/components/custom/workflow/flow-task-approval-modal.vue similarity index 98% rename from src/components/custom/workflow/workflow-task-apply-modal.vue rename to src/components/custom/workflow/flow-task-approval-modal.vue index babb2475..9d932422 100644 --- a/src/components/custom/workflow/workflow-task-apply-modal.vue +++ b/src/components/custom/workflow/flow-task-approval-modal.vue @@ -6,7 +6,7 @@ import { fetchCompleteTask, fetchGetTask } from '@/service/api/workflow'; import FileUpload from '@/components/custom/file-upload.vue'; defineOptions({ - name: 'WorkflowTaskApplyModal' + name: 'FlowTaskApprovalModal' }); interface Props { diff --git a/src/components/custom/workflow/leave-edit/index.vue b/src/components/custom/workflow/leave-edit/index.vue index 3026dcd5..ed6cbd2a 100644 --- a/src/components/custom/workflow/leave-edit/index.vue +++ b/src/components/custom/workflow/leave-edit/index.vue @@ -1,5 +1,5 @@ diff --git a/src/typings/api/workflow.api.d.ts b/src/typings/api/workflow.api.d.ts index 695f3680..52921bc9 100644 --- a/src/typings/api/workflow.api.d.ts +++ b/src/typings/api/workflow.api.d.ts @@ -246,6 +246,9 @@ declare namespace Api { /** 是否显示 */ show: boolean; }>; + + type TaskOrHisTask = Task | HisTask; + /** 任务详情 */ type Task = Common.CommonTenantRecord<{ /** 任务ID */ diff --git a/src/typings/components.d.ts b/src/typings/components.d.ts index d2246768..dda007e5 100644 --- a/src/typings/components.d.ts +++ b/src/typings/components.d.ts @@ -24,7 +24,12 @@ declare module 'vue' { DictTag: typeof import('./../components/custom/dict-tag.vue')['default'] ExceptionBase: typeof import('./../components/common/exception-base.vue')['default'] FileUpload: typeof import('./../components/custom/file-upload.vue')['default'] + FlowCategorySelect: typeof import('./../components/custom/workflow/flow-category-select.vue')['default'] + FlowDrawer: typeof import('./../components/custom/workflow/flow-drawer.vue')['default'] + FlowInterveneModal: typeof import('./../components/custom/workflow/flow-intervene-modal.vue')['default'] FlowPreview: typeof import('./../components/custom/workflow/flow-preview.vue')['default'] + FlowTaskApprovalModal: typeof import('./../components/custom/workflow/flow-task-approval-modal.vue')['default'] + FlowTaskPassModal: typeof import('../components/custom/workflow/flow-task-approval-modal.vue')['default'] FormTip: typeof import('./../components/custom/form-tip.vue')['default'] FullScreen: typeof import('./../components/common/full-screen.vue')['default'] GroupTag: typeof import('./../components/custom/group-tag.vue')['default'] @@ -85,7 +90,7 @@ declare module 'vue' { NColorPicker: typeof import('naive-ui')['NColorPicker'] NDataTable: typeof import('naive-ui')['NDataTable'] NDatePicker: typeof import('naive-ui')['NDatePicker'] - NDescription: typeof import('naive-ui')['NDescription'] + NDescriptionItem: typeof import('naive-ui')['NDescriptionItem'] NDescriptions: typeof import('naive-ui')['NDescriptions'] NDescriptionsItem: typeof import('naive-ui')['NDescriptionsItem'] NDialogProvider: typeof import('naive-ui')['NDialogProvider'] @@ -165,7 +170,5 @@ declare module 'vue' { TinymceEditor: typeof import('./../components/custom/tinymce-editor.vue')['default'] UserSelect: typeof import('./../components/custom/user-select.vue')['default'] WaveBg: typeof import('./../components/custom/wave-bg.vue')['default'] - WorkflowCategorySelect: typeof import('./../components/custom/workflow/workflow-category-select.vue')['default'] - WorkflowTaskApplyModal: typeof import('./../components/custom/workflow/workflow-task-apply-modal.vue')['default'] } } diff --git a/src/views/workflow/task/all-task-waiting/index.vue b/src/views/workflow/task/all-task-waiting/index.vue index 47eb8b64..07d502d7 100644 --- a/src/views/workflow/task/all-task-waiting/index.vue +++ b/src/views/workflow/task/all-task-waiting/index.vue @@ -19,9 +19,6 @@ interface WaitingStatusOption { value: boolean; } -// Create a union type to handle both Task and HisTask -type TaskOrHisTask = Api.Workflow.Task | Api.Workflow.HisTask; - defineOptions({ name: 'ProcessInstanceList' }); @@ -30,7 +27,7 @@ useDict('wf_business_status'); useDict('wf_task_status'); const appStore = useAppStore(); const { bool: viewVisible, setTrue: showViewDrawer } = useBoolean(false); - +const { bool: interveneVisible, setTrue: showInterveneDrawer } = useBoolean(false); const dynamicComponent = shallowRef(); const waitingStatus = ref(true); @@ -39,7 +36,7 @@ const waitingStatusOptions = ref([ { label: '已办任务', value: false } ]); -const commonColumns: NaiveUI.TableColumn[] = [ +const commonColumns: NaiveUI.TableColumn[] = [ { type: 'selection', align: 'center', width: 50 }, { key: 'flowName', title: '流程定义名称', align: 'center', width: 120 }, { key: 'flowCode', title: '流程定义编码', align: 'center', width: 120 }, @@ -82,7 +79,13 @@ const waitingColumns = ref[]>([ const finishColumns = ref[]>([ ...(commonColumns as NaiveUI.TableColumn[]), - { key: 'approveName', title: '办理人', align: 'center', width: 120 }, + { + key: 'approveName', + title: '办理人', + align: 'center', + width: 120, + render: row => {row.approveName} + }, { key: 'flowTaskStatus', title: '任务状态', @@ -93,7 +96,7 @@ const finishColumns = ref[]>([ { key: 'createTime', title: '创建时间', align: 'center', width: 120 } ]); -const operateColumns = ref[]>([ +const operateColumns = ref[]>([ { key: 'operate', title: $t('common.operate'), @@ -112,7 +115,15 @@ const operateColumns = ref[]>([ ]; if (waitingStatus.value) { - buttons.push(); + buttons.push( + handleIntervene(row)} + /> + ); } return ( @@ -149,7 +160,7 @@ const { }, columns: () => { const baseColumns = waitingStatus.value ? waitingColumns.value : finishColumns.value; - return [...baseColumns, ...operateColumns.value] as NaiveUI.TableColumn[]; + return [...baseColumns, ...operateColumns.value] as NaiveUI.TableColumn[]; } }); @@ -200,7 +211,7 @@ function handleResetSearch() { const modules = import.meta.glob('@/components/custom/workflow/**/*.vue'); const businessId = ref(); -async function handleView(row: TaskOrHisTask) { +async function handleView(row: Api.Workflow.TaskOrHisTask) { businessId.value = row.businessId; const formPath = row.formPath; if (formPath) { @@ -208,6 +219,12 @@ async function handleView(row: TaskOrHisTask) { showViewDrawer(); } } + +const interveneRowData = ref(); +function handleIntervene(row: Api.Workflow.TaskOrHisTask) { + interveneRowData.value = row; + showInterveneDrawer(); +}