fix bug calendar

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-04-30 10:59:11 +07:00
parent 2737810c6c
commit 6f5f1f90c9
111 changed files with 2002 additions and 1866 deletions

View file

@ -13,7 +13,7 @@ import { useDisciplineSuspendStore } from "@/modules/11_discipline/store/Suspend
import type { QForm } from "quasar";
import type { dataDetail } from "@/modules/11_discipline/interface/response/suspend";
import PopupPersonal from "@/components/Dialogs/PopupPersonal.vue";
const modalPersonal = ref<boolean>(false);
const personId = ref<string>("");
/** use */
@ -64,7 +64,7 @@ const data = reactive<dataDetail>({
});
/**นำข้อมูลจาก API มาแสดง */
async function getData(){
async function getData() {
showLoader();
await http
.get(config.API.suspendById(dataId))
@ -92,7 +92,7 @@ async function getData(){
data.offenseDetails = dataGet.offenseDetails;
data.disciplinaryFaultLevel = dataGet.disciplinaryFaultLevel;
data.disciplinaryCaseFault = dataGet.disciplinaryCaseFault;
getAvatar(dataGet.personId)
getAvatar(dataGet.personId);
})
.catch((e) => {
messageError($q, e);
@ -100,39 +100,37 @@ async function getData(){
.finally(() => {
hideLoader();
});
};
}
/**
* งช งรปภาพโปรไฟล
* @param id id ของบคคล
*/
function getAvatar(id:string){
if(id){
function getAvatar(id: string) {
if (id) {
http
.get(config.API.profileAvaId(id))
.then((res)=>{
console.log(res)
const dataList = res.data.result
data.avatar = dataList.avatar
}).catch((e)=>{
}).finally(()=>{
})
.get(config.API.profileAvaId(id))
.then((res) => {
console.log(res);
const dataList = res.data.result;
data.avatar = dataList.avatar;
})
.catch((e) => {})
.finally(() => {});
}
}
/**
* งก Cancle
*/
async function clickCancel(){
async function clickCancel() {
await getData();
edit.value = false;
};
}
/**
* งก Save
*/
async function conditionSave(){
async function conditionSave() {
if (myForm.value !== null) {
myForm.value.validate().then((success) => {
if (success) {
@ -149,12 +147,12 @@ function getAvatar(id:string){
}
});
}
};
}
/**
* งก Saveจาก API
*/
async function saveData(){
async function saveData() {
const body = {
organization: data.organization,
position: data.position,
@ -179,18 +177,18 @@ function getAvatar(id:string){
await getData();
hideLoader();
});
};
}
/**
* Function เพ Class เวลา Edit
* @param val เมอเปนEdit จะเปลยน Class
*/
function getClass(val: boolean){
function getClass(val: boolean) {
return {
"full-width inputgreen cursor-pointer": val,
"full-width cursor-pointer": !val,
};
};
}
function onclickViewinfo(id: string) {
modalPersonal.value = true;
@ -211,7 +209,6 @@ function changeFormDataDate() {
}
}
/** Hook */
onMounted(async () => {
if (keycloak.tokenParsed != null) {
@ -254,7 +251,10 @@ onMounted(async () => {
<div class="row col-12 q-pa-md">
<div class="col-12 row bg-white q-col-gutter-md">
<div class="col-xs-3 col-sm-2 col-md-1 row">
<q-img :src="data.avatar" v-if="data.avatar !== '' && data.avatar !== null" />
<q-img
:src="data.avatar"
v-if="data.avatar !== '' && data.avatar !== null"
/>
<q-img src="@/assets/avatar_user.jpg" v-else />
</div>
<div class="col-xs-6 col-sm-3 row items-center">
@ -428,7 +428,6 @@ onMounted(async () => {
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:readonly="!edit"
:borderless="!edit"
:model-value="
@ -468,7 +467,6 @@ onMounted(async () => {
:enableTimePicker="false"
week-start="0"
:min-date="data.startDateSuspend"
>
<template #year="{ year }">{{ year + 543 }}</template>
<template #year-overlay-value="{ value }">{{
@ -479,7 +477,6 @@ onMounted(async () => {
:class="getClass(edit)"
:outlined="edit"
dense
lazy-rules
:readonly="!edit || data.startDateSuspend === null"
:borderless="!edit"
:model-value="
@ -490,7 +487,6 @@ onMounted(async () => {
:rules="[(val) => !!val || `${'กรุณาเลือกถึงวันที่'}`]"
hide-bottom-space
:label="`${'ถึงวันที่'}`"
>
<template v-slot:prepend>
<q-icon