From 86b2aaf2e2edf2ec1264c7f36f287f1b4684bdbb Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 3 Apr 2025 10:55:55 +0700 Subject: [PATCH] =?UTF-8?q?fix=20Columns=20=E0=B8=8A=E0=B9=88=E0=B8=B2?= =?UTF-8?q?=E0=B8=A7=E0=B8=A2=E0=B8=A3=E0=B8=B2=E0=B8=8A=E0=B8=81=E0=B8=B2?= =?UTF-8?q?=E0=B8=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../02_Government/06_Assistance.vue | 74 ++++++++++++++++++- 1 file changed, 70 insertions(+), 4 deletions(-) diff --git a/src/modules/10_registry/02_Government/06_Assistance.vue b/src/modules/10_registry/02_Government/06_Assistance.vue index a87f459..b9526ce 100644 --- a/src/modules/10_registry/02_Government/06_Assistance.vue +++ b/src/modules/10_registry/02_Government/06_Assistance.vue @@ -29,22 +29,38 @@ const modalHistory = ref(false); /** ตัวแปรข้อมูล */ const visibleColumns = ref([ + "commandName", "agency", "dateStart", "dateEnd", "commandNo", "document", + "lastUpdateFullName", "lastUpdatedAt", ]); const columns = ref([ + { + name: "commandName", + align: "left", + label: "ประเภทคำสั่ง", + sortable: true, + field: "commandName", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { name: "agency", align: "left", - label: "หน่วยงานที่ให้ช่วยราชการ", + label: "หน่วยงานที่ให้ช่วยราชการ/ส่งตัวกลับ", sortable: true, field: "agency", headerStyle: "font-size: 14px", style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "dateStart", @@ -55,6 +71,8 @@ const columns = ref([ format: (v) => date2Thai(v), headerStyle: "font-size: 14px", style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "dateEnd", @@ -65,6 +83,8 @@ const columns = ref([ format: (v) => date2Thai(v), headerStyle: "font-size: 14px", style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "commandNo", @@ -74,6 +94,8 @@ const columns = ref([ field: "commandNo", headerStyle: "font-size: 14px", style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "document", @@ -83,6 +105,19 @@ const columns = ref([ field: "document", headerStyle: "font-size: 14px", style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { + name: "lastUpdateFullName", + align: "left", + label: "ผู้ดำเนินการ", + sortable: true, + field: "lastUpdateFullName", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "lastUpdatedAt", @@ -102,6 +137,7 @@ const pagination = ref({ }); const visibleColumnsHistory = ref([ + "commandName", "agency", "dateStart", "dateEnd", @@ -111,14 +147,28 @@ const visibleColumnsHistory = ref([ "lastUpdatedAt", ]); const columnsHistory = ref([ + { + name: "commandName", + align: "left", + label: "ประเภทคำสั่ง", + sortable: true, + field: "commandName", + headerStyle: "font-size: 14px", + style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), + }, + { name: "agency", align: "left", - label: "หน่วยงานที่ให้ช่วยราชการ", + label: "หน่วยงานที่ให้ช่วยราชการ/ส่งตัวกลับ", sortable: true, field: "agency", headerStyle: "font-size: 14px", style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "dateStart", @@ -129,6 +179,8 @@ const columnsHistory = ref([ format: (v) => date2Thai(v), headerStyle: "font-size: 14px", style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "dateEnd", @@ -139,6 +191,8 @@ const columnsHistory = ref([ format: (v) => date2Thai(v), headerStyle: "font-size: 14px", style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "commandNo", @@ -148,6 +202,8 @@ const columnsHistory = ref([ field: "commandNo", headerStyle: "font-size: 14px", style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "document", @@ -157,6 +213,8 @@ const columnsHistory = ref([ field: "document", headerStyle: "font-size: 14px", style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "lastUpdateFullName", @@ -166,6 +224,8 @@ const columnsHistory = ref([ field: "lastUpdateFullName", headerStyle: "font-size: 14px", style: "font-size: 14px", + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, { name: "lastUpdatedAt", @@ -173,9 +233,11 @@ const columnsHistory = ref([ label: "วันที่แก้ไข", sortable: true, field: "lastUpdatedAt", + format: (v) => date2Thai(v, false, true), headerStyle: "font-size: 14px", style: "font-size: 14px", - format: (v) => date2Thai(v, false, true), + sort: (a: string, b: string) => + a.localeCompare(b, undefined, { numeric: true, sensitivity: "base" }), }, ]); @@ -316,6 +378,7 @@ onMounted(async () => { {{ col.label }} + @@ -331,17 +394,20 @@ onMounted(async () => { ดาวน์โหลด + + +