From 09d1dbedf9bc7ea91d5c199a254f2e9d76011b69 Mon Sep 17 00:00:00 2001 From: "xunchangguo@126.com" Date: Tue, 10 Sep 2024 16:10:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AF=B9serviceTask=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 +- .../designer/plugins/palette/CustomPalette.js | 6 ++ .../plugins/palette/paletteProvider.js | 6 ++ .../package/designer/plugins/translate/zh.js | 1 + .../package/penal/PropertiesPanel.vue | 4 +- .../penal/properties/ElementProperties.vue | 7 +- .../package/penal/task/ElementTask.vue | 5 + .../task/task-components/ServiceTask.vue | 91 +++++++++++++++++++ 8 files changed, 115 insertions(+), 9 deletions(-) create mode 100644 src/components/bpmnProcessDesigner/package/penal/task/task-components/ServiceTask.vue diff --git a/package.json b/package.json index 8da17220..3bf76482 100644 --- a/package.json +++ b/package.json @@ -95,8 +95,8 @@ "@vitejs/plugin-vue": "^5.0.4", "@vitejs/plugin-vue-jsx": "^3.1.0", "autoprefixer": "^10.4.17", - "bpmn-js": "8.9.0", - "bpmn-js-properties-panel": "0.46.0", + "bpmn-js": "^17.9.2", + "bpmn-js-properties-panel": "5.23.0", "consola": "^3.2.3", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", diff --git a/src/components/bpmnProcessDesigner/package/designer/plugins/palette/CustomPalette.js b/src/components/bpmnProcessDesigner/package/designer/plugins/palette/CustomPalette.js index 5e2803b5..c1f40c1b 100644 --- a/src/components/bpmnProcessDesigner/package/designer/plugins/palette/CustomPalette.js +++ b/src/components/bpmnProcessDesigner/package/designer/plugins/palette/CustomPalette.js @@ -165,6 +165,12 @@ F.prototype.getPaletteEntries = function () { 'bpmn-icon-user-task', translate('Create User Task') ), + 'create.service-task': createAction( + 'bpmn:ServiceTask', + 'activity', + 'bpmn-icon-service', + translate('Create Service Task') + ), 'create.data-object': createAction( 'bpmn:DataObjectReference', 'data-object', diff --git a/src/components/bpmnProcessDesigner/package/designer/plugins/palette/paletteProvider.js b/src/components/bpmnProcessDesigner/package/designer/plugins/palette/paletteProvider.js index 7098981c..304875ce 100644 --- a/src/components/bpmnProcessDesigner/package/designer/plugins/palette/paletteProvider.js +++ b/src/components/bpmnProcessDesigner/package/designer/plugins/palette/paletteProvider.js @@ -171,6 +171,12 @@ PaletteProvider.prototype.getPaletteEntries = function () { 'bpmn-icon-user-task', translate('Create User Task') ), + 'create.service-task': createAction( + 'bpmn:ServiceTask', + 'activity', + 'bpmn-icon-service', + translate('Create Service Task') + ), 'create.data-object': createAction( 'bpmn:DataObjectReference', 'data-object', diff --git a/src/components/bpmnProcessDesigner/package/designer/plugins/translate/zh.js b/src/components/bpmnProcessDesigner/package/designer/plugins/translate/zh.js index 777db3e7..7e5aa8c6 100644 --- a/src/components/bpmnProcessDesigner/package/designer/plugins/translate/zh.js +++ b/src/components/bpmnProcessDesigner/package/designer/plugins/translate/zh.js @@ -56,6 +56,7 @@ export default { 'Create EndEvent': '创建结束事件', 'Create Task': '创建任务', 'Create User Task': '创建用户任务', + 'Create Service Task': '创建服务任务', 'Create Gateway': '创建网关', 'Create DataObjectReference': '创建数据对象', 'Create DataStoreReference': '创建数据存储', diff --git a/src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue b/src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue index 86a1cf74..dc39b2aa 100644 --- a/src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue +++ b/src/components/bpmnProcessDesigner/package/penal/PropertiesPanel.vue @@ -27,12 +27,12 @@ - + diff --git a/src/components/bpmnProcessDesigner/package/penal/properties/ElementProperties.vue b/src/components/bpmnProcessDesigner/package/penal/properties/ElementProperties.vue index 494b3d97..001ec6f9 100644 --- a/src/components/bpmnProcessDesigner/package/penal/properties/ElementProperties.vue +++ b/src/components/bpmnProcessDesigner/package/penal/properties/ElementProperties.vue @@ -75,17 +75,14 @@ const attributeFormRef = ref() const bpmnInstances = () => (window as any)?.bpmnInstances const resetAttributesList = () => { - console.log(window, 'windowwindowwindowwindowwindowwindowwindow') bpmnElement.value = bpmnInstances().bpmnElement otherExtensionList.value = [] // 其他扩展配置 - bpmnElementProperties.value = - // bpmnElement.value.businessObject?.extensionElements?.filter((ex) => { - bpmnElement.value.businessObject?.extensionElements?.values.filter((ex) => { + bpmnElementProperties.value = bpmnElement.value.businessObject?.extensionElements?.values?.filter((ex) => { if (ex.$type !== `${prefix}:Properties`) { otherExtensionList.value.push(ex) } return ex.$type === `${prefix}:Properties` - }) ?? [] + }) ?? []; // 保存所有的 扩展属性字段 bpmnElementPropertyList.value = bpmnElementProperties.value.reduce( diff --git a/src/components/bpmnProcessDesigner/package/penal/task/ElementTask.vue b/src/components/bpmnProcessDesigner/package/penal/task/ElementTask.vue index bbeeb4c8..16ea8b52 100644 --- a/src/components/bpmnProcessDesigner/package/penal/task/ElementTask.vue +++ b/src/components/bpmnProcessDesigner/package/penal/task/ElementTask.vue @@ -30,6 +30,7 @@