some refactoring and make highlighter change when app changed

This commit is contained in:
xue jiahao
2024-11-11 15:21:28 +08:00
parent 1028327a37
commit a3375c4526
3 changed files with 22 additions and 25 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)=>{