แก้ฟิลเตอร์

This commit is contained in:
setthawutttty 2024-12-11 13:46:33 +07:00
parent 698d03ce00
commit c7a8374784
26 changed files with 626 additions and 532 deletions

View file

@ -26,6 +26,7 @@ const {
const editPhone = ref<boolean>(false);
const editEmail = ref<boolean>(false);
const rowsHistory = ref<any[]>([]);
const rowsHistoryData = ref<any[]>([]);
const modalHistory = ref<boolean>(false);
const phone = ref<string>("");
const email = ref<string>("");
@ -307,6 +308,7 @@ function getHistory() {
.then((res) => {
const data = res.data.result;
rowsHistory.value = data;
rowsHistoryData.value = data;
})
.catch((e) => {
messageError($q, e);
@ -666,6 +668,7 @@ onMounted(async () => {
:title="'ประวัติแก้ไขข้อมูลส่วนตัว'"
:getData="getHistory"
:rows="rowsHistory"
:rows-data="rowsHistoryData"
:visibleColumns="visibleColumnsHistory"
:columns="columnsHistory"
/>

View file

@ -14,12 +14,14 @@ const link = ref<string>("");
const $q = useQuasar();
const mixin = useCounterMixin();
const dataStore = useDataStore();
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
const { showLoader, hideLoader, messageError, date2Thai,onSearchDataTable } = mixin;
const rows = ref<ChangNameRows[]>([]);
const rowsData = ref<ChangNameRows[]>([]);
const idByrow = ref<string>("");
const filter = ref<string>("");
const rowsHistory = ref<ChangNameRows[]>([]);
const rowsHistoryData = ref<ChangNameRows[]>([]);
const mode = ref<boolean>($q.screen.gt.xs);
const modalHistory = ref<boolean>(false);
@ -169,6 +171,7 @@ async function getData() {
.then((res) => {
const data = res.data.result;
rows.value = data;
rowsData.value = data;
})
.catch((e) => {
messageError($q, e);
@ -191,6 +194,7 @@ function getHistory() {
.then((res) => {
const data = res.data.result;
rowsHistory.value = data;
rowsHistoryData.value = data;
})
.catch((e) => {
messageError($q, e);
@ -200,6 +204,15 @@ function getHistory() {
});
}
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
rowsData.value,
columns.value ? columns.value : []
);
}
onMounted(async () => {
link.value = await dataStore.getProFileType();
await getData();
@ -221,20 +234,10 @@ onMounted(async () => {
v-model="filter"
label="ค้นหา"
style="max-width: 200px"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon
v-if="filter !== ''"
name="clear"
class="cursor-pointer"
@click="filter = ''"
/>
<q-icon
v-else
name="search"
class="cursor-pointer"
@click="filter = ''"
/>
<q-icon name="search" />
</template>
</q-input>
<q-select
@ -261,7 +264,6 @@ onMounted(async () => {
:rows="rows.length !== 0 ? rows : []"
:columns="columns"
:grid="!mode"
:filter="filter"
:rows-per-page-options="[10, 25, 50, 100]"
:visible-columns="visibleColumns"
:virtual-scroll-sticky-size-start="48"
@ -339,6 +341,7 @@ onMounted(async () => {
:title="'ประวัติแก้ไขการเปลี่ยนชื่อ-นามสกุล'"
:getData="getHistory"
:rows="rowsHistory"
:rows-data="rowsHistoryData"
:visibleColumns="visibleColumnsHistory"
:columns="columnsHistory"
/>

View file

@ -22,6 +22,7 @@ const link = ref<string>("");
const store = useRegistryInFormationStore();
const dataStore = useDataStore();
const rowsHistory = ref<any[]>([]);
const rowsHistoryData = ref<any[]>([]);
const $q = useQuasar();
const mixin = useCounterMixin();
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
@ -272,6 +273,7 @@ function getHistory() {
.then((res) => {
const data = res.data.result;
rowsHistory.value = data;
rowsHistoryData.value = data;
})
.catch((e) => {
messageError($q, e);
@ -547,6 +549,7 @@ onMounted(async () => {
:title="'ประวัติแก้ไขข้อมูลที่อยู่'"
:getData="getHistory"
:rows="rowsHistory"
:rows-data="rowsHistoryData"
:visibleColumns="visibleColumnsHistory"
:columns="columnsHistory"
/>

View file

@ -21,6 +21,7 @@ const idFamily = ref<string>("");
const store = useRegistryInFormationStore();
const dataStore = useDataStore();
const rowsHistory = ref<any[]>([]);
const rowsHistoryData = ref<any[]>([]);
const typeForm = ref<string>("");
const modalHistory = ref<boolean>(false);
@ -215,7 +216,8 @@ function getHistory() {
.get(url)
.then((res) => {
const data = res.data.result;
rowsHistory.value = data.map((e: any) => ({
const listData =
data.map((e: any) => ({
citizenId: e[`${typeForm.value}CitizenId`],
prefix: e[`${typeForm.value}Prefix`],
firstName: e[`${typeForm.value}FirstName`],
@ -225,6 +227,8 @@ function getHistory() {
lastNameOld:
typeForm.value === "couple" ? e.coupleLastNameOld : undefined,
}));
rowsHistory.value = listData
rowsHistoryData.value = listData
})
.catch((e) => {
messageError($q, e);
@ -594,6 +598,7 @@ onMounted(async () => {
}`"
:getData="getHistory"
:rows="rowsHistory"
:rows-data="rowsHistoryData"
:visibleColumns="visibleColumnsHistory"
:columns="
typeForm === 'couple'

View file

@ -16,10 +16,12 @@ const link = ref<string>("");
const $q = useQuasar();
const mixin = useCounterMixin();
const dataStore = useDataStore();
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
const { showLoader, hideLoader, messageError, date2Thai,onSearchDataTable } = mixin;
const rows = ref<EducationProfile[]>([]);
const rowsData = ref<EducationProfile[]>([]);
const rowsHistory = ref<EducationProfile[]>([]);
const rowsHistoryData = ref<EducationProfile[]>([]);
const idByRow = ref<string>("");
const filter = ref<string>("");
const mode = ref<boolean>($q.screen.gt.xs);
@ -448,6 +450,7 @@ async function getData() {
.then((res) => {
const data = res.data.result;
rows.value = data;
rowsData.value = data;
})
.catch((e) => {
messageError($q, e);
@ -467,6 +470,7 @@ function getHistory() {
.then((res) => {
const data = res.data.result;
rowsHistory.value = data;
rowsHistoryData.value = data;
})
.catch((e) => {
messageError($q, e);
@ -476,6 +480,14 @@ function getHistory() {
});
}
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
rowsData.value,
columns.value ? columns.value : []
);
}
onMounted(async () => {
link.value = await dataStore.getProFileType();
@ -498,20 +510,10 @@ onMounted(async () => {
v-model="filter"
label="ค้นหา"
style="max-width: 200px"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon
v-if="filter !== ''"
name="clear"
class="cursor-pointer"
@click="filter = ''"
/>
<q-icon
v-else
name="search"
class="cursor-pointer"
@click="filter = ''"
/>
<q-icon name="search" />
</template>
</q-input>
<q-select
@ -538,7 +540,6 @@ onMounted(async () => {
:rows="rows.length !== 0 ? rows : []"
:columns="columns"
:grid="!mode"
:filter="filter"
:rows-per-page-options="[10, 25, 50, 100]"
:visible-columns="visibleColumns"
:virtual-scroll-sticky-size-start="48"
@ -619,6 +620,7 @@ onMounted(async () => {
:title="'ประวัติแก้ไขประวัติการศึกษา'"
:getData="getHistory"
:rows="rowsHistory"
:rows-data="rowsHistoryData"
:visibleColumns="visibleColumnsHistory"
:columns="columnsHistory"
/>

View file

@ -13,14 +13,16 @@ import DialogHistory from "@/modules/10_registry/Dialog/DialogHistory.vue";
const link = ref<string>("");
const rows = ref<AbilityRows[]>([]);
const rowsData = ref<AbilityRows[]>([]);
const rowsHistory = ref<AbilityRows[]>([]);
const rowsHistoryData = ref<AbilityRows[]>([]);
const idByRow = ref<string>("");
const filter = ref<string>("");
const $q = useQuasar();
const mode = ref<boolean>($q.screen.gt.xs);
const mixin = useCounterMixin();
const dataStore = useDataStore();
const { showLoader, hideLoader, messageError, date2Thai } = mixin;
const { showLoader, hideLoader, messageError, date2Thai,onSearchDataTable } = mixin;
const modalHistory = ref<boolean>(false);
/** ตัวแปรข้อมูล */
@ -170,6 +172,7 @@ async function getData() {
.then((res) => {
const data = res.data.result;
rows.value = data;
rowsData.value = data;
})
.catch((e) => {
messageError($q, e);
@ -189,6 +192,7 @@ function getHistory() {
.then((res) => {
const data = res.data.result;
rowsHistory.value = data;
rowsHistoryData.value = data;
})
.catch((e) => {
messageError($q, e);
@ -198,6 +202,14 @@ function getHistory() {
});
}
function onSearch() {
rows.value = onSearchDataTable(
filter.value,
rowsData.value,
columns.value ? columns.value : []
);
}
onMounted(async () => {
link.value = await dataStore.getProFileType();
await getData();
@ -219,20 +231,10 @@ onMounted(async () => {
v-model="filter"
label="ค้นหา"
style="max-width: 200px"
@keydown.enter="onSearch"
>
<template v-slot:append>
<q-icon
v-if="filter !== ''"
name="clear"
class="cursor-pointer"
@click="filter = ''"
/>
<q-icon
v-else
name="search"
class="cursor-pointer"
@click="filter = ''"
/>
<q-icon name="search" />
</template>
</q-input>
<q-select
@ -259,7 +261,6 @@ onMounted(async () => {
:rows="rows.length !== 0 ? rows : []"
:columns="columns"
:grid="!mode"
:filter="filter"
:rows-per-page-options="[10, 25, 50, 100]"
:visible-columns="visibleColumns"
:virtual-scroll-sticky-size-start="48"
@ -341,6 +342,7 @@ onMounted(async () => {
:title="'ประวัติแก้ไขความสามารถพิเศษ'"
:getData="getHistory"
:rows="rowsHistory"
:rows-data="rowsHistoryData"
:visibleColumns="visibleColumnsHistory"
:columns="columnsHistory"
/>