MainLayout , Dashboard, Transfer

This commit is contained in:
Tanyalak 2023-07-07 16:54:53 +07:00
parent ff07547749
commit 3f50b3d075
31 changed files with 14376 additions and 1 deletions

16
src/App.vue Normal file
View file

@ -0,0 +1,16 @@
<script setup lang="ts">
// import { RouterLink, RouterView } from "vue-router";
// import HelloWorld from "./components/HelloWorld.vue";
</script>
<template>
<div id="azay-admin-app">
<router-view v-slot="{ Component }">
<transition>
<component :is="Component" />
</transition>
</router-view>
</div>
</template>
<style scoped></style>

BIN
src/assets/avatar_user.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
src/assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

186
src/components/Table.vue Normal file
View file

@ -0,0 +1,186 @@
<template>
<div class="q-pb-sm row">
<div>
<q-btn
size="14px"
flat
dense
color="blue"
@click="add"
icon="mdi-plus"
>
<q-tooltip>เพมขอม</q-tooltip>
</q-btn>
</div>
<q-space />
<div class="items-center q-gutter-sm" style="display: flex">
<!-- นหาขอความใน table -->
<q-input
standout
dense
:model-value="inputfilter"
ref="filterRef"
@update:model-value="updateInput"
outlined
debounce="300"
placeholder="ค้นหา"
style="max-width: 200px"
>
<template v-slot:append>
<q-icon v-if="inputfilter == ''" name="search" />
<q-icon
v-if="inputfilter !== ''"
name="clear"
class="cursor-pointer"
@click="resetFilter"
/>
</template>
</q-input>
<!-- แสดงคอลมนใน table -->
<q-select
:model-value="inputvisible"
@update:model-value="updateVisible"
:display-value="$q.lang.table.columns"
multiple
outlined
dense
:options="attrs.columns"
options-dense
option-value="name"
map-options
emit-value
style="min-width: 150px"
class="gt-xs"
>
<template> </template>
</q-select>
</div>
</div>
<div>
<q-table
ref="table"
flat
bordered
class="custom-table2"
v-bind="attrs"
virtual-scroll
:virtual-scroll-sticky-size-start="48"
dense
:pagination-label="paginationLabel"
:pagination="initialPagination"
:rows-per-page-options="[0]"
>
<template v-slot:header="props">
<q-tr :props="props">
<q-th v-for="col in props.cols" :key="col.name" :props="props">
<span class="text-weight-medium" v-html="col.label" />
</q-th>
<q-th auto-width v-if="inputShow" />
</q-tr>
</template>
<template #body="props">
<slot v-bind="props" name="columns"></slot>
</template>
</q-table>
</div>
</template>
<script setup lang="ts">
import { ref, useAttrs } from "vue";
const attrs = ref<any>(useAttrs());
const table = ref<any>(null);
const filterRef = ref<any>(null);
const initialPagination = ref({
rowsPerPage: 0,
});
const props = defineProps({
count: Number,
pass: Number,
notpass: Number,
inputfilter: String,
name: String,
icon: String,
inputvisible: Array,
editvisible: Boolean,
inputShow: Boolean,
add: {
type: Function,
default: () => console.log("not function"),
},
});
const emit = defineEmits([
"update:inputfilter",
"update:inputvisible",
"update:editvisible",
]);
const updateInput = (value: string | number | null) => {
emit("update:inputfilter", value);
};
const updateVisible = (value: []) => {
emit("update:inputvisible", value);
};
const paginationLabel = (start: string, end: string, total: string) => {
return start + "-" + end + " ใน " + total;
};
const resetFilter = () => {
// reset X
emit("update:inputfilter", "");
filterRef.value.focus();
};
const add = () => {
props.add();
};
</script>
<style lang="scss">
.icon-color {
color: #4154b3;
}
.custom-table2 {
max-height: 64vh;
.q-table tr:nth-child(odd) td {
background: white;
}
.q-table tr:nth-child(even) td {
background: #f8f8f8;
}
.q-table thead tr {
background: #ecebeb;
}
.q-table thead tr th {
position: sticky;
}
.q-table td:nth-of-type(2) {
z-index: 3 !important;
}
.q-table th:nth-of-type(2),
.q-table td:nth-of-type(2) {
position: sticky;
left: 0;
z-index: 1;
}
/* this will be the loading indicator */
.q-table thead tr:last-child th {
/* height of all previous header rows */
top: 48px;
}
.q-table thead tr:first-child th {
top: 0;
}
}
</style>

32
src/main.ts Normal file
View file

@ -0,0 +1,32 @@
import { createApp, defineAsyncComponent } from 'vue'
import App from './App.vue'
import router from './router'
import { Dialog, Notify, Quasar } from "quasar";
import th from "quasar/lang/th";
import quasarUserOptions from "./quasar-user-options"
import { createPinia } from "pinia";
import "@vuepic/vue-datepicker/dist/main.css";
import 'quasar/src/css/index.sass'
// import './assets/main.css'
const app = createApp(App);
const pinia = createPinia();
app.use(router);
app.use(Quasar, {
plugins: {
Notify,
Dialog
},
lang: th,
}
);
app.component(
"datepicker",
defineAsyncComponent(() => import("@vuepic/vue-datepicker"))
);
app.mount('#app');

View file

@ -0,0 +1,203 @@
<script setup lang="ts">
import { ref, Static } from "vue";
const link = ref<number>(1);
import { useQuasar } from "quasar";
import router from "@/router";
const $q = useQuasar();
const fullname = ref<string>("ธัญลักษณ์");
const inboxList = ref<any>([
{
no: 1,
sender: "เจ้าหน้าที่ทะเบียนประวัติ",
subject: "ขอแก้ไขข้อมูลทะเบียนประวัติ",
timereceive: "13/12/2565",
body: "ขอแก้ไขข้อมูลทะเบียนประวัติ เรื่อง ชื่อ-นามสกุล",
ratingModel: 0,
},
{
no: 2,
sender: "เจ้าหน้าที่ทะเบียนประวัติ",
subject: "ขอแก้ไขข้อมูลทะเบียนประวัติ",
timereceive: "13/12/2565",
body: "ขอแก้ไขข้อมูลทะเบียนประวัติ เรื่อง ชื่อ-นามสกุล",
ratingModel: 1,
},
{
no: 3,
sender: "เจ้าหน้าที่ทะเบียนประวัติ",
subject: "ขอแก้ไขข้อมูลทะเบียนประวัติ",
timereceive: "13/12/2565",
body: "ขอแก้ไขข้อมูลทะเบียนประวัติ เรื่อง ชื่อ-นามสกุล",
ratingModel: 0,
},
]);
const items = ref<any>([
{
icon: "mdi-account-group-outline",
title: "แผนผังองค์กร",
sub: "ดูแผนผังองค์กร",
color: "blue-3",
path: "",
active: false,
},
{
icon: "mdi-clipboard-account-outline",
title: "ประเมินผล",
sub: "ข้อมูลการประเมินผลการปฏิบัติราชการ",
color: "lime-4",
path: "",
active: false,
},
{
icon: "mdi-calendar-account-outline",
title: "การลา",
sub:"ดู/ลงเวลา ทำเรื่องลา",
color: "cyan-3",
path: "",
active: false,
},
{
icon: "mdi-folder-account-outline",
title: "ผลงาน",
sub:"ดูผลงาน",
color: "light-green-3",
path: "",
active: false,
},
{
icon: "mdi-account-arrow-right-outline",
title: "ขอโอน",
sub:"ทำเรื่องขอโอนย้าย",
color: "deep-purple-3",
path: "/transfer",
active: false,
},
{
icon: "mdi-account-remove-outline",
title: "ลาออก",
sub:"ทำเรื่องลาออก",
color: "orange-3",
path: "",
active: false,
}
]);
const transferToPage = (path?: string) => {
router.push(`${path}`);
};
</script>
<template>
<div class="col-12 row q-col-gutter-md" style="padding-top: 1.8%;">
<div class="col-12 row" v-if="!$q.screen.gt.xs">
<div class="text-white text-weight-light text-18px">สวสด, {{fullname}}</div>
<div
style="color: #ffffff;"
class="text-18px text-weight-medium col-12"
>
ระบบทรพยากรบคคล
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-9">
<div class="row justify-start q-col-gutter-md">
<div class="col-xs-6 col-sm-4 col-md-4 col-lg-3 col-xl-2 row" v-for="(item, j) in items" :key="j">
<q-card
bordered
@click="transferToPage(item.path)"
class="noactive col-12">
<div class="col-12">
<q-avatar
:color="item.color"
text-color="white"
:size="$q.screen.gt.xs ? '55px': '40px'"
>
<q-icon
:name="item.icon"
:size="$q.screen.gt.xs ? '28px': '20px'"
color="black"
/>
</q-avatar>
</div>
<div class="q-pt-md col-12 text-left text-18px" >{{ item.title }}</div>
<div class="col-12 text-left text-grey text-weight-regular gt-xs" style="font-size: 14px;">{{ item.sub }}</div>
</q-card>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-12 col-md-3 row">
<q-card
flat
bordered
:style="$q.screen.gt.xs ? 'max-height: 80vh' : 'height: auto;'"
class="q-pb-md col-12"
>
<div class="col-12 row q-pa-md">
<div class="text-subtitle1 text-weight-bold text-dark">กลองขอความ</div>
<q-space />
<q-btn dense icon="mdi-dots-vertical" color="grey-6" size="11px" flat />
</div>
<q-list v-for="(contact, index) in inboxList" :key="index" class="q-px-md">
<q-item clickable v-ripple class="q-py-md q-mb-sm my-menu" :active="link === contact.no" @click="link = contact.no" active-class="my-menu-link">
<q-item-section>
<q-item-label >{{ contact.sender }}</q-item-label>
<q-item-label caption class="text-grey-6" lines="2">{{ contact.subject }}</q-item-label>
</q-item-section>
<q-item-section side top>
<q-item-label caption>{{ contact.timereceive }}</q-item-label>
</q-item-section>
</q-item>
</q-list>
<q-banner rounded class="bg-amber-1 text-center q-mx-sm" v-if="inboxList.length < 1">
<div class="text-yellow-10">
<q-icon name="mdi-alert-box" class="q-mx-xs" size="sm" color="yellow-10" />
ไมพบขอความ
</div>
</q-banner>
</q-card>
</div>
</div>
</template>
<style>
.my-menu-link {
color: #1bb19b;
background: #ebf9f7 !important;
font-weight: 600;
border-radius: 10px;
}
.my-menu-link .q-hoverable {
border-radius: 10px;
}
.my-menu{
background: #f1f0f04a ;
border-radius: 10px;
}
.q-card{
border-radius: 12px;
}
.text-18px{
font-size: 1.25em;
}
.noactive {
color: #35473C ;
border-radius: 12px;
padding: 10%;
transition: 0.1s ease;
opacity:1;
cursor: pointer;
}
.noactive:hover{
background: #ebf9f7 ;
color: #1bb19b !important;
font-weight: 600 ;
border: 1px solid #6dbdb142;
}
.disabledcard {
color: rgba(209, 209, 209, 0.733) !important;
border-color: rgba(207, 207, 207, 0.322) !important;
box-shadow: none !important;
border-radius: 12px;
cursor: no-drop !important;
padding: 10%;
}
</style>

View file

@ -0,0 +1,27 @@
/**
* Router
*/
const TransferMain = () =>
import("@/modules/02_transfer/views/Main.vue");
const AddTransfer = () =>
import("@/modules/02_transfer/views/AddTransfer.vue");
export default [
{
path: "/transfer",
name: "transfer",
component: TransferMain
},
{
path: "/transfer/add",
name: "addTransfer",
component: AddTransfer,
},
{
path: "/transfer/:id",
name: "detailTransfer",
component: AddTransfer,
}
];

View file

@ -0,0 +1,87 @@
<script setup lang="ts">
import type { QTableProps } from "quasar";
import { ref } from "vue";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
const router = useRouter();
const $q = useQuasar();
const edu = ref('');
const academy = ref('');
const position = ref('');
const noPos = ref('');
const level = ref('');
const salary = ref('');
const positionNew = ref('');
const salaryNew = ref('');
const transfer = ref('');
const note = ref('');
const routeName = router.currentRoute.value.name
</script>
<template>
<div class="col-12 row justify-center" >
<div class="col-xs-12 col-sm-12 col-md-11">
<div class="toptitle text-white col-12 row items-center">
<q-btn
icon="mdi-arrow-left"
unelevated
round
dense
flat
color="primary"
class="q-mr-sm"
@click="router.go(-1)"
/>
<div v-if="routeName == 'addTransfer'">
เพมเรองขอโอน
</div>
<div v-else>
รายละเอยดเรองขอโอน
</div>
</div>
<div class="col-12">
<q-card bordered>
<div class="col-12 row q-col-gutter-md q-pa-md">
<div class="col-xs-12 col-sm-6 row">
<q-card bordered flat>
<div class="q-pa-xs bg-grey-2 row items-center q-py-sm q-px-md justify-center text-bold">
อมลเด
</div>
<q-separator />
<div class="col-12 row q-pa-sm q-col-gutter-sm">
<q-input class="col-12" dense outlined v-model="edu" label="วุฒิการศึกษา" :readonly="routeName != 'addTransfer'" />
<q-input class="col-12" dense outlined v-model="academy" label="สถานศึกษา" :readonly="routeName != 'addTransfer'"/>
<q-input class="col-xs-12 col-sm-6" dense outlined v-model="position" label="ตำแหน่ง" :readonly="routeName != 'addTransfer'"/>
<q-input class="col-xs-12 col-sm-6" dense outlined v-model="noPos" label="ตำแหน่งเลขที่" :readonly="routeName != 'addTransfer'"/>
<q-input class="col-xs-12 col-sm-6" dense outlined v-model="level" label="อันดับ/ระดับ" :readonly="routeName != 'addTransfer'" />
<q-input class="col-xs-12 col-sm-6" dense outlined v-model="salary" label="เงินเดือน" :readonly="routeName != 'addTransfer'" />
</div>
</q-card>
</div>
<div class="col-xs-12 col-sm-6 row">
<q-card bordered flat>
<div class="q-pa-xs bg-grey-2 row items-center q-py-sm q-px-md justify-center text-bold">
อมลใหม
</div>
<q-separator />
<div class="col-12 row q-pa-sm q-col-gutter-sm">
<q-input class="col-xs-12 col-sm-6" dense outlined v-model="positionNew" label="ตำแหน่ง" :readonly="routeName != 'addTransfer'"/>
<q-input class="col-xs-12 col-sm-6" dense outlined v-model="salaryNew" label="เงินเดือน" :readonly="routeName != 'addTransfer'" />
<q-input class="col-12" dense outlined v-model="transfer" label="โอนไปสังกัด" type="textarea" :readonly="routeName != 'addTransfer'" />
<q-input class="col-12" dense outlined v-model="note" label="หมายเหตุ" :readonly="routeName != 'addTransfer'" />
</div>
</q-card>
</div>
</div>
<q-separator/>
<div class="row col-12 q-pa-sm" v-if="routeName == 'addTransfer'">
<q-space />
<q-btn unelevated dense class="q-px-md" color="primary" label="ยื่นเรื่องขอโอน" @click="router.go(-1)"/>
</div>
</q-card>
</div>
</div>
</div>
</template>

View file

@ -0,0 +1,174 @@
<script setup lang="ts">
import type { QTableProps } from "quasar";
import { ref } from "vue";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
const router = useRouter();
const $q = useQuasar();
import Table from "@/components/Table.vue";
const filter = ref<string>("");
const rows = ref<any>([
{date: '02/02/2566',position: 'นักจัดการงานทั่วไป',noPos: 'กบห.2',level: 'ปฏิบัติการ',salary: '15920',transfer: 'กองบริหารทั่วไป/ฝ่ายการคลัง', status: 'รอดำเนินการ'},
{date: '02/02/2565',position: 'นักจัดการงานทั่วไป',noPos: 'กบห.2',level: 'ปฏิบัติการ',salary: '15920',transfer: 'กองบริหารทั่วไป/กลุ่มงานช่วยนักบริหาร', status: 'เสร็จสิ้น'},
{date: '10/01/2565',position: 'นักจัดการงานทั่วไป',noPos: 'กบห.2',level: 'ปฏิบัติการ',salary: '15920',transfer: 'กองบริหารทั่วไป/กลุ่มงานช่วยนักบริหาร', status: 'เสร็จสิ้น'},
]);
const initialPagination = ref({
rowsPerPage: 0,
});
const visibleColumns = ref<String[]>([
"no",
"date",
"position",
"noPos",
"level",
"salary",
"transfer",
"status",
]);
const columns = ref<QTableProps["columns"]>([
{
name: "no",
align: "left",
label: "ลำดับ",
sortable: true,
field: "no",
headerStyle: "font-size: 14px",
style: "font-size: 14px; width:5px;",
},
{
name: "date",
align: "left",
label: "วันที่",
sortable: true,
field: "date",
headerStyle: "font-size: 14px",
style: "font-size: 14px; width:15%;",
},
{
name: "position",
align: "left",
label: "ตำแหน่ง",
sortable: true,
field: "position",
headerStyle: "font-size: 14px",
style: "font-size: 14px; width:15%;",
},
{
name: "noPos",
align: "left",
label: "ตำแหน่งเลขที่",
sortable: true,
field: "noPos",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "level",
align: "left",
label: "อันดับ/ระดับ",
sortable: true,
field: "level",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "salary",
align: "left",
label: "เงินเดือน",
sortable: true,
field: "salary",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "transfer",
align: "left",
label: "โอนไปสังกัด",
sortable: true,
field: "transfer",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
},
{
name: "status",
align: "left",
label: "สถานะ",
sortable: true,
field: "status",
headerStyle: "font-size: 14px",
style: "font-size: 14px; width:10%;",
},
]);
const clickAdd = async () => {
router.push(`/transfer/add`);
};
</script>
<template>
<div class="col-12 row justify-center">
<div class="col-xs-12 col-sm-12 col-md-11">
<div class="toptitle text-white col-12 row items-center">
<q-btn
icon="mdi-arrow-left"
unelevated
round
dense
flat
color="primary"
class="q-mr-sm"
@click="router.go(-1)"
/>
เรองขอโอน
</div>
<div class="col-12">
<q-card bordered class="q-pa-md">
<Table
style="max-height: 80vh"
:rows="rows"
:columns="columns"
:filter="filter"
:visible-columns="visibleColumns"
v-model:inputfilter="filter"
v-model:inputvisible="visibleColumns"
:pagination="initialPagination"
:inputShow="false"
:add="clickAdd"
:titleText="''"
>
<template #columns="props">
<q-tr :props="props" class="cursor-pointer" @click="router.push(`/transfer/1`)">
<q-td
v-for="col in props.cols"
:key="col.name"
:props="props"
>
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
<div v-else-if="col.name == 'status'">
<q-icon size="20px" v-if="props.row.status == 'รอดำเนินการ'" name="mdi-timer-sand" color="deep-orange">
<q-tooltip>รอดำเนนการ</q-tooltip>
</q-icon>
<q-icon size="20px" v-else name="mdi-check" color="teal">
<q-tooltip>เสรจส</q-tooltip>
</q-icon>
</div>
<div v-else>
{{ col.value }}
</div>
</q-td>
</q-tr>
</template>
</Table>
</q-card>
</div>
</div>
</div>
</template>
<style>
</style>

View file

@ -0,0 +1,11 @@
// import "./styles/quasar.scss"
import "@quasar/extras/material-icons/material-icons.css"
import "@quasar/extras/material-icons-outlined/material-icons-outlined.css"
import "@quasar/extras/fontawesome-v5/fontawesome-v5.css"
import "@quasar/extras/mdi-v4/mdi-v4.css"
// To be used on app.use(Quasar, { ... })
export default {
config: {},
plugins: {},
}

27
src/router/index.ts Normal file
View file

@ -0,0 +1,27 @@
import { createRouter, createWebHistory } from 'vue-router'
const MainLayout = () => import("@/views/MainLayout.vue");
const Dashboard = () => import("@/modules/01_dashboard/views/Dashboard.vue");
import ModuleTransfer from "@/modules/02_transfer/router.ts";
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: '/',
name: 'home',
component: MainLayout,
children:[
{
path: "/",
name: "dashboard",
component: Dashboard,
},
...ModuleTransfer
]
},
]
})
export default router;

13
src/router/loader.ts Normal file
View file

@ -0,0 +1,13 @@
/**
***** DEPRECATED - Must be delete later *****
*/
/** async/await
* @param view "ชี่อไฟล์".vue
* @param folder "folderในsrc" [Ex. /src/"folder"] default=views
*/
export function load(view: string, folder: string = "views") {
// console.log(`@/${folder}/${view}.vue`);
return async () => await import(`@/${folder}/${view}.vue`);
}

View file

@ -0,0 +1,31 @@
// FILE (create it): src/quasar-variables.sass
$primary: #02A998
$secondary: #016987
$accent: #9C27B0
// $dark: #1D1D1D
$dark: #35473C
$positive: #21BA45
$negative: #C10015
$info: #31CCEC
$warning: #F2C037
$add: #00aa86
.bg-white-btn
background: #ffffff20 !important
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@100;200;300;400;500;600;700;800;900&display=swap')
$noto-thai: 'Noto Sans Thai', sans-serif
#azay-app,
div
font-family: $noto-thai !important
text-rendering: optimizeLegibility
-webkit-font-smoothing: antialiased
-moz-osx-font-smoothing: grayscale
$separator-color: #EDEDED !default

232
src/views/MainLayout.vue Normal file
View file

@ -0,0 +1,232 @@
<script setup lang="ts">
import { onMounted, ref, watch } from "vue";
import { useRoute, useRouter } from "vue-router";
import { useQuasar } from "quasar";
const route = useRoute();
const router = useRouter();
const $q = useQuasar();
const link = ref<string>("");
const fullname = ref<string>("นางสาวธัญลักษณ์ รอดกูล");
const notiList = [
{
id: 1,
sender: "นัดหมาย",
body: "เพิ่มการนัดหมาย",
timereceive: "13/06/2566",
},
{
id: 1,
sender: "นัดหมาย",
body: "เพิ่มการนัดหมาย",
timereceive: "14/06/2566",
},
];
const notiTrigger = ref(false);
const currentRouteName = router.currentRoute.value.name
const tab = ref(currentRouteName);
</script>
<!-- โครงเว -->
<template>
<q-layout view="hHh LpR fFr">
<!-- header -->
<q-header flat class="text-dark col-12 bg-top header-br" height-hint="7">
<q-toolbar class="q-my-xs items-center" :style="$q.screen.gt.xs ? 'padding: 1% 2%;': 'padding: 1% 4%;'">
<div class="row items-center no-wrap" v-if="$q.screen.gt.xs">
<q-img src="@/assets/logo.png" spinner-color="white" style="height: 35px; max-width: 35px" />
<div class="row q-ml-md items-center q-pt-xs">
<div
style="color: #ffffff; letter-spacing: 1px; line-height:10px;"
class="text-body2 text-weight-bolder col-12"
>
ระบบ<span class="text-primary">ทรพยากรบคคล</span>
</div>
<div class="text-caption text-white">กรงเทพมหานคร</div>
</div>
</div>
<div v-else class="row items-center">
<img src="@/assets/logo.png" style="height: 35px; max-width: 35px" />
</div>
<div v-if="$q.screen.gt.xs">
<q-tabs
v-model="tab"
align="justify"
indicator-color="transparent"
active-color="white bg-white-btn border-100"
dense
inline-label
class="text-grey-5 tabsHome"
>
<q-tab class="border-100" name="dashboard" label="หน้าแรก" icon="mdi-view-dashboard-outline" @click="router.push(`/`)" />
<q-tab class="border-100" name="time" label="ลงเวลางาน" icon="mdi-map-marker-check-outline" />
<q-tab class="border-100" name="leave" label="การลา" icon="mdi-calendar-blank-outline" />
</q-tabs>
</div>
<q-space />
<!-- Notification -->
<q-btn
round
dense
flat
size="13px"
:class="$q.screen.gt.xs ? 'bg-white-btn q-mx-md': 'q-mr-sm'"
:color="notiList.length === 0 ? 'grey-6' : 'grey-8'"
:disable="notiList.length === 0"
>
<q-icon name="mdi-bell-outline" size="22px" color="white" />
<q-badge
rounded
v-show="notiList.length > 0"
color="negative"
text-color="white"
floating
>{{ notiList.length }}</q-badge
>
<q-menu v-model="notiTrigger" max-width="480px" :offset="[0, 10]">
<div class="q-px-md q-py-sm row col-12 items-center">
<div class="text-subtitle1 text-weight-medium">การแจงเตอน</div>
<q-space />
<q-btn label="ล้างข้อมูล" color="pink" dense class="text-caption" flat />
</div>
<q-list style="min-width: 300px" v-for="(n, index) in notiList" :key="index">
<q-item v-ripple class="mytry q-py-sm" dense>
<q-item-section avatar top style="min-width: 40px">
<q-avatar rounded color="primary" size="25px" text-color="white">
<span class="text-weight-medium text-uppercase">{{n.sender[0]}}</span>
</q-avatar>
</q-item-section>
<q-item-section>
<q-item-label caption class="text-black">{{n.body}}</q-item-label>
<q-item-label caption class="row items-center text-grey-7" style="font-size: 12px;">{{ n.timereceive }}</q-item-label>
</q-item-section>
<div>
<q-btn
size="sm"
unelevated
dense
icon="mdi-close"
class="mybtn q-mx-xs"
v-close-popup
></q-btn>
</div>
</q-item>
<q-separator class="q-my-xs" color="grey-2" v-if="index + 1 < notiList.length" :key="index" />
</q-list>
</q-menu>
</q-btn>
<!-- User -->
<q-btn-dropdown
v-if="$q.screen.gt.xs"
rounded
dense
flat
:class="$q.screen.gt.xs ? 'bg-white-btn': ''"
color="white"
class="q-pr-sm border-10"
dropdown-icon="mdi-chevron-down">
<template v-slot:label>
<q-item dense v-close-popup class="q-pa-none q-pl-xs">
<q-item-section avatar class="q-pa-none " style="min-width:30px;">
<q-img src="@/assets/avatar_user.jpg" class="border-100" spinner-color="white" style="height: 30px; max-width: 30px;" />
</q-item-section>
<q-item-section class="text-left text-white q-pa-none q-pl-sm" >
<q-item-label class="text-caption text-weight-medium">{{fullname}}</q-item-label>
</q-item-section>
</q-item>
</template>
<q-list>
<q-item clickable v-close-popup >
<q-item-section avatar style="min-width:30px;">
<q-icon color="orange-9" size="18px" name="mdi-lock-outline" />
</q-item-section>
<q-item-section><q-item-label>เปลยนรหสผาน</q-item-label></q-item-section>
</q-item>
<q-item clickable v-close-popup >
<q-item-section avatar style="min-width:30px;">
<q-icon color="primary" size="18px" name="mdi-logout-variant" />
</q-item-section>
<q-item-section><q-item-label>ออกจากระบบ</q-item-label></q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
<div v-else class="q-ml-sm" style="width: 30px;">
<q-img src="@/assets/avatar_user.jpg" class="border-100" spinner-color="white" style="height: 30px; max-width: 30px;" />
</div>
</q-toolbar>
</q-header>
<div class="bg-top" :style="$q.screen.gt.xs ? 'height: 200px;': 'height: 200px;'" />
<!-- end header -->
<q-footer class="bg-top" v-if="!$q.screen.gt.xs">
<q-toolbar style="padding: 2% 2%;">
<div class="row col-12 justify-around">
<q-btn flat round class="bg-white-btn" color="white" icon="mdi-view-dashboard-outline" />
<q-btn flat round color="white" icon="mdi-map-marker-check-outline" />
<q-btn flat round color="white" icon="mdi-calendar-blank-outline"/>
<q-btn flat round color="white" icon="mdi-account-outline" />
</div>
</q-toolbar>
</q-footer>
<q-page-container class="bg-grey-2 q-pb-md">
<q-page :style="$q.screen.gt.xs ? 'padding: 1.8% 2%; margin-top: -200px;': 'padding: 5% 4%; margin-top: -200px;'">
<router-view :key="$route.fullPath" />
</q-page>
</q-page-container>
</q-layout>
</template>
<style>
.bg-drawer{
background: #242a3d;
}
.menu {
padding-bottom: 5px;
padding-top: 5px;
}
.tabsHome .q-tab__icon{
font-size: 18px;
}
.border-100{
border-radius: 100px;
}
.bg-top{
background: #273238;
}
.header-br{
border-bottom: 1px solid #fdfdfd31;
}
.menuActive {
background: #1e2234;
border-radius: 0 100px 100px 0;
margin-right: 4%;
}
.q-card {
box-shadow: 3px 3px 20px -10px rgba(151, 150, 150, 0.261) !important;
border: 1px solid #eeeded;
}
.q-menu {
box-shadow: 3px 3px 10px 1px rgba(95, 95, 95, 0.15) !important;
}
.toptitle {
font-size: 1.2rem;
font-weight: bold;
margin-bottom: 1.2%;
}
.q-field--outlined .q-field__control{
border-radius: 5px;
}
.q-field--outlined .q-field__control:before {
border-color: #C8D3DB;
}
.q-field--outlined .q-icon{
color: #7474747f;
}
</style>