Skip to content

Commit 9c9f09f

Browse files
committed
fix: 代码审查修改
1 parent 357955c commit 9c9f09f

File tree

6 files changed

+53
-59
lines changed

6 files changed

+53
-59
lines changed

src/assets/svgs/bpm/async-child-process.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/components/SimpleProcessDesignerV2/src/NodeHandler.vue

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,6 @@
6969
</div>
7070
<div class="handler-item-text">子流程</div>
7171
</div>
72-
<div class="handler-item" @click="addNode(NodeType.ASYNC_CHILD_PROCESS_NODE)">
73-
<div class="handler-item-icon async-child-process">
74-
<span class="iconfont icon-size icon-async-child-process"></span>
75-
</div>
76-
<div class="handler-item-text">异步子流程</div>
77-
</div>
7872
</div>
7973
<template #reference>
8074
<div class="add-icon"><Icon icon="ep:plus" /></div>
@@ -303,8 +297,8 @@ const addNode = (type: number) => {
303297
type: NodeType.CHILD_PROCESS_NODE,
304298
childNode: props.childNode,
305299
childProcessSetting: {
306-
calledElement: '',
307-
calledElementName: '',
300+
calledProcessDefinitionKey: '',
301+
calledProcessDefinitionName: '',
308302
async: false,
309303
skipStartUserNode: false,
310304
startUserSetting: {

src/components/SimpleProcessDesignerV2/src/consts.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,10 @@ export enum NodeType {
3939
TRIGGER_NODE = 15,
4040

4141
/**
42-
* 触发器节点
42+
* 子流程节点
4343
*/
4444
CHILD_PROCESS_NODE = 20,
4545

46-
/**
47-
* 触发器节点
48-
*/
49-
ASYNC_CHILD_PROCESS_NODE = 21,
50-
5146
/**
5247
* 条件节点
5348
*/
@@ -804,11 +799,11 @@ export const TRIGGER_TYPES: DictDataVO[] = [
804799
* 子流程节点结构定义
805800
*/
806801
export type ChildProcessSetting = {
807-
calledElement: string
808-
calledElementName: string
802+
calledProcessDefinitionKey: string
803+
calledProcessDefinitionName: string
809804
async: boolean,
810-
inVariable?: IOParameter[],
811-
outVariable?: IOParameter[],
805+
inVariables?: IOParameter[],
806+
outVariables?: IOParameter[],
812807
skipStartUserNode: boolean,
813808
startUserSetting: StartUserSetting,
814809
}
@@ -823,5 +818,5 @@ export type IOParameter = {
823818
export type StartUserSetting = {
824819
type: number
825820
formField?: string
826-
emptyHandleType?: number
821+
emptyType?: number
827822
}

src/components/SimpleProcessDesignerV2/src/nodes-config/ChildProcessNodeConfig.vue

Lines changed: 44 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,16 @@
2727
<el-tab-pane label="子流程" name="child">
2828
<div>
2929
<el-form ref="formRef" :model="configForm" label-position="top" :rules="formRules">
30-
<el-form-item label="选择子流程" prop="calledElement">
30+
<el-form-item label="是否异步" prop="async">
31+
<el-switch
32+
v-model="configForm.async"
33+
active-text="异步"
34+
inactive-text="不异步"
35+
/>
36+
</el-form-item>
37+
<el-form-item label="选择子流程" prop="calledProcessDefinitionKey">
3138
<el-select
32-
v-model="configForm.calledElement"
39+
v-model="configForm.calledProcessDefinitionKey"
3340
clearable
3441
@change="handleCalledElementChange"
3542
>
@@ -48,11 +55,11 @@
4855
inactive-text="不跳过"
4956
/>
5057
</el-form-item>
51-
<el-form-item label="主→子变量传递" prop="inVariable">
52-
<div class="flex pt-2" v-for="(item, index) in configForm.inVariable" :key="index">
58+
<el-form-item label="主→子变量传递" prop="inVariables">
59+
<div class="flex pt-2" v-for="(item, index) in configForm.inVariables" :key="index">
5360
<div class="mr-2">
5461
<el-form-item
55-
:prop="`inVariable.${index}.source`"
62+
:prop="`inVariables.${index}.source`"
5663
:rules="{
5764
required: true,
5865
message: '变量不能为空',
@@ -71,7 +78,7 @@
7178
</div>
7279
<div class="mr-2">
7380
<el-form-item
74-
:prop="`inVariable.${index}.target`"
81+
:prop="`inVariables.${index}.target`"
7582
:rules="{
7683
required: true,
7784
message: '变量不能为空',
@@ -92,23 +99,23 @@
9299
<Icon
93100
icon="ep:delete"
94101
:size="18"
95-
@click="deleteVariable(configForm.inVariable, index)"
102+
@click="deleteVariable(configForm.inVariables, index)"
96103
/>
97104
</div>
98105
</div>
99-
<el-button type="primary" text @click="addVariable(configForm.inVariable)">
106+
<el-button type="primary" text @click="addVariable(configForm.inVariables)">
100107
<Icon icon="ep:plus" class="mr-5px" />添加一行
101108
</el-button>
102109
</el-form-item>
103110
<el-form-item
104-
v-if="currentNode.childProcessSetting?.async === false"
111+
v-if="configForm.async === false"
105112
label="子→主变量传递"
106-
prop="outVariable"
113+
prop="outVariables"
107114
>
108-
<div class="flex pt-2" v-for="(item, index) in configForm.outVariable" :key="index">
115+
<div class="flex pt-2" v-for="(item, index) in configForm.outVariables" :key="index">
109116
<div class="mr-2">
110117
<el-form-item
111-
:prop="`outVariable.${index}.source`"
118+
:prop="`outVariables.${index}.source`"
112119
:rules="{
113120
required: true,
114121
message: '变量不能为空',
@@ -127,7 +134,7 @@
127134
</div>
128135
<div class="mr-2">
129136
<el-form-item
130-
:prop="`outVariable.${index}.target`"
137+
:prop="`outVariables.${index}.target`"
131138
:rules="{
132139
required: true,
133140
message: '变量不能为空',
@@ -148,11 +155,11 @@
148155
<Icon
149156
icon="ep:delete"
150157
:size="18"
151-
@click="deleteVariable(configForm.outVariable, index)"
158+
@click="deleteVariable(configForm.outVariables, index)"
152159
/>
153160
</div>
154161
</div>
155-
<el-button type="primary" text @click="addVariable(configForm.outVariable)">
162+
<el-button type="primary" text @click="addVariable(configForm.outVariables)">
156163
<Icon icon="ep:plus" class="mr-5px" />添加一行
157164
</el-button>
158165
</el-form-item>
@@ -227,7 +234,8 @@ const activeTabName = ref('child')
227234
const formRef = ref() // 表单 Ref
228235
// 表单校验规则
229236
const formRules = reactive({
230-
calledElement: [{ required: true, message: '子流程不能为空', trigger: 'change' }],
237+
async: [{ required: true, message: '是否异步不能为空', trigger: 'change' }],
238+
calledProcessDefinitionKey: [{ required: true, message: '子流程不能为空', trigger: 'change' }],
231239
skipStartUserNode: [
232240
{ required: true, message: '是否自动跳过子流程发起节点不能为空', trigger: 'change' }
233241
],
@@ -238,10 +246,10 @@ const formRules = reactive({
238246
startUserFormField: [{ required: true, message: '发起人表单不能为空', trigger: 'change' }]
239247
})
240248
const configForm = ref({
241-
calledElement: '',
249+
calledProcessDefinitionKey: '',
242250
skipStartUserNode: false,
243-
inVariable: [],
244-
outVariable: [],
251+
inVariables: [],
252+
outVariables: [],
245253
startUserType: 1,
246254
startUserEmptyType: 1,
247255
startUserFormField: ''
@@ -257,17 +265,18 @@ const saveConfig = async () => {
257265
const valid = await formRef.value.validate()
258266
if (!valid) return false
259267
const childInfo = childProcessOptions.value.find(
260-
(option) => option.key === configForm.value.calledElement
268+
(option) => option.key === configForm.value.calledProcessDefinitionKey
261269
)
262270
currentNode.value.name = nodeName.value!
263271
if (currentNode.value.childProcessSetting) {
264-
currentNode.value.childProcessSetting.calledElement = childInfo.key
265-
currentNode.value.childProcessSetting.calledElementName = childInfo.name
272+
currentNode.value.childProcessSetting.async = configForm.value.async
273+
currentNode.value.childProcessSetting.calledProcessDefinitionKey = childInfo.key
274+
currentNode.value.childProcessSetting.calledProcessDefinitionName = childInfo.name
266275
currentNode.value.childProcessSetting.skipStartUserNode = configForm.value.skipStartUserNode
267-
currentNode.value.childProcessSetting.inVariable = configForm.value.inVariable
268-
currentNode.value.childProcessSetting.outVariable = configForm.value.outVariable
276+
currentNode.value.childProcessSetting.inVariables = configForm.value.inVariables
277+
currentNode.value.childProcessSetting.outVariables = configForm.value.outVariables
269278
currentNode.value.childProcessSetting.startUserSetting.type = configForm.value.startUserType
270-
currentNode.value.childProcessSetting.startUserSetting.emptyHandleType =
279+
currentNode.value.childProcessSetting.startUserSetting.emptyType =
271280
configForm.value.startUserEmptyType
272281
currentNode.value.childProcessSetting.startUserSetting.formField =
273282
configForm.value.startUserFormField
@@ -280,13 +289,15 @@ const saveConfig = async () => {
280289
const showChildProcessNodeConfig = (node: SimpleFlowNode) => {
281290
nodeName.value = node.name
282291
if (node.childProcessSetting) {
283-
configForm.value.calledElement = node.childProcessSetting.calledElement
292+
configForm.value.async =
293+
node.childProcessSetting.async
294+
configForm.value.calledProcessDefinitionKey =
295+
node.childProcessSetting.calledProcessDefinitionKey
284296
configForm.value.skipStartUserNode = node.childProcessSetting.skipStartUserNode
285-
configForm.value.inVariable = node.childProcessSetting.inVariable
286-
configForm.value.outVariable = node.childProcessSetting.outVariable
297+
configForm.value.inVariables = node.childProcessSetting.inVariables
298+
configForm.value.outVariables = node.childProcessSetting.outVariables
287299
configForm.value.startUserType = node.childProcessSetting.startUserSetting.type
288-
configForm.value.startUserEmptyType =
289-
node.childProcessSetting.startUserSetting.emptyHandleType ?? 1
300+
configForm.value.startUserEmptyType = node.childProcessSetting.startUserSetting.emptyType ?? 1
290301
configForm.value.startUserFormField = node.childProcessSetting.startUserSetting.formField ?? ''
291302
}
292303
loadFormInfo()
@@ -304,13 +315,13 @@ const deleteVariable = (arr, index: number) => {
304315
arr.splice(index, 1)
305316
}
306317
const handleCalledElementChange = () => {
307-
configForm.value.inVariable = []
308-
configForm.value.outVariable = []
318+
configForm.value.inVariables = []
319+
configForm.value.outVariables = []
309320
loadFormInfo()
310321
}
311322
const loadFormInfo = async () => {
312323
const childInfo = childProcessOptions.value.find(
313-
(option) => option.key === configForm.value.calledElement
324+
(option) => option.key === configForm.value.calledProcessDefinitionKey
314325
)
315326
const formInfo = await getForm(childInfo.formId)
316327
childFormFieldOptions.value = []

src/views/bpm/processInstance/detail/ProcessInstanceSimpleViewer.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ const setSimpleModelNodeTaskStatus = (
8686
simpleModel.type === NodeType.START_USER_NODE ||
8787
simpleModel.type === NodeType.USER_TASK_NODE ||
8888
simpleModel.type === NodeType.TRANSACTOR_NODE ||
89-
simpleModel.type === NodeType.CHILD_PROCESS_NODE ||
90-
simpleModel.type === NodeType.ASYNC_CHILD_PROCESS_NODE
89+
simpleModel.type === NodeType.CHILD_PROCESS_NODE
9190
) {
9291
simpleModel.activityStatus = TaskStatusEnum.NOT_START
9392
if (rejectedTaskActivityIds.includes(simpleModel.id)) {

src/views/bpm/processInstance/detail/ProcessInstanceTimeline.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ import parallelSvg from '@/assets/svgs/bpm/parallel.svg'
182182
import finishSvg from '@/assets/svgs/bpm/finish.svg'
183183
import transactorSvg from '@/assets/svgs/bpm/transactor.svg'
184184
import childProcessSvg from '@/assets/svgs/bpm/child-process.svg'
185-
import asyncChildProcessSvg from '@/assets/svgs/bpm/async-child-process.svg'
186185
187186
defineOptions({ name: 'BpmProcessInstanceTimeline' })
188187
withDefaults(
@@ -254,8 +253,6 @@ const nodeTypeSvgMap = {
254253
[NodeType.PARALLEL_BRANCH_NODE]: { color: '#14bb83', svg: parallelSvg },
255254
// 子流程节点
256255
[NodeType.CHILD_PROCESS_NODE]: { color: '#14bb83', svg: childProcessSvg },
257-
// 异步子流程节点
258-
[NodeType.ASYNC_CHILD_PROCESS_NODE]: { color: '#14bb83', svg: asyncChildProcessSvg }
259256
}
260257
261258
// 只有只有状态是 -1、0、1 才展示头像右小角状态小icon
@@ -276,7 +273,6 @@ const getApprovalNodeIcon = (taskStatus: number, nodeType: NodeType) => {
276273
nodeType === NodeType.USER_TASK_NODE ||
277274
nodeType === NodeType.TRANSACTOR_NODE ||
278275
nodeType === NodeType.CHILD_PROCESS_NODE ||
279-
nodeType === NodeType.ASYNC_CHILD_PROCESS_NODE ||
280276
nodeType === NodeType.END_EVENT_NODE
281277
) {
282278
return statusIconMap[taskStatus]?.icon

0 commit comments

Comments
 (0)