システム管理者専用のページを追加しました。

This commit is contained in:
Mouriya
2024-08-19 21:24:38 +09:00
parent 9eb87fe3f3
commit 2f11323193

View File

@@ -2,40 +2,26 @@
<q-layout view="lHh Lpr lFf"> <q-layout view="lHh Lpr lFf">
<q-header elevated> <q-header elevated>
<q-toolbar> <q-toolbar>
<q-btn <q-btn flat dense round icon="menu" aria-label="Menu" @click="toggleLeftDrawer" />
flat
dense
round
icon="menu"
aria-label="Menu"
@click="toggleLeftDrawer"
/>
<q-toolbar-title> <q-toolbar-title>
{{ productName }} {{ productName }}
<q-badge align="top" outline>V{{ version }}</q-badge> <q-badge align="top" outline>V{{ version }}</q-badge>
</q-toolbar-title> </q-toolbar-title>
<domain-selector></domain-selector> <domain-selector></domain-selector>
<q-btn flat round dense icon="logout" @click="authStore.logout()"/> <q-btn flat round dense icon="logout" @click="authStore.logout()" />
</q-toolbar> </q-toolbar>
</q-header> </q-header>
<q-drawer <q-drawer :model-value="authStore.LeftDrawer" :show-if-above="false" bordered>
:model-value="authStore.LeftDrawer"
:show-if-above="false"
bordered
>
<q-list> <q-list>
<q-item-label <q-item-label header>
header
>
メニュー メニュー
</q-item-label> </q-item-label>
<EssentialLink <EssentialLink v-for="link in essentialLinks" :key="link.title" v-bind="link" />
v-for="link in essentialLinks" <div v-if="isAdmin">
:key="link.title" <EssentialLink v-for="link in adminLinks" :key="link.title" v-bind="link" />
v-bind="link" </div>
/>
</q-list> </q-list>
</q-drawer> </q-drawer>
@@ -54,19 +40,19 @@ import { useAuthStore } from 'stores/useAuthStore';
const authStore = useAuthStore(); const authStore = useAuthStore();
const essentialLinks: EssentialLinkProps[] = [ const essentialLinks: EssentialLinkProps[] = [
{ {
title: 'ホーム', title: 'ホーム',
caption: '設計書から導入する', caption: '設計書から導入する',
icon: 'home', icon: 'home',
link: '/', link: '/',
target:'_self' target: '_self'
}, },
{ {
title: 'フローエディター', title: 'フローエディター',
caption: 'イベントを設定する', caption: 'イベントを設定する',
icon: 'account_tree', icon: 'account_tree',
link: '/#/FlowChart', link: '/#/FlowChart',
target:'_self' target: '_self'
}, },
// { // {
// title: '条件エディター', // title: '条件エディター',
@@ -76,8 +62,8 @@ const essentialLinks: EssentialLinkProps[] = [
// target:'_self' // target:'_self'
// }, // },
{ {
title:'', title: '',
isSeparator:true isSeparator: true
}, },
// { // {
// title:'Kintone ポータル', // title:'Kintone ポータル',
@@ -151,8 +137,33 @@ const essentialLinks: EssentialLinkProps[] = [
// } // }
]; ];
const adminLinks: EssentialLinkProps[] = [
{
title: 'ユーザー',
caption: 'ユーザー設定する',
icon: 'manage_accounts',
link: '/#/user',
target: '_self'
},
{
title: 'テナント',
caption: 'テナント設定',
icon: 'domain',
link: '/#/domain',
target: '_self'
},
{
title: 'アカウント',
caption: 'アカウント設定',
icon: 'assignment_ind',
link: '/#/userDomain',
target: '_self'
},
]
const version = process.env.version; const version = process.env.version;
const productName = process.env.productName; const productName = process.env.productName;
onMounted(() => { onMounted(() => {
authStore.toggleLeftMenu(); authStore.toggleLeftMenu();
}); });
@@ -160,4 +171,8 @@ onMounted(() => {
function toggleLeftDrawer() { function toggleLeftDrawer() {
authStore.toggleLeftMenu(); authStore.toggleLeftMenu();
} }
function isAdmin(){
const permission = authStore.permissions;
return permission === 'admin'
}
</script> </script>