add pagination for screen 27 move pagination screen 28 #62

Merged
dev merged 1 commits from dev-manhph1-figbug into dev 2025-08-13 13:46:56 +09:00
3 changed files with 50 additions and 36 deletions

View File

@ -30,16 +30,17 @@
</v-row>
<v-row ref="contents">
<v-col :cols="12" class="h100">
<v-card class="px-5 py-5 h100">
<div ref="gridParent" class="h100 px-5">
<v-card class="px-5 py-5">
<div ref="gridParent" class="px-5" style="height:calc(100% - 40px)">
<component ref="myGrid" :is="loadGrid ? 'Grid' : null" :gridName="gridName"
:parentPrgmId="myPrgmId" />
</div>
</v-card>
<div class="d-flex align-center justify-center pa-5" v-if="loadGrid && totalCount > 0" >
<div class="d-flex align-center justify-center pa-5" v-if="loadGrid && totalCount > 0">
<pagination id="pagination" :total-count="totalCount" :page-num="page" :limit="limit"
@loadData="changeGrid" />
</div>
</v-card>
</v-col>
</v-row>
</div>
@ -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(

View File

@ -100,6 +100,10 @@
:gridName="gridName"
/>
</div>
<div class="d-flex align-center justify-center pa-5" v-if="loadGrid && totalCount > 0">
<pagination id="pagination" :total-count="totalCount" :page-num="page" :limit="limit"
@loadData="changeGrid" />
</div>
</v-card>
</v-col>
</v-row>
@ -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",
});
</script>

View File

@ -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: