From 2802e93a44c8c565b25b7d2760897a3cc51c48a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pham=20Hoang=20Manh/=28Pham=20Hoang=20Manh=29/=ED=98=84?= =?UTF-8?q?=EC=9E=A5=EB=8C=80=EB=A6=AC=EC=9D=B8/SK?= <20074606@skcc.com> Date: Wed, 13 Aug 2025 13:38:12 +0900 Subject: [PATCH] add pagination for screen 27 move pagination screen 28 --- pages/ems/base/PastRsltDataReadPage.vue | 15 ++--- pages/ems/base/ReadResultCloseMngPage.vue | 69 +++++++++++++---------- store/modules/list.js | 2 + 3 files changed, 50 insertions(+), 36 deletions(-) diff --git a/pages/ems/base/PastRsltDataReadPage.vue b/pages/ems/base/PastRsltDataReadPage.vue index e5904e9..3679e8a 100644 --- a/pages/ems/base/PastRsltDataReadPage.vue +++ b/pages/ems/base/PastRsltDataReadPage.vue @@ -30,16 +30,17 @@ - -
+ +
+
+ +
-
- -
+
@@ -212,7 +213,7 @@ export default { }, layoutInit() { const searchFilterHeight = this.$refs.searchFilter.offsetHeight; - this.$refs.contents.style.height = `calc(100% - 90px - ${searchFilterHeight}px) `; + this.$refs.contents.style.height = `calc(100% - 30px - ${searchFilterHeight}px) `; }, async setFromDt() { this.pageData.fromDt = Utility.setBeforetDate( diff --git a/pages/ems/base/ReadResultCloseMngPage.vue b/pages/ems/base/ReadResultCloseMngPage.vue index 0720a38..136704c 100644 --- a/pages/ems/base/ReadResultCloseMngPage.vue +++ b/pages/ems/base/ReadResultCloseMngPage.vue @@ -100,6 +100,10 @@ :gridName="gridName" /> +
+ +
@@ -117,6 +121,7 @@ import selectCodeList from "@/components/common/select/selectCodeList"; import SelectMttList from "@/components/common/select/SelectMttList"; import Datepicker from "~/components/common/Datepicker"; import BtnExcelDownload from "~/components/common/button/BtnExcelDownload"; +import pagination from '~/components/common/Pagination'; let myTitle; // const myPrgmId = "PRG0018"; @@ -144,27 +149,18 @@ export default { Datepicker, Search, Grid, + pagination, }, data() { return { myPrgmId: myPrgmId, gridName: "rowGrid", loadGrid: false, - dataPathMock: { - rowGrid: { - column: [ - { header: "태그", name: "id", headerAlign: "left" }, - { header: "배율", name: "lable", headerAlign: "left" }, - { header: "설비비", name: "type", headerAlign: "left" }, - { header: "설비배분비율", name: "note", headerAlign: "left" }, - { header: "금일데이터", name: "note", headerAlign: "left" }, - { header: "최종마감시각", name: "date", headerAlign: "left" }, - ], - data: dataPathDataExample, - defaultRow: dataPathDataExample, - option: {}, - }, - }, + itemsPerPage: 10, + itemsPerPageArray: [10, 20, 30], + limit: 20, + page: 1, + totalCount: 0, }; }, computed: { @@ -190,7 +186,10 @@ export default { }, watch: { chkIsFind(val) { - if (val) this.search(); + if (val) { + this.page = 1; + this.search(); + } }, chkBlocId() { this.setPageData({ isFind: true }); @@ -243,10 +242,6 @@ export default { columnOptions: { resizable: true, }, - pageOptions: { - useClient: true, - perPage: 13, - }, }; this.setGridOption({ gridKey: this.gridName, @@ -261,6 +256,8 @@ export default { await this.getRowGridData(); }, async getRowGridData() { + this.loadGrid = false; + if ( this.pageData.blocMstrList.length > 0 && this.pageData.commCdList.length > 0 && @@ -274,8 +271,25 @@ export default { mttCd: this.pageData.commCd, // 검침대상유형 mttTp: this.pageData.readObjId, // 검침대상 readDt: this.pageData.fromDt, // 조회기간 + limit: this.limit, + page: this.page, + offset: (this.page - 1) * this.limit, // MariaDB Query에서 직접 계산이 안됨 }, }); + + const res2 = await this.postApiReturn({ + apiKey: 'selectReadResultCloseMngPageTotal', + resKey: 'cdKindPageTotal', + sendParam: { + blocId: this.pageData.blocMstrList[this.pageData.blocId].blocId, // 사업장 + mttCd: this.pageData.commCd, // 검침대상유형 + mttTp: this.pageData.readObjId, // 검침대상 + readDt: this.pageData.fromDt, // 조회기간 + }, + }); + + this.totalCount = res2[0].totalcount; + this.setGridData({ gridKey: this.gridName, value: res.map((item) => ({ @@ -325,6 +339,12 @@ export default { this.setPageData({ isFind: true }); } }, + changeGrid: async function (pageNum, limit) { + this.page = pageNum; + this.limit = limit; + + this.search(); + }, }, }; @@ -431,13 +451,4 @@ const myColumns = [ }, }, ]; - -import { getPathDataExample } from "@/const/const"; -const dataPathDataExample = getPathDataExample({ - id: "INCHEON.HVAC.EQP_HT_CH001.UT_CH101.CHI_AMP_1A_PV", - lable: "INCHEON 고온 냉동기 101호기 - 호로1", - type: "사용", - note: "-", - date: "2023-01-10 20:02:00", -}); diff --git a/store/modules/list.js b/store/modules/list.js index cf61676..3010f05 100644 --- a/store/modules/list.js +++ b/store/modules/list.js @@ -210,6 +210,8 @@ const INIT_URL_STATE = { // prgmId: "TMP0013" 검침실적마감관리 ems/ReadResultCloseMngPage selectReadResultCloseMng: 'ems/base/ReadResultCloseMngCtr/selectReadResultCloseMng', // 일일검침정보 + selectReadResultCloseMngPageTotal: + 'ems/base/ReadResultCloseMngCtr/selectReadResultCloseMngPageTotal', // 일일검침정보 saveReadResultCloseMngSP: 'ems/base/ReadResultCloseMngCtr/saveReadResultCloseMngSP', // 전월 or 일 마감 saveReadResultCloseMngSPMM: -- 2.50.1.windows.1