Merge branch 'feature/bpm' of https://gitee.com/yudaocode/yudao-ui-admin-vue3 into feature/bpm
commit
62ad543163
|
@ -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
|
||||
|
|
|
@ -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'),
|
||||
|
|
|
@ -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)"
|
||||
>
|
||||
报表
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue