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

View File

@ -307,6 +307,18 @@ const remainingRouter: AppRouteRecordRaw[] = [
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',
component: () => import('@/views/bpm/oa/leave/create.vue'),

View File

@ -194,7 +194,10 @@
</el-dropdown-item>
<el-dropdown-item
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)"
>
报表

View File

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