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
bad11ff2
authored
Feb 26, 2025
by
Lesan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 子流程-多实例
parent
2ff1bccb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
148 additions
and
7 deletions
+148
-7
src/components/SimpleProcessDesignerV2/src/NodeHandler.vue
+3
-0
src/components/SimpleProcessDesignerV2/src/consts.ts
+27
-0
src/components/SimpleProcessDesignerV2/src/nodes-config/ChildProcessNodeConfig.vue
+118
-7
No files found.
src/components/SimpleProcessDesignerV2/src/NodeHandler.vue
View file @
bad11ff2
...
...
@@ -306,6 +306,9 @@ const addNode = (type: number) => {
},
timeoutSetting
:
{
enable
:
false
},
multiInstanceSetting
:
{
enable
:
false
}
}
}
...
...
src/components/SimpleProcessDesignerV2/src/consts.ts
View file @
bad11ff2
...
...
@@ -821,6 +821,7 @@ export type ChildProcessSetting = {
skipStartUserNode
:
boolean
,
startUserSetting
:
StartUserSetting
,
timeoutSetting
:
TimeoutSetting
,
multiInstanceSetting
:
MultiInstanceSetting
,
}
export
type
IOParameter
=
{
source
:
string
...
...
@@ -836,6 +837,13 @@ export type TimeoutSetting = {
type
?:
DelayTypeEnum
,
timeExpression
?:
string
,
}
export
type
MultiInstanceSetting
=
{
enable
:
boolean
,
sequential
?:
boolean
,
completeRatio
?:
number
,
sourceType
?:
ChildProcessMultiInstanceSourceTypeEnum
,
source
?:
string
,
}
export
enum
ChildProcessStartUserTypeEnum
{
/**
* 同主流程发起人
...
...
@@ -869,3 +877,22 @@ export const CHILD_PROCESS_START_USER_EMPTY_TYPE = [
{
label
:
'子流程管理员'
,
value
:
ChildProcessStartUserEmptyTypeEnum
.
CHILD_PROCESS_ADMIN
},
{
label
:
'主流程管理员'
,
value
:
ChildProcessStartUserEmptyTypeEnum
.
MAIN_PROCESS_ADMIN
}
]
export
enum
ChildProcessMultiInstanceSourceTypeEnum
{
/**
* 固定数量
*/
FIXED_QUANTITY
=
1
,
/**
* 数字表单
*/
DIGITAL_FORM
=
2
,
/**
* 多项表单
*/
MULTI_FORM
=
3
,
}
export
const
CHILD_PROCESS_MULTI_INSTANCE_SOURCE_TYPE
=
[
{
label
:
'固定数量'
,
value
:
ChildProcessMultiInstanceSourceTypeEnum
.
FIXED_QUANTITY
},
{
label
:
'数字表单'
,
value
:
ChildProcessMultiInstanceSourceTypeEnum
.
DIGITAL_FORM
},
{
label
:
'多项表单'
,
value
:
ChildProcessMultiInstanceSourceTypeEnum
.
MULTI_FORM
}
]
src/components/SimpleProcessDesignerV2/src/nodes-config/ChildProcessNodeConfig.vue
View file @
bad11ff2
...
...
@@ -164,8 +164,10 @@
<el-radio
v-for=
"item in CHILD_PROCESS_START_USER_TYPE"
:key=
"item.value"
:value=
"item.value"
>
{{ item.label }}
</el-radio>
:value=
"item.value"
>
{{ item.label }}
</el-radio
>
</el-radio-group>
</el-form-item>
<el-form-item
...
...
@@ -177,8 +179,10 @@
<el-radio
v-for=
"item in CHILD_PROCESS_START_USER_EMPTY_TYPE"
:key=
"item.value"
:value=
"item.value"
>
{{ item.label }}
</el-radio>
:value=
"item.value"
>
{{ item.label }}
</el-radio
>
</el-radio-group>
</el-form-item>
<el-form-item
...
...
@@ -249,6 +253,68 @@
<el-text>
后进入下一节点
</el-text>
</el-form-item>
</div>
<el-divider
content-position=
"left"
>
多实例设置
</el-divider>
<el-form-item
label=
"启用开关"
prop=
"multiInstanceEnable"
>
<el-switch
v-model=
"configForm.multiInstanceEnable"
active-text=
"开启"
inactive-text=
"关闭"
/>
</el-form-item>
<div
v-if=
"configForm.multiInstanceEnable"
>
<el-form-item
prop=
"sequential"
>
<el-switch
v-model=
"configForm.sequential"
active-text=
"串行"
inactive-text=
"并行"
/>
</el-form-item>
<el-form-item
prop=
"completeRatio"
>
<el-text>
完成比例(%)
</el-text>
<el-input-number
class=
"ml-10px"
v-model=
"configForm.completeRatio"
:min=
"10"
:max=
"100"
:step=
"10"
/>
</el-form-item>
<el-form-item
prop=
"multiInstanceSourceType"
>
<el-text>
多实例来源
</el-text>
<el-select
class=
"ml-10px w-200px!"
v-model=
"configForm.multiInstanceSourceType"
@
change=
"handleMultiInstanceSourceTypeChange"
>
<el-option
v-for=
"item in CHILD_PROCESS_MULTI_INSTANCE_SOURCE_TYPE"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
/>
</el-select>
</el-form-item>
<el-form-item
v-if=
"configForm.multiInstanceSourceType === 1"
>
<el-input-number
v-model=
"configForm.multiInstanceSource"
:min=
"1"
/>
</el-form-item>
<el-form-item
v-if=
"configForm.multiInstanceSourceType === 2"
>
<el-select
class=
"w-200px!"
v-model=
"configForm.multiInstanceSource"
>
<el-option
v-for=
"(field, fIdx) in digitalFormFieldOptions"
:key=
"fIdx"
:label=
"field.title"
:value=
"field.field"
/>
</el-select>
</el-form-item>
<el-form-item
v-if=
"configForm.multiInstanceSourceType === 3"
>
<el-select
class=
"w-200px!"
v-model=
"configForm.multiInstanceSource"
>
<el-option
v-for=
"(field, fIdx) in multiFormFieldOptions"
:key=
"fIdx"
:label=
"field.title"
:value=
"field.field"
/>
</el-select>
</el-form-item>
</div>
</el-form>
</div>
</el-tab-pane>
...
...
@@ -276,7 +342,9 @@ import {
ChildProcessStartUserTypeEnum
,
CHILD_PROCESS_START_USER_TYPE
,
ChildProcessStartUserEmptyTypeEnum
,
CHILD_PROCESS_START_USER_EMPTY_TYPE
CHILD_PROCESS_START_USER_EMPTY_TYPE
,
CHILD_PROCESS_MULTI_INSTANCE_SOURCE_TYPE
,
ChildProcessMultiInstanceSourceTypeEnum
}
from
'../consts'
import
{
useWatchNode
,
useDrawer
,
useNodeName
,
useFormFieldsAndStartUser
}
from
'../node'
import
{
parseFormFields
}
from
'@/components/FormCreate/src/utils'
...
...
@@ -315,7 +383,8 @@ const formRules = reactive({
timeoutEnable
:
[{
required
:
true
,
message
:
'超时设置是否开启不能为空'
,
trigger
:
'change'
}],
timeoutType
:
[{
required
:
true
,
message
:
'超时设置时间不能为空'
,
trigger
:
'change'
}],
timeDuration
:
[{
required
:
true
,
message
:
'超时设置时间不能为空'
,
trigger
:
'change'
}],
dateTime
:
[{
required
:
true
,
message
:
'超时设置时间不能为空'
,
trigger
:
'change'
}]
dateTime
:
[{
required
:
true
,
message
:
'超时设置时间不能为空'
,
trigger
:
'change'
}],
multiInstanceEnable
:
[{
required
:
true
,
message
:
'多实例设置不能为空'
,
trigger
:
'change'
}]
})
type
ChildProcessFormType
=
{
async
:
boolean
...
...
@@ -331,6 +400,11 @@ type ChildProcessFormType = {
timeDuration
:
number
timeUnit
:
TimeUnitType
dateTime
:
string
multiInstanceEnable
:
boolean
sequential
:
boolean
completeRatio
:
number
multiInstanceSourceType
:
ChildProcessMultiInstanceSourceTypeEnum
multiInstanceSource
:
string
}
const
configForm
=
ref
<
ChildProcessFormType
>
({
async
:
false
,
...
...
@@ -345,10 +419,21 @@ const configForm = ref<ChildProcessFormType>({
timeoutType
:
DelayTypeEnum
.
FIXED_TIME_DURATION
,
timeDuration
:
1
,
timeUnit
:
TimeUnitType
.
HOUR
,
dateTime
:
''
dateTime
:
''
,
multiInstanceEnable
:
false
,
sequential
:
false
,
completeRatio
:
100
,
multiInstanceSourceType
:
ChildProcessMultiInstanceSourceTypeEnum
.
FIXED_QUANTITY
,
multiInstanceSource
:
''
})
const
childProcessOptions
=
ref
()
const
formFieldOptions
=
useFormFieldsAndStartUser
()
const
digitalFormFieldOptions
=
computed
(()
=>
{
return
formFieldOptions
.
filter
((
item
)
=>
item
.
type
===
'inputNumber'
)
})
const
multiFormFieldOptions
=
computed
(()
=>
{
return
formFieldOptions
.
filter
((
item
)
=>
item
.
type
===
'select'
||
item
.
type
===
'checkbox'
)
})
const
childFormFieldOptions
=
ref
()
// 保存配置
...
...
@@ -393,6 +478,19 @@ const saveConfig = async () => {
configForm
.
value
.
dateTime
}
}
// 8. 多实例设置
currentNode
.
value
.
childProcessSetting
.
multiInstanceSetting
=
{
enable
:
configForm
.
value
.
multiInstanceEnable
}
if
(
configForm
.
value
.
multiInstanceEnable
)
{
currentNode
.
value
.
childProcessSetting
.
multiInstanceSetting
.
sequential
=
configForm
.
value
.
sequential
currentNode
.
value
.
childProcessSetting
.
multiInstanceSetting
.
completeRatio
=
configForm
.
value
.
completeRatio
currentNode
.
value
.
childProcessSetting
.
multiInstanceSetting
.
sourceType
=
configForm
.
value
.
multiInstanceSourceType
currentNode
.
value
.
childProcessSetting
.
multiInstanceSetting
.
source
=
configForm
.
value
.
multiInstanceSource
}
}
currentNode
.
value
.
showText
=
`调用子流程:
${
childInfo
.
name
}
`
...
...
@@ -436,6 +534,16 @@ const showChildProcessNodeConfig = (node: SimpleFlowNode) => {
configForm
.
value
.
dateTime
=
node
.
childProcessSetting
.
timeoutSetting
.
timeExpression
??
''
}
}
// 8. 多实例设置
configForm
.
value
.
multiInstanceEnable
=
node
.
childProcessSetting
.
multiInstanceSetting
.
enable
??
false
if
(
configForm
.
value
.
multiInstanceEnable
)
{
configForm
.
value
.
sequential
=
node
.
childProcessSetting
.
multiInstanceSetting
.
sequential
??
false
configForm
.
value
.
completeRatio
=
node
.
childProcessSetting
.
multiInstanceSetting
.
completeRatio
??
100
configForm
.
value
.
multiInstanceSourceType
=
node
.
childProcessSetting
.
multiInstanceSetting
.
sourceType
??
ChildProcessMultiInstanceSourceTypeEnum
.
FIXED_QUANTITY
configForm
.
value
.
multiInstanceSource
=
node
.
childProcessSetting
.
multiInstanceSetting
.
source
??
''
}
}
loadFormInfo
()
}
...
...
@@ -481,6 +589,9 @@ const getIsoTimeDuration = () => {
}
return
strTimeDuration
}
const
handleMultiInstanceSourceTypeChange
=
()
=>
{
configForm
.
value
.
multiInstanceSource
=
''
}
onMounted
(
async
()
=>
{
childProcessOptions
.
value
=
await
getModelList
(
undefined
)
...
...
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