From c9a6f7cbb5209415e626df29c7572cf40fe92b66 Mon Sep 17 00:00:00 2001 From: houzhongjian <houzhongyi@126.com> Date: 星期一, 06 一月 2025 11:44:50 +0800 Subject: [PATCH] 1、工作流程功能优化,解决流程图模拟功能simulation不生效的bug 2、system menu等页面修改 3、Footer copyright年份修改为动态 --- src/components/SimpleProcessDesignerV2/src/node.ts | 31 +++++++++++++++++++++++++++---- 1 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/components/SimpleProcessDesignerV2/src/node.ts b/src/components/SimpleProcessDesignerV2/src/node.ts index 4cbac6e..282e81b 100644 --- a/src/components/SimpleProcessDesignerV2/src/node.ts +++ b/src/components/SimpleProcessDesignerV2/src/node.ts @@ -1,4 +1,3 @@ -import { cloneDeep } from 'lodash-es' import { TaskStatusEnum } from '@/api/bpm/task' import * as RoleApi from '@/api/system/role' import * as DeptApi from '@/api/system/dept' @@ -14,7 +13,7 @@ NODE_DEFAULT_NAME, AssignStartUserHandlerType, AssignEmptyHandlerType, - FieldPermissionType, + FieldPermissionType } from './consts' import { parseFormFields } from '@/components/FormCreate/src/utils/index' export function useWatchNode(props: { flowNode: SimpleFlowNode }): Ref<SimpleFlowNode> { @@ -52,9 +51,33 @@ const getNodeConfigFormFields = (nodeFormFields?: Array<Record<string, string>>) => { nodeFormFields = toRaw(nodeFormFields) - fieldsPermissionConfig.value = - cloneDeep(nodeFormFields) || getDefaultFieldsPermission(unref(formFields)) + if (!nodeFormFields || nodeFormFields.length === 0) { + fieldsPermissionConfig.value = getDefaultFieldsPermission(unref(formFields)) + } else { + fieldsPermissionConfig.value = mergeFieldsPermission(nodeFormFields, unref(formFields)) + } } + // 合并已经设置的表单字段权限,当前流程表单字段 (可能新增,或删除了字段) + const mergeFieldsPermission = ( + formFieldsPermisson: Array<Record<string, string>>, + formFields?: string[] + ) => { + let mergedFieldsPermission: Array<Record<string, any>> = [] + if (formFields) { + mergedFieldsPermission = parseFormCreateFields(formFields).map((item) => { + const found = formFieldsPermisson.find( + (fieldPermission) => fieldPermission.field == item.field + ) + return { + field: item.field, + title: item.title, + permission: found ? found.permission : defaultPermission + } + }) + } + return mergedFieldsPermission + } + // 默认的表单权限: 获取表单的所有字段,设置字段默认权限为只读 const getDefaultFieldsPermission = (formFields?: string[]) => { let defaultFieldsPermission: Array<Record<string, any>> = [] -- Gitblit v1.9.3