Skip to content

Commit f87b37e

Browse files
YunaiVgitee-org
authored andcommitted
!619 同步最新的 bpm 改动
Merge pull request !619 from 芋道源码/feature/bpm
2 parents c79f027 + 9f0f5b0 commit f87b37e

File tree

28 files changed

+2717
-715
lines changed

28 files changed

+2717
-715
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@
9696
"@vitejs/plugin-vue": "^5.0.4",
9797
"@vitejs/plugin-vue-jsx": "^3.1.0",
9898
"autoprefixer": "^10.4.17",
99-
"bpmn-js": "8.10.0",
100-
"bpmn-js-properties-panel": "0.46.0",
99+
"bpmn-js": "^17.9.2",
100+
"bpmn-js-properties-panel": "5.23.0",
101101
"consola": "^3.2.3",
102102
"eslint": "^8.57.0",
103103
"eslint-config-prettier": "^9.1.0",

pnpm-lock.yaml

Lines changed: 304 additions & 125 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/SimpleProcessDesignerV2/src/node.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
AssignStartUserHandlerType,
1616
AssignEmptyHandlerType,
1717
FieldPermissionType,
18-
ProcessVariableEnum
1918
} from './consts'
2019
import { parseFormFields } from '@/components/FormCreate/src/utils/index'
2120
export function useWatchNode(props: { flowNode: SimpleFlowNode }): Ref<SimpleFlowNode> {
@@ -37,13 +36,6 @@ const parseFormCreateFields = (formFields?: string[]) => {
3736
parseFormFields(JSON.parse(fieldStr), result)
3837
})
3938
}
40-
// 固定添加发起人 ID 字段
41-
result.unshift({
42-
field: ProcessVariableEnum.START_USER_ID,
43-
title: '发起人',
44-
type: 'UserSelect',
45-
required: true
46-
})
4739
return result
4840
}
4941

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

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,13 @@
2626
</div>
2727
</template>
2828
<div>
29-
<div class="mb-3 font-size-16px" v-if="currentNode.defaultFlow">未满足其它条件时,将进入此分支(该分支不可编辑和删除)</div>
29+
<div class="mb-3 font-size-16px" v-if="currentNode.defaultFlow"
30+
>未满足其它条件时,将进入此分支(该分支不可编辑和删除)</div
31+
>
3032
<div v-else>
31-
<el-form
32-
ref="formRef"
33-
:model="currentNode"
34-
:rules="formRules"
35-
label-position="top"
36-
>
33+
<el-form ref="formRef" :model="currentNode" :rules="formRules" label-position="top">
3734
<el-form-item label="配置方式" prop="conditionType">
38-
<el-radio-group
39-
v-model="currentNode.conditionType"
40-
@change="changeConditionType"
41-
>
35+
<el-radio-group v-model="currentNode.conditionType" @change="changeConditionType">
4236
<el-radio
4337
v-for="(dict, index) in conditionConfigTypes"
4438
:key="index"
@@ -108,10 +102,11 @@
108102
<div class="mr-2">
109103
<el-select style="width: 160px" v-model="rule.leftSide">
110104
<el-option
111-
v-for="(item, index) in fieldsInfo"
105+
v-for="(item, index) in fieldOptions"
112106
:key="index"
113107
:label="item.title"
114108
:value="item.field"
109+
:disabled="!item.required"
115110
/>
116111
</el-select>
117112
</div>
@@ -165,10 +160,12 @@ import {
165160
COMPARISON_OPERATORS,
166161
ConditionGroup,
167162
Condition,
168-
ConditionRule
163+
ConditionRule,
164+
ProcessVariableEnum
169165
} from '../consts'
170166
import { getDefaultConditionNodeName } from '../utils'
171167
import { useFormFields } from '../node'
168+
import { BpmModelFormType } from '@/utils/constants'
172169
const message = useMessage() // 消息弹窗
173170
defineOptions({
174171
name: 'ConditionNodeConfig'
@@ -177,8 +174,8 @@ const formType = inject<Ref<number>>('formType') // 表单类型
177174
const conditionConfigTypes = computed(() => {
178175
return CONDITION_CONFIG_TYPES.filter((item) => {
179176
// 业务表单暂时去掉条件规则选项
180-
if (formType?.value !== 10) {
181-
return item.value === ConditionType.RULE
177+
if (formType?.value === BpmModelFormType.CUSTOM && item.value === ConditionType.RULE) {
178+
return false
182179
} else {
183180
return true
184181
}
@@ -368,16 +365,29 @@ const addConditionRule = (condition: Condition, idx: number) => {
368365
const deleteConditionRule = (condition: Condition, idx: number) => {
369366
condition.rules.splice(idx, 1)
370367
}
371-
372368
const fieldsInfo = useFormFields()
373369
370+
/** 条件规则可选择的表单字段 */
371+
const fieldOptions = computed(() => {
372+
const fieldsCopy = fieldsInfo.slice()
373+
// 固定添加发起人 ID 字段
374+
fieldsCopy.unshift({
375+
field: ProcessVariableEnum.START_USER_ID,
376+
title: '发起人',
377+
required: true
378+
})
379+
return fieldsCopy
380+
})
381+
382+
/** 获取字段名称 */
374383
const getFieldTitle = (field: string) => {
375384
const item = fieldsInfo.find((item) => item.field === field)
376385
return item?.title
377386
}
378387
388+
/** 获取操作符名称 */
379389
const getOpName = (opCode: string): string => {
380-
const opName = COMPARISON_OPERATORS.find((item) => item.value === opCode)
390+
const opName = COMPARISON_OPERATORS.find((item: any) => item.value === opCode)
381391
return opName?.label
382392
}
383393
</script>

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,8 @@ import {
469469
TimeoutHandlerType,
470470
ASSIGN_EMPTY_HANDLER_TYPES,
471471
AssignEmptyHandlerType,
472-
FieldPermissionType
472+
FieldPermissionType,
473+
ProcessVariableEnum
473474
} from '../consts'
474475
475476
import {
@@ -519,6 +520,13 @@ const { formType, fieldsPermissionConfig, formFieldOptions, getNodeConfigFormFie
519520
useFormFieldsPermission(FieldPermissionType.READ)
520521
// 表单内用户字段选项, 必须是必填和用户选择器
521522
const userFieldOnFormOptions = computed(() => {
523+
// 固定添加发起人 ID 字段
524+
formFieldOptions.unshift({
525+
field: ProcessVariableEnum.START_USER_ID,
526+
title: '发起人',
527+
type: 'UserSelect',
528+
required: true
529+
})
522530
return formFieldOptions.filter((item) => item.type === 'UserSelect')
523531
})
524532
// 表单内部门字段选项, 必须是必填和部门选择器

src/components/bpmnProcessDesigner/package/designer/plugins/descriptor/flowableDescriptor.json

Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,31 @@
406406
"name": "variableMappingDelegateExpression",
407407
"isAttr": true,
408408
"type": "String"
409+
},
410+
{
411+
"name": "calledElementType",
412+
"isAttr": true,
413+
"type": "String"
414+
},
415+
{
416+
"name": "processInstanceName",
417+
"isAttr": true,
418+
"type": "String"
419+
},
420+
{
421+
"name": "inheritBusinessKey",
422+
"isAttr": true,
423+
"type": "Boolean"
424+
},
425+
{
426+
"name": "businessKey",
427+
"isAttr": true,
428+
"type": "String"
429+
},
430+
{
431+
"name": "inheritVariables",
432+
"isAttr": true,
433+
"type": "Boolean"
409434
}
410435
]
411436
},
@@ -1281,6 +1306,138 @@
12811306
"isBody": true
12821307
}
12831308
]
1309+
},
1310+
{
1311+
"name": "ButtonsSetting",
1312+
"superClass": ["Element"],
1313+
"meta": {
1314+
"allowedIn": ["bpmn:UserTask"]
1315+
},
1316+
"properties": [
1317+
{
1318+
"name": "flowable:id",
1319+
"type": "Integer",
1320+
"isAttr": true
1321+
},
1322+
{
1323+
"name": "flowable:enable",
1324+
"type": "Boolean",
1325+
"isAttr": true
1326+
},
1327+
{
1328+
"name": "flowable:displayName",
1329+
"type": "String",
1330+
"isAttr": true
1331+
}
1332+
]
1333+
},
1334+
{
1335+
"name": "FieldsPermission",
1336+
"superClass": ["Element"],
1337+
"meta": {
1338+
"allowedIn": ["bpmn:UserTask"]
1339+
},
1340+
"properties": [
1341+
{
1342+
"name": "flowable:field",
1343+
"type": "String",
1344+
"isAttr": true
1345+
},
1346+
{
1347+
"name": "flowable:title",
1348+
"type": "String",
1349+
"isAttr": true
1350+
},
1351+
{
1352+
"name": "flowable:permission",
1353+
"type": "String",
1354+
"isAttr": true
1355+
}
1356+
]
1357+
},
1358+
{
1359+
"name": "BoundaryEventType",
1360+
"superClass": ["Element"],
1361+
"meta": {
1362+
"allowedIn": ["bpmn:BoundaryEvent"]
1363+
},
1364+
"properties": [
1365+
{
1366+
"name": "value",
1367+
"type": "Integer",
1368+
"isBody": true
1369+
}
1370+
]
1371+
},
1372+
{
1373+
"name": "TimeoutHandlerType",
1374+
"superClass": ["Element"],
1375+
"meta": {
1376+
"allowedIn": ["bpmn:BoundaryEvent"]
1377+
},
1378+
"properties": [
1379+
{
1380+
"name": "value",
1381+
"type": "Integer",
1382+
"isBody": true
1383+
}
1384+
]
1385+
},
1386+
{
1387+
"name": "ApproveType",
1388+
"superClass": ["Element"],
1389+
"meta": {
1390+
"allowedIn": ["bpmn:UserTask"]
1391+
},
1392+
"properties": [
1393+
{
1394+
"name": "value",
1395+
"type": "Integer",
1396+
"isBody": true
1397+
}
1398+
]
1399+
},
1400+
{
1401+
"name": "ApproveMethod",
1402+
"superClass": ["Element"],
1403+
"meta": {
1404+
"allowedIn": ["bpmn:UserTask"]
1405+
},
1406+
"properties": [
1407+
{
1408+
"name": "value",
1409+
"type": "Integer",
1410+
"isBody": true
1411+
}
1412+
]
1413+
},
1414+
{
1415+
"name": "CandidateStrategy",
1416+
"superClass": ["Element"],
1417+
"meta": {
1418+
"allowedIn": ["bpmn:UserTask"]
1419+
},
1420+
"properties": [
1421+
{
1422+
"name": "value",
1423+
"type": "Integer",
1424+
"isBody": true
1425+
}
1426+
]
1427+
},
1428+
{
1429+
"name": "CandidateParam",
1430+
"superClass": ["Element"],
1431+
"meta": {
1432+
"allowedIn": ["bpmn:UserTask"]
1433+
},
1434+
"properties": [
1435+
{
1436+
"name": "value",
1437+
"type": "String",
1438+
"isBody": true
1439+
}
1440+
]
12841441
}
12851442
],
12861443
"emumerations": []

src/components/bpmnProcessDesigner/package/designer/plugins/palette/CustomPalette.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,18 @@ F.prototype.getPaletteEntries = function () {
165165
'bpmn-icon-user-task',
166166
translate('Create User Task')
167167
),
168+
'create.call-activity': createAction(
169+
'bpmn:CallActivity',
170+
'activity',
171+
'bpmn-icon-call-activity',
172+
translate('Create Call Activity')
173+
),
174+
'create.service-task': createAction(
175+
'bpmn:ServiceTask',
176+
'activity',
177+
'bpmn-icon-service',
178+
translate('Create Service Task')
179+
),
168180
'create.data-object': createAction(
169181
'bpmn:DataObjectReference',
170182
'data-object',

src/components/bpmnProcessDesigner/package/designer/plugins/palette/paletteProvider.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,12 @@ PaletteProvider.prototype.getPaletteEntries = function () {
171171
'bpmn-icon-user-task',
172172
translate('Create User Task')
173173
),
174+
'create.service-task': createAction(
175+
'bpmn:ServiceTask',
176+
'activity',
177+
'bpmn-icon-service',
178+
translate('Create Service Task')
179+
),
174180
'create.data-object': createAction(
175181
'bpmn:DataObjectReference',
176182
'data-object',

src/components/bpmnProcessDesigner/package/designer/plugins/translate/zh.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ export default {
5656
'Create EndEvent': '创建结束事件',
5757
'Create Task': '创建任务',
5858
'Create User Task': '创建用户任务',
59+
'Create Call Activity': '创建调用活动',
60+
'Create Service Task': '创建服务任务',
5961
'Create Gateway': '创建网关',
6062
'Create DataObjectReference': '创建数据对象',
6163
'Create DataStoreReference': '创建数据存储',

0 commit comments

Comments
 (0)