no message
This commit is contained in:
parent
3dd67d1a7d
commit
17968ff8d5
1 changed files with 38 additions and 21 deletions
|
|
@ -9,7 +9,7 @@ import { useQuasar } from "quasar";
|
||||||
|
|
||||||
const myForm = ref<QForm>();
|
const myForm = ref<QForm>();
|
||||||
const mixin = useCounterMixin();
|
const mixin = useCounterMixin();
|
||||||
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
|
const { showLoader, hideLoader, messageError, date2Thai, notifyError } = mixin;
|
||||||
const $q = useQuasar();
|
const $q = useQuasar();
|
||||||
|
|
||||||
const modal = ref<boolean>(false);
|
const modal = ref<boolean>(false);
|
||||||
|
|
@ -144,14 +144,18 @@ const clickSearch = async (type: string) => {
|
||||||
.post(config.API.profileHistory(type), body)
|
.post(config.API.profileHistory(type), body)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
let data = res.data.result;
|
let data = res.data.result;
|
||||||
rows.value = data.map((e: any) => ({
|
if (data.length !== 0) {
|
||||||
id: e.id,
|
rows.value = data.map((e: any) => ({
|
||||||
citizenId: e.citizenId,
|
id: e.id,
|
||||||
name: e.firstName + " " + e.lastName,
|
citizenId: e.citizenId,
|
||||||
posNo: e.posNo,
|
name: e.firstName + " " + e.lastName,
|
||||||
position: e.position,
|
posNo: e.posNo,
|
||||||
date: date2Thai(e.date),
|
position: e.position,
|
||||||
}));
|
date: date2Thai(e.date),
|
||||||
|
}));
|
||||||
|
} else {
|
||||||
|
notifyError($q, "ไม่มีข้อมูลที่ต้องการค้นหา");
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -164,17 +168,20 @@ const clickSearch = async (type: string) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const options = ref<any>([]);
|
const options = ref<any>([]);
|
||||||
// const filterFn = (val: string) => {
|
const filterFn = (val: string, update: any) => {
|
||||||
// options.value = positionOps.value;
|
if (val === "") {
|
||||||
// console.log(options.value);
|
update(() => {
|
||||||
// if (val !== "") {
|
options.value = positionOps.value;
|
||||||
// options.value = positionOps.value.filter(
|
});
|
||||||
// (e: any) => e.name.search(val) !== -1
|
return;
|
||||||
// );
|
} else {
|
||||||
// console.log(options.value);
|
update(() => {
|
||||||
|
options.value = positionOps.value.filter(
|
||||||
// }
|
(e) => e.name.search(val) !== -1
|
||||||
// };
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const paging = ref<boolean>(true);
|
const paging = ref<boolean>(true);
|
||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
|
|
@ -290,7 +297,17 @@ const paginationLabel = (start: number, end: number, total: number) => {
|
||||||
:label="`${' เลือกตำแหน่ง'}`"
|
:label="`${' เลือกตำแหน่ง'}`"
|
||||||
use-input
|
use-input
|
||||||
input-debounce="0"
|
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 />
|
<q-space />
|
||||||
<div>
|
<div>
|
||||||
<q-btn
|
<q-btn
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue