no message

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2023-08-31 16:16:12 +07:00
parent 3dd67d1a7d
commit 17968ff8d5

View file

@ -9,7 +9,7 @@ import { useQuasar } from "quasar";
const myForm = ref<QForm>();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
const { showLoader, hideLoader, messageError, date2Thai, notifyError } = mixin;
const $q = useQuasar();
const modal = ref<boolean>(false);
@ -144,14 +144,18 @@ const clickSearch = async (type: string) => {
.post(config.API.profileHistory(type), body)
.then((res) => {
let data = res.data.result;
rows.value = data.map((e: any) => ({
id: e.id,
citizenId: e.citizenId,
name: e.firstName + " " + e.lastName,
posNo: e.posNo,
position: e.position,
date: date2Thai(e.date),
}));
if (data.length !== 0) {
rows.value = data.map((e: any) => ({
id: e.id,
citizenId: e.citizenId,
name: e.firstName + " " + e.lastName,
posNo: e.posNo,
position: e.position,
date: date2Thai(e.date),
}));
} else {
notifyError($q, "ไม่มีข้อมูลที่ต้องการค้นหา");
}
})
.catch((err) => {
messageError($q, err);
@ -164,17 +168,20 @@ const clickSearch = async (type: string) => {
});
};
const options = ref<any>([]);
// const filterFn = (val: string) => {
// options.value = positionOps.value;
// console.log(options.value);
// if (val !== "") {
// options.value = positionOps.value.filter(
// (e: any) => e.name.search(val) !== -1
// );
// console.log(options.value);
// }
// };
const filterFn = (val: string, update: any) => {
if (val === "") {
update(() => {
options.value = positionOps.value;
});
return;
} else {
update(() => {
options.value = positionOps.value.filter(
(e) => e.name.search(val) !== -1
);
});
}
};
const paging = ref<boolean>(true);
const pagination = ref({
@ -290,7 +297,17 @@ const paginationLabel = (start: number, end: number, total: number) => {
:label="`${' เลือกตำแหน่ง'}`"
use-input
input-debounce="0"
/>
@filter="filterFn"
behavior="menu"
>
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
ไมอม
</q-item-section>
</q-item>
</template></q-select
>
<q-space />
<div>
<q-btn