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
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
278 additions
and
108 deletions
+278
-108
src/components/FormCreate/src/components/useApiSelect.tsx
+1
-1
src/components/SimpleProcessDesignerV2/src/consts.ts
+21
-1
src/components/SimpleProcessDesignerV2/src/node.ts
+111
-80
src/components/SimpleProcessDesignerV2/src/nodes-config/CopyTaskNodeConfig.vue
+77
-4
src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue
+68
-22
No files found.
src/components/FormCreate/src/components/useApiSelect.tsx
View file @
158708c1
...
...
@@ -185,7 +185,7 @@ export const useApiSelect = (option: ApiSelectProps) => {
</
el
-
select
>
)
}
debugger
//
debugger
return
(
<
el
-
select
class=
"w-1/1"
...
...
src/components/SimpleProcessDesignerV2/src/consts.ts
View file @
158708c1
...
...
@@ -79,7 +79,7 @@ export interface SimpleFlowNode {
// 审批按钮设置
buttonsSetting
?:
any
[]
// 表单权限
fieldsPermission
?:
Array
<
Record
<
string
,
string
>>
fieldsPermission
?:
Array
<
Record
<
string
,
any
>>
// 审批任务超时处理
timeoutHandler
?:
TimeoutHandler
// 审批任务拒绝处理
...
...
@@ -145,6 +145,14 @@ export enum CandidateStrategy {
* 指定用户组
*/
USER_GROUP
=
40
,
/**
* 表单内用户字段
*/
USER_FIELD_ON_FORM
=
50
,
/**
* 表单内部门负责人
*/
DEPT_LEADER_ON_FORM
=
51
,
/**
* 流程表达式
*/
...
...
@@ -424,6 +432,8 @@ export const CANDIDATE_STRATEGY: DictDataVO[] = [
{
label
:
'发起人部门负责人'
,
value
:
CandidateStrategy
.
START_USER_DEPT_LEADER
},
{
label
:
'发起人连续部门负责人'
,
value
:
CandidateStrategy
.
START_USER_MULTI_LEVEL_DEPT_LEADER
},
{
label
:
'用户组'
,
value
:
CandidateStrategy
.
USER_GROUP
},
{
label
:
'表单内用户字段'
,
value
:
CandidateStrategy
.
USER_FIELD_ON_FORM
},
{
label
:
'表单内部门负责人'
,
value
:
CandidateStrategy
.
DEPT_LEADER_ON_FORM
},
{
label
:
'流程表达式'
,
value
:
CandidateStrategy
.
EXPRESSION
}
]
// 审批节点 的审批类型
...
...
@@ -548,3 +558,13 @@ export const MULTI_LEVEL_DEPT: DictDataVO = [
{
label
:
'第 14 级部门'
,
value
:
14
},
{
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 @@
<el-form-item
v-if=
"
configForm.candidateStrategy == CandidateStrategy.DEPT_MEMBER ||
configForm.candidateStrategy == CandidateStrategy.DEPT_LEADER
configForm.candidateStrategy == CandidateStrategy.DEPT_LEADER ||
configForm.candidateStrategy == CandidateStrategy.MULTI_LEVEL_DEPT_LEADER
"
label=
"指定部门"
prop=
"deptIds"
...
...
@@ -122,7 +123,54 @@
/>
</el-select>
</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
v-if=
"configForm.candidateStrategy === CandidateStrategy.EXPRESSION"
label=
"流程表达式"
...
...
@@ -201,7 +249,8 @@ import {
CandidateStrategy
,
NodeType
,
CANDIDATE_STRATEGY
,
FieldPermissionType
FieldPermissionType
,
MULTI_LEVEL_DEPT
}
from
'../consts'
import
{
useWatchNode
,
...
...
@@ -221,6 +270,15 @@ const props = defineProps({
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
()
// 当前节点
...
...
@@ -230,9 +288,21 @@ const { nodeName, showInput, clickIcon, blurEvent } = useNodeName(NodeType.COPY_
// 激活的 Tab 标签页
const
activeTabName
=
ref
(
'user'
)
// 表单字段权限配置
const
{
formType
,
fieldsPermissionConfig
,
getNodeConfigFormFields
}
=
useFormFieldsPermission
(
const
{
formType
,
fieldsPermissionConfig
,
formFieldOptions
,
getNodeConfigFormFields
}
=
useFormFieldsPermission
(
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
// 表单校验规则
...
...
@@ -243,6 +313,8 @@ const formRules = reactive({
deptIds
:
[{
required
:
true
,
message
:
'部门不能为空'
,
trigger
:
'change'
}],
userGroups
:
[{
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'
}]
})
...
...
@@ -272,6 +344,7 @@ const changeCandidateStrategy = () => {
configForm
.
value
.
postIds
=
[]
configForm
.
value
.
userGroups
=
[]
configForm
.
value
.
deptLevel
=
1
configForm
.
value
.
userFieldOnForm
=
''
}
// 保存配置
const
saveConfig
=
async
()
=>
{
...
...
src/components/SimpleProcessDesignerV2/src/nodes-config/UserTaskNodeConfig.vue
View file @
158708c1
...
...
@@ -56,7 +56,6 @@
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
v-if=
"configForm.candidateStrategy == CandidateStrategy.ROLE"
label=
"指定角色"
...
...
@@ -95,25 +94,6 @@
/>
</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"
label=
"指定岗位"
prop=
"postIds"
...
...
@@ -157,6 +137,54 @@
/>
</el-select>
</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:后续要支持选择已经存好的表达式 -->
<el-form-item
v-if=
"configForm.candidateStrategy === CandidateStrategy.EXPRESSION"
...
...
@@ -468,8 +496,10 @@ const deptLevelLabel = computed(() => {
let
label
=
'部门负责人来源'
if
(
configForm
.
value
.
candidateStrategy
==
CandidateStrategy
.
MULTI_LEVEL_DEPT_LEADER
)
{
label
=
label
+
'(指定部门向上)'
}
else
if
(
configForm
.
value
.
candidateStrategy
==
CandidateStrategy
.
DEPT_LEADER_ON_FORM
)
{
label
=
label
+
'(表单内部门向上)'
}
else
{
label
=
label
+
'(发起人部门向上)'
label
=
label
+
'(发起人部门向上)'
}
return
label
})
...
...
@@ -482,9 +512,21 @@ const { nodeName, showInput, clickIcon, blurEvent } = useNodeName(NodeType.USER_
// 激活的 Tab 标签页
const
activeTabName
=
ref
(
'user'
)
// 表单字段权限设置
const
{
formType
,
fieldsPermissionConfig
,
getNodeConfigFormFields
}
=
useFormFieldsPermission
(
const
{
formType
,
fieldsPermissionConfig
,
formFieldOptions
,
getNodeConfigFormFields
}
=
useFormFieldsPermission
(
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
}
=
useButtonsSetting
()
...
...
@@ -498,6 +540,8 @@ const formRules = reactive({
roleIds
:
[{
required
:
true
,
message
:
'角色不能为空'
,
trigger
:
'change'
}],
deptIds
:
[{
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'
}],
expression
:
[{
required
:
true
,
message
:
'流程表达式不能为空'
,
trigger
:
'blur'
}],
approveMethod
:
[{
required
:
true
,
message
:
'多人审批方式不能为空'
,
trigger
:
'change'
}],
...
...
@@ -533,6 +577,8 @@ const changeCandidateStrategy = () => {
configForm
.
value
.
postIds
=
[]
configForm
.
value
.
userGroups
=
[]
configForm
.
value
.
deptLevel
=
1
configForm
.
value
.
userFieldOnForm
=
''
configForm
.
value
.
deptFieldOnForm
=
''
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