Merge branch 'develop' into devTee

This commit is contained in:
STW_TTTY\stwtt 2024-06-28 14:07:55 +07:00
commit 55182b688d
23 changed files with 1461 additions and 652 deletions

View file

@ -11,6 +11,7 @@ const KpiFile = `${env.API_URI}/salary/file`;
const KpiEvaluationInfo = `${env.API_URI}/kpi/evaluation`; const KpiEvaluationInfo = `${env.API_URI}/kpi/evaluation`;
const Kpiorg = `${env.API_URI}/org/profile/commander`; const Kpiorg = `${env.API_URI}/org/profile/commander`;
const Kpi = `${env.API_URI}/kpi`;
const KpiUser = `${env.API_URI}/kpi/user`; const KpiUser = `${env.API_URI}/kpi/user`;
const kpiAchievement = `${env.API_URI}/kpi/user/achievement`; const kpiAchievement = `${env.API_URI}/kpi/user/achievement`;
const kpiReason = `${env.API_URI}/kpi/reason`; const kpiReason = `${env.API_URI}/kpi/reason`;
@ -45,7 +46,8 @@ export default {
kpiSendToStatus: (id: string) => `${kpiEvaluation}/status/${id}`, kpiSendToStatus: (id: string) => `${kpiEvaluation}/status/${id}`,
kpiSendToSummary: (id: string) => `${kpiEvaluation}/summary/${id}`, kpiSendToSummary: (id: string) => `${kpiEvaluation}/summary/${id}`,
kpiSendToGet: (id: string) => `${kpiEvaluation}/reason/${id}`, kpiSendToGet: (id: string) => `${kpiEvaluation}/reason/${id}`,
kpiSendToReason: (id: string,type:string) => `${kpiEvaluation}/reason/${type}/${id}`, kpiSendToReason: (id: string, type: string) =>
`${kpiEvaluation}/reason/${type}/${id}`,
kpiReqEdit: (id: string) => `${kpiEvaluation}/edit/${id}`, kpiReqEdit: (id: string) => `${kpiEvaluation}/edit/${id}`,
/**ประเมิน*/ /**ประเมิน*/
kpiAchievementDevelop: `${kpiAchievement}/development`, kpiAchievementDevelop: `${kpiAchievement}/development`,
@ -59,4 +61,5 @@ export default {
sendToSummary: (id: string) => `${kpiEvaluation}/summary/${id}`, sendToSummary: (id: string) => `${kpiEvaluation}/summary/${id}`,
updatePoint: (id: string) => `${kpiEvaluation}/point/${id}`, updatePoint: (id: string) => `${kpiEvaluation}/point/${id}`,
openPoint: (id: string) => `${kpiEvaluation}/open/${id}`, openPoint: (id: string) => `${kpiEvaluation}/open/${id}`,
kpiReport: (id: string) => `${Kpi}/report/kpi9/${id}`,
}; };

View file

@ -0,0 +1,15 @@
import env from "./index";
const development = `${env.API_URI}/development`;
const urlFile = `${env.API_URI}/salary`;
export default {
// portfolio
portfolio: `${development}/portfolio`,
portfolioId: (id: string) => `${development}/portfolio/${id}`,
file: (name: string, group: string, id: string) =>
`${urlFile}/file/${name}/${group}/${id}`,
fileByFile: (name: string, group: string, id: string, fileName: string) =>
`${urlFile}/file/${name}/${group}/${id}/${fileName}`,
};

View file

@ -12,21 +12,51 @@ import org from "./api/org/api.org";
import scholarship from "./api/scholarship/api.scholarship"; import scholarship from "./api/scholarship/api.scholarship";
import kpi from "./api/KPI/api.kpis"; import kpi from "./api/KPI/api.kpis";
import probation from "./api/probation/api.probation"; import probation from "./api/probation/api.probation";
import development from "./api/api.development";
const API = { const API = {
...testtest, ...testtest,
...retirementResign, ...retirementResign,
...placementTransfer, ...placementTransfer,
...message, ...message,
...evaluate, ...evaluate,
...appeal, ...appeal,
...support, ...support,
...org, ...org,
...scholarship, ...scholarship,
...kpi, ...kpi,
...probation, ...probation,
...development,
};
const path = "http://localhost:3008";
const generatePopupPath = (routeName: any) => {
if (routeName.includes("metadata")) {
return `${path}/manual/chapter-2-admin-metadata`;
}
if (routeName.includes("leave")) {
return `${path}/manual/chapter-3-user-leave`;
}
// if (routeName.includes("compete")) {
// return `${path}/manual/chapter-10-admin-recruit`;
// }
// if (routeName.includes("registryNew")) {
// return `${path}/manual/chapter-7-admin-registry`;
// }
// if (routeName.includes("registry")) {
// return `${path}/manual/chapter-7-admin-registry`;
// }
else {
return manualConfig[routeName as keyof typeof manualConfig];
}
};
const manualConfig = {
dashboard: `${path}/manual/chapter-1-user-organization-chart`,
}; };
export default { export default {
API: API, API: API,
generatePopupPath,
}; };

View file

