Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6b31a32a
authored
Aug 17, 2024
by
jason
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/bpm' of
https://gitee.com/yudaocode/yudao-ui-admin-vue3
into feature/bpm
parents
ab9ce936
0ce9ecec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
26 deletions
+84
-26
src/components/SimpleProcessDesignerV2/src/consts.ts
+39
-2
src/components/SimpleProcessDesignerV2/src/node.ts
+7
-3
src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue
+38
-21
No files found.
src/components/SimpleProcessDesignerV2/src/consts.ts
View file @
6b31a32a
...
@@ -78,6 +78,8 @@ export interface SimpleFlowNode {
...
@@ -78,6 +78,8 @@ export interface SimpleFlowNode {
timeoutHandler
?:
TimeoutHandler
timeoutHandler
?:
TimeoutHandler
// 审批任务拒绝处理
// 审批任务拒绝处理
rejectHandler
?:
RejectHandler
rejectHandler
?:
RejectHandler
// 审批节点的审批人与发起人相同时,对应的处理类型
assignStartUserHandlerType
?:
number
}
}
// 候选人策略枚举 ( 用于审批节点。抄送节点 )
// 候选人策略枚举 ( 用于审批节点。抄送节点 )
export
enum
CandidateStrategy
{
export
enum
CandidateStrategy
{
...
@@ -170,7 +172,7 @@ export type TimeoutHandler = {
...
@@ -170,7 +172,7 @@ export type TimeoutHandler = {
//是否开启超时处理
//是否开启超时处理
enable
:
boolean
enable
:
boolean
// 超时执行的动作
// 超时执行的动作
action
?:
number
type
?:
number
// 超时时间设置
// 超时时间设置
timeDuration
?:
string
timeDuration
?:
string
// 执行动作是自动提醒, 最大提醒次数
// 执行动作是自动提醒, 最大提醒次数
...
@@ -187,6 +189,36 @@ export enum RejectHandlerType {
...
@@ -187,6 +189,36 @@ export enum RejectHandlerType {
*/
*/
RETURN_USER_TASK
=
2
RETURN_USER_TASK
=
2
}
}
// 用户任务超时处理类型枚举
export
enum
TimeoutHandlerType
{
/**
* 自动提醒
*/
REMINDER
=
1
,
/**
* 自动同意
*/
APPROVE
=
2
,
/**
* 自动拒绝
*/
REJECT
=
3
}
// 用户任务的审批人与发起人相同时,处理类型枚举
export
enum
AssignStartUserHandlerType
{
/**
* 由发起人对自己审批
*/
START_USER_AUDIT
=
1
,
/**
* 自动跳过【参考飞书】:1)如果当前节点还有其他审批人,则交由其他审批人进行审批;2)如果当前节点没有其他审批人,则该节点自动通过
*/
SKIP
=
2
,
/**
* 转交给部门负责人审批
*/
ASSIGN_DEPT_LEADER
}
// 时间单位枚举
// 时间单位枚举
export
enum
TimeUnitType
{
export
enum
TimeUnitType
{
...
@@ -327,7 +359,7 @@ export const TIME_UNIT_TYPES: DictDataVO[] = [
...
@@ -327,7 +359,7 @@ export const TIME_UNIT_TYPES: DictDataVO[] = [
{
label
:
'天'
,
value
:
TimeUnitType
.
DAY
}
{
label
:
'天'
,
value
:
TimeUnitType
.
DAY
}
]
]
// 超时处理执行动作类型
// 超时处理执行动作类型
export
const
TIMEOUT_HANDLER_
ACTION_
TYPES
:
DictDataVO
[]
=
[
export
const
TIMEOUT_HANDLER_TYPES
:
DictDataVO
[]
=
[
{
label
:
'自动提醒'
,
value
:
1
},
{
label
:
'自动提醒'
,
value
:
1
},
{
label
:
'自动同意'
,
value
:
2
},
{
label
:
'自动同意'
,
value
:
2
},
{
label
:
'自动拒绝'
,
value
:
3
}
{
label
:
'自动拒绝'
,
value
:
3
}
...
@@ -337,6 +369,11 @@ export const REJECT_HANDLER_TYPES: DictDataVO[] = [
...
@@ -337,6 +369,11 @@ export const REJECT_HANDLER_TYPES: DictDataVO[] = [
{
label
:
'驳回到指定节点'
,
value
:
RejectHandlerType
.
RETURN_USER_TASK
}
{
label
:
'驳回到指定节点'
,
value
:
RejectHandlerType
.
RETURN_USER_TASK
}
// { label: '结束任务', value: RejectHandlerType.FINISH_TASK }
// { label: '结束任务', value: RejectHandlerType.FINISH_TASK }
]
]
export
const
ASSIGN_START_USER_HANDLER_TYPES
:
DictDataVO
[]
=
[
{
label
:
'由发起人对自己审批'
,
value
:
1
},
{
label
:
'自动跳过'
,
value
:
2
},
{
label
:
'转交给部门负责人审批'
,
value
:
3
}
]
// 比较运算符
// 比较运算符
export
const
COMPARISON_OPERATORS
:
DictDataVO
=
[
export
const
COMPARISON_OPERATORS
:
DictDataVO
=
[
...
...
src/components/SimpleProcessDesignerV2/src/node.ts
View file @
6b31a32a
...
@@ -10,7 +10,9 @@ import {
...
@@ -10,7 +10,9 @@ import {
NodeType
,
NodeType
,
ApproveMethodType
,
ApproveMethodType
,
RejectHandlerType
,
RejectHandlerType
,
NODE_DEFAULT_NAME
NODE_DEFAULT_NAME
,
AssignStartUserHandlerType
,
ASSIGN_START_USER_HANDLER_TYPES
}
from
'./consts'
}
from
'./consts'
export
function
useWatchNode
(
props
:
{
flowNode
:
SimpleFlowNode
}):
Ref
<
SimpleFlowNode
>
{
export
function
useWatchNode
(
props
:
{
flowNode
:
SimpleFlowNode
}):
Ref
<
SimpleFlowNode
>
{
const
node
=
ref
<
SimpleFlowNode
>
(
props
.
flowNode
)
const
node
=
ref
<
SimpleFlowNode
>
(
props
.
flowNode
)
...
@@ -103,7 +105,8 @@ export type UserTaskFormType = {
...
@@ -103,7 +105,8 @@ export type UserTaskFormType = {
rejectHandlerType
?:
RejectHandlerType
rejectHandlerType
?:
RejectHandlerType
returnNodeId
?:
string
returnNodeId
?:
string
timeoutHandlerEnable
?:
boolean
timeoutHandlerEnable
?:
boolean
timeoutHandlerAction
?:
number
timeoutHandlerType
?:
number
assignStartUserHandlerType
?:
AssignStartUserHandlerType
timeDuration
?:
number
timeDuration
?:
number
maxRemindCount
?:
number
maxRemindCount
?:
number
buttonsSetting
:
any
[]
buttonsSetting
:
any
[]
...
@@ -139,9 +142,10 @@ export function useNodeForm(nodeType: NodeType) {
...
@@ -139,9 +142,10 @@ export function useNodeForm(nodeType: NodeType) {
approveMethod
:
ApproveMethodType
.
RRANDOM_SELECT_ONE_APPROVE
,
approveMethod
:
ApproveMethodType
.
RRANDOM_SELECT_ONE_APPROVE
,
approveRatio
:
100
,
approveRatio
:
100
,
rejectHandlerType
:
RejectHandlerType
.
FINISH_PROCESS
,
rejectHandlerType
:
RejectHandlerType
.
FINISH_PROCESS
,
assignStartUserHandlerType
:
AssignStartUserHandlerType
.
START_USER_AUDIT
,
returnNodeId
:
''
,
returnNodeId
:
''
,
timeoutHandlerEnable
:
false
,
timeoutHandlerEnable
:
false
,
timeoutHandler
Action
:
1
,
timeoutHandler
Type
:
1
,
timeDuration
:
6
,
// 默认 6小时
timeDuration
:
6
,
// 默认 6小时
maxRemindCount
:
1
,
// 默认 提醒 1次
maxRemindCount
:
1
,
// 默认 提醒 1次
buttonsSetting
:
[]
buttonsSetting
:
[]
...
...
src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue
View file @
6b31a32a
...
@@ -232,15 +232,15 @@
...
@@ -232,15 +232,15 @@
</el-form-item>
</el-form-item>
<el-form-item
<el-form-item
label=
"执行动作"
label=
"执行动作"
prop=
"timeoutHandler
Action
"
prop=
"timeoutHandler
Type
"
v-if=
"configForm.timeoutHandlerEnable"
v-if=
"configForm.timeoutHandlerEnable"
>
>
<el-radio-group
<el-radio-group
v-model=
"configForm.timeoutHandler
Action
"
v-model=
"configForm.timeoutHandler
Type
"
@
change=
"timeout
Action
Changed"
@
change=
"timeout
HandlerType
Changed"
>
>
<el-radio-button
<el-radio-button
v-for=
"item in TIMEOUT_HANDLER_
ACTION_
TYPES"
v-for=
"item in TIMEOUT_HANDLER_TYPES"
:key=
"item.value"
:key=
"item.value"
:value=
"item.value"
:value=
"item.value"
:label=
"item.label"
:label=
"item.label"
...
@@ -276,10 +276,21 @@
...
@@ -276,10 +276,21 @@
<el-form-item
<el-form-item
label=
"最大提醒次数"
label=
"最大提醒次数"
prop=
"maxRemindCount"
prop=
"maxRemindCount"
v-if=
"configForm.timeoutHandlerEnable && configForm.timeoutHandler
Action
=== 1"
v-if=
"configForm.timeoutHandlerEnable && configForm.timeoutHandler
Type
=== 1"
>
>
<el-input-number
v-model=
"configForm.maxRemindCount"
:min=
"1"
:max=
"10"
/>
<el-input-number
v-model=
"configForm.maxRemindCount"
:min=
"1"
:max=
"10"
/>
</el-form-item>
</el-form-item>
<el-divider
content-position=
"left"
>
审批人与提交人为同一人时
</el-divider>
<el-form-item
prop=
"assignStartUserHandlerType"
>
<el-radio-group
v-model=
"configForm.assignStartUserHandlerType"
>
<div
class=
"flex-col"
>
<div
v-for=
"(item, index) in ASSIGN_START_USER_HANDLER_TYPES"
:key=
"index"
>
<el-radio
:key=
"item.value"
:value=
"item.value"
:label=
"item.label"
/>
</div>
</div>
</el-radio-group>
</el-form-item>
</el-form>
</el-form>
</div>
</div>
</el-tab-pane>
</el-tab-pane>
...
@@ -364,14 +375,16 @@ import {
...
@@ -364,14 +375,16 @@ import {
ApproveMethodType
,
ApproveMethodType
,
TimeUnitType
,
TimeUnitType
,
RejectHandlerType
,
RejectHandlerType
,
TIMEOUT_HANDLER_
ACTION_
TYPES
,
TIMEOUT_HANDLER_TYPES
,
TIME_UNIT_TYPES
,
TIME_UNIT_TYPES
,
REJECT_HANDLER_TYPES
,
REJECT_HANDLER_TYPES
,
DEFAULT_BUTTON_SETTING
,
DEFAULT_BUTTON_SETTING
,
OPERATION_BUTTON_NAME
,
OPERATION_BUTTON_NAME
,
ButtonSetting
,
ButtonSetting
,
MULTI_LEVEL_DEPT
,
MULTI_LEVEL_DEPT
,
CANDIDATE_STRATEGY
CANDIDATE_STRATEGY
,
ASSIGN_START_USER_HANDLER_TYPES
,
TimeoutHandlerType
}
from
'../consts'
}
from
'../consts'
import
{
import
{
...
@@ -435,7 +448,7 @@ const formRules = reactive({
...
@@ -435,7 +448,7 @@ const formRules = reactive({
approveRatio
:
[{
required
:
true
,
message
:
'通过比例不能为空'
,
trigger
:
'blur'
}],
approveRatio
:
[{
required
:
true
,
message
:
'通过比例不能为空'
,
trigger
:
'blur'
}],
returnNodeId
:
[{
required
:
true
,
message
:
'驳回节点不能为空'
,
trigger
:
'change'
}],
returnNodeId
:
[{
required
:
true
,
message
:
'驳回节点不能为空'
,
trigger
:
'change'
}],
timeoutHandlerEnable
:
[{
required
:
true
}],
timeoutHandlerEnable
:
[{
required
:
true
}],
timeoutHandler
Action
:
[{
required
:
true
}],
timeoutHandler
Type
:
[{
required
:
true
}],
timeDuration
:
[{
required
:
true
,
message
:
'超时时间不能为空'
,
trigger
:
'blur'
}],
timeDuration
:
[{
required
:
true
,
message
:
'超时时间不能为空'
,
trigger
:
'blur'
}],
maxRemindCount
:
[{
required
:
true
,
message
:
'提醒次数不能为空'
,
trigger
:
'blur'
}]
maxRemindCount
:
[{
required
:
true
,
message
:
'提醒次数不能为空'
,
trigger
:
'blur'
}]
})
})
...
@@ -499,8 +512,8 @@ const returnTaskList = ref<SimpleFlowNode[]>([])
...
@@ -499,8 +512,8 @@ const returnTaskList = ref<SimpleFlowNode[]>([])
// 审批人超时未处理设置
// 审批人超时未处理设置
const
{
const
{
timeoutHandlerChange
,
timeoutHandlerChange
,
cTimeout
Action
,
cTimeout
Type
,
timeout
Action
Changed
,
timeout
HandlerType
Changed
,
timeUnit
,
timeUnit
,
timeUnitChange
,
timeUnitChange
,
isoTimeDuration
,
isoTimeDuration
,
...
@@ -532,10 +545,12 @@ const saveConfig = async () => {
...
@@ -532,10 +545,12 @@ const saveConfig = async () => {
// 设置超时处理
// 设置超时处理
currentNode
.
value
.
timeoutHandler
=
{
currentNode
.
value
.
timeoutHandler
=
{
enable
:
configForm
.
value
.
timeoutHandlerEnable
!
,
enable
:
configForm
.
value
.
timeoutHandlerEnable
!
,
action
:
cTimeoutAction
.
value
,
type
:
cTimeoutType
.
value
,
timeDuration
:
isoTimeDuration
.
value
,
timeDuration
:
isoTimeDuration
.
value
,
maxRemindCount
:
cTimeoutMaxRemindCount
.
value
maxRemindCount
:
cTimeoutMaxRemindCount
.
value
}
}
// 设置用户任务的审批人与发起人相同时
currentNode
.
value
.
assignStartUserHandlerType
=
configForm
.
value
.
assignStartUserHandlerType
// 设置表单权限
// 设置表单权限
currentNode
.
value
.
fieldsPermission
=
fieldsPermissionConfig
.
value
currentNode
.
value
.
fieldsPermission
=
fieldsPermissionConfig
.
value
// 设置按钮权限
// 设置按钮权限
...
@@ -553,7 +568,7 @@ const showUserTaskNodeConfig = (node: SimpleFlowNode) => {
...
@@ -553,7 +568,7 @@ const showUserTaskNodeConfig = (node: SimpleFlowNode) => {
configForm
.
value
.
candidateStrategy
=
node
.
candidateStrategy
!
configForm
.
value
.
candidateStrategy
=
node
.
candidateStrategy
!
// 解析候选人参数
// 解析候选人参数
parseCandidateParam
(
node
.
candidateStrategy
!
,
node
?.
candidateParam
)
parseCandidateParam
(
node
.
candidateStrategy
!
,
node
?.
candidateParam
)
if
(
configForm
.
value
.
deptIds
&&
configForm
.
value
.
dept
Ids
.
length
>
1
)
{
if
(
configForm
.
value
.
userIds
&&
configForm
.
value
.
user
Ids
.
length
>
1
)
{
notAllowedMultiApprovers
.
value
=
true
notAllowedMultiApprovers
.
value
=
true
}
else
{
}
else
{
notAllowedMultiApprovers
.
value
=
false
notAllowedMultiApprovers
.
value
=
false
...
@@ -578,8 +593,10 @@ const showUserTaskNodeConfig = (node: SimpleFlowNode) => {
...
@@ -578,8 +593,10 @@ const showUserTaskNodeConfig = (node: SimpleFlowNode) => {
configForm
.
value
.
timeDuration
=
parseInt
(
parseTime
)
configForm
.
value
.
timeDuration
=
parseInt
(
parseTime
)
timeUnit
.
value
=
convertTimeUnit
(
parseTimeUnit
)
timeUnit
.
value
=
convertTimeUnit
(
parseTimeUnit
)
}
}
configForm
.
value
.
timeoutHandler
Action
=
node
.
timeoutHandler
?.
action
configForm
.
value
.
timeoutHandler
Type
=
node
.
timeoutHandler
?.
type
configForm
.
value
.
maxRemindCount
=
node
.
timeoutHandler
?.
maxRemindCount
configForm
.
value
.
maxRemindCount
=
node
.
timeoutHandler
?.
maxRemindCount
// 1.5 设置用户任务的审批人与发起人相同时
configForm
.
value
.
assignStartUserHandlerType
=
node
.
assignStartUserHandlerType
// 2. 操作按钮设置
// 2. 操作按钮设置
buttonsSetting
.
value
=
cloneDeep
(
node
.
buttonsSetting
)
||
DEFAULT_BUTTON_SETTING
buttonsSetting
.
value
=
cloneDeep
(
node
.
buttonsSetting
)
||
DEFAULT_BUTTON_SETTING
// 3. 表单字段权限配置
// 3. 表单字段权限配置
...
@@ -623,21 +640,21 @@ function useTimeoutHandler() {
...
@@ -623,21 +640,21 @@ function useTimeoutHandler() {
if
(
configForm
.
value
.
timeoutHandlerEnable
)
{
if
(
configForm
.
value
.
timeoutHandlerEnable
)
{
timeUnit
.
value
=
2
timeUnit
.
value
=
2
configForm
.
value
.
timeDuration
=
6
configForm
.
value
.
timeDuration
=
6
configForm
.
value
.
timeoutHandler
Action
=
1
configForm
.
value
.
timeoutHandler
Type
=
1
configForm
.
value
.
maxRemindCount
=
1
configForm
.
value
.
maxRemindCount
=
1
}
}
}
}
// 超时执行的动作
// 超时执行的动作
const
cTimeout
Action
=
computed
(()
=>
{
const
cTimeout
Type
=
computed
(()
=>
{
if
(
!
configForm
.
value
.
timeoutHandlerEnable
)
{
if
(
!
configForm
.
value
.
timeoutHandlerEnable
)
{
return
undefined
return
undefined
}
}
return
configForm
.
value
.
timeoutHandler
Action
return
configForm
.
value
.
timeoutHandler
Type
})
})
// 超时处理动作改变
// 超时处理动作改变
const
timeout
Action
Changed
=
()
=>
{
const
timeout
HandlerType
Changed
=
()
=>
{
if
(
configForm
.
value
.
timeoutHandler
Action
===
1
)
{
if
(
configForm
.
value
.
timeoutHandler
Type
===
TimeoutHandlerType
.
REMINDER
)
{
configForm
.
value
.
maxRemindCount
=
1
// 超时提醒次数,默认为1
configForm
.
value
.
maxRemindCount
=
1
// 超时提醒次数,默认为1
}
}
}
}
...
@@ -680,7 +697,7 @@ function useTimeoutHandler() {
...
@@ -680,7 +697,7 @@ function useTimeoutHandler() {
if
(
!
configForm
.
value
.
timeoutHandlerEnable
)
{
if
(
!
configForm
.
value
.
timeoutHandlerEnable
)
{
return
undefined
return
undefined
}
}
if
(
configForm
.
value
.
timeoutHandler
Action
!==
1
)
{
if
(
configForm
.
value
.
timeoutHandler
Type
!==
TimeoutHandlerType
.
REMINDER
)
{
return
undefined
return
undefined
}
}
return
configForm
.
value
.
maxRemindCount
return
configForm
.
value
.
maxRemindCount
...
@@ -688,8 +705,8 @@ function useTimeoutHandler() {
...
@@ -688,8 +705,8 @@ function useTimeoutHandler() {
return
{
return
{
timeoutHandlerChange
,
timeoutHandlerChange
,
cTimeout
Action
,
cTimeout
Type
,
timeout
Action
Changed
,
timeout
HandlerType
Changed
,
timeUnit
,
timeUnit
,
timeUnitChange
,
timeUnitChange
,
isoTimeDuration
,
isoTimeDuration
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment