Merge branch 'develop' into devTee

This commit is contained in:
setthawutttty 2025-01-16 17:00:13 +07:00
commit 9312af4556
12 changed files with 126 additions and 108 deletions

View file

@ -292,6 +292,7 @@ async function getDataTable(id: string, level: number = 0) {
node: e.node,
nodeId: e.nodeId,
isCondition: e.isCondition,
isDirector: e.isDirector,
}));
positionNo.value = listPosNo;

View file

@ -277,6 +277,7 @@ async function getDataTable(id: string, level: number = 0) {
node: e.node,
nodeId: e.nodeId,
isCondition: e.isCondition,
isDirector: e.isDirector,
}));
positionNo.value = listPosNo;

View file

@ -73,6 +73,7 @@ interface PositionMain {
node: number;
nodeId: string;
isCondition: boolean;
isDirector: boolean;
}
interface PositionNo {

View file

@ -108,18 +108,7 @@ const columns = ref<QTableProps["columns"]>([
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "isEducation",
align: "left",
label: "เป็นวุฒิการศึกษาในตำแหน่ง",
sortable: true,
field: "isEducation",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => (v === true ? "ใช่" : "ไม่ใช่"),
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "degree",
align: "left",
@ -143,82 +132,94 @@ const columns = ref<QTableProps["columns"]>([
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "fundName",
name: "isEducation",
align: "left",
label: "ทุน",
label: "เป็นวุฒิการศึกษาในตำแหน่ง",
sortable: true,
field: "fundName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "gpa",
align: "left",
label: "เกรดเฉลี่ย",
sortable: true,
field: "gpa",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "country",
align: "left",
label: "ประเทศ",
sortable: true,
field: "country",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "other",
align: "left",
label: "ข้อมูลการติดต่อ",
sortable: true,
field: "other",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "duration",
align: "left",
label: "ระยะเวลา",
sortable: true,
field: "duration",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "durationYear",
align: "left",
label: "ระยะเวลาหลักสูตร (ปี)",
sortable: true,
field: "durationYear",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "note",
align: "left",
label: "หมายเหตุ",
sortable: true,
field: "note",
field: "isEducation",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => (v === true ? "ใช่" : "ไม่ใช่"),
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
// {
// name: "fundName",
// align: "left",
// label: "",
// sortable: true,
// field: "fundName",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// sort: (a: string, b: string) =>
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
// },
// {
// name: "gpa",
// align: "left",
// label: "",
// sortable: true,
// field: "gpa",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// sort: (a: string, b: string) =>
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
// },
// {
// name: "country",
// align: "left",
// label: "",
// sortable: true,
// field: "country",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// sort: (a: string, b: string) =>
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
// },
// {
// name: "other",
// align: "left",
// label: "",
// sortable: true,
// field: "other",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// sort: (a: string, b: string) =>
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
// },
// {
// name: "duration",
// align: "left",
// label: "",
// sortable: true,
// field: "duration",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// sort: (a: string, b: string) =>
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
// },
// {
// name: "durationYear",
// align: "left",
// label: " ()",
// sortable: true,
// field: "durationYear",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// sort: (a: string, b: string) =>
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
// },
// {
// name: "note",
// align: "left",
// label: "",
// sortable: true,
// field: "note",
// headerStyle: "font-size: 14px",
// style: "font-size: 14px",
// sort: (a: string, b: string) =>
// a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
// },
]);
/**
* fiunction ดลำด

View file

@ -168,8 +168,8 @@ function resizeImage(file: File): Promise<File> {
img.onload = () => {
const canvas = document.createElement("canvas");
const ctx = canvas.getContext("2d");
const width = 150;
const height = 200;
const width = 354;
const height = 472;
//
canvas.width = width;
@ -1111,7 +1111,7 @@ onMounted(async () => {
<q-dialog v-model="dialogImage" persistent>
<q-card style="width: 100vw; max-width: 60vw">
<DialogHeader
:tittle="'เลือกรูปภาพ (150 x 200 px)'"
:tittle="'เลือกรูปภาพ (354 x 472 px)'"
:close="closeImage"
/>

View file

@ -224,22 +224,22 @@ async function fetchData() {
data.education.map((row: any) => {
listRow.push({
id: guidCheck(row.id) ?? "",
educationLevel: row.educationLevel ?? "",
educationLevelId: guidCheck(row.educationLevelId) ?? "",
institute: row.institute ?? "",
degree: row.degree ?? "",
field: row.field ?? "",
gpa: row.gpa ?? "",
country: row.country ?? "",
duration: row.duration ?? "",
other: row.other ?? "",
fundName: row.fundName ?? "",
educationLevel: row.educationLevel ?? "-",
educationLevelId: guidCheck(row.educationLevelId) ?? "-",
institute: row.institute ?? "-",
degree: row.degree ?? "-",
field: row.field ?? "-",
gpa: row.gpa ?? "-",
country: row.country ?? "-",
duration: row.duration ?? "-",
other: row.other ?? "-",
fundName: row.fundName ?? "-",
durationYear: row.durationYear ?? 0,
finishDate: row.finishDate ?? new Date(),
isDate: row.isDate ? "true" : "false",
startDate: row.startDate ? new Date(row.startDate) : new Date(),
endDate: row.endDate ? new Date(row.endDate) : new Date(),
positionPath: row.positionPath ?? "",
startDate: row.startDate ? new Date(row.startDate) : "",
endDate: row.endDate ? new Date(row.endDate) : "",
positionPath: row.positionPath ?? "-",
isEducation: row.isEducation ? true : false,
});
});

View file

@ -544,10 +544,10 @@ onMounted(() => {
v-if="col.name == 'issueDate' || col.name == 'expireDate'"
class="table_ellipsis"
>
{{ date2Thai(col.value) }}
{{ col.value ? date2Thai(col.value) : "-" }}
</div>
<div v-else class="table_ellipsis">
{{ col.value }}
{{ col.value ? col.value : "-" }}
</div>
</q-td>
</q-tr>

View file

@ -696,7 +696,9 @@ watch(visibleColumns, (count: String[], prevCount: String[]) => {
onMounted(async () => {
await fetchLevel();
await fetchPositionPath();
rows.value = props.data;
rowsData.value = props.data;
});
</script>
<template>
@ -729,15 +731,19 @@ onMounted(async () => {
>
{{
props.row.isDate == "true"
? date2Thai(col.value)
: new Date(col.value).getFullYear() + 543
? col.value
? date2Thai(col.value)
: "-"
: col.value
? new Date(col.value).getFullYear() + 543
: "-"
}}
</div>
<div v-else-if="col.name == 'finishDate'" class="table_ellipsis">
{{ date2Thai(col.value) }}
{{ col.value ? date2Thai(col.value) : "-" }}
</div>
<div v-else class="table_ellipsis">
{{ col.value }}
{{ col.value ?? "-" }}
</div>
</q-td>
<!-- <q-td auto-width>

View file

@ -107,8 +107,8 @@ interface Education {
durationYear: number;
finishDate: Date;
isDate: string;
startDate: Date;
endDate: Date;
startDate: Date | string;
endDate: Date | string;
positionPath: string;
isEducation: boolean;
}

View file

@ -74,6 +74,7 @@ interface PositionMaim {
node: number;
nodeId: string;
isCondition: boolean;
isDirector: boolean;
}
interface PositionNo {

View file

@ -28,6 +28,7 @@ export const useSelectOrgStore = defineStore("selectorg", () => {
node: e.node,
nodeId: e.nodeId,
isCondition: e.isCondition,
isDirector: e.isDirector,
}));
return listPosNo;

View file

@ -223,15 +223,20 @@ function filterSelector(val: string, update: Function, refData: string) {
}
}
/**
* งกนคำนวนอาย
*/
/** ฟังก์ชันคำนวนอายุ*/
function calculateMaxDate() {
const today = new Date();
today.setFullYear(today.getFullYear() - 18);
return today;
}
/** function เช็คอายุไม่เกิน 60 ปี*/
function calculateMinDate() {
const today = new Date();
today.setFullYear(today.getFullYear() - 60); // 60
return today;
}
/**
* งกนบนทกขอมลลกจางชวคราว
*/
@ -390,6 +395,7 @@ watch(
<datepicker
autoApply
:max-date="calculateMaxDate()"
:min-date="calculateMinDate()"
borderless
:enableTimePicker="false"
week-start="0"