@ -34,6 +34,14 @@ const items = ref<any>([
path: "/organization-chart", path: "/organization-chart",
active: false, active: false,
}, },
{
icon: "mdi-clipboard-account-outline",
title: "ทะเบียนประวัติ",
sub: "ข้อมูลทะเบียนประวัติ",
color: "blue-4",
path: "/registry",
active: false,
},
{ {
icon: "mdi-clipboard-account-outline", icon: "mdi-clipboard-account-outline",
title: "ประเมินบุคคล", title: "ประเมินบุคคล",
@ -55,7 +63,7 @@ const items = ref<any>([
title: "ผลงาน", title: "ผลงาน",
sub: "ดูผลงาน", sub: "ดูผลงาน",
color: "light-green-3", color: "light-green-3",
path: "", path: "/portfolio",
active: false, active: false,
}, },
{ {
@ -66,14 +74,14 @@ const items = ref<any>([
path: "/transfer", path: "/transfer",
active: false, active: false,
}, },
{ /*{
icon: "mdi-account-remove-outline", icon: "mdi-account-remove-outline",
title: "ลาออก", title: "ลาออก",
sub: "ทำเรื่องลาออก", sub: "ทำเรื่องลาออก",
color: "orange-3", color: "orange-3",
path: "/retire", path: "/retire",
active: false, active: false,
}, },*/
{ {
icon: "mdi-scale-balance", icon: "mdi-scale-balance",
title: "อุทธรณ์ร้องทุกข์", title: "อุทธรณ์ร้องทุกข์",

View file

@ -99,13 +99,13 @@ const fecthDataTransfer = async (id: string) => {
}; };
/** /**
* งกนดาวโหลดอโหลดไฟล * งกนดาวโหลดอโหลดไฟล
*/ */
const fileDocDataUpload = ref<File[]>([]); const fileDocDataUpload = ref<File[]>([]);
const filesNull = () => { const filesNull = () => {
files.value = null; files.value = null;
}; };
// //
const fileUploadDoc = async (file: any) => { const fileUploadDoc = async (file: any) => {
fileDocDataUpload.value.push(file); fileDocDataUpload.value.push(file);
nameFile.value = file[0].name; nameFile.value = file[0].name;
@ -178,25 +178,12 @@ function fileOpen(url: string) {
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space
accept=".pdf" accept=".pdf"
:rules="[ :rules="[(val: string) => !!val || 'กรุณาเลือกไฟล์เอกสารเพิ่มเติม']"
(val) => !!val || 'กรุณากรอกอัพโหลดเอกสารเพิ่มเติม',
]"
label="เอกสารเพิ่มเติม" label="เอกสารเพิ่มเติม"
> >
<template v-slot:prepend> <template v-slot:prepend>
<q-icon name="attach_file" /> </template <q-icon name="attach_file" /> </template
></q-file> ></q-file>
<!-- <q-uploader
bordered
flat
class="col-12"
accept=".jpg,.png,.pdf,.csv,.doc"
url="http://localhost:4444/upload"
label="เอกสารเพิ่มเติม"
type="file"
@added="fileUploadDoc"
@removed="filesNull"
/> -->
</div> </div>
<div class="col-12 row" v-if="routeName != 'addTransfer'"> <div class="col-12 row" v-if="routeName != 'addTransfer'">
<q-card bordered flat class="full-width"> <q-card bordered flat class="full-width">
@ -209,10 +196,7 @@ function fileOpen(url: string) {
</div> </div>
<q-separator /> <q-separator />
<q-list separator> <q-list separator>
<q-item <q-item v-for="file in files" :key="file.key">
v-for="file in files"
:key="file.key"
>
<q-item-section> <q-item-section>
{{ file.fileName }} {{ file.fileName }}
</q-item-section> </q-item-section>

View file

@ -234,7 +234,7 @@ function downloadFile(data: string) {
" "
:label="`${'วันที่ยื่นขอลาออกจากราชการ'}`" :label="`${'วันที่ยื่นขอลาออกจากราชการ'}`"
:rules="[ :rules="[
(val) => (val: string) =>
!!val || `${'กรุณาเลือกวันที่ยื่นขอลาออกจากราชการ'}`, !!val || `${'กรุณาเลือกวันที่ยื่นขอลาออกจากราชการ'}`,
]" ]"
> >
@ -282,7 +282,7 @@ function downloadFile(data: string) {
" "
:label="`${'วันที่ขอลาออกจากราชการ'}`" :label="`${'วันที่ขอลาออกจากราชการ'}`"
:rules="[ :rules="[
(val) => (val: string) =>
!!val || `${'กรุณาเลือกวันที่ขอลาออกจากราชการ'}`, !!val || `${'กรุณาเลือกวันที่ขอลาออกจากราชการ'}`,
]" ]"
> >
@ -309,7 +309,7 @@ function downloadFile(data: string) {
hide-bottom-space hide-bottom-space
:readonly="routeName != 'AddRetire'" :readonly="routeName != 'AddRetire'"
:rules="[ :rules="[
(val) => !!val || `${'กรุณากรอกเหตุผลที่ลาออกจากราชการ'}`, (val: string) => !!val || `${'กรุณากรอกเหตุผลที่ลาออกจากราชการ'}`,
]" ]"
/> />
@ -322,9 +322,7 @@ function downloadFile(data: string) {
lazy-rules lazy-rules
hide-bottom-space hide-bottom-space
accept=".pdf" accept=".pdf"
:rules="[ :rules="[(val: string) => !!val || 'กรุณาเลือกเอกสารเพิ่มเติม']"
(val) => !!val || 'กรุณากรอกอัพโหลดเอกสารเพิ่มเติม',
]"
label="เอกสารเพิ่มเติม" label="เอกสารเพิ่มเติม"
> >
<template v-slot:prepend> <template v-slot:prepend>
@ -332,12 +330,7 @@ function downloadFile(data: string) {
></q-file> ></q-file>
</div> </div>
<div class="col-12 row" v-if="routeName != 'AddRetire'"> <div class="col-12 row" v-if="routeName != 'AddRetire'">
<q-card <q-card bordered flat class="row col-12 text-dark q-mt-sm">
bordered
flat
class="row col-12 text-dark q-mt-sm"
>
<div <div
class="bg-grey-1 q-pa-sm col-12 row items-center text-primary" class="bg-grey-1 q-pa-sm col-12 row items-center text-primary"
> >
@ -376,11 +369,7 @@ function downloadFile(data: string) {
</div> </div>
<div class="col-12 row" v-if="routeName != 'AddRetire'"> <div class="col-12 row" v-if="routeName != 'AddRetire'">
<q-card <q-card bordered class="row col-12 text-dark q-mt-sm">
bordered
class="row col-12 text-dark q-mt-sm"
>
<div <div
class="bg-grey-1 q-pa-sm col-12 row items-center text-primary" class="bg-grey-1 q-pa-sm col-12 row items-center text-primary"
> >
@ -444,11 +433,7 @@ function downloadFile(data: string) {
</div> </div>
<div class="col-12 row" v-if="routeName != 'AddRetire'"> <div class="col-12 row" v-if="routeName != 'AddRetire'">
<q-card <q-card bordered class="row col-12 text-dark q-mt-sm">
bordered
class="row col-12 text-dark q-mt-sm"
>
<div <div
class="bg-grey-1 q-pa-sm col-12 row items-center text-primary" class="bg-grey-1 q-pa-sm col-12 row items-center text-primary"
> >
@ -511,11 +496,7 @@ function downloadFile(data: string) {
</q-card> </q-card>
</div> </div>
<div class="col-12 row" v-if="routeName != 'AddRetire'"> <div class="col-12 row" v-if="routeName != 'AddRetire'">
<q-card <q-card bordered class="row col-12 text-dark q-mt-sm">
bordered
class="row col-12 text-dark q-mt-sm"
>
<div <div
class="bg-grey-1 q-pa-sm col-12 row items-center text-primary" class="bg-grey-1 q-pa-sm col-12 row items-center text-primary"
> >
@ -579,27 +560,33 @@ function downloadFile(data: string) {
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<q-separator v-if="routeName !== 'AddRetire'" /> <q-separator v-if="routeName !== 'AddRetire'" />
<q-card-actions align="right" v-if="routeName !== 'AddRetire'" class="q-px-md"> <q-card-actions
<q-btn align="right"
v-if=" v-if="routeName !== 'AddRetire'"
dataDetail.status !== 'DELETE' && class="q-px-md"
dataDetail.status !== 'DONE' && >
dataDetail.status !== 'CANCEL' <q-btn
" v-if="
unelevated dataDetail.status !== 'DELETE' &&
dataDetail.status !== 'DONE' &&
class="q-px-md items-center" dataDetail.status !== 'CANCEL'
color="orange" "
label="ยกเลิกการลาออก" unelevated
@click="cancelResing" class="q-px-md items-center"
:disable="tranferOrg == '' && noteReason == ''" color="orange"
/> label="ยกเลิกการลาออก"
</q-card-actions> @click="cancelResing"
:disable="tranferOrg == '' && noteReason == ''"
/>
</q-card-actions>
<q-separator v-if="routeName == 'AddRetire'" /> <q-separator v-if="routeName == 'AddRetire'" />
<q-card-actions align="right" v-if="routeName == 'AddRetire'" class="q-px-md"> <q-card-actions
align="right"
v-if="routeName == 'AddRetire'"
class="q-px-md"
>
<q-space /> <q-space />
<q-btn <q-btn
unelevated unelevated

View file

@ -139,7 +139,7 @@ const clickBack = () => {
<div class="col-12 row justify-center"> <div class="col-12 row justify-center">
<div class="col-xs-12 col-sm-12 col-md-11"> <div class="col-xs-12 col-sm-12 col-md-11">
<div class="toptitle text-white col-12 row items-center"> <div class="toptitle text-white col-12 row items-center">
<q-btn <!-- <q-btn
icon="mdi-arrow-left" icon="mdi-arrow-left"
unelevated unelevated
round round
@ -148,8 +148,8 @@ const clickBack = () => {
color="primary" color="primary"
class="q-mr-sm" class="q-mr-sm"
@click="clickBack" @click="clickBack"
/> /> -->
ลาออก ขอลาออก
</div> </div>
<div class="col-12"> <div class="col-12">
<q-card bordered class="q-pa-md"> <q-card bordered class="q-pa-md">

View file

@ -185,22 +185,6 @@ watch(
store.indicatorScoreVal = store.indicatorScoreVal =
store.indicatorPercentVal * (store.indicatorScore / 100); store.indicatorPercentVal * (store.indicatorScore / 100);
if (store.isUpdate && store.tabMain === "3") {
http
.put(config.API.updatePoint(evaluationId.value), {
totalPoint1: (
store.indicatorPercentVal *
(store.indicatorScore / 100)
).toFixed(2),
summaryPoint: (
store.indicatorScoreVal +
store.competencyScoreVal +
store.devScoreVal
).toFixed(2),
})
.then((res) => {});
}
} }
} }
); );
@ -229,7 +213,7 @@ onMounted(() => {
<!-- องคประกอบท 1 --> <!-- องคประกอบท 1 -->
<div <div
v-if=" v-if="
store.dataEvaluation.posTypeName == 'อำนวยการ' && store.dataEvaluation.posTypeName == 'อำนวยการ' ||
store.dataEvaluation.posTypeName == 'บริหาร' store.dataEvaluation.posTypeName == 'บริหาร'
" "
> >

View file

@ -6,6 +6,7 @@ import { useKpiDataStore } from "@/modules/08_KPI/store";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import genReport from "@/plugins/genreport";
const store = useKpiDataStore(); const store = useKpiDataStore();
const $q = useQuasar(); const $q = useQuasar();
@ -191,6 +192,33 @@ function getData() {
.finally(() => {}); .finally(() => {});
} }
/**
* งกนดาวนโหลดรายงาน
*/
async function downloadReport() {
showLoader();
await http
.get(config.API.kpiReport(id.value))
.then(async (res) => {
console.log(res.data.result.data);
const data = res.data.result;
await genReport(
data,
"แบบรายงานผลการปฏิบัติราชการ " +
store.dataEvaluation.prefix +
store.dataEvaluation.fileName +
" " +
store.dataEvaluation.lastName
);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
onMounted(() => { onMounted(() => {
getData(); getData();
fetchEvaluation(); fetchEvaluation();
@ -206,6 +234,21 @@ onMounted(() => {
<q-toolbar-title class="text-subtitle2 text-bold" <q-toolbar-title class="text-subtitle2 text-bold"
>สรปผลการประเม</q-toolbar-title >สรปผลการประเม</q-toolbar-title
> >
<q-space />
<q-btn
v-if="store.dataEvaluation.evaluationStatus === 'COMPLETE'"
outline
flat
dense
color="blue"
icon="mdi-download"
size="12px"
class="q-mr-md"
@click="downloadReport"
>
<q-tooltip>ดาวนโหลดแบบรายงานผลการปฏราชการ</q-tooltip>
</q-btn>
</q-toolbar> </q-toolbar>
<q-separator /> <q-separator />
<q-card-section> <q-card-section>

View file

@ -277,12 +277,22 @@ watch(
<q-dialog v-model="modal" persistent> <q-dialog v-model="modal" persistent>
<q-card class="col-12" style="width: 85%"> <q-card class="col-12" style="width: 85%">
<q-form greedy @submit.prevent @validation-success="onSubmit"> <q-form greedy @submit.prevent @validation-success="onSubmit">
<DialogHeader :tittle="`เพิ่มสมรรถนะ`" :close="closeDialog" /> <DialogHeader
:tittle="
competencyType == 'HEAD' || competencyType == 'GROUP'
? `รายละเอียดสมรรถนะ`
: `เพิ่มสมรรถนะ`
"
:close="closeDialog"
/>
<q-separator /> <q-separator />
<q-card-section class="q-pa-none scroll" style="max-height: 80vh"> <q-card-section class="q-pa-none scroll" style="max-height: 80vh">
<div class="row"> <div class="row">
<div class="bg-grey-1 q-pa-md col-xs-12 col-md-3 row lineRight"> <div
v-if="competencyType != 'HEAD' && competencyType != 'GROUP'"
class="bg-grey-1 q-pa-md col-xs-12 col-md-3 row lineRight"
>
<div class="col-12 q-col-gutter-sm fit"> <div class="col-12 q-col-gutter-sm fit">
<div class="col-12"> <div class="col-12">
<q-select <q-select
@ -362,7 +372,13 @@ watch(
</div> </div>
</div> </div>
<div class="col-xs-12 col-md-9 q-pa-md q-col-gutter-sm"> <div
:class="
competencyType == 'HEAD' || competencyType == 'GROUP'
? `col-xs-12 col-md-12 q-pa-md q-col-gutter-sm`
: `col-xs-12 col-md-9 q-pa-md q-col-gutter-sm`
"
>
<span class="text-body2 text-weight-medium" <span class="text-body2 text-weight-medium"
>รายละเอยดสมรรถนะ</span >รายละเอยดสมรรถนะ</span
> >

View file

@ -19,6 +19,7 @@ import type {
import DialogListCriteria from "@/modules/08_KPI/components/Tab/Dialog/DialogListCriteria.vue"; import DialogListCriteria from "@/modules/08_KPI/components/Tab/Dialog/DialogListCriteria.vue";
import DialogCompetncyByRow from "@/modules/08_KPI/components/Tab/Dialog/DialogCompetncyByRow.vue"; import DialogCompetncyByRow from "@/modules/08_KPI/components/Tab/Dialog/DialogCompetncyByRow.vue";
import DialogLevel from "@/modules/08_KPI/components/Tab/Dialog/DialogLevel.vue"; import DialogLevel from "@/modules/08_KPI/components/Tab/Dialog/DialogLevel.vue";
import type { DataOptions } from "@/modules/08_KPI/interface/index/Main";
const modalLevel = ref<boolean>(false); const modalLevel = ref<boolean>(false);
const modalCompetncyByRow = ref<boolean>(false); const modalCompetncyByRow = ref<boolean>(false);
@ -146,8 +147,8 @@ function getData(type: string) {
let result = 0; let result = 0;
let weight = 0; let weight = 0;
let total = 0; let total = 0;
for (let index = 0; index < store.competencyType.length; index++) { for (let index = 0; index < competencyType.value.length; index++) {
const element = await store.competencyType[index]; const element = await competencyType.value[index];
const dataArr = await lists.value.find( const dataArr = await lists.value.find(
(x: any) => x.type == element.id (x: any) => x.type == element.id
@ -171,7 +172,7 @@ function getData(type: string) {
let resultAvg = result / total; let resultAvg = result / total;
if ( if (
store.dataEvaluation.posTypeName == "อำนวยการ" && store.dataEvaluation.posTypeName == "อำนวยการ" ||
store.dataEvaluation.posTypeName == "บริหาร" store.dataEvaluation.posTypeName == "บริหาร"
) { ) {
store.competencyScoreVal = store.competencyScoreVal =
@ -184,24 +185,6 @@ function getData(type: string) {
? (resultAvg / weightAvg) * store.competencyScore ? (resultAvg / weightAvg) * store.competencyScore
: 0; : 0;
} }
if (
store.isUpdate &&
store.tabMain === "3" &&
(store.dataEvaluation.evaluationStatus === "EVALUATOR" ||
store.dataEvaluation.evaluationStatus === "EVALUATING_EVALUATOR")
) {
http
.put(config.API.updatePoint(store.dataEvaluation.id), {
totalPoint2_1: store.competencyScoreVal.toFixed(2),
summaryPoint: (
store.indicatorScoreVal +
store.competencyScoreVal +
store.devScoreVal
).toFixed(2),
})
.then((res) => {});
}
} }
}); });
} }
@ -273,18 +256,6 @@ const isEditStep3 = computed(() => {
); );
}); });
watch(
() => store.dataEvaluation.capacityPoint,
(newValue, oldValue) => {
if (newValue !== oldValue) {
for (let index = 0; index < store.competencyType.length; index++) {
const element = store.competencyType[index];
getData(element.id);
}
}
}
);
function onInfo() { function onInfo() {
modalCriteria.value = true; modalCriteria.value = true;
} }
@ -299,16 +270,32 @@ function onLevel(num: number, list: any) {
modalLevel.value = true; modalLevel.value = true;
} }
onMounted(() => { const competencyType = ref<DataOptions[]>([]);
for (let index = 0; index < store.competencyType.length; index++) { onMounted(async () => {
const element = store.competencyType[index]; setTimeout(async () => {
getData(element.id); competencyType.value = await (store.dataEvaluation.posTypeName ==
} "อำนวยการ" || store.dataEvaluation.posTypeName == "บริหาร"
? store.competencyType.filter(
(x: DataOptions) =>
x.id == "HEAD" ||
x.id == "EXECUTIVE" ||
x.id == "INSPECTOR" ||
x.id == "DIRECTOR"
)
: store.competencyType.filter(
(x: DataOptions) => x.id == "HEAD" || x.id == "GROUP"
));
for (let index = 0; index < competencyType.value.length; index++) {
const element = competencyType.value[index];
getData(element.id);
}
}, 1000);
}); });
</script> </script>
<template> <template>
<div v-for="(item, index) in store.competencyType" :key="index"> <div v-for="(item, index) in competencyType" :key="index">
<q-card bordered style="border-radius: 5px" class="no-shadow q-mt-sm"> <q-card bordered style="border-radius: 5px" class="no-shadow q-mt-sm">
<q-card-section class="bg-grey-2 q-py-sm"> <q-card-section class="bg-grey-2 q-py-sm">
<div class="row items-center"> <div class="row items-center">
@ -468,7 +455,10 @@ onMounted(() => {
color="info" color="info"
@click.stop.pervent="onEdit(props.row, item.id)" @click.stop.pervent="onEdit(props.row, item.id)"
> >
<q-tooltip>แกไข </q-tooltip> <q-tooltip v-if="item.id == 'HEAD' || item.id == 'GROUP'"
>รายละเอยด</q-tooltip
>
<q-tooltip v-else>แก้ไข</q-tooltip>
</q-btn> </q-btn>
<q-btn <q-btn
flat flat

View file

@ -126,24 +126,6 @@ function getDevelop() {
(sum: number, e: any) => sum + e.summary, (sum: number, e: any) => sum + e.summary,
0 0
); );
if (
store.isUpdate &&
store.tabMain === "3" &&
(store.dataEvaluation.evaluationStatus === "EVALUATOR" ||
store.dataEvaluation.evaluationStatus === "EVALUATING_EVALUATOR")
) {
http
.put(config.API.updatePoint(store.dataEvaluation.id), {
totalPoint2_2: store.devScoreVal.toFixed(2),
summaryPoint: (
store.indicatorScoreVal +
store.competencyScoreVal +
store.devScoreVal
).toFixed(2),
})
.then((res) => {});
}
}); });
} }

View file

@ -58,7 +58,9 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
const dataEvaluation = ref<any>({ const dataEvaluation = ref<any>({
evaluationReqEdit: null, evaluationReqEdit: null,
evaluationResults: null,
evaluationStatus: null, evaluationStatus: null,
isOpen: null,
profileId: null, profileId: null,
evaluatorId: null, evaluatorId: null,
commanderId: null, commanderId: null,
@ -66,6 +68,17 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
plannedPoint: 0, plannedPoint: 0,
rolePoint: 0, rolePoint: 0,
specialPoint: 0, specialPoint: 0,
prefix: "",
firstName: "",
lastName: "",
posExecutiveName: "",
posLevelName: "",
posTypeName: "",
position: "",
summaryPoint: 0,
totalPoint1: 0,
totalPoint2_1: 0,
totalPoint2_2: 0,
}); });
const competencyType = ref<DataOptions[]>([ const competencyType = ref<DataOptions[]>([
@ -144,39 +157,41 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
} }
} }
async function checkCompetency() { // async function checkCompetency() {
// const position = await dataEvaluation.value.position; // // const position = await dataEvaluation.value.position;
// const executiveName = await dataEvaluation.value.posExecutiveName; // // const executiveName = await dataEvaluation.value.posExecutiveName;
const posTypeName = dataEvaluation.value.posTypeName; // const posTypeName = await dataEvaluation.value.posTypeName;
const posLevelName = dataEvaluation.value.posLevelName; // const posLevelName = dataEvaluation.value.posLevelName;
// if ( // console.log("posTypeName===>", posTypeName);
// position == "ผู้ตรวจราชการกรุงเทพมหานคร" ||
// position == "ผู้ตรวจราชการ" // // if (
// ) { // // position == "ผู้ตรวจราชการกรุงเทพมหานคร" ||
// competencyType.value = competencyType.value.filter( // // position == "ผู้ตรวจราชการ"
// (x: DataOptions) => x.id == "HEAD" || x.id == "INSPECTOR" // // ) {
// ); // // competencyType.value = competencyType.value.filter(
// } else if (position == "ผู้อำนวยการเขต") { // // (x: DataOptions) => x.id == "HEAD" || x.id == "INSPECTOR"
// competencyType.value = competencyType.value.filter( // // );
// (x: DataOptions) => x.id == "HEAD" || x.id == "DIRECTOR" // // } else if (position == "ผู้อำนวยการเขต") {
// ); // // competencyType.value = competencyType.value.filter(
// } else { // // (x: DataOptions) => x.id == "HEAD" || x.id == "DIRECTOR"
if (posTypeName == "อำนวยการ" || posTypeName == "บริหาร") { // // );
competencyType.value = competencyType.value.filter( // // } else {
(x: DataOptions) => // if (posTypeName == "อำนวยการ" || posTypeName == "บริหาร") {
x.id == "HEAD" || // competencyType.value = await competencyType.value.filter(
x.id == "EXECUTIVE" || // (x: DataOptions) =>
x.id == "INSPECTOR" || // x.id == "HEAD" ||
x.id == "DIRECTOR" // x.id == "EXECUTIVE" ||
); // x.id == "INSPECTOR" ||
} else { // x.id == "DIRECTOR"
competencyType.value = competencyType.value.filter( // );
(x: DataOptions) => x.id == "HEAD" || x.id == "GROUP" // } else {
); // competencyType.value = await competencyType.value.filter(
} // (x: DataOptions) => x.id == "HEAD" || x.id == "GROUP"
// } // );
} // }
// // }
// }
const defaultCompetencyCoreLevel = ref<number>(); const defaultCompetencyCoreLevel = ref<number>();
const defaultCompetencyGroupLevel = ref<number | null>(null); const defaultCompetencyGroupLevel = ref<number | null>(null);
@ -343,46 +358,46 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
const indicatorScoreVal = ref<number>(0); // สรุปผลการประเมินผลสัมฤทธิ์ของงานที่ได้ const indicatorScoreVal = ref<number>(0); // สรุปผลการประเมินผลสัมฤทธิ์ของงานที่ได้
const competencyScoreVal = ref<number>(0); // ผลการประเมินสมรรถนะที่ได้กี่คะแนน const competencyScoreVal = ref<number>(0); // ผลการประเมินสมรรถนะที่ได้กี่คะแนน
function getDataWork() { // function getDataWork() {
showLoader(); // showLoader();
http // http
.get(config.API.orgPosition + `/${dataProfile.value.profileId}`) // .get(config.API.orgPosition + `/${dataProfile.value.profileId}`)
.then((res) => { // .then((res) => {
const data = res.data.result.isProbation; // const data = res.data.result.isProbation;
work.value = data; // work.value = data;
if (data) { // if (data) {
indicatorScore.value = 50; // indicatorScore.value = 50;
competencyScore.value = 40; // competencyScore.value = 40;
excusiveCompetencyScore.value = 40; // excusiveCompetencyScore.value = 40;
competencyDevScore.value = 10; // competencyDevScore.value = 10;
} else { // } else {
indicatorScore.value = 70; // indicatorScore.value = 70;
competencyScore.value = 20; // competencyScore.value = 20;
excusiveCompetencyScore.value = 20; // excusiveCompetencyScore.value = 20;
competencyDevScore.value = 30; // competencyDevScore.value = 30;
} // }
}) // })
.catch((e) => { // .catch((e) => {
messageError($q, e); // messageError($q, e);
}) // })
.finally(() => { // .finally(() => {
hideLoader(); // hideLoader();
}); // });
} // }
watch( // watch(
() => tabMain.value, // () => tabMain.value,
() => { // () => {
if (tabMain.value == "3" && tabOpen.value == 3) { // if (tabMain.value == "3" && tabOpen.value == 3) {
getDataWork(); // getDataWork();
} else { // } else {
indicatorScore.value = 70; // indicatorScore.value = 70;
competencyScore.value = 20; // competencyScore.value = 20;
excusiveCompetencyScore.value = 20; // excusiveCompetencyScore.value = 20;
competencyDevScore.value = 30; // competencyDevScore.value = 30;
} // }
} // }
); // );
return { return {
tabMain, tabMain,
@ -392,7 +407,7 @@ export const useKpiDataStore = defineStore("KPIDate", () => {
convertCompetencyType, convertCompetencyType,
convertStatus, convertStatus,
convertResults, convertResults,
checkCompetency, // checkCompetency,
checkCompetencyDefaultCompetencyLevel, checkCompetencyDefaultCompetencyLevel,
defaultCompetencyCoreLevel, defaultCompetencyCoreLevel,
defaultCompetencyGroupLevel, defaultCompetencyGroupLevel,

View file

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, onMounted, reactive, computed, watch } from "vue"; import { ref, onMounted, reactive } from "vue";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import http from "@/plugins/http"; import http from "@/plugins/http";
import config from "@/app.config"; import config from "@/app.config";
@ -66,7 +66,7 @@ async function fetchEvaluation() {
store.dataEvaluation = await data; store.dataEvaluation = await data;
formProfile.status = store.convertStatus(data.evaluationStatus); formProfile.status = store.convertStatus(data.evaluationStatus);
formProfile.result = store.convertResults(data.evaluationResults); formProfile.result = store.convertResults(data.evaluationResults);
store.checkCompetency(); // store.checkCompetency();
store.checkCompetencyDefaultCompetencyLevel(); store.checkCompetencyDefaultCompetencyLevel();
fetchProfile(data.profileId); fetchProfile(data.profileId);
@ -264,8 +264,8 @@ function filterOption(val: any, update: Function, refData: string) {
async function getAll() { async function getAll() {
await fetchEvaluation(); await fetchEvaluation();
getProfile(); await getProfile();
getOrgOp(); await getOrgOp();
} }
function sendToEvaluatore() { function sendToEvaluatore() {
@ -401,14 +401,44 @@ function sendToEvauator() {
}); });
} }
function goToSummary() { async function goToSummary() {
dialogConfirm( dialogConfirm(
$q, $q,
() => { async () => {
showLoader(); showLoader();
http await http
.get(config.API.sendToSummary(store.dataEvaluation.id)) .get(config.API.sendToSummary(store.dataEvaluation.id))
.then(async (res) => { .then(async (res) => {
await http
.put(
config.API.updatePoint(store.dataEvaluation.id),
store.dataEvaluation.posTypeName != "อำนวยการ" &&
store.dataEvaluation.posTypeName != "บริหาร"
? {
totalPoint1: store.indicatorScoreVal.toFixed(2),
totalPoint2_1: store.competencyScoreVal.toFixed(2),
totalPoint2_2: store.devScoreVal.toFixed(2),
summaryPoint: (
store.indicatorScoreVal +
store.competencyScoreVal +
store.devScoreVal
).toFixed(2),
}
: {
totalPoint1: (
store.excusiveIndicator1ScoreVal +
store.excusiveIndicator2ScoreVal
).toFixed(2),
totalPoint2_1: store.competencyScoreVal.toFixed(2),
summaryPoint: (
store.excusiveIndicator1ScoreVal +
store.excusiveIndicator2ScoreVal +
store.competencyScoreVal
).toFixed(2),
}
)
.then((res) => {});
await fetchEvaluation(); await fetchEvaluation();
store.tabMain = "4"; store.tabMain = "4";
store.tabOpen = 4; store.tabOpen = 4;
@ -502,15 +532,15 @@ onMounted(async () => {
<div class="q-gutter-x-sm"> <div class="q-gutter-x-sm">
<span <span
v-if=" v-if="
(store.tabMain === '1' && store.tabMain === '1' &&
store.dataEvaluation.posTypeName != 'อำนวยการ' && store.dataEvaluation.evaluationStatus == 'NEW' &&
((store.dataEvaluation.posTypeName != 'อำนวยการ' &&
store.dataEvaluation.posTypeName != 'บริหาร' && store.dataEvaluation.posTypeName != 'บริหาร' &&
store.indicatorWeightTotal != 100) || store.indicatorWeightTotal != 100) ||
(store.dataEvaluation.posTypeName == 'อำนวยการ' && ((store.dataEvaluation.posTypeName == 'อำนวยการ' ||
store.dataEvaluation.posTypeName == 'บริหาร' && store.dataEvaluation.posTypeName == 'บริหาร') &&
(store.indicatorWeight1Total != 100 || (store.indicatorWeight1Total != 100 ||
store.indicatorWeight2Total != 20) && store.indicatorWeight2Total != 20)))
store.dataEvaluation.evaluationStatus == 'NEW')
" "
class="text-red" class="text-red"
>*ำหน(อยละ) ผลสมฤทธของงานไมกตอง</span >*ำหน(อยละ) ผลสมฤทธของงานไมกตอง</span
@ -525,8 +555,8 @@ onMounted(async () => {
(store.dataEvaluation.posTypeName != 'อำนวยการ' && (store.dataEvaluation.posTypeName != 'อำนวยการ' &&
store.dataEvaluation.posTypeName != 'บริหาร' && store.dataEvaluation.posTypeName != 'บริหาร' &&
store.indicatorWeightTotal != 100) || store.indicatorWeightTotal != 100) ||
(store.dataEvaluation.posTypeName == 'อำนวยการ' && ((store.dataEvaluation.posTypeName == 'อำนวยการ' ||
store.dataEvaluation.posTypeName == 'บริหาร' && store.dataEvaluation.posTypeName == 'บริหาร') &&
(store.indicatorWeight1Total != 100 || (store.indicatorWeight1Total != 100 ||
store.indicatorWeight2Total != 20)) store.indicatorWeight2Total != 20))
" "

View file

@ -275,8 +275,6 @@ function getProfile() {
.then(async (res) => { .then(async (res) => {
const data = await res.data.result; const data = await res.data.result;
store.dataProfile = data; store.dataProfile = data;
store.checkCompetency();
store.checkCompetencyDefaultCompetencyLevel();
formRound.profileId = data.profileId; formRound.profileId = data.profileId;
formRound.prefix = data.prefix; formRound.prefix = data.prefix;

View file

@ -292,7 +292,7 @@ async function clickUpload(file: any) {
} }
/** /**
* งกนสำหรบอโหลดไฟลเอกสารหลกฐาน * งกนสำหรบอโหลดไฟลเอกสารหลกฐาน
*/ */
async function uploadFileDoc(uploadUrl: string, file: any) { async function uploadFileDoc(uploadUrl: string, file: any) {
const Data = new FormData(); const Data = new FormData();

View file

@ -132,16 +132,34 @@ const doLogout = () => {
); );
}; };
/**
* งชนกลบหนาหล
*/
const clickBack = () => {
router.push(`/`);
};
onMounted(async () => { onMounted(async () => {
store.typeProfile = "OFFICER"; store.typeProfile = "OFFICER";
await getType(); await getType();
await getMain(); await getMain();
}); });
</script> </script>
<template> <template>
<div class="row justify-center"> <div class="row justify-center">
<div class="col-xs-12 col-sm-12 col-md-11"> <div class="col-xs-12 col-sm-12 col-md-11">
<div class="toptitle text-white col-12 row items-center"> <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="clickBack"
/>
อมลทะเบยนประว อมลทะเบยนประว
</div> </div>
<div v-if="$q.screen.gt.xs" class="row q-col-gutter-md"> <div v-if="$q.screen.gt.xs" class="row q-col-gutter-md">

View file

@ -0,0 +1,33 @@
/**
* Router
*/
const MainPage = () => import("@/modules/13_portfolio/views/Main.vue");
const FormData = () => import("@/modules/13_portfolio/views/Add.vue");
export default [
{
path: "/portfolio",
name: "portfolio",
component: MainPage,
meta: {
Auth: true,
},
},
{
path: "/portfolio/add",
name: "addPortfolio",
component: FormData,
meta: {
Auth: true,
},
},
{
path: "/portfolio/:id",
name: "portfolioDetail",
component: FormData,
meta: {
Auth: true,
},
},
];

View file

@ -0,0 +1,302 @@
<script setup lang="ts">
import { ref, onMounted } from "vue";
import { useQuasar } from "quasar";
import { useRouter, useRoute } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
import axios from "axios";
import type { QForm } from "quasar";
const router = useRouter();
const $q = useQuasar();
const mixin = useCounterMixin();
const { success, messageError, showLoader, hideLoader, dialogConfirm } = mixin;
/**
* วแปรทใชงาน
*/
const route = useRoute();
const files = ref<any>();
const name = ref("");
const detail = ref("");
const id = ref<string>("");
const routeName = router.currentRoute.value.name;
const fileList = ref<any[]>([]);
/**
* เรยกฟงกนทงหมดตอนเรยกใชไฟล
*/
onMounted(() => {
if (route.params.id !== undefined) {
id.value = route.params.id.toString();
fecthData(id.value);
}
});
const saveData = async () => {
dialogConfirm(
$q,
() => {
createTransfer();
},
"ยืนยันการยื่นข้อมูลการโอน",
"ต้องการยื่นข้อมูลการโอนนี้ใช่หรือไม่"
);
};
/**
* งกนสรางขอโอน
*/
const createTransfer = async () => {
showLoader();
await http
.post(config.API.portfolio, { name: name.value, detail: detail.value })
.then(async (res) => {
uploadFiles(res.data.result);
})
.catch((e) => {
messageError($q, e);
hideLoader();
});
};
/**
* งกนเรยกขอมลจาก Api
* @param id ไอดของขอม
*/
const fecthData = async (id: string) => {
showLoader();
await http
.get(config.API.portfolioId(id))
.then((res: any) => {
let data = res.data.result;
name.value = data.name;
detail.value = data.detail;
fetchFile();
})
.catch((e: any) => {
messageError($q, e);
hideLoader();
});
};
/**
* function ปโหลดไฟล
* @param id ผลงาน
*/
function uploadFiles(id: string) {
showLoader();
http
.post(config.API.file("ระบบผลงาน", "เอกสารผลงาน", id), {
replace: true,
fileList: [
{
fileName: files.value.name,
},
],
})
.then(async (res) => {
console.log(res);
const foundKey: string | undefined = Object.keys(res.data).find(
(key) =>
res.data[key]?.fileName !== undefined &&
res.data[key]?.fileName !== ""
);
foundKey && uploadFileURL(res.data[foundKey]?.uploadUrl);
})
.catch((err) => {
messageError($q, err);
hideLoader();
});
}
/**
* function นทกไฟล
* @param uploadUrl นทกไฟล
*/
function uploadFileURL(uploadUrl: string) {
const Data = new FormData();
Data.append("file", files.value);
showLoader();
axios
.put(uploadUrl, files.value, {
headers: {
"Content-Type": files.value.type,
},
})
.then(() => {
success($q, "บันทึกข้อมูลสำเร็จ");
router.push(`/portfolio`);
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
files.value = null;
});
}
/**
*function fetch รายการเอกสาร
*/
function fetchFile() {
showLoader();
http
.get(config.API.file("ระบบผลงาน", "เอกสารผลงาน", id.value))
.then((res) => {
fileList.value = res.data;
})
.catch((e) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
}
/**
* งกนดาวโหลดอปโหลดไฟล
* @param fileName อไฟล
*/
function fileOpen(fileName: string) {
showLoader();
http
.get(
config.API.fileByFile("ระบบผลงาน", "เอกสารผลงาน", id.value, fileName)
)
.then((res) => {
const data = res.data.downloadUrl;
window.open(data, "_blank");
})
.catch((e) => {
messageError($q, e);
})
.finally(async () => {
hideLoader();
});
}
</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>
<q-form
class="col-12"
greedy
@submit.prevent
@validation-success="saveData"
>
<q-card bordered>
<div class="col-12 row q-col-gutter-md q-pa-md">
<div class="col-xs-12 col-sm-12">
<div class="col-12 row q-pa-sm q-col-gutter-sm">
<q-input
:class="
routeName != 'addPortfolio' ? 'col-12' : 'col-12 inputgreen'
"
dense
outlined
v-model="name"
hide-bottom-space
label="ชื่อเอกสาร/ผลงาน"
:readonly="routeName != 'addPortfolio'"
:rules="[(val:string) => !!val || `${'กรุณากรอกชื่อเอกสาร/ผลงาน'}`]"
/>
<q-input
:class="
routeName != 'addPortfolio' ? 'col-12' : 'col-12 inputgreen'
"
dense
outlined
v-model="detail"
label="รายละเอียดเอกสาร/ผลงาน"
hide-bottom-space
type="textarea"
:readonly="routeName != 'addPortfolio'"
:rules="[(val:string) => !!val || `${'กรุณากรอกรายละเอียดเอกสาร/ผลงาน'}`]"
/>
<div class="col-12 row" v-if="routeName == 'addPortfolio'">
<q-file
v-model="files"
class="col-xs-12 col-sm-12 inputgreen"
outlined
dense
lazy-rules
hide-bottom-space
accept=".pdf, .docx, .doc, .xlsx, .xls"
:rules="[
(val:string) => !!val || 'กรุณาเลือกไฟล์เอกสาร/ผลงาน',
]"
label="เอกสาร/ผลงาน"
>
<template v-slot:prepend>
<q-icon name="attach_file" /> </template
></q-file>
</div>
<div class="col-12 row" v-if="routeName != 'addPortfolio'">
<q-card bordered flat class="full-width">
<div
class="bg-grey-1 q-pa-sm col-12 row items-center text-primary"
>
<div class="q-pl-sm text-weight-bold text-dark">
เอกสาร/ผลงาน
</div>
</div>
<q-separator />
<q-list separator>
<q-item v-for="file in fileList" :key="file.key">
<q-item-section>
{{ file.fileName }}
</q-item-section>
<q-item-section avatar>
<q-btn
color="teal-5"
round
flat
icon="mdi-download"
@click="fileOpen(file.fileName)"
></q-btn>
</q-item-section>
</q-item>
</q-list>
</q-card>
</div>
</div>
</div>
</div>
<q-separator v-if="routeName == 'addPortfolio'" />
<q-card-actions
align="right"
class="row col-12"
v-if="routeName == 'addPortfolio'"
>
<q-space />
<q-btn
unelevated
class="q-px-md items-center"
color="primary"
label="บันทึก"
type="onsubmit"
/>
</q-card-actions>
</q-card>
</q-form>
</div>
</div>
</template>

View file

@ -0,0 +1,303 @@
<script setup lang="ts">
import type { QTableProps } from "quasar";
import { ref, onMounted } from "vue";
import { useQuasar } from "quasar";
import { useRouter } from "vue-router";
import { useCounterMixin } from "@/stores/mixin";
import http from "@/plugins/http";
import config from "@/app.config";
const currentPage = ref<number>(1);
const router = useRouter();
const $q = useQuasar();
const mixin = useCounterMixin();
const {
date2Thai,
messageError,
showLoader,
hideLoader,
dialogRemove,
success,
} = mixin;
const pagination = ref({
sortBy: "desc",
descending: false,
page: 1,
rowsPerPage: 10,
});
/**
* เพมหวขอตาราง
*/
const filter = ref<string>("");
const rows = ref<any>([]);
const visibleColumns = ref<String[]>(["no", "name", "detail"]);
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: "name",
align: "left",
label: "ชื่อเอกสาร/ผลงาน",
sortable: true,
field: "name",
headerStyle: "font-size: 14px",
style: "font-size: 14px; width:5px;",
},
{
name: "detail",
align: "left",
label: "รายละเอียดเอกสาร/ผลงาน",
sortable: true,
field: "detail",
headerStyle: "font-size: 14px",
style: "font-size: 14px; width:5px;",
},
]);
/**
* เรยกฟงกนทงหมดตอนเรยกใชไฟล
*/
onMounted(async () => {
await fecthList();
});
//
const fecthList = async () => {
showLoader();
await http
.get(config.API.portfolio)
.then((res: any) => {
rows.value = res.data.result;
})
.catch((e: any) => {
messageError($q, e);
})
.finally(() => {
hideLoader();
});
};
/**
* งกนกดเพมไปหนาเพมขอโอน
*/
const clickAdd = async () => {
router.push(`/portfolio/add`);
};
/**
* งกนกดยอนกล
*/
const clickBack = () => {
router.push(`/`);
};
function onDelete(id: string) {
dialogRemove($q, () => {
showLoader();
http
.delete(config.API.portfolioId(id))
.then((res) => {
success($q, "ลบข้อมูลสำเร็จ");
fecthList();
})
.catch((err) => {
messageError($q, err);
hideLoader();
});
});
}
</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="clickBack"
/>
รายการเอกสาร/ผลงาน
</div>
<div class="col-12">
<q-card bordered class="q-pa-md">
<div class="q-pb-sm row">
<div>
<q-btn
size="14px"
flat
dense
color="blue"
@click="clickAdd"
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
v-model="filter"
ref="filterRef"
outlined
debounce="300"
placeholder="ค้นหา"
style="max-width: 200px"
>
<template v-slot:append>
<q-icon v-if="filter == ''" name="search" />
<q-icon
v-if="filter !== ''"
name="clear"
class="cursor-pointer"
@click="filter = ''"
/>
</template>
</q-input>
<!-- แสดงคอลมนใน table -->
<q-select
v-model="visibleColumns"
:display-value="$q.lang.table.columns"
multiple
outlined
dense
:options="columns"
options-dense
option-value="name"
map-options
emit-value
style="min-width: 150px"
class="gt-xs"
>
<template> </template>
</q-select>
</div>
</div>
<div>
<d-table
flat
bordered
dense
:paging="true"
row-key="id"
class="custom-table2"
style="max-height: 80vh"
:rows="rows"
:columns="columns"
:visible-columns="visibleColumns"
:rows-per-page-options="[10, 25, 50, 100]"
v-model:pagination="pagination"
>
<template v-slot:pagination="scope">
งหมด {{ rows.length }} รายการ
<q-pagination
v-model="pagination.page"
active-color="primary"
color="dark"
:max="scope.pagesNumber"
:max-pages="5"
size="sm"
boundary-links
direction-links
></q-pagination>
</template>
<template v-slot:header="props">
<q-tr :props="props">
<q-th
v-for="col in props.cols"
:key="col.name"
:props="props"
style="color: #000000; font-weight: 500"
>
<span class="text-weight-medium">{{ col.label }}</span>
</q-th>
<q-th auto-width />
</q-tr>
</template>
<template v-slot:body="props">
<q-tr :props="props" class="cursor-pointer">
<q-td
v-for="col in props.cols"
:key="col.name"
:props="props"
@click="router.push(`/portfolio/` + props.row.id)"
>
<div v-if="col.name == 'no'">
{{ props.rowIndex + 1 }}
</div>
<div v-else class="table_ellipsis2">
{{ col.value }}
</div>
</q-td>
<q-td>
<q-btn
dense
flat
round
color="red"
icon="delete"
@click.pervent="onDelete(props.row.id)"
/>
</q-td>
</q-tr>
</template>
<template #item="props">
<div class="q-pa-xs col-xs-12 col-sm-6 col-md-4 col-lg-3">
<q-card bordered flat>
<q-list @click="router.push(`/portfolio/` + props.row.id)">
<q-item
v-for="col in props.cols.filter((col:any) => col.name !== 'desc')"
:key="col.name"
>
<q-item-section>
<q-item-label caption>{{ col.label }}</q-item-label>
<q-item-label v-if="col.name === 'no'">
{{ props.rowIndex + 1 }}
</q-item-label>
<q-item-label v-else>{{
col.value ?? "-"
}}</q-item-label>
</q-item-section>
</q-item>
</q-list>
<q-separator />
<q-card-actions vertical align="center">
<q-btn
dense
flat
round
color="red"
icon="delete"
@click.pervent="onDelete(props.row.id)"
/>
</q-card-actions>
</q-card>
</div>
</template>
</d-table>
</div>
</q-card>
</div>
</div>
</div>
</template>
<style scoped lang="scss"></style>

View file

@ -16,6 +16,7 @@ import ModuleScholarship from "@/modules/09_scholarship/router";
import ModuleRegistry from "@/modules/10_registry/router"; import ModuleRegistry from "@/modules/10_registry/router";
import ModuleProbation from "@/modules/11_probation/router"; import ModuleProbation from "@/modules/11_probation/router";
import ModuleOrganization from "@/modules/12_organization/router"; import ModuleOrganization from "@/modules/12_organization/router";
import ModulePortfolio from "@/modules/13_portfolio/router";
// TODO: ใช้หรือไม่? // TODO: ใช้หรือไม่?
import keycloak from "@/plugins/keycloak"; import keycloak from "@/plugins/keycloak";
@ -57,6 +58,7 @@ const router = createRouter({
...ModuleRegistry, ...ModuleRegistry,
...ModuleProbation, ...ModuleProbation,
...ModuleOrganization, ...ModuleOrganization,
...ModulePortfolio,
], ],
}, },
], ],

View file

@ -89,5 +89,28 @@ input.input-alert
text-overflow: ellipsis text-overflow: ellipsis
width: 200px width: 200px
.q-card__actions .q-btn--rectangle .q-card__actions .q-btn--rectangle
padding: 0 14px !important padding: 0 14px !important
.table_ellipsis
max-width: 200px
white-space: nowrap
overflow: hidden
text-overflow: ellipsis
.table_ellipsis:hover
word-wrap: break-word
overflow: visible
white-space: normal
.table_ellipsis2
max-width: 25vw
white-space: nowrap
overflow: hidden
text-overflow: ellipsis
.table_ellipsis2:hover
word-wrap: break-word
overflow: visible
white-space: normal
transition: width 2s

View file

@ -14,13 +14,13 @@ const $q = useQuasar();
const mixin = useCounterMixin(); const mixin = useCounterMixin();
const { const {
date2Thai, date2Thai,
dialogRemove, dialogRemove,
showLoader, showLoader,
hideLoader, hideLoader,
messageError, messageError,
success, success,
dialogConfirm, dialogConfirm,
} = mixin; } = mixin;
const fullname = ref<string>(""); const fullname = ref<string>("");
@ -34,54 +34,54 @@ const link = ref<string>("");
* เรยกฟงกนทงหมดตอนเรยกใชไฟล * เรยกฟงกนทงหมดตอนเรยกใชไฟล
*/ */
onMounted(async () => { onMounted(async () => {
await fetchTotolNotificate(); await fetchTotolNotificate();
if (keycloak.tokenParsed != null) { if (keycloak.tokenParsed != null) {
fullname.value = keycloak.tokenParsed.name; fullname.value = keycloak.tokenParsed.name;
} }
}); });
const totalNoti = ref<number>(0); const totalNoti = ref<number>(0);
async function fetchTotolNotificate() { async function fetchTotolNotificate() {
await http await http
.get(config.API.msgNotificateTotal) .get(config.API.msgNotificateTotal)
.then((res) => { .then((res) => {
totalNoti.value = res.data.result; totalNoti.value = res.data.result;
}) })
.catch((err) => { .catch((err) => {
messageError($q, err); messageError($q, err);
}); });
} }
const statusLoad = ref<boolean>(false); const statusLoad = ref<boolean>(false);
const fetchlistNotification = async (index: number, type: string) => { const fetchlistNotification = async (index: number, type: string) => {
await http await http
.get(config.API.msgNotificate + `?page=${index}&pageSize=${15}`) .get(config.API.msgNotificate + `?page=${index}&pageSize=${15}`)
.then((res: any) => { .then((res: any) => {
const data = res.data.result.data; const data = res.data.result.data;
totalInbox.value = res.data.result.total; totalInbox.value = res.data.result.total;
let list: any[] = []; let list: any[] = [];
if (type === "DEL") { if (type === "DEL") {
notiList.value = []; notiList.value = [];
} }
data.map((e: any) => { data.map((e: any) => {
list.push({ list.push({
id: e.id, id: e.id,
sender: sender:
e.createdFullName == "" || e.createdFullName == null e.createdFullName == "" || e.createdFullName == null
? "เจ้าหน้าที่"[0] ? "เจ้าหน้าที่"[0]
: e.createdFullName[0], : e.createdFullName[0],
body: e.body ?? "", body: e.body ?? "",
timereceive: date2Thai(e.createdAt), timereceive: date2Thai(e.createdAt),
isOpen: e.isOpen, isOpen: e.isOpen,
receiveDate: e.receiveDate, receiveDate: e.receiveDate,
}); });
}); });
notiList.value.push(...list); notiList.value.push(...list);
statusLoad.value = totalInbox.value === 0 ? true : false; statusLoad.value = totalInbox.value === 0 ? true : false;
}) })
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
}); });
}; };
/** /**
@ -89,280 +89,311 @@ const fetchlistNotification = async (index: number, type: string) => {
* confirm อนออกจากระบบ * confirm อนออกจากระบบ
*/ */
const doLogout = () => { const doLogout = () => {
dialogConfirm( dialogConfirm(
$q, $q,
() => { () => {
keycloak.logout(); keycloak.logout();
}, },
"ยืนยันการออกจากระบบ", "ยืนยันการออกจากระบบ",
"ต้องการออกจากระบบใช่หรือไม่" "ต้องการออกจากระบบใช่หรือไม่"
); );
}; };
const clickDelete = async (id: string, index: number) => { const clickDelete = async (id: string, index: number) => {
dialogRemove($q, async () => { dialogRemove($q, async () => {
// showLoader(); // showLoader();
await http await http
.delete(config.API.msgId(id)) .delete(config.API.msgId(id))
.then(() => { .then(() => {
notiList.value.splice(index, 1); notiList.value.splice(index, 1);
totalInbox.value--; totalInbox.value--;
success($q, "ลบข้อมูลสำเร็จ"); success($q, "ลบข้อมูลสำเร็จ");
}) })
.catch((e) => { .catch((e) => {
messageError($q, e); messageError($q, e);
}) })
.finally(async () => { .finally(async () => {
notiList.value.length === 12 && fetchlistNotification(1, "DEL"); notiList.value.length === 12 && fetchlistNotification(1, "DEL");
// hideLoader(); // hideLoader();
}); });
}); });
}; };
const totalInbox = ref<number>(0); const totalInbox = ref<number>(0);
const page = ref<number>(0); const page = ref<number>(0);
async function onLoad(index: any, done: any) { async function onLoad(index: any, done: any) {
if ( if (
notiList.value.length < totalInbox.value || notiList.value.length < totalInbox.value ||
(notiList.value.length === 0 && totalInbox.value === 0) (notiList.value.length === 0 && totalInbox.value === 0)
) { ) {
page.value++; page.value++;
setTimeout(async () => { setTimeout(async () => {
await fetchlistNotification(page.value, "NOMAL"); await fetchlistNotification(page.value, "NOMAL");
done(); done();
}, 1500); }, 1500);
} }
} }
watch( watch(
() => notiTrigger.value, () => notiTrigger.value,
() => { () => {
if (!notiTrigger.value) { if (!notiTrigger.value) {
const updatedNotifications = notiList.value.map((item: any) => ({ const updatedNotifications = notiList.value.map((item: any) => ({
...item, ...item,
isOpen: true, isOpen: true,
})); }));
notiList.value = updatedNotifications; notiList.value = updatedNotifications;
fetchTotolNotificate(); fetchTotolNotificate();
} }
} }
); );
const thaiOptions: Intl.DateTimeFormatOptions = { const thaiOptions: Intl.DateTimeFormatOptions = {
hour: "2-digit", hour: "2-digit",
minute: "2-digit", minute: "2-digit",
};
const handleButtonClick = () => {
const currentPath = route.name;
const queryParams = { role: "user" }; // Replace with your query parameters
const queryString = new URLSearchParams(queryParams).toString();
// Assuming config.generatePopupPath() returns a base URL
const popupBasePath = config.generatePopupPath(currentPath);
if (popupBasePath) {
const popupPath = `${popupBasePath}?${queryString}`;
window.open(popupPath, "_blank"); // Opens in a new tab/window
} else {
console.log("No manual available for this page:", currentPath);
}
}; };
function onInfo() { function onInfo() {
router.push(`/registry`); router.push(`/retire`);
} }
</script> </script>
<!-- โครงเว --> <!-- โครงเว -->
<template> <template>
<q-layout view="hHh LpR fFr"> <q-layout view="hHh LpR fFr">
<!-- header --> <!-- header -->
<q-header flat class="text-dark col-12 bg-top header-br" height-hint="7"> <q-header flat class="text-dark col-12 bg-top header-br" height-hint="7">
<q-toolbar <q-toolbar
class="q-my-xs items-center" class="q-my-xs items-center"
:style="$q.screen.gt.xs ? 'padding: 1% 2%;' : 'padding: 1% 4%;'" :style="$q.screen.gt.xs ? 'padding: 1% 2%;' : 'padding: 1% 4%;'"
> >
<div class="row items-center no-wrap" v-if="$q.screen.gt.xs"> <div class="row items-center no-wrap" v-if="$q.screen.gt.xs">
<q-img <q-img
src="@/assets/logo.png" src="@/assets/logo.png"
spinner-color="white" spinner-color="white"
style="height: 35px; max-width: 35px" style="height: 35px; max-width: 35px"
/> />
<div class="row q-ml-md items-center q-pt-xs"> <div class="row q-ml-md items-center q-pt-xs">
<div <div
style="color: #ffffff; letter-spacing: 1px; line-height: 10px" style="color: #ffffff; letter-spacing: 1px; line-height: 10px"
class="text-body2 text-weight-bolder col-12" class="text-body2 text-weight-bolder col-12"
> >
ระบบ<span class="text-primary">บรหารทรพยากรบคคล</span> ระบบ<span class="text-primary">บรหารทรพยากรบคคล</span>
</div> </div>
<div class="text-caption text-white">ของกรงเทพมหานคร</div> <div class="text-caption text-white">ของกรงเทพมหานคร</div>
</div> </div>
</div> </div>
<div v-else class="row items-center"> <div v-else class="row items-center">
<img src="@/assets/logo.png" style="height: 35px; max-width: 35px" /> <img src="@/assets/logo.png" style="height: 35px; max-width: 35px" />
</div> </div>
<div v-if="$q.screen.gt.xs"> <div v-if="$q.screen.gt.xs">
<q-tabs <q-tabs
v-model="tab" v-model="tab"
align="justify" align="justify"
indicator-color="transparent" indicator-color="transparent"
active-color="white bg-white-btn border-100" active-color="white bg-white-btn border-100"
dense dense
inline-label inline-label
class="text-grey-5 tabsHome" class="text-grey-5 tabsHome"
> >
<q-tab <q-tab
class="border-100 q-mr-sm" class="border-100 q-mr-sm"
name="dashboard" name="dashboard"
label="หน้าแรก" label="หน้าแรก"
icon="mdi-view-dashboard-outline" icon="mdi-view-dashboard-outline"
@click="router.push(`/`)" @click="router.push(`/`)"
/> />
<!-- <q-tab class="border-100" name="Checkin" label="ลงเวลางาน" icon="mdi-map-marker-check-outline" <!-- <q-tab class="border-100" name="Checkin" label="ลงเวลางาน" icon="mdi-map-marker-check-outline"
@click="router.push(`/check-in`)" /> --> @click="router.push(`/check-in`)" /> -->
<q-tab <q-tab
class="border-100 q-mr-sm" class="border-100 q-mr-sm"
name="leave" name="leave"
label="การลา" label="การลา"
icon="mdi-calendar-blank-outline" icon="mdi-calendar-blank-outline"
@click="router.push(`/leave`)" @click="router.push(`/leave`)"
/> />
</q-tabs> </q-tabs>
</div> </div>
<q-space /> <q-space />
<q-btn
round
dense
flat
size="13px"
class="bg-white-btn"
:color="totalNoti === 0 ? 'grey-6' : 'grey-8'"
no-caps
@click="handleButtonClick()"
style="margin-right: 10px"
>
<q-icon name="mdi-book-open-variant" size="18px" color="white" />
<q-tooltip></q-tooltip>
</q-btn>
<!-- Notification --> <!-- Notification -->
<q-btn <q-btn
round round
dense dense
flat flat
size="13px" size="13px"
:class="$q.screen.gt.xs ? 'bg-white-btn q-mx-md' : 'q-mr-sm'" class="bg-white-btn"
:color="totalNoti === 0 ? 'grey-6' : 'grey-8'" :color="totalNoti === 0 ? 'grey-6' : 'grey-8'"
no-caps no-caps
> style="margin-right: 10px"
<q-icon name="mdi-bell-outline" size="22px" color="white" /> >
<q-badge <q-icon name="mdi-bell-outline" size="22px" color="white" />
rounded <q-badge
v-show="totalNoti !== 0" rounded
color="negative" v-show="totalNoti !== 0"
text-color="white" color="negative"
floating text-color="white"
>{{ totalNoti }}</q-badge floating
> >{{ totalNoti }}</q-badge
<q-menu v-model="notiTrigger" :offset="[0, 8]" style="width: 480px"> >
<div class="q-px-md q-py-sm row col-12 items-center"> <q-menu v-model="notiTrigger" :offset="[0, 8]" style="width: 480px">
<div class="text-subtitle1 text-weight-medium">การแจงเตอน</div> <div class="q-px-md q-py-sm row col-12 items-center">
<q-space /> <div class="text-subtitle1 text-weight-medium">การแจงเตอน</div>
<div class="text-grey-5" style="font-size: 12px"> <q-space />
งหมด {{ totalInbox }} อความ <div class="text-grey-5" style="font-size: 12px">
</div> งหมด {{ totalInbox }} อความ
</div> </div>
<q-infinite-scroll </div>
@load="onLoad" <q-infinite-scroll
:offset="250" @load="onLoad"
v-if="statusLoad === false" :offset="250"
> v-if="statusLoad === false"
<div >
v-for="(item, index) in notiList" <div
:key="index" v-for="(item, index) in notiList"
class="caption" :key="index"
> class="caption"
<q-item v-ripple class="mytry q-py-sm" dense> >
<q-item-section avatar top style="min-width: 10px"> <q-item v-ripple class="mytry q-py-sm" dense>
<q-avatar <q-item-section avatar top style="min-width: 10px">
rounded <q-avatar
color="primary" rounded
size="25px" color="primary"
text-color="white" size="25px"
> text-color="white"
<span class="text-weight-medium text-uppercase">{{ >
item.body[0] <span class="text-weight-medium text-uppercase">{{
}}</span> item.body[0]
</q-avatar> }}</span>
</q-item-section> </q-avatar>
<q-item-section> </q-item-section>
<q-item-label caption class="text-grey-7"> <q-item-section>
{{ date2Thai(item.receiveDate) }} <q-item-label caption class="text-grey-7">
{{ {{ date2Thai(item.receiveDate) }}
new Date(item.receiveDate).toLocaleTimeString( {{
"th-TH", new Date(item.receiveDate).toLocaleTimeString(
thaiOptions "th-TH",
) thaiOptions
}} )
. <q-space /> }}
</q-item-label> . <q-space />
<q-item-label </q-item-label>
caption <q-item-label
:class=" caption
item.isOpen :class="
? 'text-grey-7' item.isOpen
: 'text-dark text-weight-medium' ? 'text-grey-7'
" : 'text-dark text-weight-medium'
>{{ item.body }}</q-item-label "
> >{{ item.body }}</q-item-label
<q-item-label >
caption <q-item-label
class="row items-center text-grey-7" caption
style="font-size: 12px" class="row items-center text-grey-7"
>{{ item.timereceive }}</q-item-label style="font-size: 12px"
> >{{ item.timereceive }}</q-item-label
</q-item-section> >
<div> </q-item-section>
<q-btn <div>
size="sm" <q-btn
unelevated size="sm"
dense unelevated
icon="mdi-close" dense
class="mybtn q-mx-xs" icon="mdi-close"
@click="clickDelete(item.id, index)" class="mybtn q-mx-xs"
></q-btn> @click="clickDelete(item.id, index)"
</div> ></q-btn>
</q-item> </div>
</div> </q-item>
</div>
<template <template
v-slot:loading v-slot:loading
v-if=" v-if="
notiList.length < totalInbox || notiList.length < totalInbox ||
(notiList.length === 0 && totalInbox === 0) (notiList.length === 0 && totalInbox === 0)
" "
> >
<div class="text-center q-my-md"> <div class="text-center q-my-md">
<q-spinner-dots color="primary" size="40px" /> <q-spinner-dots color="primary" size="40px" />
</div> </div>
</template> </template>
</q-infinite-scroll> </q-infinite-scroll>
<div class="q-pa-md" v-else> <div class="q-pa-md" v-else>
<q-banner rounded class="bg-amber-1 text-center"> <q-banner rounded class="bg-amber-1 text-center">
<div class="text-yellow-10"> <div class="text-yellow-10">
<q-icon <q-icon
name="mdi-alert-box" name="mdi-alert-box"
class="q-mx-xs" class="q-mx-xs"
size="sm" size="sm"
color="yellow-10" color="yellow-10"
/> />
ไมมอม ไมมอม
</div> </div>
</q-banner> </q-banner>
</div> </div>
</q-menu> </q-menu>
</q-btn> </q-btn>
<!-- User --> <!-- User -->
<q-btn-dropdown <q-btn-dropdown
v-if="$q.screen.gt.xs" v-if="$q.screen.gt.xs"
rounded rounded
dense dense
flat flat
:class="$q.screen.gt.xs ? 'bg-white-btn' : ''" :class="$q.screen.gt.xs ? 'bg-white-btn' : ''"
color="white" color="white"
class="q-pr-sm border-10" class="q-pr-sm border-10"
dropdown-icon="mdi-chevron-down" dropdown-icon="mdi-chevron-down"
> >
<template v-slot:label> <template v-slot:label>
<q-item dense v-close-popup class="q-pa-none q-pl-xs"> <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-item-section avatar class="q-pa-none" style="min-width: 30px">
<q-img <q-img
src="@/assets/avatar_user.jpg" src="@/assets/avatar_user.jpg"
class="border-100" class="border-100"
spinner-color="white" spinner-color="white"
style="height: 30px; max-width: 30px" style="height: 30px; max-width: 30px"
/> />
</q-item-section> </q-item-section>
<q-item-section class="text-left text-white q-pa-none q-pl-sm"> <q-item-section class="text-left text-white q-pa-none q-pl-sm">
<q-item-label class="text-caption text-weight-medium">{{ <q-item-label class="text-caption text-weight-medium">{{
fullname fullname
}}</q-item-label> }}</q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
</template> </template>
<q-list> <q-list>
<q-item clickable v-close-popup @click="onInfo"> <!-- <q-item clickable v-close-popup @click="onInfo">
<q-item-section avatar style="min-width: 30px"> <q-item-section avatar style="min-width: 30px">
<q-icon <q-icon
color="blue-9" color="blue-9"
@ -375,39 +406,51 @@ function onInfo() {
>อมลทะเบยนประว</q-item-label >อมลทะเบยนประว</q-item-label
></q-item-section ></q-item-section
> >
</q-item> </q-item> -->
<q-item clickable v-close-popup @click="onInfo">
<q-item-section avatar style="min-width: 30px">
<q-icon
color="red-9"
size="18px"
name="mdi-account-remove-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 clickable v-close-popup>
<q-item-section avatar style="min-width: 30px"> <q-item-section avatar style="min-width: 30px">
<q-icon color="orange-9" size="18px" name="mdi-lock-outline" /> <q-icon color="orange-9" size="18px" name="mdi-lock-outline" />
</q-item-section> </q-item-section>
<q-item-section <q-item-section
><q-item-label>เปลยนรหสผาน</q-item-label></q-item-section ><q-item-label>เปลยนรหสผาน</q-item-label></q-item-section
> >
</q-item> </q-item>
<q-item clickable v-close-popup @click="doLogout"> <q-item clickable v-close-popup @click="doLogout">
<q-item-section avatar style="min-width: 30px"> <q-item-section avatar style="min-width: 30px">
<q-icon color="primary" size="18px" name="mdi-logout-variant" /> <q-icon color="primary" size="18px" name="mdi-logout-variant" />
</q-item-section> </q-item-section>
<q-item-section> <q-item-section>
<q-item-label>ออกจากระบบ</q-item-label> <q-item-label>ออกจากระบบ</q-item-label>
</q-item-section> </q-item-section>
</q-item> </q-item>
</q-list> </q-list>
</q-btn-dropdown> </q-btn-dropdown>
<div v-else class="q-ml-sm" style="width: 30px"> <div v-else class="q-ml-sm" style="width: 30px">
<q-btn round> <q-btn round>
<q-avatar> <q-avatar>
<q-img <q-img
src="@/assets/avatar_user.jpg" src="@/assets/avatar_user.jpg"
class="border-100" class="border-100"
spinner-color="white" spinner-color="white"
style="height: 30px; max-width: 30px" style="height: 30px; max-width: 30px"
/> />
</q-avatar> </q-avatar>
<!-- <q-menu> <!-- <q-menu>
<q-list dense style="min-width: 200px"> <q-list dense style="min-width: 200px">
<q-item clickable v-close-popup> <q-item clickable v-close-popup>
<q-item-section> <q-item-section>
@ -460,119 +503,119 @@ function onInfo() {
</q-item> </q-item>
</q-list> </q-list>
</q-menu> --> </q-menu> -->
</q-btn> </q-btn>
</div> </div>
</q-toolbar> </q-toolbar>
</q-header> </q-header>
<div <div
class="bg-top" class="bg-top"
:style="$q.screen.gt.xs ? 'height: 200px;' : 'height: 200px;'" :style="$q.screen.gt.xs ? 'height: 200px;' : 'height: 200px;'"
/> />
<!-- end header --> <!-- end header -->
<q-footer class="bg-top" v-if="!$q.screen.gt.xs"> <q-footer class="bg-top" v-if="!$q.screen.gt.xs">
<q-toolbar style="padding: 2% 2%"> <q-toolbar style="padding: 2% 2%">
<div class="row col-12 justify-around"> <div class="row col-12 justify-around">
<q-btn <q-btn
flat flat
round round
color="white" color="white"
icon="mdi-home" icon="mdi-home"
@click="router.push(`/`)" @click="router.push(`/`)"
/> />
<!-- <q-btn <!-- <q-btn
flat flat
round round
color="white" color="white"
icon="mdi-map-marker-check-outline" icon="mdi-map-marker-check-outline"
@click="router.push(`/check-in`)" @click="router.push(`/check-in`)"
/> --> /> -->
<q-btn <q-btn
flat flat
round round
color="white" color="white"
icon="mdi-calendar-blank-outline" icon="mdi-calendar-blank-outline"
@click="router.push(`/leave`)" @click="router.push(`/leave`)"
/> />
<q-btn <q-btn
flat flat
round round
color="white" color="white"
icon="mdi-account-outline" icon="mdi-account-outline"
@click="router.push(`/registry`)" @click="router.push(`/registry`)"
/> />
</div> </div>
</q-toolbar> </q-toolbar>
</q-footer> </q-footer>
<q-page-container class="bg-grey-2 q-pb-md"> <q-page-container class="bg-grey-2 q-pb-md">
<q-page <q-page
:style=" :style="
$q.screen.gt.xs $q.screen.gt.xs
? 'padding: 1.8% 2%; margin-top: -200px;' ? 'padding: 1.8% 2%; margin-top: -200px;'
: 'padding: 5% 4%; margin-top: -200px;' : 'padding: 5% 4%; margin-top: -200px;'
" "
> >
<router-view :key="$route.fullPath" /> <router-view :key="$route.fullPath" />
</q-page> </q-page>
</q-page-container> </q-page-container>
</q-layout> </q-layout>
</template> </template>
<style> <style>
.bg-drawer { .bg-drawer {
background: #242a3d; background: #242a3d;
} }
.menu { .menu {
padding-bottom: 5px; padding-bottom: 5px;
padding-top: 5px; padding-top: 5px;
} }
.tabsHome .q-tab__icon { .tabsHome .q-tab__icon {
font-size: 18px; font-size: 18px;
} }
.border-100 { .border-100 {
border-radius: 100px; border-radius: 100px;
} }
.bg-top { .bg-top {
background: #273238; background: #273238;
} }
.header-br { .header-br {
border-bottom: 1px solid #fdfdfd31; border-bottom: 1px solid #fdfdfd31;
} }
.menuActive { .menuActive {
background: #1e2234; background: #1e2234;
border-radius: 0 100px 100px 0; border-radius: 0 100px 100px 0;
margin-right: 4%; margin-right: 4%;
} }
.q-card { .q-card {
box-shadow: 3px 3px 20px -10px rgba(151, 150, 150, 0.261) !important; box-shadow: 3px 3px 20px -10px rgba(151, 150, 150, 0.261) !important;
/* border: 1px solid #eeeded; */ /* border: 1px solid #eeeded; */
border-radius: 8px; border-radius: 8px;
} }
.q-menu { .q-menu {
box-shadow: 3px 3px 10px 1px rgba(95, 95, 95, 0.15) !important; box-shadow: 3px 3px 10px 1px rgba(95, 95, 95, 0.15) !important;
} }
.toptitle { .toptitle {
font-size: 1.2rem; font-size: 1.2rem;
font-weight: bold; font-weight: bold;
margin-bottom: 1.2%; margin-bottom: 1.2%;
} }
.q-field--outlined .q-field__control { .q-field--outlined .q-field__control {
border-radius: 5px; border-radius: 5px;
} }
.q-field--outlined .q-field__control:before { .q-field--outlined .q-field__control:before {
border-color: #c8d3db; border-color: #c8d3db;
} }
/* .q-field--outlined .q-icon { /* .q-field--outlined .q-icon {
@ -580,11 +623,11 @@ function onInfo() {
} */ } */
.shadow-0 { .shadow-0 {
box-shadow: none !important; box-shadow: none !important;
} }
.btnBlue { .btnBlue {
background-color: #016987; background-color: #016987;
color: #fff; color: #fff;
} }
</style> </style>