From 4ee72a8a75a4f232eb50a7980fe2da73ed9a9acb Mon Sep 17 00:00:00 2001 From: "maxiaozhe@alicorns.co.jp" Date: Tue, 11 Jun 2024 15:11:24 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=9C=E3=82=BF=E3=83=B3=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=94=B9=E4=BF=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/left/EventTree.vue | 26 ++++++++----------- frontend/src/components/right/EventSetter.vue | 12 ++++----- frontend/src/stores/flowEditor.ts | 16 ++++++------ frontend/src/types/KintoneEvents.ts | 5 +--- 4 files changed, 26 insertions(+), 33 deletions(-) diff --git a/frontend/src/components/left/EventTree.vue b/frontend/src/components/left/EventTree.vue index 4cbe294..746a9f0 100644 --- a/frontend/src/components/left/EventTree.vue +++ b/frontend/src/components/left/EventTree.vue @@ -3,11 +3,11 @@ diff --git a/frontend/src/components/right/EventSetter.vue b/frontend/src/components/right/EventSetter.vue index 54303dd..25a90d5 100644 --- a/frontend/src/components/right/EventSetter.vue +++ b/frontend/src/components/right/EventSetter.vue @@ -61,12 +61,12 @@ export default defineComponent({ if(store.eventTree.findEventById(addEventId)){ return; } - customEvents.events.push( - new kintoneEvent( - displayName, - addEventId, - customButtonId) - ); + customEvents.events.push({ + eventId: addEventId, + label: displayName, + parentId: customButtonId, + header: 'DELETABLE' + }); } } diff --git a/frontend/src/stores/flowEditor.ts b/frontend/src/stores/flowEditor.ts index 009756d..21580ce 100644 --- a/frontend/src/stores/flowEditor.ts +++ b/frontend/src/stores/flowEditor.ts @@ -113,19 +113,19 @@ export const useFlowEditorStore = defineStore('flowEditor', { }, - deleteEvent(event: IKintoneEvent) { + async deleteEvent(event: IKintoneEvent) { const store = useFlowEditorStore(); if (event.flowData) { const flow = event.flowData; - if (flow.id === '') { - return; + if (flow.id !== '') { + await flowCtrl.DeleteFlow(flow.id) + if (this.flows) { + this.flows = this.flows.filter((f) => f.id !== flow.id); + } } - flowCtrl.DeleteFlow(flow.id) eventTree.deleteEvent(event, store); - if(this.flows){ - this.flows = this.flows.filter((f) => f.id !== flow.id); - } - } else { + } + else { eventTree.deleteEvent(event, store); } }, diff --git a/frontend/src/types/KintoneEvents.ts b/frontend/src/types/KintoneEvents.ts index 975e929..da6db3d 100644 --- a/frontend/src/types/KintoneEvents.ts +++ b/frontend/src/types/KintoneEvents.ts @@ -95,10 +95,7 @@ export class KintoneEventManager { const lastIndex = eventId.lastIndexOf('.'); const groupId = eventId.substring(0, lastIndex); const eventNode = this.findEventById(groupId); - if ( - eventNode && - (eventNode.header === 'EVENTGROUP' || eventNode.header === 'CHANGE') - ) { + if (eventNode && (eventNode.header === 'EVENTGROUP' || eventNode.header === 'CHANGE')) { const groupEvent = eventNode as kintoneEventGroup; const newEvent = {