From c27685285a6dfac271b4337f46ab6c5067624cee Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 17 Oct 2023 19:50:09 +0800 Subject: [PATCH] =?UTF-8?q?code=20review=EF=BC=9A=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=E7=9A=84=E5=AE=A1=E6=89=B9=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProcessInstanceChildrenTaskList.vue | 49 +++++++++---------- .../detail/TaskAddSignDialogForm.vue | 12 ++--- 2 files changed, 29 insertions(+), 32 deletions(-) diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceChildrenTaskList.vue b/src/views/bpm/processInstance/detail/ProcessInstanceChildrenTaskList.vue index f162d1fb..363874cf 100644 --- a/src/views/bpm/processInstance/detail/ProcessInstanceChildrenTaskList.vue +++ b/src/views/bpm/processInstance/detail/ProcessInstanceChildrenTaskList.vue @@ -1,13 +1,20 @@ @@ -53,12 +59,11 @@ import { DICT_TYPE } from '@/utils/dict' import { dateFormatter } from '@/utils/formatTime' import TaskSubSignDialogForm from './TaskSubSignDialogForm.vue' -const message = useMessage() // 消息弹窗 -defineOptions({ name: 'ProcessInstancechildrenList' }) +defineOptions({ name: 'ProcessInstanceChildrenTaskList' }) +const message = useMessage() // 消息弹窗 const drawerVisible = ref(false) // 抽屉的是否展示 -const tableData = ref([]) //表格数据 const baseTask = ref({}) /** 打开弹窗 */ const open = async (task: any) => { @@ -67,30 +72,22 @@ const open = async (task: any) => { return } baseTask.value = task - //设置表格数据 - tableData.value = task.children - //展开抽屉 + // 展开抽屉 drawerVisible.value = true } defineExpose({ open }) // 提供 openModal 方法,用于打开弹窗 -const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 - -/** - * 减签 - */ +/** 发起减签 */ const taskSubSignDialogForm = ref() const handleSubSign = (item) => { taskSubSignDialogForm.value.open(item.id) + // TODO @海洋:减签后,需要刷新下界面哈 } -/** - * 显示减签按钮 - * @param task - */ -const showSubSignButton = (task:any) => { - if(!isEmpty(task.children)){ - //有子任务,且子任务有任意一个是 待处理 和 待前置任务完成 则显示减签按钮 +/** 是否显示减签按钮 */ +const isSubSignButtonVisible = (task: any) => { + if (task && task.children && !isEmpty(task.children)) { + // 有子任务,且子任务有任意一个是 待处理 和 待前置任务完成 则显示减签按钮 const subTask = task.children.find((item) => item.result === 1 || item.result === 9) return !isEmpty(subTask) } diff --git a/src/views/bpm/processInstance/detail/TaskAddSignDialogForm.vue b/src/views/bpm/processInstance/detail/TaskAddSignDialogForm.vue index 4b91c9b9..40cd200e 100644 --- a/src/views/bpm/processInstance/detail/TaskAddSignDialogForm.vue +++ b/src/views/bpm/processInstance/detail/TaskAddSignDialogForm.vue @@ -22,12 +22,12 @@