Merge branch 'feature/bpm' of https://gitee.com/yudaocode/yudao-ui-admin-vue3 into feature/bpm

pull/686/head
jason 2025-01-26 14:34:47 +08:00
commit 62ad543163
4 changed files with 36 additions and 11 deletions

View File

@ -106,14 +106,16 @@ export function useFormFieldsPermission(defaultPermission: FieldPermissionType)
getNodeConfigFormFields getNodeConfigFormFields
} }
} }
/** /**
* @description * @description
*/ */
export function useFormFields() { export function useFormFields() {
const formFields = inject<Ref<string[]>>('formFields', ref([])) // 流程表单字段 const formFields = inject<Ref<string[]>>('formFields', ref([])) // 流程表单字段
return parseFormCreateFields(unref(formFields)) return parseFormCreateFields(unref(formFields))
} }
// TODO @芋艿:后续需要把各种类似 useFormFieldsPermission 的逻辑,抽成一个通用方法。
/** /**
* @description * @description
*/ */
@ -155,19 +157,19 @@ export type UserTaskFormType = {
taskCreateListenerEnable?: boolean taskCreateListenerEnable?: boolean
taskCreateListenerPath?: string taskCreateListenerPath?: string
taskCreateListener?: { taskCreateListener?: {
header: HttpRequestParam[], header: HttpRequestParam[]
body: HttpRequestParam[] body: HttpRequestParam[]
} }
taskAssignListenerEnable?: boolean taskAssignListenerEnable?: boolean
taskAssignListenerPath?: string taskAssignListenerPath?: string
taskAssignListener?: { taskAssignListener?: {
header: HttpRequestParam[], header: HttpRequestParam[]
body: HttpRequestParam[] body: HttpRequestParam[]
} }
taskCompleteListenerEnable?: boolean taskCompleteListenerEnable?: boolean
taskCompleteListenerPath?: string taskCompleteListenerPath?: string
taskCompleteListener?:{ taskCompleteListener?: {
header: HttpRequestParam[], header: HttpRequestParam[]
body: HttpRequestParam[] body: HttpRequestParam[]
} }
signEnable: boolean signEnable: boolean

View File

@ -307,6 +307,18 @@ const remainingRouter: AppRouteRecordRaw[] = [
activityId: route.query.activityId activityId: route.query.activityId
}) })
}, },
{
path: 'process-instance/report',
component: () => import('@/views/bpm/processInstance/report/index.vue'),
name: 'BpmProcessInstanceReport',
meta: {
noCache: true,
hidden: true,
canTo: true,
title: '数据报表',
activeMenu: '/bpm/manager/model'
}
},
{ {
path: 'oa/leave/create', path: 'oa/leave/create',
component: () => import('@/views/bpm/oa/leave/create.vue'), component: () => import('@/views/bpm/oa/leave/create.vue'),

View File

@ -194,7 +194,10 @@
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item <el-dropdown-item
command="handleReport" command="handleReport"
v-if="checkPermi(['bpm:model:report']) && scope.row.processDefinition" v-if="
checkPermi(['bpm:process-instance:manager-query']) &&
scope.row.processDefinition
"
:disabled="!isManagerUser(scope.row)" :disabled="!isManagerUser(scope.row)"
> >
报表 报表

View File

@ -72,7 +72,7 @@
:label="item.title" :label="item.title"
:prop="item.field" :prop="item.field"
> >
<!-- TODO 目前只支持input类型的字符串搜索 --> <!-- TODO @lesan目前只支持input类型的字符串搜索 -->
<el-input <el-input
:disabled="item.type !== 'input'" :disabled="item.type !== 'input'"
v-model="queryParams.formFieldsParams[item.field]" v-model="queryParams.formFieldsParams[item.field]"
@ -120,11 +120,12 @@
:prop="item.field" :prop="item.field"
width="120" width="120"
> >
<!-- TODO 可以根据formField的type进行展示方式的控制现在全部以字符串 --> <!-- TODO @lesan可以根据formField的type进行展示方式的控制现在全部以字符串 -->
<template #default="scope"> <template #default="scope">
{{ scope.row.formVariables[item.field] ?? '' }} {{ scope.row.formVariables[item.field] ?? '' }}
</template> </template>
</el-table-column> </el-table-column>
<!-- TODO @lesan可能要类似 manager 加个详情和取消 -->
</el-table> </el-table>
<!-- 分页 --> <!-- 分页 -->
<Pagination <Pagination
@ -170,9 +171,10 @@ const userList = ref<any[]>([]) // 用户列表
const getList = async () => { const getList = async () => {
loading.value = true loading.value = true
try { try {
let queryParamsClone = { ...queryParams } const data = await ProcessInstanceApi.getProcessInstanceManagerPage({
queryParamsClone.formFieldsParams = JSON.stringify(queryParamsClone.formFieldsParams) ...queryParams,
const data = await ProcessInstanceApi.getProcessInstanceManagerPage(queryParamsClone) formFieldsParams: JSON.stringify(queryParams.formFieldsParams)
})
list.value = data.list list.value = data.list
total.value = data.total total.value = data.total
} finally { } finally {
@ -180,11 +182,13 @@ const getList = async () => {
} }
} }
/** 获取流程定义 */
const getProcessDefinition = async () => { const getProcessDefinition = async () => {
const processDefinition = await DefinitionApi.getProcessDefinition(processDefinitionId) const processDefinition = await DefinitionApi.getProcessDefinition(processDefinitionId)
formFields.value = parseFormCreateFields(processDefinition.formFields) formFields.value = parseFormCreateFields(processDefinition.formFields)
} }
/** 解析表单字段 */
const parseFormCreateFields = (formFields?: string[]) => { const parseFormCreateFields = (formFields?: string[]) => {
const result: Array<Record<string, any>> = [] const result: Array<Record<string, any>> = []
if (formFields) { if (formFields) {
@ -202,6 +206,7 @@ const handleQuery = () => {
} }
/** 重置按钮操作 */ /** 重置按钮操作 */
// TODO @lesan search
const resetQuery = () => { const resetQuery = () => {
queryFormRef.value.resetFields() queryFormRef.value.resetFields()
queryFormRef.value.formFieldsParams = {} queryFormRef.value.formFieldsParams = {}
@ -210,8 +215,11 @@ const resetQuery = () => {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
// table column
await getProcessDefinition() await getProcessDefinition()
//
await getList() await getList()
//
userList.value = await UserApi.getSimpleUserList() userList.value = await UserApi.getSimpleUserList()
}) })
</script> </script>