diff --git a/frontend/src/layouts/MainLayout.vue b/frontend/src/layouts/MainLayout.vue index f5d7284..e0048da 100644 --- a/frontend/src/layouts/MainLayout.vue +++ b/frontend/src/layouts/MainLayout.vue @@ -20,7 +20,7 @@ @@ -151,11 +151,10 @@ const essentialLinks: EssentialLinkProps[] = [ } ]; -const leftDrawerOpen = ref(false) const version = process.env.version; const productName = process.env.productName; function toggleLeftDrawer() { - leftDrawerOpen.value = !leftDrawerOpen.value + authStore.toggleLeftMenu(); } diff --git a/frontend/src/pages/FlowChart.vue b/frontend/src/pages/FlowChart.vue index ed3cfb7..3833e5d 100644 --- a/frontend/src/pages/FlowChart.vue +++ b/frontend/src/pages/FlowChart.vue @@ -57,6 +57,8 @@ import {ref,reactive,computed,onMounted} from 'vue'; import {IActionNode, ActionNode, IActionFlow, ActionFlow,RootAction, IActionProperty } from 'src/types/ActionTypes'; import { storeToRefs } from 'pinia'; import { useFlowEditorStore } from 'stores/flowEditor'; +import { authStore, useAuthStore } from 'stores/useAuthStore'; + import NodeItem from 'src/components/main/NodeItem.vue'; import ShowDialog from 'components/ShowDialog.vue'; import ActionSelect from 'components/ActionSelect.vue'; @@ -67,10 +69,10 @@ import {FlowCtrl } from '../control/flowctrl'; import { useQuasar } from 'quasar'; const deployLoading = ref(false); const saveLoading = ref(false); - const drawerLeft = ref(false); const $q=useQuasar(); const store = useFlowEditorStore(); +const authStore =useAuthStore(); // ref関数を使ってtemplateとバインド const state=reactive({ activeNode:{ @@ -222,6 +224,7 @@ const fetchData = async ()=>{ } onMounted(() => { + authStore.toggleLeftMenu(); fetchData(); }); diff --git a/frontend/src/router/routes.ts b/frontend/src/router/routes.ts index 2312a82..af5edf3 100644 --- a/frontend/src/router/routes.ts +++ b/frontend/src/router/routes.ts @@ -5,7 +5,13 @@ const routes: RouteRecordRaw[] = [ path: '/login', component: () => import('pages/LoginPage.vue') }, - + { + path:'/FlowChart', + component:()=>import('layouts/MainLayout.vue'), + children:[ + {path:'',component:()=>import('pages/FlowChart.vue')} + ] + }, { path: '/', component: () => import('layouts/MainLayout.vue'), @@ -16,7 +22,7 @@ const routes: RouteRecordRaw[] = [ { path: 'flow', component: () => import('pages/testFlow.vue') }, { path: 'FlowChartTest', component: () => import('pages/FlowChartTest.vue') }, { path: 'flowEditor', component: () => import('pages/FlowEditorPage.vue') }, - { path: 'FlowChart', component: () => import('pages/FlowChart.vue') }, + // { path: 'FlowChart', component: () => import('pages/FlowChart.vue') }, { path: 'right', component: () => import('pages/testRight.vue') }, { path: 'domain', component: () => import('pages/TenantDomain.vue') }, { path: 'userdomain', component: () => import('pages/UserDomain.vue')}, diff --git a/frontend/src/stores/useAuthStore.ts b/frontend/src/stores/useAuthStore.ts index 19891dc..a2c3f84 100644 --- a/frontend/src/stores/useAuthStore.ts +++ b/frontend/src/stores/useAuthStore.ts @@ -8,6 +8,7 @@ export interface IUserState{ token?:string; returnUrl:string; currentDomain:IDomainInfo; + LeftDrawer:boolean; } export const useAuthStore = defineStore({ @@ -20,10 +21,19 @@ export const useAuthStore = defineStore({ return { token, returnUrl: '', + LeftDrawer:false, currentDomain: JSON.parse(localStorage.getItem('currentDomain')||"{}") } }, + getters:{ + toggleLeftDrawer():boolean{ + return this.LeftDrawer; + } + }, actions: { + toggleLeftMenu(){ + this.LeftDrawer=!this.LeftDrawer; + }, async login(username:string, password:string) { const params = new URLSearchParams(); params.append('username', username);