left menu 修正

This commit is contained in:
2024-02-03 11:55:44 +09:00
parent 3159366560
commit 8fecde4c42
4 changed files with 24 additions and 6 deletions

View File

@@ -20,7 +20,7 @@
</q-header>
<q-drawer
v-model="leftDrawerOpen"
:model-value="authStore.toggleLeftDrawer"
:show-if-above="false"
bordered
>
@@ -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();
}
</script>

View File

@@ -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();
});
</script>

View File

@@ -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')},

View File

@@ -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);