From aadc43d5dc33cab0f3a1b23dd1a4880d967ebaf4 Mon Sep 17 00:00:00 2001 From: LiuHao Date: Sun, 21 Jan 2024 22:35:34 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BpmnDesign/PropertyPanel.vue | 9 ++- src/components/BpmnDesign/hooks/usePanel.ts | 4 +- src/components/BpmnDesign/index.vue | 8 ++- .../BpmnDesign/panel/GatewayPanel.vue | 47 +++++++++++++ .../BpmnDesign/panel/SequenceFlowPanel.vue | 66 +++++++++++++++++++ .../BpmnDesign/panel/StartEndPanel.vue | 47 +++++++++++++ src/components/BpmnDesign/panel/TaskPanel.vue | 8 ++- .../panel/property/TaskListener.vue | 1 - src/types/bpmn.d.ts | 20 ++++-- 9 files changed, 192 insertions(+), 18 deletions(-) create mode 100644 src/components/BpmnDesign/panel/GatewayPanel.vue create mode 100644 src/components/BpmnDesign/panel/SequenceFlowPanel.vue create mode 100644 src/components/BpmnDesign/panel/StartEndPanel.vue diff --git a/src/components/BpmnDesign/PropertyPanel.vue b/src/components/BpmnDesign/PropertyPanel.vue index f0da6c7..81a1e04 100644 --- a/src/components/BpmnDesign/PropertyPanel.vue +++ b/src/components/BpmnDesign/PropertyPanel.vue @@ -9,6 +9,9 @@ import { NodeName } from './assets/lang/zh'; import TaskPanel from './panel/TaskPanel.vue'; import ProcessPanel from './panel/ProcessPanel.vue'; +import StartEndPanel from './panel/StartEndPanel.vue'; +import GatewayPanel from './panel/GatewayPanel.vue'; +import SequenceFlowPanel from './panel/SequenceFlowPanel.vue'; interface propsType { users: Array; groups: Array; @@ -49,10 +52,10 @@ const processType = ['bpmn:Process']; const component = computed(() => { if (!element.value) return null; const type = element.value.type; - if (startEndType.includes(type)) return 'startEndPanel'; + if (startEndType.includes(type)) return StartEndPanel; if (taskType.includes(type)) return TaskPanel; - if (sequenceType.includes(type)) return 'sequenceFlowPanel'; - if (gatewayType.includes(type)) return 'gatewayPanel'; + if (sequenceType.includes(type)) return SequenceFlowPanel; + if (gatewayType.includes(type)) return GatewayPanel; if (processType.includes(type)) return ProcessPanel; return console.error('no ' + type + ' type panel'); }); diff --git a/src/components/BpmnDesign/hooks/usePanel.ts b/src/components/BpmnDesign/hooks/usePanel.ts index 7a600ea..8f92c53 100644 --- a/src/components/BpmnDesign/hooks/usePanel.ts +++ b/src/components/BpmnDesign/hooks/usePanel.ts @@ -36,9 +36,7 @@ export default (ops: Options) => { const documentationElement = modeler.get('moddle').create('bpmn:Documentation', { text: newVal }); updateProperties({ documentation: [documentationElement] }); } else { - const elements = element.businessObject; - delete elements.documentation; - updateProperties({ process: elements }); + updateProperties({ documentation: null }); } }; diff --git a/src/components/BpmnDesign/index.vue b/src/components/BpmnDesign/index.vue index 1e0c418..2e5cb4b 100644 --- a/src/components/BpmnDesign/index.vue +++ b/src/components/BpmnDesign/index.vue @@ -50,9 +50,11 @@
- - - + + + + +
diff --git a/src/components/BpmnDesign/panel/GatewayPanel.vue b/src/components/BpmnDesign/panel/GatewayPanel.vue new file mode 100644 index 0000000..0877aa6 --- /dev/null +++ b/src/components/BpmnDesign/panel/GatewayPanel.vue @@ -0,0 +1,47 @@ + + + + diff --git a/src/components/BpmnDesign/panel/SequenceFlowPanel.vue b/src/components/BpmnDesign/panel/SequenceFlowPanel.vue new file mode 100644 index 0000000..90337d3 --- /dev/null +++ b/src/components/BpmnDesign/panel/SequenceFlowPanel.vue @@ -0,0 +1,66 @@ + + + + diff --git a/src/components/BpmnDesign/panel/StartEndPanel.vue b/src/components/BpmnDesign/panel/StartEndPanel.vue new file mode 100644 index 0000000..2332f6c --- /dev/null +++ b/src/components/BpmnDesign/panel/StartEndPanel.vue @@ -0,0 +1,47 @@ + + + + diff --git a/src/components/BpmnDesign/panel/TaskPanel.vue b/src/components/BpmnDesign/panel/TaskPanel.vue index 2f249bd..e064c74 100644 --- a/src/components/BpmnDesign/panel/TaskPanel.vue +++ b/src/components/BpmnDesign/panel/TaskPanel.vue @@ -1,6 +1,6 @@