add app dialog
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user