sort
This commit is contained in:
parent
9349bd216e
commit
df93a526fa
18 changed files with 87 additions and 63 deletions
|
|
@ -44,7 +44,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: true,
|
||||
sortable: false,
|
||||
field: (row) =>
|
||||
(currentPage.value - 1) * pageSize.value + rows.value.indexOf(row) + 1,
|
||||
headerStyle: "font-size: 14px",
|
||||
|
|
@ -54,7 +54,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
name: "username",
|
||||
align: "left",
|
||||
label: "ชื่อผู้ใช้งาน",
|
||||
sortable: true,
|
||||
sortable: false,
|
||||
field: "username",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
@ -63,7 +63,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
name: "email",
|
||||
align: "left",
|
||||
label: "อีเมล",
|
||||
sortable: true,
|
||||
sortable: false,
|
||||
field: "email",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
@ -72,7 +72,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
name: "firstname",
|
||||
align: "left",
|
||||
label: "ชื่อ",
|
||||
sortable: true,
|
||||
sortable: false,
|
||||
field: "firstname",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
@ -81,7 +81,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
name: "lastname",
|
||||
align: "left",
|
||||
label: "นามสกุล",
|
||||
sortable: true,
|
||||
sortable: false,
|
||||
field: "lastname",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
@ -90,7 +90,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
name: "role",
|
||||
align: "left",
|
||||
label: "สิทธิ์",
|
||||
sortable: true,
|
||||
sortable: false,
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
field: (row) => {
|
||||
|
|
@ -102,7 +102,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
name: "enabled",
|
||||
align: "left",
|
||||
label: "สถานะการใช้งาน",
|
||||
sortable: true,
|
||||
sortable: false,
|
||||
field: "enabled",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ const columns = ref<QTableProps["columns"]>([
|
|||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: true,
|
||||
field: (row) => rows.value.indexOf(row) + 1,
|
||||
sortable: false,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
|
@ -226,7 +226,10 @@ onMounted(() => {
|
|||
<template v-slot:body="props">
|
||||
<q-tr :props="props">
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div>
|
||||
<div v-if="col.name === 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ const columnsExpand = ref<QTableProps["columns"]>([
|
|||
name: "positionName",
|
||||
align: "left",
|
||||
label: "ตำแหน่งในสายงาน",
|
||||
sortable: true,
|
||||
sortable: false,
|
||||
field: "positionName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
@ -179,7 +179,7 @@ const columnsExpand = ref<QTableProps["columns"]>([
|
|||
name: "positionField",
|
||||
align: "left",
|
||||
label: "สายงาน",
|
||||
sortable: true,
|
||||
sortable: false,
|
||||
field: "positionField",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
@ -188,7 +188,7 @@ const columnsExpand = ref<QTableProps["columns"]>([
|
|||
name: "posTypeName",
|
||||
align: "left",
|
||||
label: "ประเภทตำเเหน่ง",
|
||||
sortable: true,
|
||||
sortable: false,
|
||||
field: "posTypeName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
@ -197,7 +197,7 @@ const columnsExpand = ref<QTableProps["columns"]>([
|
|||
name: "posLevelName",
|
||||
align: "left",
|
||||
label: "ระดับตำแหน่ง",
|
||||
sortable: true,
|
||||
sortable: false,
|
||||
field: "posLevelName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
@ -206,7 +206,7 @@ const columnsExpand = ref<QTableProps["columns"]>([
|
|||
name: "posExecutiveName",
|
||||
align: "left",
|
||||
label: "ตำแหน่งทางการบริหาร",
|
||||
sortable: true,
|
||||
sortable: false,
|
||||
field: "posExecutiveName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
@ -215,7 +215,7 @@ const columnsExpand = ref<QTableProps["columns"]>([
|
|||
name: "positionExecutiveField",
|
||||
align: "left",
|
||||
label: "ด้านทางการบริหาร",
|
||||
sortable: true,
|
||||
sortable: false,
|
||||
field: "positionExecutiveField",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
@ -224,7 +224,7 @@ const columnsExpand = ref<QTableProps["columns"]>([
|
|||
name: "positionArea",
|
||||
align: "left",
|
||||
label: "ด้าน/สาขา",
|
||||
sortable: true,
|
||||
sortable: false,
|
||||
field: "positionArea",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ const columnsExpand = ref<QTableProps["columns"]>([
|
|||
name: "positionName",
|
||||
align: "left",
|
||||
label: "ตำแหน่งในสายงาน",
|
||||
sortable: true,
|
||||
sortable: false,
|
||||
field: "positionName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
@ -173,7 +173,7 @@ const columnsExpand = ref<QTableProps["columns"]>([
|
|||
name: "positionField",
|
||||
align: "left",
|
||||
label: "สายงาน",
|
||||
sortable: true,
|
||||
sortable: false,
|
||||
field: "positionField",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
@ -182,7 +182,7 @@ const columnsExpand = ref<QTableProps["columns"]>([
|
|||
name: "posTypeName",
|
||||
align: "left",
|
||||
label: "ประเภทตำเเหน่ง",
|
||||
sortable: true,
|
||||
sortable: false,
|
||||
field: "posTypeName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
@ -191,7 +191,7 @@ const columnsExpand = ref<QTableProps["columns"]>([
|
|||
name: "posLevelName",
|
||||
align: "left",
|
||||
label: "ระดับตำแหน่ง",
|
||||
sortable: true,
|
||||
sortable: false,
|
||||
field: "posLevelName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
@ -200,7 +200,7 @@ const columnsExpand = ref<QTableProps["columns"]>([
|
|||
name: "posExecutiveName",
|
||||
align: "left",
|
||||
label: "ตำแหน่งทางการบริหาร",
|
||||
sortable: true,
|
||||
sortable: false,
|
||||
field: "posExecutiveName",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
@ -209,7 +209,7 @@ const columnsExpand = ref<QTableProps["columns"]>([
|
|||
name: "positionExecutiveField",
|
||||
align: "left",
|
||||
label: "ด้านทางการบริหาร",
|
||||
sortable: true,
|
||||
sortable: false,
|
||||
field: "positionExecutiveField",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
@ -218,7 +218,7 @@ const columnsExpand = ref<QTableProps["columns"]>([
|
|||
name: "positionArea",
|
||||
align: "left",
|
||||
label: "ด้าน/สาขา",
|
||||
sortable: true,
|
||||
sortable: false,
|
||||
field: "positionArea",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ const columns = ref<QTableProps["columns"]>([
|
|||
name: "no",
|
||||
align: "left",
|
||||
label: "ลำดับ",
|
||||
sortable: true,
|
||||
field: (row) => rows.value.indexOf(row) + 1,
|
||||
sortable: false,
|
||||
field: "no",
|
||||
headerStyle: "font-size: 14px",
|
||||
style: "font-size: 14px",
|
||||
},
|
||||
|
|
@ -185,7 +185,10 @@ onMounted(async () => {
|
|||
<template v-slot:body="props">
|
||||
<q-tr :props="props" class="cursor-pointer">
|
||||
<q-td v-for="col in props.cols" :key="col.name" :props="props">
|
||||
<div>
|
||||
<div v-if="col.name === 'no'">
|
||||
{{ props.rowIndex + 1 }}
|
||||
</div>
|
||||
<div v-else>
|
||||
{{ col.value ? col.value : "-" }}
|
||||
</div>
|
||||
</q-td>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue