diff --git a/src/components/TableView.vue b/src/components/TableView.vue index 6091126c5..0487ac38c 100644 --- a/src/components/TableView.vue +++ b/src/components/TableView.vue @@ -181,23 +181,16 @@ @@ -331,6 +324,8 @@ import { ref, useAttrs, computed } from "vue"; import { useCounterMixin } from "@/stores/mixin"; import { useQuasar } from "quasar"; +const filter = defineModel("filter", { required: true }); + const $q = useQuasar(); const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง const { dialogMessage } = mixin; @@ -359,6 +354,7 @@ const paginationLabel = (start: string, end: string, total: string) => { }; const props = defineProps({ + onSearch: Function, inputfilter: String, inputvisible: Array, inputvisibleFilter: String, diff --git a/src/modules/03_recruiting/components/Career.vue b/src/modules/03_recruiting/components/Career.vue index 8e2f69356..b36950613 100644 --- a/src/modules/03_recruiting/components/Career.vue +++ b/src/modules/03_recruiting/components/Career.vue @@ -25,7 +25,7 @@ const props = defineProps({ const $q = useQuasar(); const mixin = useCounterMixin(); //เรียกฟังก์ชันกลาง -const { date2Thai, modalDelete, modalConfirm, dateToISO, success } = mixin; +const { date2Thai, modalDelete, modalConfirm, dateToISO, success,onSearchDataTable } = mixin; const store = useExamDataStore(); const { examData, changeExamColumns } = store; const id = ref(""); @@ -58,6 +58,7 @@ const route = useRoute(); const candidateId = ref(route.params.candidateId.toString()); const total = ref("-"); const rows = ref([]); +const rowsData = ref([]); const filter = ref(""); //search data table const { messageError, showLoader, hideLoader } = mixin; @@ -260,6 +261,11 @@ const fetchData = async () => { startDate: new Date(r.durationStart), endDate: new Date(r.durationEnd), }); + rowsData.value.push({ + ...r, + startDate: new Date(r.durationStart), + endDate: new Date(r.durationEnd), + }); calDateSplit(new Date(r.durationStart), new Date(r.durationEnd)).then( (d) => { yearDiff = yearDiff + d.yearDiff; @@ -554,6 +560,14 @@ const getClass = (val: boolean) => { "full-width cursor-pointer": !val, }; }; + +function onSearch() { + rows.value = onSearchDataTable( + filter.value, + rowsData.value, + columns.value ? columns.value : [] + ); +}