แก้ วินัย เพิ่ม api
This commit is contained in:
parent
fc55ffc928
commit
142fc30d8b
13 changed files with 134 additions and 145 deletions
|
|
@ -22,13 +22,13 @@ const router = useRouter();
|
|||
const filter = ref<string>(""); //search data table
|
||||
const page = ref<number>(1);
|
||||
const maxPage = ref<number>(1);
|
||||
|
||||
const status = ref<string>("ALL");
|
||||
async function fetchListDisciplinary() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(
|
||||
config.API.disciplineDisciplinary() +
|
||||
`?page=${page.value}&pageSize=${rowsPerPage.value}&keyword=${filter.value}`
|
||||
`?page=${page.value}&pageSize=${rowsPerPage.value}&keyword=${filter.value}&status=${status.value}`
|
||||
)
|
||||
.then((res) => {
|
||||
const data = res.data.result.data;
|
||||
|
|
@ -55,6 +55,11 @@ async function updatePagingProp(rowPerpage: number, pageCurrent: number) {
|
|||
await fetchListDisciplinary();
|
||||
}
|
||||
|
||||
function filterStatus(statusReturn: string) {
|
||||
status.value = statusReturn;
|
||||
fetchListDisciplinary()
|
||||
}
|
||||
|
||||
/**เมื่อเริ่มโหลดหน้า
|
||||
* ส่งข้อมูลจำลองไปยัง store
|
||||
*/
|
||||
|
|
@ -86,6 +91,7 @@ onMounted(async () => {
|
|||
:fetchListDisciplinary="fetchListDisciplinary"
|
||||
@update:pagination="updatePagingProp"
|
||||
v-model:open-edit="openEdit"
|
||||
:filterStatus="filterStatus"
|
||||
>
|
||||
</Table>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue