add app dialog

This commit is contained in:
2023-09-30 13:12:08 +09:00
parent 4c6b2ea844
commit 461cd26690
8 changed files with 88 additions and 36 deletions

View File

@@ -1,5 +1,6 @@
import { defineStore } from 'pinia';
import { ActionFlow,AppInfo } from 'src/types/ActionTypes';
import {FlowCtrl } from '../control/flowCtrl';
export interface FlowEditorState{
flowNames1:string;
@@ -7,7 +8,7 @@ export interface FlowEditorState{
flows?:ActionFlow[];
selectedFlow?:ActionFlow|undefined;
}
const flowCtrl=new FlowCtrl();
export const useFlowEditorStore = defineStore("flowEditor",{
state: ():FlowEditorState => ({
flowNames1: '',
@@ -27,6 +28,19 @@ export const useFlowEditorStore = defineStore("flowEditor",{
},
selectFlow(flow:ActionFlow){
this.selectedFlow=flow;
},
setApp(app:AppInfo){
this.appInfo=app;
},
async setFlow(){
if(this.appInfo===undefined) return;
const actionFlows = await flowCtrl.getFlows(this.appInfo?.appId);
if(actionFlows && actionFlows.length>0){
this.setFlows(actionFlows);
}
if(actionFlows && actionFlows.length==1){
this.selectFlow(actionFlows[0]);
}
}
}