【功能优化】BPM:我的流程,优化“流程状态”的展示

This commit is contained in:
YunaiV 2025-03-01 19:58:49 +08:00
parent 986d1cdfc2
commit f974bf236e

View File

@ -24,9 +24,7 @@
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
</el-form-item> </el-form-item>
<!-- TODO @ tuitujistyle 可以使用 unocss --> <el-form-item label="" prop="category" class="absolute right-[300px]">
<el-form-item label="" prop="category" :style="{ position: 'absolute', right: '300px' }">
<!-- TODO @tuituji应该选择好分类就触发搜索啦 RE:done & to check-->
<el-select <el-select
v-model="queryParams.category" v-model="queryParams.category"
placeholder="请选择流程分类" placeholder="请选择流程分类"
@ -43,7 +41,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="" prop="status" :style="{ position: 'absolute', right: '130px' }"> <el-form-item label="" prop="status" class="absolute right-[130px]">
<el-select <el-select
v-model="queryParams.status" v-model="queryParams.status"
placeholder="请选择流程状态" placeholder="请选择流程状态"
@ -61,8 +59,7 @@
</el-form-item> </el-form-item>
<!-- 高级筛选 --> <!-- 高级筛选 -->
<!-- TODO @ tuitujistyle 可以使用 unocss --> <el-form-item class="absolute right-0">
<el-form-item :style="{ position: 'absolute', right: '0px' }">
<el-popover <el-popover
:visible="showPopover" :visible="showPopover"
persistent persistent
@ -75,24 +72,9 @@
<Icon icon="ep:plus" class="mr-5px" />高级筛选 <Icon icon="ep:plus" class="mr-5px" />高级筛选
</el-button> </el-button>
</template> </template>
<!-- <el-form-item label="流程发起人" class="bold-label" label-position="top" prop="category">
<el-select
v-model="queryParams.category"
placeholder="请选择流程发起人"
clearable
class="!w-390px"
>
<el-option
v-for="category in categoryList"
:key="category.code"
:label="category.name"
:value="category.code"
/>
</el-select>
</el-form-item> -->
<el-form-item <el-form-item
label="所属流程" label="所属流程"
class="bold-label" class="font-bold"
label-position="top" label-position="top"
prop="processDefinitionKey" prop="processDefinitionKey"
> >
@ -104,7 +86,7 @@
class="!w-390px" class="!w-390px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="发起时间" class="bold-label" label-position="top" prop="createTime"> <el-form-item label="发起时间" class="font-bold" label-position="top" prop="createTime">
<el-date-picker <el-date-picker
v-model="queryParams.createTime" v-model="queryParams.createTime"
value-format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"
@ -115,11 +97,12 @@
class="!w-240px" class="!w-240px"
/> />
</el-form-item> </el-form-item>
<!-- TODO tuituiji参考钉钉1按照清空取消确认排序2右对齐3确认增加 primary --> <el-form-item class="font-bold" label-position="top">
<el-form-item class="bold-label" label-position="top"> <div class="flex justify-end w-full">
<el-button @click="handleQuery"> 确认</el-button> <el-button @click="resetQuery">清空</el-button>
<el-button @click="showPopover = false"> 取消</el-button> <el-button @click="showPopover = false">取消</el-button>
<el-button @click="resetQuery"> 清空</el-button> <el-button type="primary" @click="handleQuery">确认</el-button>
</div>
</el-form-item> </el-form-item>
</el-popover> </el-popover>
</el-form-item> </el-form-item>
@ -146,11 +129,37 @@
min-width="100" min-width="100"
fixed="left" fixed="left"
/> />
<!-- TODO @芋艿摘要 --> <el-table-column label="流程状态" prop="status" min-width="200">
<!-- TODO tuituiji参考钉钉1审批中时展示审批任务2非审批中展示状态 -->
<el-table-column label="流程状态" prop="status" width="120">
<template #default="scope"> <template #default="scope">
<dict-tag :type="DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS" :value="scope.row.status" /> <!-- 审批中状态 -->
<template
v-if="
scope.row.status === BpmProcessInstanceStatus.RUNNING && scope.row.tasks?.length > 0
"
>
<!-- 单人审批 -->
<template v-if="scope.row.tasks.length === 1">
<span>
<el-button link type="primary" @click="handleDetail(scope.row)">
{{ scope.row.tasks[0].assigneeUser?.nickname }}
</el-button>
({{ scope.row.tasks[0].name }}) 审批中
</span>
</template>
<!-- 多人审批 -->
<template v-else>
<span>
<el-button link type="primary" @click="handleDetail(scope.row)">
{{ scope.row.tasks[0].assigneeUser?.nickname }}
</el-button>
{{ scope.row.tasks.length }} ({{ scope.row.tasks[0].name }})审批中
</span>
</template>
</template>
<!-- 非审批中状态 -->
<template v-else>
<dict-tag :type="DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS" :value="scope.row.status" />
</template>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -167,19 +176,6 @@
width="180" width="180"
:formatter="dateFormatter" :formatter="dateFormatter"
/> />
<!--<el-table-column align="center" label="耗时" prop="durationInMillis" width="160">
<template #default="scope">
{{ scope.row.durationInMillis > 0 ? formatPast2(scope.row.durationInMillis) : '-' }}
</template>
</el-table-column>
<el-table-column label="当前审批任务" align="center" prop="tasks" min-width="120px">
<template #default="scope">
<el-button type="primary" v-for="task in scope.row.tasks" :key="task.id" link>
<span>{{ task.name }}</span>
</el-button>
</template>
</el-table-column>
-->
<el-table-column label="操作" align="center" fixed="right" width="180"> <el-table-column label="操作" align="center" fixed="right" width="180">
<template #default="scope"> <template #default="scope">
<el-button <el-button
@ -215,7 +211,6 @@
</ContentWrap> </ContentWrap>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
// TODO @tuitujiList <Icon icon="ep:plus" class="mr-5px" /> RE:done & to check
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import { ElMessageBox } from 'element-plus' import { ElMessageBox } from 'element-plus'
@ -223,6 +218,7 @@ import * as ProcessInstanceApi from '@/api/bpm/processInstance'
import { CategoryApi, CategoryVO } from '@/api/bpm/category' import { CategoryApi, CategoryVO } from '@/api/bpm/category'
import { ProcessInstanceVO } from '@/api/bpm/processInstance' import { ProcessInstanceVO } from '@/api/bpm/processInstance'
import * as DefinitionApi from '@/api/bpm/definition' import * as DefinitionApi from '@/api/bpm/definition'
import { BpmProcessInstanceStatus } from '@/utils/constants'
defineOptions({ name: 'BpmProcessInstanceMy' }) defineOptions({ name: 'BpmProcessInstanceMy' })
@ -244,6 +240,7 @@ const queryParams = reactive({
}) })
const queryFormRef = ref() // const queryFormRef = ref() //
const categoryList = ref<CategoryVO[]>([]) // const categoryList = ref<CategoryVO[]>([]) //
const showPopover = ref(false) //
/** 查询列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {
@ -257,8 +254,6 @@ const getList = async () => {
} }
} }
const showPopover = ref(false)
/** 搜索按钮操作 */ /** 搜索按钮操作 */
const handleQuery = () => { const handleQuery = () => {
queryParams.pageNo = 1 queryParams.pageNo = 1
@ -327,8 +322,3 @@ onMounted(async () => {
categoryList.value = await CategoryApi.getCategorySimpleList() categoryList.value = await CategoryApi.getCategorySimpleList()
}) })
</script> </script>
<style>
.bold-label .el-form-item__label {
font-weight: bold; /* 将字体加粗 */
}
</style>