fix:sortBy ,descending

- ทำ sortBy เฉพาะ API ที่มีการทำ paging
This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2025-09-15 13:52:27 +07:00
parent 4308f8887f
commit 1f18b56fbf
13 changed files with 98 additions and 67 deletions

View file

@ -28,22 +28,20 @@ const dataListMain = ref<ResEvaluatorAssessor[]>([]);
const roundOp = ref<DataOptions[]>([]);
const visibleColumns = ref<string[]>([
"name",
"firstName",
"createdAt",
"evaluationStatus",
"evaluationResults",
]);
const columns = ref<QTableProps["columns"]>([
{
name: "name",
name: "firstName",
align: "left",
label: "ผู้ขอรับการประเมิน",
sortable: true,
field: "name",
field: "firstName",
headerStyle: "font-size: 14px",
style: "font-size: 14px",
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "createdAt",
@ -54,8 +52,6 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => date2Thai(v),
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "evaluationStatus",
@ -66,8 +62,6 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => store.convertStatus(v),
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
{
name: "evaluationResults",
@ -78,8 +72,6 @@ const columns = ref<QTableProps["columns"]>([
headerStyle: "font-size: 14px",
style: "font-size: 14px",
format: (v) => store.convertResults(v),
sort: (a: string, b: string) =>
a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }),
},
]);
@ -147,6 +139,10 @@ async function fetchList() {
? "SUMMARY"
: undefined,
reqedit: store.tabMainevaluator === "3" ? "NEW" : undefined,
...(store.formQuery.sortBy && {
sortBy: store.formQuery.sortBy,
descending: store.formQuery.descending,
}),
};
await http