+
@@ -23,10 +23,19 @@
{{ scaleValue }}%
+ 重置
-
@@ -76,11 +85,51 @@ const emits = defineEmits<{
const processNodeTree = useWatchNode(props)
provide('readonly', props.readonly)
+
+// TODO 可优化:拖拽有点卡顿
+/** 拖拽、放大缩小等操作 */
let scaleValue = ref(100)
const MAX_SCALE_VALUE = 200
const MIN_SCALE_VALUE = 50
+const isDragging = ref(false)
+const startX = ref(0)
+const startY = ref(0)
+const currentX = ref(0)
+const currentY = ref(0)
+const initialX = ref(0)
+const initialY = ref(0)
+
+const setGrabCursor = () => {
+ document.body.style.cursor = 'grab'
+}
+
+const resetCursor = () => {
+ document.body.style.cursor = 'default'
+}
+
+const startDrag = (e: MouseEvent) => {
+ isDragging.value = true
+ startX.value = e.clientX - currentX.value
+ startY.value = e.clientY - currentY.value
+ setGrabCursor() // 设置小手光标
+}
+
+const onDrag = (e: MouseEvent) => {
+ if (!isDragging.value) return
+ e.preventDefault() // 禁用文本选择
+
+ // 使用 requestAnimationFrame 优化性能
+ requestAnimationFrame(() => {
+ currentX.value = e.clientX - startX.value
+ currentY.value = e.clientY - startY.value
+ })
+}
+
+const stopDrag = () => {
+ isDragging.value = false
+ resetCursor() // 重置光标
+}
-// 放大
const zoomIn = () => {
if (scaleValue.value == MAX_SCALE_VALUE) {
return
@@ -88,7 +137,6 @@ const zoomIn = () => {
scaleValue.value += 10
}
-// 缩小
const zoomOut = () => {
if (scaleValue.value == MIN_SCALE_VALUE) {
return
@@ -100,20 +148,15 @@ const processReZoom = () => {
scaleValue.value = 100
}
+const resetPosition = () => {
+ currentX.value = initialX.value
+ currentY.value = initialY.value
+}
+
+/** 校验节点设置 */
const errorDialogVisible = ref(false)
let errorNodes: SimpleFlowNode[] = []
-const saveSimpleFlowModel = async () => {
- errorNodes = []
- validateNode(processNodeTree.value, errorNodes)
- if (errorNodes.length > 0) {
- errorDialogVisible.value = true
- return
- }
- emits('save', processNodeTree.value)
-}
-
-// 校验节点设置。 暂时以 showText 为空 未节点错误配置
const validateNode = (node: SimpleFlowNode | undefined, errorNodes: SimpleFlowNode[]) => {
if (node) {
const { type, showText, conditionNodes } = node
@@ -193,6 +236,30 @@ const importLocalFile = () => {
}
}
}
+
+// 在组件初始化时记录初始位置
+onMounted(() => {
+ initialX.value = currentX.value
+ initialY.value = currentY.value
+})
-
+
diff --git a/src/components/SimpleProcessDesignerV2/src/SimpleProcessViewer.vue b/src/components/SimpleProcessDesignerV2/src/SimpleProcessViewer.vue
index abf73b481e110e7e55e65f82c13455235270ae1f..26cd43fd3866eeec7d7b78583f1eb2e497548354 100644
--- a/src/components/SimpleProcessDesignerV2/src/SimpleProcessViewer.vue
+++ b/src/components/SimpleProcessDesignerV2/src/SimpleProcessViewer.vue
@@ -45,4 +45,3 @@ watch(
provide('tasks', approveTasks)
provide('processInstance', currentProcessInstance)
-p
diff --git a/src/components/SimpleProcessDesignerV2/src/consts.ts b/src/components/SimpleProcessDesignerV2/src/consts.ts
index f0614eefa9a7ca5495da35c339b7301da2bd5a22..f564c3f06b4e2cf505b4207b2ff7da48413f94fb 100644
--- a/src/components/SimpleProcessDesignerV2/src/consts.ts
+++ b/src/components/SimpleProcessDesignerV2/src/consts.ts
@@ -23,6 +23,11 @@ export enum NodeType {
*/
COPY_TASK_NODE = 12,
+ /**
+ * 办理人节点
+ */
+ TRANSACTOR_NODE = 13,
+
/**
* 延迟器节点
*/
@@ -33,6 +38,11 @@ export enum NodeType {
*/
TRIGGER_NODE = 15,
+ /**
+ * 子流程节点
+ */
+ CHILD_PROCESS_NODE = 20,
+
/**
* 条件节点
*/
@@ -123,6 +133,8 @@ export interface SimpleFlowNode {
reasonRequire?: boolean
// 触发器设置
triggerSetting?: TriggerSetting
+ // 子流程
+ childProcessSetting?: ChildProcessSetting
}
// 候选人策略枚举 ( 用于审批节点。抄送节点 )
export enum CandidateStrategy {
@@ -150,6 +162,10 @@ export enum CandidateStrategy {
* 指定用户
*/
USER = 30,
+ /**
+ * 审批人自选
+ */
+ APPROVE_USER_SELECT = 34,
/**
* 发起人自选
*/
@@ -506,6 +522,8 @@ NODE_DEFAULT_TEXT.set(NodeType.START_USER_NODE, '请设置发起人')
NODE_DEFAULT_TEXT.set(NodeType.DELAY_TIMER_NODE, '请设置延迟器')
NODE_DEFAULT_TEXT.set(NodeType.ROUTER_BRANCH_NODE, '请设置路由节点')
NODE_DEFAULT_TEXT.set(NodeType.TRIGGER_NODE, '请设置触发器')
+NODE_DEFAULT_TEXT.set(NodeType.TRANSACTOR_NODE, '请设置办理人')
+NODE_DEFAULT_TEXT.set(NodeType.CHILD_PROCESS_NODE, '请设置子流程')
export const NODE_DEFAULT_NAME = new Map
()
NODE_DEFAULT_NAME.set(NodeType.USER_TASK_NODE, '审批人')
@@ -515,15 +533,20 @@ NODE_DEFAULT_NAME.set(NodeType.START_USER_NODE, '发起人')
NODE_DEFAULT_NAME.set(NodeType.DELAY_TIMER_NODE, '延迟器')
NODE_DEFAULT_NAME.set(NodeType.ROUTER_BRANCH_NODE, '路由分支')
NODE_DEFAULT_NAME.set(NodeType.TRIGGER_NODE, '触发器')
+NODE_DEFAULT_NAME.set(NodeType.TRANSACTOR_NODE, '办理人')
+NODE_DEFAULT_NAME.set(NodeType.CHILD_PROCESS_NODE, '子流程')
// 候选人策略。暂时不从字典中取。 后续可能调整。控制显示顺序
export const CANDIDATE_STRATEGY: DictDataVO[] = [
{ label: '指定成员', value: CandidateStrategy.USER },
{ label: '指定角色', value: CandidateStrategy.ROLE },
+ { label: '指定岗位', value: CandidateStrategy.POST },
{ label: '部门成员', value: CandidateStrategy.DEPT_MEMBER },
{ label: '部门负责人', value: CandidateStrategy.DEPT_LEADER },
{ label: '连续多级部门负责人', value: CandidateStrategy.MULTI_LEVEL_DEPT_LEADER },
+ { label: '指定岗位', value: CandidateStrategy.MULTI_LEVEL_DEPT_LEADER },
{ label: '发起人自选', value: CandidateStrategy.START_USER_SELECT },
+ { label: '审批人自选', value: CandidateStrategy.APPROVE_USER_SELECT },
{ label: '发起人本人', value: CandidateStrategy.START_USER },
{ label: '发起人部门负责人', value: CandidateStrategy.START_USER_DEPT_LEADER },
{ label: '发起人连续部门负责人', value: CandidateStrategy.START_USER_MULTI_LEVEL_DEPT_LEADER },
@@ -627,6 +650,16 @@ export const DEFAULT_BUTTON_SETTING: ButtonSetting[] = [
{ id: OperationButtonType.RETURN, displayName: '退回', enable: true }
]
+// 办理人默认的按钮权限设置
+export const TRANSACTOR_DEFAULT_BUTTON_SETTING: ButtonSetting[] = [
+ { id: OperationButtonType.APPROVE, displayName: '办理', enable: true },
+ { id: OperationButtonType.REJECT, displayName: '拒绝', enable: false },
+ { id: OperationButtonType.TRANSFER, displayName: '转办', enable: false },
+ { id: OperationButtonType.DELEGATE, displayName: '委派', enable: false },
+ { id: OperationButtonType.ADD_SIGN, displayName: '加签', enable: false },
+ { id: OperationButtonType.RETURN, displayName: '退回', enable: false }
+]
+
// 发起人的按钮权限。暂时定死,不可以编辑
export const START_USER_BUTTON_SETTING: ButtonSetting[] = [
{ id: OperationButtonType.APPROVE, displayName: '提交', enable: true },
@@ -717,7 +750,7 @@ export type RouterSetting = {
export type TriggerSetting = {
type: TriggerTypeEnum
httpRequestSetting?: HttpRequestTriggerSetting
- normalFormSetting?: NormalFormTriggerSetting
+ formSettings?: FormTriggerSetting[]
}
/**
@@ -729,9 +762,17 @@ export enum TriggerTypeEnum {
*/
HTTP_REQUEST = 1,
/**
- * 更新流程表单触发器
+ * 接收 HTTP 回调请求触发器
*/
- UPDATE_NORMAL_FORM = 2 // TODO @jason:FORM_UPDATE?
+ HTTP_CALLBACK = 2,
+ /**
+ * 表单数据更新触发器
+ */
+ FORM_UPDATE = 10,
+ /**
+ * 表单数据删除触发器
+ */
+ FORM_DELETE = 11
}
/**
@@ -751,12 +792,110 @@ export type HttpRequestTriggerSetting = {
/**
* 流程表单触发器配置结构定义
*/
-export type NormalFormTriggerSetting = {
- // 更新表单字段
+export type FormTriggerSetting = {
+ // 条件类型
+ conditionType?: ConditionType
+ // 条件表达式
+ conditionExpression?: string
+ // 条件组
+ conditionGroups?: ConditionGroup
+ // 更新表单字段配置
updateFormFields?: Record
+ // 删除表单字段配置
+ deleteFields?: string[]
}
export const TRIGGER_TYPES: DictDataVO[] = [
- { label: 'HTTP 请求', value: TriggerTypeEnum.HTTP_REQUEST },
- { label: '修改表单数据', value: TriggerTypeEnum.UPDATE_NORMAL_FORM }
+ { label: '发送 HTTP 请求', value: TriggerTypeEnum.HTTP_REQUEST },
+ { label: '接收 HTTP 回调', value: TriggerTypeEnum.HTTP_CALLBACK },
+ { label: '修改表单数据', value: TriggerTypeEnum.FORM_UPDATE },
+ { label: '删除表单数据', value: TriggerTypeEnum.FORM_DELETE }
+]
+
+/**
+ * 子流程节点结构定义
+ */
+export type ChildProcessSetting = {
+ calledProcessDefinitionKey: string
+ calledProcessDefinitionName: string
+ async: boolean
+ inVariables?: IOParameter[]
+ outVariables?: IOParameter[]
+ skipStartUserNode: boolean
+ startUserSetting: StartUserSetting
+ timeoutSetting: TimeoutSetting
+ multiInstanceSetting: MultiInstanceSetting
+}
+export type IOParameter = {
+ source: string
+ target: string
+}
+export type StartUserSetting = {
+ type: ChildProcessStartUserTypeEnum
+ formField?: string
+ emptyType?: ChildProcessStartUserEmptyTypeEnum
+}
+export type TimeoutSetting = {
+ enable: boolean
+ type?: DelayTypeEnum
+ timeExpression?: string
+}
+export type MultiInstanceSetting = {
+ enable: boolean
+ sequential?: boolean
+ approveRatio?: number
+ sourceType?: ChildProcessMultiInstanceSourceTypeEnum
+ source?: string
+}
+export enum ChildProcessStartUserTypeEnum {
+ /**
+ * 同主流程发起人
+ */
+ MAIN_PROCESS_START_USER = 1,
+ /**
+ * 表单
+ */
+ FROM_FORM = 2
+}
+export const CHILD_PROCESS_START_USER_TYPE = [
+ { label: '同主流程发起人', value: ChildProcessStartUserTypeEnum.MAIN_PROCESS_START_USER },
+ { label: '表单', value: ChildProcessStartUserTypeEnum.FROM_FORM }
+]
+export enum ChildProcessStartUserEmptyTypeEnum {
+ /**
+ * 同主流程发起人
+ */
+ MAIN_PROCESS_START_USER = 1,
+ /**
+ * 子流程管理员
+ */
+ CHILD_PROCESS_ADMIN = 2,
+ /**
+ * 主流程管理员
+ */
+ MAIN_PROCESS_ADMIN = 3
+}
+export const CHILD_PROCESS_START_USER_EMPTY_TYPE = [
+ { label: '同主流程发起人', value: ChildProcessStartUserEmptyTypeEnum.MAIN_PROCESS_START_USER },
+ { label: '子流程管理员', value: ChildProcessStartUserEmptyTypeEnum.CHILD_PROCESS_ADMIN },
+ { label: '主流程管理员', value: ChildProcessStartUserEmptyTypeEnum.MAIN_PROCESS_ADMIN }
+]
+export enum ChildProcessMultiInstanceSourceTypeEnum {
+ /**
+ * 固定数量
+ */
+ FIXED_QUANTITY = 1,
+ /**
+ * 数字表单
+ */
+ NUMBER_FORM = 2,
+ /**
+ * 多选表单
+ */
+ MULTIPLE_FORM = 3
+}
+export const CHILD_PROCESS_MULTI_INSTANCE_SOURCE_TYPE = [
+ { label: '固定数量', value: ChildProcessMultiInstanceSourceTypeEnum.FIXED_QUANTITY },
+ { label: '数字表单', value: ChildProcessMultiInstanceSourceTypeEnum.NUMBER_FORM },
+ { label: '多选表单', value: ChildProcessMultiInstanceSourceTypeEnum.MULTIPLE_FORM }
]
diff --git a/src/components/SimpleProcessDesignerV2/src/node.ts b/src/components/SimpleProcessDesignerV2/src/node.ts
index 407fd4837933520d8a3cbc907a37616ee107c138..5b754bfac57564a34094640b9b8095e2ae4c151a 100644
--- a/src/components/SimpleProcessDesignerV2/src/node.ts
+++ b/src/components/SimpleProcessDesignerV2/src/node.ts
@@ -15,7 +15,10 @@ import {
AssignEmptyHandlerType,
FieldPermissionType,
HttpRequestParam,
- ProcessVariableEnum
+ ProcessVariableEnum,
+ ConditionType,
+ ConditionGroup,
+ COMPARISON_OPERATORS
} from './consts'
import { parseFormFields } from '@/components/FormCreate/src/utils'
@@ -201,7 +204,7 @@ export function useNodeForm(nodeType: NodeType) {
const deptTreeOptions = inject('deptTree', ref()) // 部门树
const formFields = inject[>('formFields', ref([])) // 流程表单字段
const configForm = ref()
- if (nodeType === NodeType.USER_TASK_NODE) {
+ if (nodeType === NodeType.USER_TASK_NODE || nodeType === NodeType.TRANSACTOR_NODE) {
configForm.value = {
candidateStrategy: CandidateStrategy.USER,
approveMethod: ApproveMethodType.SEQUENTIAL_APPROVE,
@@ -307,6 +310,11 @@ export function useNodeForm(nodeType: NodeType) {
showText = `表单内部门负责人`
}
+ // 审批人自选
+ if (configForm.value?.candidateStrategy === CandidateStrategy.APPROVE_USER_SELECT) {
+ showText = `审批人自选`
+ }
+
// 发起人自选
if (configForm.value?.candidateStrategy === CandidateStrategy.START_USER_SELECT) {
showText = `发起人自选`
@@ -543,6 +551,66 @@ export function useTaskStatusClass(taskStatus: TaskStatusEnum | undefined): stri
if (taskStatus === TaskStatusEnum.CANCEL) {
return 'status-cancel'
}
-
return ''
}
+
+/** 条件组件文字展示 */
+export function getConditionShowText(
+ conditionType: ConditionType | undefined,
+ conditionExpression: string | undefined,
+ conditionGroups: ConditionGroup | undefined,
+ fieldOptions: Array>
+) {
+ let showText = ''
+ if (conditionType === ConditionType.EXPRESSION) {
+ if (conditionExpression) {
+ showText = `表达式:${conditionExpression}`
+ }
+ }
+ if (conditionType === ConditionType.RULE) {
+ // 条件组是否为与关系
+ const groupAnd = conditionGroups?.and
+ let warningMessage: undefined | string = undefined
+ const conditionGroup = conditionGroups?.conditions.map((item) => {
+ return (
+ '(' +
+ item.rules
+ .map((rule) => {
+ if (rule.leftSide && rule.rightSide) {
+ return (
+ getFormFieldTitle(fieldOptions, rule.leftSide) +
+ ' ' +
+ getOpName(rule.opCode) +
+ ' ' +
+ rule.rightSide
+ )
+ } else {
+ // 有一条规则不完善。提示错误
+ warningMessage = '请完善条件规则'
+ return ''
+ }
+ })
+ .join(item.and ? ' 且 ' : ' 或 ') +
+ ' ) '
+ )
+ })
+ if (warningMessage) {
+ showText = ''
+ } else {
+ showText = conditionGroup!.join(groupAnd ? ' 且 ' : ' 或 ')
+ }
+ }
+ return showText
+}
+
+/** 获取表单字段名称*/
+const getFormFieldTitle = (fieldOptions: Array>, field: string) => {
+ const item = fieldOptions.find((item) => item.field === field)
+ return item?.title
+}
+
+/** 获取操作符名称 */
+const getOpName = (opCode: string): string => {
+ const opName = COMPARISON_OPERATORS.find((item: any) => item.value === opCode)
+ return opName?.label
+}
diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/ChildProcessNodeConfig.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/ChildProcessNodeConfig.vue
new file mode 100644
index 0000000000000000000000000000000000000000..7ec382fca0dacf10ce8457e006d51f667bc1731c
--- /dev/null
+++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/ChildProcessNodeConfig.vue
@@ -0,0 +1,610 @@
+
+
+
+
+
+
+
+ ]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 添加一行
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 添加一行
+
+
+
+
+
+ {{ item.label }}
+
+
+
+
+
+
+ {{ item.label }}
+
+
+
+
+
+
+
+
+
+ 超时设置
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 后进入下一节点
+
+
+
+ 后进入下一节点
+
+
+
+ 多实例设置
+
+
+
+
+
+
+
+
+ 完成比例(%)
+
+
+
+ 多实例来源
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 确 定
+ 取 消
+
+
+
+
+
+
+
diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue
index e9b387a7ff5bdb3116d66cd6a876b519da901d56..9020d655e0f57ea7bde7cd2aba2e0116b55603c7 100644
--- a/src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue
+++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/ConditionNodeConfig.vue
@@ -43,15 +43,12 @@
diff --git a/src/components/SimpleProcessDesignerV2/src/nodes-config/components/HttpRequestParamSetting.vue b/src/components/SimpleProcessDesignerV2/src/nodes-config/components/HttpRequestParamSetting.vue
index 039e4c80dcbf2908f397622d32dfc6efa5f9640e..9a0a9feffe349a9fc7a8ecdd460b282321ab20c8 100644
--- a/src/components/SimpleProcessDesignerV2/src/nodes-config/components/HttpRequestParamSetting.vue
+++ b/src/components/SimpleProcessDesignerV2/src/nodes-config/components/HttpRequestParamSetting.vue
@@ -1,5 +1,5 @@
-
+
添加一行
-
+
+
+
diff --git a/src/components/SimpleProcessDesignerV2/src/nodes/ChildProcessNode.vue b/src/components/SimpleProcessDesignerV2/src/nodes/ChildProcessNode.vue
new file mode 100644
index 0000000000000000000000000000000000000000..0b362446daced6e9293ccef95b96f25b8c0af83c
--- /dev/null
+++ b/src/components/SimpleProcessDesignerV2/src/nodes/ChildProcessNode.vue
@@ -0,0 +1,106 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{ currentNode.name }}
+
+
+
+
+ {{ currentNode.showText }}
+
+
+ {{ NODE_DEFAULT_TEXT.get(NodeType.CHILD_PROCESS_NODE) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/SimpleProcessDesignerV2/src/nodes/UserTaskNode.vue b/src/components/SimpleProcessDesignerV2/src/nodes/UserTaskNode.vue
index 47ef540cc9e1229db7d2986ff42eff60fb6db84e..ae1af6c287957627fcdc5b0febe729ad618593be 100644
--- a/src/components/SimpleProcessDesignerV2/src/nodes/UserTaskNode.vue
+++ b/src/components/SimpleProcessDesignerV2/src/nodes/UserTaskNode.vue
@@ -9,7 +9,14 @@
]"
>
-
+
+
+
+
- {{ NODE_DEFAULT_TEXT.get(NodeType.USER_TASK_NODE) }}
+ {{ NODE_DEFAULT_TEXT.get(currentNode.type) }}
diff --git a/src/components/SimpleProcessDesignerV2/theme/iconfont.ttf b/src/components/SimpleProcessDesignerV2/theme/iconfont.ttf
index 58f31c36179719bbeed7b42238b838ff9c3d4d49..06f4e31c4b4ce9868cd39b25f6beb1fd5884ff9c 100644
Binary files a/src/components/SimpleProcessDesignerV2/theme/iconfont.ttf and b/src/components/SimpleProcessDesignerV2/theme/iconfont.ttf differ
diff --git a/src/components/SimpleProcessDesignerV2/theme/iconfont.woff b/src/components/SimpleProcessDesignerV2/theme/iconfont.woff
index f4b4f3de95d8fb8c727b52d9a06b18e22a566d85..0724e75054dc761f7cec794944cc140f3056bebf 100644
Binary files a/src/components/SimpleProcessDesignerV2/theme/iconfont.woff and b/src/components/SimpleProcessDesignerV2/theme/iconfont.woff differ
diff --git a/src/components/SimpleProcessDesignerV2/theme/iconfont.woff2 b/src/components/SimpleProcessDesignerV2/theme/iconfont.woff2
index d66f968531f29868912969439cc3634ae976b9c1..c904bb67db38c218b1f3f4292803cbc7fe3a80c6 100644
Binary files a/src/components/SimpleProcessDesignerV2/theme/iconfont.woff2 and b/src/components/SimpleProcessDesignerV2/theme/iconfont.woff2 differ
diff --git a/src/components/SimpleProcessDesignerV2/theme/simple-process-designer.scss b/src/components/SimpleProcessDesignerV2/theme/simple-process-designer.scss
index f3d8b4437335aa206dce04c919d343001252a4ad..d0adbdbb9c4622c53c7ad1ba3c78b30ae201a723 100644
--- a/src/components/SimpleProcessDesignerV2/theme/simple-process-designer.scss
+++ b/src/components/SimpleProcessDesignerV2/theme/simple-process-designer.scss
@@ -177,6 +177,18 @@
color: #ca3a31
}
+ .transactor {
+ color: #330099;
+ }
+
+ .child-process {
+ color: #996633;
+ }
+
+ .async-child-process {
+ color: #006666;
+ }
+
.handler-item-text {
margin-top: 4px;
width: 80px;
@@ -290,10 +302,22 @@
&.trigger-node {
color: #3373d2;
}
-
+
&.router-node {
color: #ca3a31
}
+
+ &.transactor-task {
+ color: #330099;
+ }
+
+ &.child-process {
+ color: #996633;
+ }
+
+ &.async-child-process {
+ color: #006666;
+ }
}
.node-title {
@@ -777,7 +801,7 @@
content: "\e7eb";
}
-.icon-handle:before {
+.icon-transactor:before {
content: "\e61c";
}
@@ -792,3 +816,11 @@
.icon-parallel:before {
content: "\e688";
}
+
+.icon-async-child-process:before {
+ content: "\e6f2";
+}
+
+.icon-child-process:before {
+ content: "\e6c1";
+}
diff --git a/src/components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue b/src/components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue
index 83d40fbfcf430a6b5f16aecc1b688ccf62b99135..00e887cb519bceb5ae48ef90219396aa0c5bb2bd 100644
--- a/src/components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue
+++ b/src/components/bpmnProcessDesigner/package/designer/ProcessDesigner.vue
@@ -188,12 +188,8 @@
:scroll="true"
max-height="600px"
>
-
-
-
-
- {{ previewResult }}
-
+
@@ -237,6 +233,8 @@ import { XmlNode, XmlNodeType, parseXmlString } from 'steady-xml'
// const eventName = reactive({
// name: ''
// })
+import hljs from 'highlight.js' // 导入代码高亮文件
+import 'highlight.js/styles/github.css' // 导入代码高亮样式
defineOptions({ name: 'MyProcessDesigner' })
@@ -308,6 +306,18 @@ const props = defineProps({
}
})
+/**
+ * 代码高亮
+ */
+const highlightedCode = (code: string) => {
+ // 高亮
+ if (previewType.value === 'json') {
+ code = JSON.stringify(code, null, 2)
+ }
+ const result = hljs.highlight(code, { language: previewType.value, ignoreIllegals: true })
+ return result.value || ' '
+}
+
provide('configGlobal', props)
let bpmnModeler: any = null
const defaultZoom = ref(1)
diff --git a/src/components/bpmnProcessDesigner/package/penal/custom-config/components/UserTaskCustomConfig.vue b/src/components/bpmnProcessDesigner/package/penal/custom-config/components/UserTaskCustomConfig.vue
index aab130d087aa243b2e89c8c89fef76b50b21bb9b..3c748ff6f8cc81b7e772b1cb1951e9a2ab816e1e 100644
--- a/src/components/bpmnProcessDesigner/package/penal/custom-config/components/UserTaskCustomConfig.vue
+++ b/src/components/bpmnProcessDesigner/package/penal/custom-config/components/UserTaskCustomConfig.vue
@@ -123,13 +123,19 @@
字段权限
-
+
字段名称
- 只读
- 可编辑
- 隐藏
+ 只读
+ 可编辑
+ 隐藏
@@ -140,24 +146,30 @@
:value="FieldPermissionType.READ"
size="large"
:label="FieldPermissionType.READ"
- >
+ @change="updateElementExtensions"
+ >
+
+
+ @change="updateElementExtensions"
+ >
+
+
+ @change="updateElementExtensions"
+ >
+
+
@@ -165,12 +177,22 @@
是否需要签名
-
+
审批意见
-
+
@@ -191,6 +213,7 @@ import {
} from '@/components/SimpleProcessDesignerV2/src/consts'
import * as UserApi from '@/api/system/user'
import { useFormFieldsPermission } from '@/components/SimpleProcessDesignerV2/src/node'
+import { BpmModelFormType } from '@/utils/constants'
defineOptions({ name: 'ElementCustomConfig4UserTask' })
const props = defineProps({
@@ -248,7 +271,6 @@ const resetCustomConfigList = () => {
bpmnElement.value.id,
bpmnInstances().modeler
)
-
// 获取元素扩展属性 或者 创建扩展属性
elExtensionElements.value =
bpmnElement.value.businessObject?.extensionElements ??
@@ -311,14 +333,13 @@ const resetCustomConfigList = () => {
}
// 字段权限
- if (formType.value === 10) {
+ if (formType.value === BpmModelFormType.NORMAL) {
const fieldsPermissionList = elExtensionElements.value.values?.filter(
(ex) => ex.$type === `${prefix}:FieldsPermission`
)
fieldsPermissionEl.value = []
getNodeConfigFormFields()
- // 由于默认添加了发起人元素,这里需要删掉
- fieldsPermissionConfig.value = fieldsPermissionConfig.value.slice(1)
+ fieldsPermissionConfig.value = fieldsPermissionConfig.value
fieldsPermissionConfig.value.forEach((element) => {
element.permission =
fieldsPermissionList?.find((obj) => obj.field === element.field)?.permission ?? '1'
@@ -487,6 +508,19 @@ function useButtonsSetting() {
}
}
+/** 批量更新权限 */
+// TODO @lesan:这个页面,有一些 idea 红色报错,咱要不要 fix 下!
+const updatePermission = (type: string) => {
+ fieldsPermissionEl.value.forEach((field) => {
+ field.permission =
+ type === 'READ'
+ ? FieldPermissionType.READ
+ : type === 'WRITE'
+ ? FieldPermissionType.WRITE
+ : FieldPermissionType.NONE
+ })
+}
+
const userOptions = ref
([]) // 用户列表
onMounted(async () => {
// 获得用户列表
@@ -497,9 +531,9 @@ onMounted(async () => {
diff --git a/src/views/bpm/model/form/ExtraSettings.vue b/src/views/bpm/model/form/ExtraSettings.vue
index d9eb1c611c966b8b14420b1f6751905d7d3f8824..1d685c75ef4b5c2c195c22aed2cad62467581f7c 100644
--- a/src/views/bpm/model/form/ExtraSettings.vue
+++ b/src/views/bpm/model/form/ExtraSettings.vue
@@ -140,6 +140,46 @@
+
+
+ 流程前置通知
+
+
+
+
+
+ 流程后置通知
+
+
+
@@ -149,6 +189,7 @@ import { BpmAutoApproveType, BpmModelFormType } from '@/utils/constants'
import * as FormApi from '@/api/bpm/form'
import { parseFormFields } from '@/components/FormCreate/src/utils'
import { ProcessVariableEnum } from '@/components/SimpleProcessDesignerV2/src/consts'
+import HttpRequestSetting from '@/components/SimpleProcessDesignerV2/src/nodes-config/components/HttpRequestSetting.vue'
const modelData = defineModel()
@@ -205,6 +246,36 @@ const numberExample = computed(() => {
}
})
+/** 是否开启流程前置通知 */
+const preProcessNotifyEnable = ref(false)
+const handlePreProcessNotifyEnableChange = (val: boolean | string | number) => {
+ if (val) {
+ modelData.value.preProcessNotifySetting = {
+ url: '',
+ header: [],
+ body: [],
+ response: []
+ }
+ } else {
+ modelData.value.preProcessNotifySetting = null
+ }
+}
+
+/** 是否开启流程后置通知 */
+const postProcessNotifyEnable = ref(false)
+const handlePostProcessNotifyEnableChange = (val: boolean | string | number) => {
+ if (val) {
+ modelData.value.postProcessNotifySetting = {
+ url: '',
+ header: [],
+ body: [],
+ response: []
+ }
+ } else {
+ modelData.value.postProcessNotifySetting = null
+ }
+}
+
/** 表单选项 */
const formField = ref>([])
const formFieldOptions4Title = computed(() => {
@@ -264,6 +335,12 @@ const initData = () => {
summary: []
}
}
+ if (modelData.value.preProcessNotifySetting) {
+ preProcessNotifyEnable.value = true
+ }
+ if (modelData.value.postProcessNotifySetting) {
+ postProcessNotifyEnable.value = true
+ }
}
defineExpose({ initData })
diff --git a/src/views/bpm/model/form/FormDesign.vue b/src/views/bpm/model/form/FormDesign.vue
index 74742f2e3ec0a1bd6bdc49637e5e20a984f23b04..e1ca27f209ceb2dd883bcd22f583e76053af1d49 100644
--- a/src/views/bpm/model/form/FormDesign.vue
+++ b/src/views/bpm/model/form/FormDesign.vue
@@ -11,12 +11,12 @@
-
+
-
+
-
+
@@ -68,6 +68,7 @@
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import * as FormApi from '@/api/bpm/form'
import { setConfAndFields2 } from '@/utils/formCreate'
+import { BpmModelFormType } from '@/utils/constants'
const props = defineProps({
formList: {
@@ -96,7 +97,7 @@ const formPreview = ref({
watch(
() => modelData.value.formId,
async (newFormId) => {
- if (newFormId && modelData.value.formType === 10) {
+ if (newFormId && modelData.value.formType === BpmModelFormType.NORMAL) {
const data = await FormApi.getForm(newFormId)
setConfAndFields2(formPreview.value, data.conf, data.fields)
// 设置只读
diff --git a/src/views/bpm/model/form/ProcessDesign.vue b/src/views/bpm/model/form/ProcessDesign.vue
index e85076a6db20f219081fa86b6a0187a82bb5b094..bb3a04b0d8b115be9d12b32a709c89105671be2b 100644
--- a/src/views/bpm/model/form/ProcessDesign.vue
+++ b/src/views/bpm/model/form/ProcessDesign.vue
@@ -25,7 +25,7 @@
diff --git a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
index 849338784deaa22e590d50eb3635ff0d0d677ad4..f69035f9a9095159a4f9ce6edb8649f9ed416d1b 100644
--- a/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
+++ b/src/views/bpm/processInstance/detail/ProcessInstanceOperationButton.vue
@@ -36,14 +36,27 @@
:rule="approveForm.rule"
/>
-
+
+
+
+
{{ getButtonDisplayName(OperationButtonType.APPROVE) }}
- 取消
+ 取消
@@ -111,7 +124,7 @@
>
{{ getButtonDisplayName(OperationButtonType.REJECT) }}
-
取消
+
取消
@@ -169,7 +182,7 @@
{{ getButtonDisplayName(OperationButtonType.COPY) }}
- 取消
+ 取消
@@ -221,7 +234,7 @@
{{ getButtonDisplayName(OperationButtonType.TRANSFER) }}
-
取消
+
取消
@@ -273,7 +286,7 @@
{{ getButtonDisplayName(OperationButtonType.DELEGATE) }}
- 取消
+ 取消