sort
This commit is contained in:
parent
2fa9fcbb4c
commit
66cb55f509
11 changed files with 102 additions and 97 deletions
|
|
@ -49,7 +49,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
name: "topic",
|
||||
align: "left",
|
||||
label: "ชื่อเรื่อง",
|
||||
sortable: false,
|
||||
sortable: true,
|
||||
field: "topic",
|
||||
format: (v) => (v ? v : "-"),
|
||||
headerStyle: "font-size: 14px",
|
||||
|
|
@ -106,6 +106,7 @@ const visibleColumns = ref<string[]>([
|
|||
const pagination = ref<PropsTable.Pagination>({
|
||||
descending: true,
|
||||
page: 1,
|
||||
sortBy: "",
|
||||
rowsPerPage: 10,
|
||||
rowsNumber: 0,
|
||||
});
|
||||
|
|
@ -122,17 +123,26 @@ function onClickAdd() {
|
|||
|
||||
/** function fetch รายการข้อมูลการยื่นคำร้องขอแก้ไขข้อมูล*/
|
||||
async function fetchListRequset() {
|
||||
let queryParams = {
|
||||
page: pagination.value.page,
|
||||
pageSize: pagination.value.rowsPerPage,
|
||||
const queryParams = new URLSearchParams({
|
||||
page: pagination.value.page.toString(),
|
||||
pageSize: pagination.value.rowsPerPage.toString(),
|
||||
status: status.value,
|
||||
keyword: keyword.value,
|
||||
};
|
||||
});
|
||||
|
||||
if (pagination.value.sortBy) {
|
||||
queryParams.append("sortBy", pagination.value.sortBy);
|
||||
queryParams.append(
|
||||
"descending",
|
||||
pagination.value.descending ? "true" : "false"
|
||||
);
|
||||
}
|
||||
isLoading.value = true;
|
||||
await http
|
||||
.get(config.API.requestEditByType(link.value) + `user`, {
|
||||
params: queryParams,
|
||||
})
|
||||
.get(
|
||||
config.API.requestEditByType(link.value) +
|
||||
`user?${queryParams.toString()}`
|
||||
)
|
||||
.then((res) => {
|
||||
const result = res.data.result;
|
||||
pagination.value.rowsNumber = result.total;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue