From 98e9ba49ae5c00df54c38cd1ffbcfc662ec611c6 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 2 Nov 2024 11:58:34 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E3=80=91=E5=B7=A5=E4=BD=9C=E6=B5=81=EF=BC=9A=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E5=AE=A1=E6=89=B9=E8=AF=A6=E6=83=85=E7=9A=84=E2=80=9C=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E8=AE=B0=E5=BD=95=E2=80=9D=EF=BC=8C=E4=BB=8E=20timeli?= =?UTF-8?q?ne=20=E6=94=B9=E6=88=90=20list=20table?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../detail/ProcessInstanceTaskList.vue | 173 ++++++------------ .../bpm/processInstance/detail/index.vue | 55 +----- 2 files changed, 67 insertions(+), 161 deletions(-) diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceTaskList.vue b/src/views/bpm/processInstance/detail/ProcessInstanceTaskList.vue index b164f337..8690e58f 100644 --- a/src/views/bpm/processInstance/detail/ProcessInstanceTaskList.vue +++ b/src/views/bpm/processInstance/detail/ProcessInstanceTaskList.vue @@ -1,71 +1,49 @@ diff --git a/src/views/bpm/processInstance/detail/index.vue b/src/views/bpm/processInstance/detail/index.vue index 9890f698..24c1ddda 100644 --- a/src/views/bpm/processInstance/detail/index.vue +++ b/src/views/bpm/processInstance/detail/index.vue @@ -65,7 +65,7 @@ - + @@ -96,12 +96,7 @@
- +
@@ -135,14 +130,14 @@ import { BpmModelType } from '@/utils/constants' import { setConfAndFields2 } from '@/utils/formCreate' import type { ApiAttrs } from '@form-create/element-ui/types/config' import * as ProcessInstanceApi from '@/api/bpm/processInstance' -import * as TaskApi from '@/api/bpm/task' +import * as UserApi from '@/api/system/user' import ProcessInstanceBpmnViewer from './ProcessInstanceBpmnViewer.vue' import ProcessInstanceSimpleViewer from './ProcessInstanceSimpleViewer.vue' import ProcessInstanceTaskList from './ProcessInstanceTaskList.vue' import ProcessInstanceOperationButton from './ProcessInstanceOperationButton.vue' import ProcessInstanceTimeline from './ProcessInstanceTimeline.vue' -import * as UserApi from '@/api/system/user' import { FieldPermissionType } from '@/components/SimpleProcessDesignerV2/src/consts' +// TODO 代码优化,换个明确的 icon 名字 import audit1 from '@/assets/svgs/bpm/audit1.svg' import audit2 from '@/assets/svgs/bpm/audit2.svg' import audit3 from '@/assets/svgs/bpm/audit3.svg' @@ -158,11 +153,8 @@ const message = useMessage() // 消息弹窗 const processInstanceLoading = ref(false) // 流程实例的加载中 const processInstance = ref({}) // 流程实例 const processDefinition = ref({}) // 流程定义 -const timelineRef = ref() -// 操作按钮组件 ref -const operationButtonRef = ref() -const tasksLoad = ref(true) // 任务的加载中 -const tasks = ref([]) // 任务列表 + +const operationButtonRef = ref() // 操作按钮组件 ref const auditIcons = { 1: audit1, 2: audit2, @@ -180,10 +172,7 @@ const detailForm = ref({ /** 获得详情 */ const getDetail = () => { - // 1. 获取审批详情 getApprovalDetail() - // 2. 获得流程任务列表 - getTaskList() } /** 加载流程实例 */ @@ -269,38 +258,6 @@ const setFieldPermission = (field: string, permission: string) => { } } -/** 加载任务列表 */ -const getTaskList = async () => { - try { - // 获得未取消的任务 - tasksLoad.value = true - const data = await TaskApi.getTaskListByProcessInstanceId(props.id) - tasks.value = [] - // 1.1 移除已取消的审批 - data.forEach((task: any) => { - if (task.status !== 4) { - tasks.value.push(task) - } - }) - // 1.2 排序,将未完成的排在前面,已完成的排在后面; - tasks.value.sort((a, b) => { - // 有已完成的情况,按照完成时间倒序 - if (a.endTime && b.endTime) { - return b.endTime - a.endTime - } else if (a.endTime) { - return 1 - } else if (b.endTime) { - return -1 - // 都是未完成,按照创建时间倒序 - } else { - return b.createTime - a.createTime - } - }) - } finally { - tasksLoad.value = false - } -} - /** * 操作成功后刷新 */