From b1532ada56301b88840d9aebb2e47332640f448e Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Thu, 9 Oct 2025 10:08:46 +0700 Subject: [PATCH] fix(investigatefacts)sort --- .../components/1_Complaint/MainPage.vue | 12 +- .../2_InvestigateFacts/MainPage.vue | 385 ++++++++---------- .../components/DialogSearchAdvanced.vue | 6 +- .../store/InvestigateFactStore.ts | 16 +- 4 files changed, 190 insertions(+), 229 deletions(-) diff --git a/src/modules/11_discipline/components/1_Complaint/MainPage.vue b/src/modules/11_discipline/components/1_Complaint/MainPage.vue index cda75e312..ea5bb1766 100644 --- a/src/modules/11_discipline/components/1_Complaint/MainPage.vue +++ b/src/modules/11_discipline/components/1_Complaint/MainPage.vue @@ -158,7 +158,7 @@ onMounted(async () => {
{
-
+ -
+
-
+
-
+
{
-
+
(dataInvestigate.statusOptions); +const attrs = ref(useAttrs()); +const option = ref(dataInvestigate.statusOptions); /** ค้นหาข้อมูลในตาราง */ const filterKeyword = ref(""); -const filterRef = ref(null); const statusFilter = ref("NEW"); -const toptitle = ref(0); - -const total = ref(0); -const totalList = ref(1); -const pagination = ref({ - sortBy: "createdAt", - descending: true, - page: 1, - rowsPerPage: 10, -}); - -const attrs = ref(useAttrs()); /** ดึงข้อมูลบสวน */ -async function getList(page?: number) { +async function getList() { const body = { - page: page ? page : pagination.value.page, - pageSize: pagination.value.rowsPerPage, + ...params.value, keyword: filterKeyword.value.trim(), status: statusFilter.value, ...(store.formInvestigateFacts.respondentType && { @@ -82,14 +73,9 @@ async function getList(page?: number) { await http .post(config.API.investigateMain(), body) .then(async (res) => { - totalList.value = Math.ceil( - res.data.result.total / pagination.value.rowsPerPage - ); - total.value = res.data.result.total; - toptitle.value = res.data.result.total; - - const data = res.data.result.data; - await dataInvestigate.fecthList(data); + const result = res.data.result; + pagination.value.rowsNumber = result.total; + await dataInvestigate.fecthList(result.data); }) .catch((e) => { messageError($q, e); @@ -104,7 +90,7 @@ async function getList(page?: number) { * @param id ไอดีเฉพาะ รายบุคคล */ async function editPage(id: string) { - dataInvestigate.tabMenu = await "investigatefacts"; + dataInvestigate.tabMenu = "investigatefacts"; router.push(`/discipline/investigatefacts/${id}`); } /** @@ -112,7 +98,7 @@ async function editPage(id: string) { * @param id ไอดีเฉพาะ รายบุคคล */ async function detailPage(id: string) { - dataInvestigate.tabMenu = await "investigatefacts"; + dataInvestigate.tabMenu = "investigatefacts"; router.push(`/discipline-detail/investigatefacts/${id}`); } @@ -129,27 +115,12 @@ function filterOptionFn(val: string, update: Function) { }); } -function updatePagination(newPagination: any) { - pagination.value.page = 1; - pagination.value.rowsPerPage = newPagination.rowsPerPage; -} - -function getSerach() { +function getSearch() { pagination.value.page = 1; getList(); } -watch( - () => pagination.value.rowsPerPage, - async () => { - getSerach(); - } -); - -/**เมื่อเริ่มโหลดหน้า - * ส่งข้อมูลจำลองไปยัง store - */ -onMounted(async () => { +onMounted(() => { getList(); }); @@ -158,173 +129,175 @@ onMounted(async () => {
รายการสืบสวนข้อเท็จจริง
- -
- - - - - - - - - - - -
- -
- - - + + +
+ + +
+
+
+ +
+ +
+ + + +
+ +
+ +
+
+
+
+
+ +
+ + + - - + {{ props.row.active }} + + + + +
diff --git a/src/modules/11_discipline/components/DialogSearchAdvanced.vue b/src/modules/11_discipline/components/DialogSearchAdvanced.vue index 73ab9ab3f..3a858ab1d 100644 --- a/src/modules/11_discipline/components/DialogSearchAdvanced.vue +++ b/src/modules/11_discipline/components/DialogSearchAdvanced.vue @@ -1,5 +1,5 @@