แก้ฟิลเตอร์ทดลองงาน
This commit is contained in:
parent
9ff4e19c38
commit
0ce0ba8723
1 changed files with 14 additions and 2 deletions
|
|
@ -18,6 +18,7 @@ const personalId = ref<string>(route.params.id as string);
|
||||||
const checkRoutePermisson = ref<boolean>(route.name == "probationDetailOnly");
|
const checkRoutePermisson = ref<boolean>(route.name == "probationDetailOnly");
|
||||||
const $q = useQuasar(); //ใช้ noti quasar
|
const $q = useQuasar(); //ใช้ noti quasar
|
||||||
const rows = ref<FormProbationDetail[]>([]);
|
const rows = ref<FormProbationDetail[]>([]);
|
||||||
|
const rowsData = ref<FormProbationDetail[]>([]);
|
||||||
const name = ref<string>("");
|
const name = ref<string>("");
|
||||||
const attrs = ref<any>(useAttrs());
|
const attrs = ref<any>(useAttrs());
|
||||||
const paging = ref<boolean>(true);
|
const paging = ref<boolean>(true);
|
||||||
|
|
@ -45,6 +46,7 @@ const {
|
||||||
hideLoader,
|
hideLoader,
|
||||||
date2Thai,
|
date2Thai,
|
||||||
dialogConfirm,
|
dialogConfirm,
|
||||||
|
onSearchDataTable,
|
||||||
} = mixin;
|
} = mixin;
|
||||||
|
|
||||||
/** ข้อมูลที่เเสดงในตาราง */
|
/** ข้อมูลที่เเสดงในตาราง */
|
||||||
|
|
@ -157,7 +159,7 @@ async function getAssignList() {
|
||||||
.get(config.API.probationGetAssignList(personalId.value))
|
.get(config.API.probationGetAssignList(personalId.value))
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
const data = await res.data.result;
|
const data = await res.data.result;
|
||||||
rows.value = await data.map((item: FormProbationDetail) => ({
|
const listData = await data.map((item: FormProbationDetail) => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
round_no: item.round_no,
|
round_no: item.round_no,
|
||||||
date_start: date2Thai(new Date(item.date_start)),
|
date_start: date2Thai(new Date(item.date_start)),
|
||||||
|
|
@ -166,6 +168,8 @@ async function getAssignList() {
|
||||||
commander: item.commander,
|
commander: item.commander,
|
||||||
chairman: item.chairman,
|
chairman: item.chairman,
|
||||||
}));
|
}));
|
||||||
|
rows.value = listData;
|
||||||
|
rowsData.value = listData;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -280,6 +284,14 @@ async function fetchProfilePhoto() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onSearch() {
|
||||||
|
rows.value = onSearchDataTable(
|
||||||
|
filterKeyword.value,
|
||||||
|
rowsData.value,
|
||||||
|
columns.value ? columns.value : []
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/** get ค่า เมื่อโหลดหน้า */
|
/** get ค่า เมื่อโหลดหน้า */
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await Promise.all([getpersonalList(), getAssignList(), fetchProfilePhoto()]);
|
await Promise.all([getpersonalList(), getAssignList(), fetchProfilePhoto()]);
|
||||||
|
|
@ -399,6 +411,7 @@ onMounted(async () => {
|
||||||
outlined
|
outlined
|
||||||
debounce="300"
|
debounce="300"
|
||||||
placeholder="ค้นหา"
|
placeholder="ค้นหา"
|
||||||
|
@keydown.enter="onSearch"
|
||||||
>
|
>
|
||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<q-icon name="search" />
|
<q-icon name="search" />
|
||||||
|
|
@ -425,7 +438,6 @@ onMounted(async () => {
|
||||||
ref="table"
|
ref="table"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:rows="rows"
|
:rows="rows"
|
||||||
:filter="filterKeyword.trim()"
|
|
||||||
row-key="Order"
|
row-key="Order"
|
||||||
flat
|
flat
|
||||||
bordered
|
bordered
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue