hsuehchiahao
2024-11-11 11:20:36 +00:00
committed by 小哲 馬
6 changed files with 127 additions and 29 deletions

View File

@@ -64,7 +64,9 @@ export const useFlowEditorStore = defineStore('flowEditor', {
this.selectedFlow = flow;
if(flow!==undefined){
const eventId = flow.getRoot()?.name;
this.selectedEvent=this.eventTree.findEventById(eventId) as IKintoneEvent;
this.selectedEvent = this.eventTree.findEventById(eventId) as IKintoneEvent;
} else {
this.selectedEvent = undefined;
}
},
setActiveNode(node: IActionNode) {
@@ -86,8 +88,8 @@ export const useFlowEditorStore = defineStore('flowEditor', {
//eventTreeにバンドする
this.eventTree.bindFlows(actionFlows);
if (actionFlows === undefined || actionFlows.length === 0) {
this.flows = [];
this.selectedFlow = undefined;
this.setFlows([]);
this.selectFlow(undefined);
this.expandedScreen =[];
return;
}
@@ -95,6 +97,11 @@ export const useFlowEditorStore = defineStore('flowEditor', {
if (actionFlows && actionFlows.length > 0) {
this.selectFlow(actionFlows[0]);
}
const root = actionFlows[0].getRoot();
if (root) {
this.setActiveNode(root);
}
const expandEventIds = actionFlows.map((flow) => flow.getRoot()?.name);
const expandScreens:string[]=[];
expandEventIds.forEach((eventid)=>{