Files
cssd-front/src/views/Dashboard.vue
T
2025-03-29 14:52:44 +03:30

269 lines
12 KiB
Vue

<template>
<v-container fluid class="dashboard">
<material-card class="" v-if="$hasRole('Admin')" color="black" title="Admin Dashboard" text="">
<v-layout row wrap>
<template v-for="(AdminCard, Key ) in AdminCards">
<v-flex v-if="!AdminCard.role || $hasRole(AdminCard.role)" :class="[AdminCard.column, 'pa-2']"
:key="Key">
<router-link :to="AdminCard.route" style="height: 100%;display: grid;">
<material-cards :title="AdminCard.title" :icon="AdminCard.icon" :color="AdminCard.color"
:text="AdminCard.text" :aligntext="AdminCard.aligntext"
:alignimg="AdminCard.alignimg"/>
</router-link>
</v-flex>
</template>
</v-layout>
</material-card>
<material-card v-if="$hasRole('Admin|Supervisor')" color="black" title="Supervisor Dashboard" text="">
<v-layout row wrap>
<template v-for="(SupervisorCard, Key ) in SupervisorCards">
<v-flex v-if="!SupervisorCard.role || $hasRole(SupervisorCard.role)"
:class="[SupervisorCard.column, 'pa-2']"
:key="Key">
<router-link :to="SupervisorCard.route" style="height: 100%;display:grid;">
<material-cards :title="SupervisorCard.title" :icon="SupervisorCard.icon"
:color="SupervisorCard.color"
:text="SupervisorCard.text" :aligntext="SupervisorCard.aligntext"
:alignimg="SupervisorCard.alignimg"/>
</router-link>
</v-flex>
</template>
</v-layout>
</material-card>
<material-card v-if="$hasRole('Admin|Supervisor|User')" color="black" title="User Dashboard" text="">
<v-layout row wrap>
<template v-for="(UsersCard, Key ) in UsersCards">
<v-flex v-if="!UsersCard.role || $hasRole(UsersCard.role)" :class="[UsersCard.column, 'pa-2']"
:key="Key">
<router-link :to="UsersCard.route" style="height: 100%;display:grid;">
<material-cards :title="UsersCard.title" :icon="UsersCard.icon" :color="UsersCard.color"
:text="UsersCard.text" :aligntext="UsersCard.aligntext"
:alignimg="UsersCard.alignimg"/>
</router-link>
</v-flex>
</template>
</v-layout>
</material-card>
</v-container>
</template>
<script>
// import { UserService } from '@/services';
export default {
data() {
return {
AdminCards: [
{
title: 'Manage Users',
text: 'You can Manage the users information',
// image: '/img/Static/Dashboard/manageusers.png',
color: 'WM-LightGray-BG',
route: {name: 'ManageUsers'},
aligntext: 'text-md-left',
alignimg: 'text-md-left',
column: 'xs12 md6 sm6',
role: 'Admin|Supervisor'
},
{
title: 'Manage Medical Center',
text: 'You can edit the medical center information',
// image: '/img/Static/Dashboard/settings.png',
color: 'WM-LightGray-BG',
route: {name: 'ManageMedicalCenter'},
aligntext: 'text-md-left',
alignimg: 'text-md-right',
column: 'xs12 md6 sm6',
role: 'Admin'
},
{
title: 'List Test Type',
text: 'You can simply add your test type',
// image: '/img/Static/Dashboard/result.png',
color: 'WM-LightGray-BG',
route: {name: 'ListTestType'},
aligntext: 'text-md-left',
alignimg: 'text-md-ce',
column: 'xs12 md12 sm12',
role: 'Admin'
}
],
SupervisorCards: [
{
title: 'Manage Users',
text: 'You can Manage the users information',
// image: '/img/Static/Dashboard/manageusers.png',
color: 'WM-LightGray-BG',
route: {name: 'ManageUsers'},
aligntext: 'text-md-left',
alignimg: 'text-md-left',
column: 'xs12 md6 sm6',
role: 'Admin|Supervisor'
},
{
title: 'Test to Verify',
text: 'You can simply verify your own medical center test result in this section of website',
// image: '/img/Static/Dashboard/verify.png',
color: 'WM-LightGray-BG',
route: {name: 'NotVerifyTestResult'},
aligntext: 'text-md-left',
alignimg: 'text-md-left',
column: 'xs12 md6 sm6',
role: 'Admin|Supervisor'
},
],
UsersCards: [
{
title: 'My Info',
text: 'You can easily edit your registration information',
// image: '/img/Static/Dashboard/info.png',
color: 'WM-LightGray-BG',
route: {name: 'MyInfo'},
aligntext: 'text-md-left',
alignimg: 'text-md-right',
column: 'xs12 md12 sm12',
role: 'Admin|Supervisor|User'
},
{
title: 'All Test Result',
text: 'You can see all user tests and own tests',
// image: '/img/Static/Dashboard/alltest.png',
color: 'WM-LightGray-BG',
route: {name: 'AllResultTest'},
aligntext: 'text-md-left',
alignimg: 'text-md-right',
column: 'xs12 md8 sm8',
role: 'Admin|Supervisor|User'
},
{
title: `<span>Add A </span><br/><span>Test Result</span>`,
icon: 'fas fa-plus',
// image:'https://cdn.willaspace.com/cssd/static/image/svg/Plus-white.svg',
color: 'black text-white',
route: {name: 'SubmitTestResult'},
aligntext: 'text-md-left',
alignimg: 'text-md-left',
column: 'xs12 md4 sm4',
role: 'Admin|Supervisor|User'
},
{
title: 'MY Items',
text: 'items that you posses',
// image: '/img/Static/Dashboard/alltest.png',
color: 'WM-LightGray-BG',
route: {name: 'MyItem'},
aligntext: 'text-md-left',
alignimg: 'text-md-right',
column: 'xs12 md4 sm4',
role: 'Admin|Supervisor|User'
},
{
title: 'All Items',
text: 'all existing items in your medical center ',
// image: '/img/Static/Dashboard/alltest.png',
color: 'WM-LightGray-BG',
route: {name: 'AllItem'},
aligntext: 'text-md-left',
alignimg: 'text-md-right',
column: 'xs12 md4 sm4',
role: 'Admin|Supervisor|User'
},
{
title: `<span>Add new </span><br/><span>item</span>`,
icon: 'fas fa-plus',
// image:'https://cdn.willaspace.com/cssd/static/image/svg/Plus-white.svg',
color: 'WM-CyanGradient-BG text-white',
route: {name: 'AddItem'},
aligntext: 'text-md-left',
alignimg: 'text-md-left',
column: 'xs12 md4 sm4',
role: 'Admin|Supervisor|User'
},
{
title: 'MY package',
text: 'packages that you posses',
// image: '/img/Static/Dashboard/alltest.png',
color: 'WM-LightGray-BG',
route: {name: 'MyItem'},
aligntext: 'text-md-left',
alignimg: 'text-md-right',
column: 'xs12 md4 sm4',
role: 'Admin|Supervisor|User'
},
{
title: 'All package',
text: 'all existing packages in your medical center ',
// image: '/img/Static/Dashboard/alltest.png',
color: 'WM-LightGray-BG',
route: {name: 'AllItem'},
aligntext: 'text-md-left',
alignimg: 'text-md-right',
column: 'xs12 md4 sm4',
role: 'Admin|Supervisor|User'
},
{
title: `<span>Add new </span><br/><span>Package</span>`,
icon: 'fas fa-plus',
// image:'https://cdn.willaspace.com/cssd/static/image/svg/Plus-white.svg',
color: 'WM-DeepBlueGradient-BG text-white',
route: {name: 'AddPackage'},
aligntext: 'text-md-left',
alignimg: 'text-md-left',
column: 'xs12 md4 sm4',
role: 'Admin|Supervisor|User'
},
{
title: 'All labels',
text: 'All active labels in your medical center',
// image: '/img/Static/Dashboard/alltest.png',
color: 'WM-LightGray-BG',
route: {name: 'AllResultTest'},
aligntext: 'text-md-left',
alignimg: 'text-md-right',
column: 'xs12 md8 sm8',
role: 'Admin|Supervisor|User'
},
{
title: `<span>Add new </span><br/><span> label</span>`,
icon: 'fas fa-plus',
// image:'https://cdn.willaspace.com/cssd/static/image/svg/Plus-white.svg',
color: 'WM-PurpleGradient-BG text-white',
route: {name: 'AddLabel'},
aligntext: 'text-md-left',
alignimg: 'text-md-left',
column: 'xs12 md4 sm4',
role: 'Admin|Supervisor|User'
},
{
title: 'All cycles',
text: 'All active cycles in your medical center',
// image: '/img/Static/Dashboard/alltest.png',
color: 'WM-LightGray-BG',
route: {name: 'AllResultTest'},
aligntext: 'text-md-left',
alignimg: 'text-md-right',
column: 'xs12 md8 sm8',
role: 'Admin|Supervisor|User'
},
{
title: `<span>Add new </span><br/><span>cycle</span>`,
icon: 'fas fa-plus',
// image:'https://cdn.willaspace.com/cssd/static/image/svg/Plus-white.svg',
color: 'WM-RedGradient-BG text-white',
route: {name: 'AddCycle'},
aligntext: 'text-md-left',
alignimg: 'text-md-left',
column: 'xs12 md4 sm4',
role: 'Admin|Supervisor|User'
},
],
}
},
}
</script>