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
158708c1
authored
Nov 19, 2024
by
YunaiV
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
6304a8e9
2fe28af0
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
272 additions
and
102 deletions
+272
-102
src/components/FormCreate/src/components/useApiSelect.tsx
+1
-1
src/components/SimpleProcessDesignerV2/src/consts.ts
+21
-1
src/components/SimpleProcessDesignerV2/src/node.ts
+106
-75
src/components/SimpleProcessDesignerV2/src/nodes-config/CopyTaskNodeConfig.vue
+77
-4
src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue
+67
-21
No files found.
src/components/FormCreate/src/components/useApiSelect.tsx
View file @
158708c1
...
@@ -185,7 +185,7 @@ export const useApiSelect = (option: ApiSelectProps) => {
...
@@ -185,7 +185,7 @@ export const useApiSelect = (option: ApiSelectProps) => {
</
el
-
select
>
</
el
-
select
>
)
)
}
}
debugger
//
debugger
return
(
return
(
<
el
-
select
<
el
-
select
class=
"w-1/1"
class=
"w-1/1"
...
...
src/components/SimpleProcessDesignerV2/src/consts.ts
View file @
158708c1
...
@@ -79,7 +79,7 @@ export interface SimpleFlowNode {
...
@@ -79,7 +79,7 @@ export interface SimpleFlowNode {
// 审批按钮设置
// 审批按钮设置
buttonsSetting
?:
any
[]
buttonsSetting
?:
any
[]
// 表单权限
// 表单权限
fieldsPermission
?:
Array
<
Record
<
string
,
string
>>
fieldsPermission
?:
Array
<
Record
<
string
,
any
>>
// 审批任务超时处理
// 审批任务超时处理
timeoutHandler
?:
TimeoutHandler
timeoutHandler
?:
TimeoutHandler
// 审批任务拒绝处理
// 审批任务拒绝处理
...
@@ -146,6 +146,14 @@ export enum CandidateStrategy {
...
@@ -146,6 +146,14 @@ export enum CandidateStrategy {
*/
*/
USER_GROUP
=
40
,
USER_GROUP
=
40
,
/**
/**
* 表单内用户字段
*/
USER_FIELD_ON_FORM
=
50
,
/**
* 表单内部门负责人
*/
DEPT_LEADER_ON_FORM
=
51
,
/**
* 流程表达式
* 流程表达式
*/
*/
EXPRESSION
=
60
EXPRESSION
=
60
...
@@ -424,6 +432,8 @@ export const CANDIDATE_STRATEGY: DictDataVO[] = [
...
@@ -424,6 +432,8 @@ export const CANDIDATE_STRATEGY: DictDataVO[] = [
{
label
:
'发起人部门负责人'
,
value
:
CandidateStrategy
.
START_USER_DEPT_LEADER
},
{
label
:
'发起人部门负责人'
,
value
:
CandidateStrategy
.
START_USER_DEPT_LEADER
},
{
label
:
'发起人连续部门负责人'
,
value
:
CandidateStrategy
.
START_USER_MULTI_LEVEL_DEPT_LEADER
},
{
label
:
'发起人连续部门负责人'
,
value
:
CandidateStrategy
.
START_USER_MULTI_LEVEL_DEPT_LEADER
},
{
label
:
'用户组'
,
value
:
CandidateStrategy
.
USER_GROUP
},
{
label
:
'用户组'
,
value
:
CandidateStrategy
.
USER_GROUP
},
{
label
:
'表单内用户字段'
,
value
:
CandidateStrategy
.
USER_FIELD_ON_FORM
},
{
label
:
'表单内部门负责人'
,
value
:
CandidateStrategy
.
DEPT_LEADER_ON_FORM
},
{
label
:
'流程表达式'
,
value
:
CandidateStrategy
.
EXPRESSION
}
{
label
:
'流程表达式'
,
value
:
CandidateStrategy
.
EXPRESSION
}
]
]
// 审批节点 的审批类型
// 审批节点 的审批类型
...
@@ -548,3 +558,13 @@ export const MULTI_LEVEL_DEPT: DictDataVO = [
...
@@ -548,3 +558,13 @@ export const MULTI_LEVEL_DEPT: DictDataVO = [
{
label
:
'第 14 级部门'
,
value
:
14
},
{
label
:
'第 14 级部门'
,
value
:
14
},
{
label
:
'第 15 级部门'
,
value
:
15
}
{
label
:
'第 15 级部门'
,
value
:
15
}
]
]
/**
* 流程实例的变量枚举
*/
export
enum
ProcessVariableEnum
{
/**
* 发起用户 ID
*/
START_USER_ID
=
'PROCESS_START_USER_ID'
}
src/components/SimpleProcessDesignerV2/src/node.ts
View file @
158708c1
This diff is collapsed.
Click to expand it.
src/components/SimpleProcessDesignerV2/src/nodes-config/CopyTaskNodeConfig.vue
View file @
158708c1
...
@@ -60,7 +60,8 @@
...
@@ -60,7 +60,8 @@
<el-form-item
<el-form-item
v-if=
"
v-if=
"
configForm.candidateStrategy == CandidateStrategy.DEPT_MEMBER ||
configForm.candidateStrategy == CandidateStrategy.DEPT_MEMBER ||
configForm.candidateStrategy == CandidateStrategy.DEPT_LEADER
configForm.candidateStrategy == CandidateStrategy.DEPT_LEADER ||
configForm.candidateStrategy == CandidateStrategy.MULTI_LEVEL_DEPT_LEADER
"
"
label=
"指定部门"
label=
"指定部门"
prop=
"deptIds"
prop=
"deptIds"
...
@@ -122,7 +123,54 @@
...
@@ -122,7 +123,54 @@
/>
/>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
v-if=
"configForm.candidateStrategy === CandidateStrategy.USER_FIELD_ON_FORM"
label=
"表单内用户字段"
prop=
"userFieldOnForm"
>
<el-select
v-model=
"configForm.userFieldOnForm"
clearable
style=
"width: 100%"
>
<el-option
v-for=
"(item,idx) in userFieldOnFormOptions"
:key=
"idx"
:label=
"item.title"
:value=
"item.field"
/>
</el-select>
</el-form-item>
<el-form-item
v-if=
"configForm.candidateStrategy === CandidateStrategy.DEPT_LEADER_ON_FORM"
label=
"表单内部门字段"
prop=
"deptFieldOnForm"
>
<el-select
v-model=
"configForm.deptFieldOnForm"
clearable
style=
"width: 100%"
>
<el-option
v-for=
"(item,idx) in deptFieldOnFormOptions"
:key=
"idx"
:label=
"item.title"
:value=
"item.field"
/>
</el-select>
</el-form-item>
<el-form-item
v-if=
"
configForm.candidateStrategy == CandidateStrategy.MULTI_LEVEL_DEPT_LEADER ||
configForm.candidateStrategy == CandidateStrategy.START_USER_DEPT_LEADER ||
configForm.candidateStrategy == CandidateStrategy.START_USER_MULTI_LEVEL_DEPT_LEADER ||
configForm.candidateStrategy == CandidateStrategy.DEPT_LEADER_ON_FORM
"
:label=
"deptLevelLabel!"
prop=
"deptLevel"
span=
"24"
>
<el-select
v-model=
"configForm.deptLevel"
clearable
>
<el-option
v-for=
"(item, index) in MULTI_LEVEL_DEPT"
:key=
"index"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</el-form-item>
<el-form-item
<el-form-item
v-if=
"configForm.candidateStrategy === CandidateStrategy.EXPRESSION"
v-if=
"configForm.candidateStrategy === CandidateStrategy.EXPRESSION"
label=
"流程表达式"
label=
"流程表达式"
...
@@ -201,7 +249,8 @@ import {
...
@@ -201,7 +249,8 @@ import {
CandidateStrategy
,
CandidateStrategy
,
NodeType
,
NodeType
,
CANDIDATE_STRATEGY
,
CANDIDATE_STRATEGY
,
FieldPermissionType
FieldPermissionType
,
MULTI_LEVEL_DEPT
}
from
'../consts'
}
from
'../consts'
import
{
import
{
useWatchNode
,
useWatchNode
,
...
@@ -221,6 +270,15 @@ const props = defineProps({
...
@@ -221,6 +270,15 @@ const props = defineProps({
required
:
true
required
:
true
}
}
})
})
const
deptLevelLabel
=
computed
(()
=>
{
let
label
=
'部门负责人来源'
if
(
configForm
.
value
.
candidateStrategy
==
CandidateStrategy
.
MULTI_LEVEL_DEPT_LEADER
)
{
label
=
label
+
'(指定部门向上)'
}
else
{
label
=
label
+
'(发起人部门向上)'
}
return
label
})
// 抽屉配置
// 抽屉配置
const
{
settingVisible
,
closeDrawer
,
openDrawer
}
=
useDrawer
()
const
{
settingVisible
,
closeDrawer
,
openDrawer
}
=
useDrawer
()
// 当前节点
// 当前节点
...
@@ -230,9 +288,21 @@ const { nodeName, showInput, clickIcon, blurEvent } = useNodeName(NodeType.COPY_
...
@@ -230,9 +288,21 @@ const { nodeName, showInput, clickIcon, blurEvent } = useNodeName(NodeType.COPY_
// 激活的 Tab 标签页
// 激活的 Tab 标签页
const
activeTabName
=
ref
(
'user'
)
const
activeTabName
=
ref
(
'user'
)
// 表单字段权限配置
// 表单字段权限配置
const
{
formType
,
fieldsPermissionConfig
,
getNodeConfigFormFields
}
=
useFormFieldsPermission
(
const
{
formType
,
fieldsPermissionConfig
,
formFieldOptions
,
getNodeConfigFormFields
}
=
useFormFieldsPermission
(
FieldPermissionType
.
READ
FieldPermissionType
.
READ
)
)
// 表单内用户字段选项, 必须是必填和用户选择器
const
userFieldOnFormOptions
=
computed
(()
=>
{
return
formFieldOptions
.
filter
(
(
item
)
=>
item
.
required
&&
item
.
type
===
'UserSelect'
)
})
// 表单内部门字段选项, 必须是必填和部门选择器
const
deptFieldOnFormOptions
=
computed
(()
=>
{
return
formFieldOptions
.
filter
(
(
item
)
=>
item
.
required
&&
item
.
type
===
'DeptSelect'
)
})
// 抄送人表单配置
// 抄送人表单配置
const
formRef
=
ref
()
// 表单 Ref
const
formRef
=
ref
()
// 表单 Ref
// 表单校验规则
// 表单校验规则
...
@@ -243,6 +313,8 @@ const formRules = reactive({
...
@@ -243,6 +313,8 @@ const formRules = reactive({
deptIds
:
[{
required
:
true
,
message
:
'部门不能为空'
,
trigger
:
'change'
}],
deptIds
:
[{
required
:
true
,
message
:
'部门不能为空'
,
trigger
:
'change'
}],
userGroups
:
[{
required
:
true
,
message
:
'用户组不能为空'
,
trigger
:
'change'
}],
userGroups
:
[{
required
:
true
,
message
:
'用户组不能为空'
,
trigger
:
'change'
}],
postIds
:
[{
required
:
true
,
message
:
'岗位不能为空'
,
trigger
:
'change'
}],
postIds
:
[{
required
:
true
,
message
:
'岗位不能为空'
,
trigger
:
'change'
}],
userFieldOnForm
:
[{
required
:
true
,
message
:
'表单内用户字段不能为空'
,
trigger
:
'change'
}],
deptFieldOnForm
:
[{
required
:
true
,
message
:
'表单内部门字段不能为空'
,
trigger
:
'change'
}],
expression
:
[{
required
:
true
,
message
:
'流程表达式不能为空'
,
trigger
:
'blur'
}]
expression
:
[{
required
:
true
,
message
:
'流程表达式不能为空'
,
trigger
:
'blur'
}]
})
})
...
@@ -272,6 +344,7 @@ const changeCandidateStrategy = () => {
...
@@ -272,6 +344,7 @@ const changeCandidateStrategy = () => {
configForm
.
value
.
postIds
=
[]
configForm
.
value
.
postIds
=
[]
configForm
.
value
.
userGroups
=
[]
configForm
.
value
.
userGroups
=
[]
configForm
.
value
.
deptLevel
=
1
configForm
.
value
.
deptLevel
=
1
configForm
.
value
.
userFieldOnForm
=
''
}
}
// 保存配置
// 保存配置
const
saveConfig
=
async
()
=>
{
const
saveConfig
=
async
()
=>
{
...
...
src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue
View file @
158708c1
...
@@ -56,7 +56,6 @@
...
@@ -56,7 +56,6 @@
</el-radio>
</el-radio>
</el-radio-group>
</el-radio-group>
</el-form-item>
</el-form-item>
<el-form-item
<el-form-item
v-if=
"configForm.candidateStrategy == CandidateStrategy.ROLE"
v-if=
"configForm.candidateStrategy == CandidateStrategy.ROLE"
label=
"指定角色"
label=
"指定角色"
...
@@ -95,25 +94,6 @@
...
@@ -95,25 +94,6 @@
/>
/>
</el-form-item>
</el-form-item>
<el-form-item
<el-form-item
v-if=
"
configForm.candidateStrategy == CandidateStrategy.MULTI_LEVEL_DEPT_LEADER ||
configForm.candidateStrategy == CandidateStrategy.START_USER_DEPT_LEADER ||
configForm.candidateStrategy == CandidateStrategy.START_USER_MULTI_LEVEL_DEPT_LEADER
"
:label=
"deptLevelLabel!"
prop=
"deptLevel"
span=
"24"
>
<el-select
v-model=
"configForm.deptLevel"
clearable
>
<el-option
v-for=
"(item, index) in MULTI_LEVEL_DEPT"
:key=
"index"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</el-form-item>
<el-form-item
v-if=
"configForm.candidateStrategy == CandidateStrategy.POST"
v-if=
"configForm.candidateStrategy == CandidateStrategy.POST"
label=
"指定岗位"
label=
"指定岗位"
prop=
"postIds"
prop=
"postIds"
...
@@ -157,6 +137,54 @@
...
@@ -157,6 +137,54 @@
/>
/>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
v-if=
"configForm.candidateStrategy === CandidateStrategy.USER_FIELD_ON_FORM"
label=
"表单内用户字段"
prop=
"userFieldOnForm"
>
<el-select
v-model=
"configForm.userFieldOnForm"
clearable
style=
"width: 100%"
>
<el-option
v-for=
"(item,idx) in userFieldOnFormOptions"
:key=
"idx"
:label=
"item.title"
:value=
"item.field"
/>
</el-select>
</el-form-item>
<el-form-item
v-if=
"configForm.candidateStrategy === CandidateStrategy.DEPT_LEADER_ON_FORM"
label=
"表单内部门字段"
prop=
"deptFieldOnForm"
>
<el-select
v-model=
"configForm.deptFieldOnForm"
clearable
style=
"width: 100%"
>
<el-option
v-for=
"(item,idx) in deptFieldOnFormOptions"
:key=
"idx"
:label=
"item.title"
:value=
"item.field"
/>
</el-select>
</el-form-item>
<el-form-item
v-if=
"
configForm.candidateStrategy == CandidateStrategy.MULTI_LEVEL_DEPT_LEADER ||
configForm.candidateStrategy == CandidateStrategy.START_USER_DEPT_LEADER ||
configForm.candidateStrategy == CandidateStrategy.START_USER_MULTI_LEVEL_DEPT_LEADER ||
configForm.candidateStrategy == CandidateStrategy.DEPT_LEADER_ON_FORM
"
:label=
"deptLevelLabel!"
prop=
"deptLevel"
span=
"24"
>
<el-select
v-model=
"configForm.deptLevel"
clearable
>
<el-option
v-for=
"(item, index) in MULTI_LEVEL_DEPT"
:key=
"index"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</el-form-item>
<!-- TODO @jason:后续要支持选择已经存好的表达式 -->
<!-- TODO @jason:后续要支持选择已经存好的表达式 -->
<el-form-item
<el-form-item
v-if=
"configForm.candidateStrategy === CandidateStrategy.EXPRESSION"
v-if=
"configForm.candidateStrategy === CandidateStrategy.EXPRESSION"
...
@@ -468,6 +496,8 @@ const deptLevelLabel = computed(() => {
...
@@ -468,6 +496,8 @@ const deptLevelLabel = computed(() => {
let
label
=
'部门负责人来源'
let
label
=
'部门负责人来源'
if
(
configForm
.
value
.
candidateStrategy
==
CandidateStrategy
.
MULTI_LEVEL_DEPT_LEADER
)
{
if
(
configForm
.
value
.
candidateStrategy
==
CandidateStrategy
.
MULTI_LEVEL_DEPT_LEADER
)
{
label
=
label
+
'(指定部门向上)'
label
=
label
+
'(指定部门向上)'
}
else
if
(
configForm
.
value
.
candidateStrategy
==
CandidateStrategy
.
DEPT_LEADER_ON_FORM
)
{
label
=
label
+
'(表单内部门向上)'
}
else
{
}
else
{
label
=
label
+
'(发起人部门向上)'
label
=
label
+
'(发起人部门向上)'
}
}
...
@@ -482,9 +512,21 @@ const { nodeName, showInput, clickIcon, blurEvent } = useNodeName(NodeType.USER_
...
@@ -482,9 +512,21 @@ const { nodeName, showInput, clickIcon, blurEvent } = useNodeName(NodeType.USER_
// 激活的 Tab 标签页
// 激活的 Tab 标签页
const
activeTabName
=
ref
(
'user'
)
const
activeTabName
=
ref
(
'user'
)
// 表单字段权限设置
// 表单字段权限设置
const
{
formType
,
fieldsPermissionConfig
,
getNodeConfigFormFields
}
=
useFormFieldsPermission
(
const
{
formType
,
fieldsPermissionConfig
,
formFieldOptions
,
getNodeConfigFormFields
}
=
useFormFieldsPermission
(
FieldPermissionType
.
READ
FieldPermissionType
.
READ
)
)
// 表单内用户字段选项, 必须是必填和用户选择器
const
userFieldOnFormOptions
=
computed
(()
=>
{
return
formFieldOptions
.
filter
(
(
item
)
=>
item
.
required
&&
item
.
type
===
'UserSelect'
)
})
// 表单内部门字段选项, 必须是必填和部门选择器
const
deptFieldOnFormOptions
=
computed
(()
=>
{
return
formFieldOptions
.
filter
(
(
item
)
=>
item
.
required
&&
item
.
type
===
'DeptSelect'
)
})
// 操作按钮设置
// 操作按钮设置
const
{
buttonsSetting
,
btnDisplayNameEdit
,
changeBtnDisplayName
,
btnDisplayNameBlurEvent
}
=
const
{
buttonsSetting
,
btnDisplayNameEdit
,
changeBtnDisplayName
,
btnDisplayNameBlurEvent
}
=
useButtonsSetting
()
useButtonsSetting
()
...
@@ -498,6 +540,8 @@ const formRules = reactive({
...
@@ -498,6 +540,8 @@ const formRules = reactive({
roleIds
:
[{
required
:
true
,
message
:
'角色不能为空'
,
trigger
:
'change'
}],
roleIds
:
[{
required
:
true
,
message
:
'角色不能为空'
,
trigger
:
'change'
}],
deptIds
:
[{
required
:
true
,
message
:
'部门不能为空'
,
trigger
:
'change'
}],
deptIds
:
[{
required
:
true
,
message
:
'部门不能为空'
,
trigger
:
'change'
}],
userGroups
:
[{
required
:
true
,
message
:
'用户组不能为空'
,
trigger
:
'change'
}],
userGroups
:
[{
required
:
true
,
message
:
'用户组不能为空'
,
trigger
:
'change'
}],
userFieldOnForm
:
[{
required
:
true
,
message
:
'表单内用户字段不能为空'
,
trigger
:
'change'
}],
deptFieldOnForm
:
[{
required
:
true
,
message
:
'表单内部门字段不能为空'
,
trigger
:
'change'
}],
postIds
:
[{
required
:
true
,
message
:
'岗位不能为空'
,
trigger
:
'change'
}],
postIds
:
[{
required
:
true
,
message
:
'岗位不能为空'
,
trigger
:
'change'
}],
expression
:
[{
required
:
true
,
message
:
'流程表达式不能为空'
,
trigger
:
'blur'
}],
expression
:
[{
required
:
true
,
message
:
'流程表达式不能为空'
,
trigger
:
'blur'
}],
approveMethod
:
[{
required
:
true
,
message
:
'多人审批方式不能为空'
,
trigger
:
'change'
}],
approveMethod
:
[{
required
:
true
,
message
:
'多人审批方式不能为空'
,
trigger
:
'change'
}],
...
@@ -533,6 +577,8 @@ const changeCandidateStrategy = () => {
...
@@ -533,6 +577,8 @@ const changeCandidateStrategy = () => {
configForm
.
value
.
postIds
=
[]
configForm
.
value
.
postIds
=
[]
configForm
.
value
.
userGroups
=
[]
configForm
.
value
.
userGroups
=
[]
configForm
.
value
.
deptLevel
=
1
configForm
.
value
.
deptLevel
=
1
configForm
.
value
.
userFieldOnForm
=
''
configForm
.
value
.
deptFieldOnForm
=
''
configForm
.
value
.
approveMethod
=
ApproveMethodType
.
SEQUENTIAL_APPROVE
configForm
.
value
.
approveMethod
=
ApproveMethodType
.
SEQUENTIAL_APPROVE
}
}
...
...
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