From 9b605121655a6693786350e073e06da48b8687cc Mon Sep 17 00:00:00 2001 From: AN <1983933789@qq.com> Date: Thu, 4 Sep 2025 14:09:05 +0800 Subject: [PATCH] =?UTF-8?q?feat(projects):=20=E6=B5=81=E7=A8=8B=E5=AE=9E?= =?UTF-8?q?=E4=BE=8B=E6=B7=BB=E5=8A=A0=E5=8F=98=E9=87=8F=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/service/api/workflow/instance.ts | 17 ++++ src/typings/api/workflow.api.d.ts | 28 ++++-- src/views/workflow/process-instance/index.vue | 24 +++-- .../process-instance-variable-modal.vue | 89 ++++++++++++++++++- 4 files changed, 142 insertions(+), 16 deletions(-) diff --git a/src/service/api/workflow/instance.ts b/src/service/api/workflow/instance.ts index dbb9351f..fb106777 100644 --- a/src/service/api/workflow/instance.ts +++ b/src/service/api/workflow/instance.ts @@ -59,3 +59,20 @@ export function fetchGetMyDocument(data: Api.Workflow.InstanceSearchParams) { params: data }); } + +/** 更新流程变量信息 */ +export function fetchUpdateInstanceVariable(data: Api.Workflow.InstanceVariableOperateParams) { + return request({ + url: '/workflow/instance/updateVariable', + method: 'put', + data + }); +} + +/** 获取流程变量信息 */ +export function fetchGetInstanceVariable(instanceId: CommonType.IdType) { + return request({ + url: `/workflow/instance/instanceVariable/${instanceId}`, + method: 'get' + }); +} diff --git a/src/typings/api/workflow.api.d.ts b/src/typings/api/workflow.api.d.ts index 29bd124f..5a08ce4e 100644 --- a/src/typings/api/workflow.api.d.ts +++ b/src/typings/api/workflow.api.d.ts @@ -175,6 +175,23 @@ declare namespace Api { /** definition list */ type DefinitionList = Api.Common.PaginatingQueryRecord; + type InstanceVariable = CommonType.RecordNullable<{ + key: string; + value: string; + }>; + + type InstanceVariableOperateParams = CommonType.RecordNullable<{ + instanceId: CommonType.IdType; + }> & + InstanceVariable; + + type InstanceVariableInfo = CommonType.RecordNullable<{ + /** 键 */ + variable: string; + /** 值 */ + variableList: InstanceVariable[]; + }>; + /** 节点类型 */ type WorkflowNodeType = 0 | 1 | 2 | 3 | 4; @@ -199,6 +216,10 @@ declare namespace Api { flowCode: string; /** 业务ID */ businessId: CommonType.IdType; + /** 业务编码 */ + businessCode: string; + /** 业务名称 */ + businessName: string; /** 节点类型 */ nodeType: WorkflowNodeType; /** 节点编码 */ @@ -221,15 +242,8 @@ declare namespace Api { ext: string; /** 流程定义版本 */ version: string; - /** 创建者 */ - createBy: string; /** 创建者名称 */ createByName: string; - /** 创建时间 */ - createTime: string; - - /** 更新时间 */ - updateTime: string; /** 删除标志 */ delFlag: number; }>; diff --git a/src/views/workflow/process-instance/index.vue b/src/views/workflow/process-instance/index.vue index fe656e88..2a41f1a0 100644 --- a/src/views/workflow/process-instance/index.vue +++ b/src/views/workflow/process-instance/index.vue @@ -67,6 +67,18 @@ const baseColumns = ref[]>([ align: 'center', width: 48 }, + { + key: 'businessCode', + title: '业务编码', + align: 'center', + width: 120 + }, + { + key: 'businessName', + title: '业务名称', + align: 'center', + width: 120 + }, { key: 'flowName', title: '流程名称', @@ -109,7 +121,7 @@ const baseColumns = ref[]>([ key: 'activityStatus', title: '状态', align: 'center', - minWidth: 100, + minWidth: 80, render(row) { return ( @@ -122,7 +134,7 @@ const baseColumns = ref[]>([ key: 'flowStatus', title: '流程状态', align: 'center', - minWidth: 100, + minWidth: 80, render(row) { return ; } @@ -242,7 +254,7 @@ const { : [...baseColumns.value, ...finishColumns.value, ...operateColumns.value] }); -const { checkedRowKeys, editingData, handleEdit, onBatchDeleted, onDeleted } = useTableOperate(data, getData); +const { checkedRowKeys, onBatchDeleted, onDeleted } = useTableOperate(data, getData); // 监听运行状态变化 watch(runningStatus, async () => { const newApiFn = runningStatus.value ? fetchGetRunningInstanceList : fetchGetFinishedInstanceList; @@ -256,7 +268,7 @@ const categoryPattern = ref(); const categoryData = ref([]); const selectedKeys = ref([]); const expandedKeys = ref(['100']); - +const instanceRowId = ref(); const selectable = computed(() => { return !loading.value; }); @@ -312,7 +324,7 @@ async function handleCancel(instanceId: CommonType.IdType) { } async function handleShowVariable(id: CommonType.IdType) { - handleEdit('id', id); + instanceRowId.value = id; showVariableDrawer(); } @@ -409,7 +421,7 @@ async function handlePreview(row: Api.Workflow.Instance) { class="sm:h-full" /> - + diff --git a/src/views/workflow/process-instance/modules/process-instance-variable-modal.vue b/src/views/workflow/process-instance/modules/process-instance-variable-modal.vue index 1c5eb9b1..6c3cb46a 100644 --- a/src/views/workflow/process-instance/modules/process-instance-variable-modal.vue +++ b/src/views/workflow/process-instance/modules/process-instance-variable-modal.vue @@ -1,23 +1,88 @@