From a73ce7f8bf198a27077d4523f2ae066430f7268c Mon Sep 17 00:00:00 2001 From: LiuHao Date: Wed, 31 Jan 2024 15:33:05 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=EF=BC=8C=E5=BD=93=E9=9D=A2=E6=9D=BF=E6=9C=AA?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E6=97=B6=E9=BB=98=E8=AE=A4=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BpmnDesign/PropertyPanel.vue | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/components/BpmnDesign/PropertyPanel.vue b/src/components/BpmnDesign/PropertyPanel.vue index 9f89384..ad5d58c 100644 --- a/src/components/BpmnDesign/PropertyPanel.vue +++ b/src/components/BpmnDesign/PropertyPanel.vue @@ -20,6 +20,7 @@ interface propsType { const props = withDefaults(defineProps(), {}); const element = ref(); +const processElement = ref(); const startEndType = ['bpmn:IntermediateThrowEvent', 'bpmn:StartEvent', 'bpmn:EndEvent']; const taskType = [ @@ -36,6 +37,7 @@ const sequenceType = ['bpmn:SequenceFlow']; const gatewayType = ['bpmn:InclusiveGateway', 'bpmn:ExclusiveGateway', 'bpmn:ParallelGateway', 'bpmn:EventBasedGateway']; const processType = ['bpmn:Process']; +// 组件计算 const component = computed(() => { if (!element.value) return null; const type = element.value.type; @@ -57,20 +59,20 @@ const nodeName = computed(() => { const handleModeler = () => { props.modeler.on('root.added', (e: any) => { + element.value = null; if (e.element.type === 'bpmn:Process') { - element.value = null; nextTick(() => { element.value = e.element; - // const modeling = props.modeler.get('modeling'); - // modeling.setColor(e.element.children, { - // fill: 'green' - // }); + processElement.value = e.element; }); } }); props.modeler.on('element.click', (e: any) => { if (e.element.type === 'bpmn:Process') { - element.value = e.element; + nextTick(() => { + element.value = e.element; + processElement.value = e.element; + }); } }); props.modeler.on('selection.changed', (e: any) => { @@ -81,6 +83,10 @@ const handleModeler = () => { nextTick(() => { element.value = newElement; }); + } else { + nextTick(() => { + element.value = processElement.value; + }); } }); };