แก้ วินัย เพิ่ม api
This commit is contained in:
parent
fc55ffc928
commit
142fc30d8b
13 changed files with 134 additions and 145 deletions
|
|
@ -26,14 +26,14 @@ const page = ref<number>(1);
|
|||
const pageSize = ref<number>(10);
|
||||
const maxPage = ref<number>(1);
|
||||
const filter = ref<string>("");
|
||||
|
||||
const status = ref<string>("ALL");
|
||||
/** function เรียกรายการสรุปผลการพิจารณาทางวินัย*/
|
||||
async function fetchListResult() {
|
||||
showLoader();
|
||||
await http
|
||||
.get(
|
||||
config.API.listResult() +
|
||||
`?page=${page.value}&pageSize=${pageSize.value}&keyword=${filter.value}`
|
||||
`?page=${page.value}&pageSize=${pageSize.value}&keyword=${filter.value}&status=${status.value}`
|
||||
)
|
||||
.then(async (res) => {
|
||||
const data = res.data.result.data;
|
||||
|
|
@ -66,6 +66,11 @@ function openEdit(id: string) {
|
|||
router.push(`/discipline-result/${id}`);
|
||||
}
|
||||
|
||||
function filterStatus(statusReturn: string) {
|
||||
status.value = statusReturn;
|
||||
fetchListResult();
|
||||
}
|
||||
|
||||
/**เมื่อเริ่มโหลดหน้า
|
||||
* ส่งข้อมูลจำลองไปยัง store
|
||||
*/
|
||||
|
|
@ -97,6 +102,7 @@ onMounted(async () => {
|
|||
:maxPage="maxPage"
|
||||
@update:queryString="updateQueryString"
|
||||
v-model:open-edit="openEdit"
|
||||
:filterStatus="filterStatus"
|
||||
>
|
||||
</Table>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -30,6 +30,10 @@ const props = defineProps({
|
|||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
filterStatus: {
|
||||
type: Function,
|
||||
default: () => console.log("not function"),
|
||||
},
|
||||
nornmalData: {
|
||||
type: Boolean,
|
||||
defualt: true,
|
||||
|
|
@ -94,7 +98,7 @@ watch([() => currentPage.value, () => pagination.value.rowsPerPage], () => {
|
|||
});
|
||||
|
||||
function dataUpdate() {
|
||||
console.log(statusFilter.value);
|
||||
props.filterStatus(statusFilter.value);
|
||||
}
|
||||
|
||||
function updateInput(value: string | number | null) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue