feat: Main => branch&personnel router

This commit is contained in:
puriphatt 2024-04-02 13:44:45 +07:00
parent b00e78f45c
commit 63a0bc33f0
5 changed files with 107 additions and 70 deletions

View file

@ -1,9 +1,13 @@
<script setup lang="ts"> <script setup lang="ts">
import { useRouter } from 'vue-router';
import AppBox from 'components/app/AppBox.vue'; import AppBox from 'components/app/AppBox.vue';
import AppCircle from 'components/app/AppCircle.vue'; import AppCircle from 'components/app/AppCircle.vue';
const router = useRouter();
defineProps<{ defineProps<{
list: { list: {
value: string;
icon: string; icon: string;
title: string; title: string;
caption: string; caption: string;
@ -19,6 +23,10 @@ defineProps<{
| 'lime'; | 'lime';
}[]; }[];
}>(); }>();
function navigateTo(destination: string) {
router.push(`${destination}`);
}
</script> </script>
<template> <template>
@ -28,6 +36,7 @@ defineProps<{
v-for="(v, i) in list" v-for="(v, i) in list"
:key="i" :key="i"
:bordered="$q.dark.isActive" :bordered="$q.dark.isActive"
@click="navigateTo(v.value)"
> >
<AppCircle <AppCircle
:class="`q-pa-sm menu-icon menu-icon__${v.color}${($q.dark.isActive && ' dark') || ''}`" :class="`q-pa-sm menu-icon menu-icon__${v.color}${($q.dark.isActive && ' dark') || ''}`"
@ -53,6 +62,7 @@ defineProps<{
border: 1px solid transparent; border: 1px solid transparent;
&:hover { &:hover {
cursor: pointer;
border-color: var(--brand-1); border-color: var(--brand-1);
} }
} }

View file

@ -0,0 +1,2 @@
<script setup lang="ts"></script>
<template>Branch Management</template>

View file

@ -0,0 +1,2 @@
<script setup lang="ts"></script>
<template>Personnel Management</template>

View file

@ -6,101 +6,114 @@ import UsersDetailCardComponent from 'components/UsersDetailCardComponent.vue';
const menu = [ const menu = [
{ {
icon: 'mdi-home', value: 'branch-management',
icon: 'mdi-chart-donut',
color: 'green', color: 'green',
title: 'Home', title: 'จัดการสาขา',
caption: 'Home Caption', caption: 'จัดการสาขาภายในองค์กร',
}, },
{ {
icon: 'mdi-home', value: 'personnel-management',
color: 'red', icon: 'mdi-account',
title: 'Home',
caption: 'Home Caption',
},
{
icon: 'mdi-home',
color: 'orange',
title: 'Home',
caption: 'Home Caption',
},
{
icon: 'mdi-home',
color: 'cyan', color: 'cyan',
title: 'Home', title: 'จัดการบุคลากร',
caption: 'Home Caption', caption: 'จัดการคนภายในองค์กร',
}, },
{ {
icon: 'mdi-home', value: '',
color: 'camo', icon: 'mdi-account',
title: 'Home', color: 'cyan',
caption: 'Home Caption', title: 'จัดการลูกค้า',
caption: 'จัดการคนภายในองค์กร',
}, },
{ {
icon: 'mdi-home', value: '',
color: 'purple', icon: 'mdi-truck',
title: 'Home', color: 'orange',
caption: 'Home Caption', title: 'สินค้าและบริการ',
caption: 'รายการสินค้าและบริการ',
}, },
{ {
icon: 'mdi-home', value: '',
icon: 'mdi-file-document',
color: 'violet', color: 'violet',
title: 'Home', title: 'ใบเสนอราคา',
caption: 'Home Caption', caption: 'รายการใบเสนอราคา',
}, },
{ {
icon: 'mdi-home', value: '',
color: 'indigo', icon: 'mdi-monitor',
title: 'Home', color: 'purple',
caption: 'Home Caption', title: 'รายการคำขอ',
caption: 'แสดงรายการคำขอ',
}, },
{ {
icon: 'mdi-home', value: '',
icon: 'mdi-receipt-text',
color: 'red',
title: 'ใบสั่งซื้อ',
caption: 'รายการใบสั่งซื้อ',
},
{
value: '',
icon: 'mdi-package',
color: 'camo',
title: 'ใบรับสินค้า',
caption: 'รายการใบรับสินค้า',
},
{
value: '',
icon: 'mdi-currency-usd',
color: 'lime', color: 'lime',
title: 'Home', title: 'การจัดการการเงิน',
caption: 'Home Caption', caption: 'รายการบัญชีทั้งหมด',
},
{
value: '',
icon: 'mdi-view-dashboard',
color: 'cyan',
title: 'Dashboard',
caption: 'แสดงข้อมูลสถิติ',
},
{
value: '',
icon: 'mdi-file-document',
color: 'indigo',
title: 'รายงาน',
caption: 'แสดงรายงาน',
}, },
] satisfies InstanceType<typeof MenuItem>['$props']['list']; ] satisfies InstanceType<typeof MenuItem>['$props']['list'];
const person = [ // const person = [
{ // {
name: 'Person 1', // name: 'Person 1',
badge: 'Badge 1', // badge: 'Badge 1',
detail: [ // detail: [
{ label: 'Label 1', value: 'Detail 1' }, // { label: 'Label 1', value: 'Detail 1' },
{ label: 'Label 2', value: 'Detail 2' }, // { label: 'Label 2', value: 'Detail 2' },
], // ],
male: true, // male: true,
}, // },
{ // {
name: 'Person 1', // name: 'Person 1',
badge: 'Badge 1', // badge: 'Badge 1',
detail: [ // detail: [
{ label: 'Label 1', value: 'Detail 1' }, // { label: 'Label 1', value: 'Detail 1' },
{ label: 'Label 2', value: 'Detail 2' }, // { label: 'Label 2', value: 'Detail 2' },
{ label: 'Label 3', value: 'Detail 3' }, // { label: 'Label 3', value: 'Detail 3' },
], // ],
female: true, // female: true,
}, // },
] satisfies InstanceType<typeof PersonCard>['$props']['list']; // ] satisfies InstanceType<typeof PersonCard>['$props']['list'];
const input = ref('');
</script> </script>
<template> <template>
<q-input <!-- <PersonCard :list="person" class="q-mb-md" /> -->
label="test"
v-model="input"
:rules="[(v) => (!!v && v.length > 3) || 'Required']"
outlined
></q-input>
<PersonCard :list="person" class="q-mb-md" />
<MenuItem :list="menu" /> <MenuItem :list="menu" />
<div class="row"> <!-- <div class="row">
<users-detail-card-component class="q-pa-md" v-for="v in [1, 2]" :key="v" /> <users-detail-card-component class="q-pa-md" v-for="v in [1, 2]" :key="v" />
</div> </div> -->
</template> </template>
<style scoped> <style scoped>

View file

@ -11,6 +11,16 @@ const routes: RouteRecordRaw[] = [
name: 'Home', name: 'Home',
component: () => import('pages/MainPage.vue'), component: () => import('pages/MainPage.vue'),
}, },
{
path: '/branch-management',
name: 'BranchManagement',
component: () => import('pages/01_branch-management/MainPage.vue'),
},
{
path: '/personnel-management',
name: 'PersonnelManagement',
component: () => import('pages/02_personnel-management/MainPage.vue'),
},
], ],
}, },