Add paging and button view detail for S1 dashboard + Fix bugs 156 163 #68
@ -2,6 +2,13 @@
|
|||||||
|
|
||||||
// @include theme($theme);
|
// @include theme($theme);
|
||||||
.v-application.#{$theme}-mode {
|
.v-application.#{$theme}-mode {
|
||||||
|
.pagination-wrapper {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
padding: 12px 0;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.ant-pagination-item,
|
.ant-pagination-item,
|
||||||
.ant-pagination-prev,
|
.ant-pagination-prev,
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<v-row>
|
<v-row>
|
||||||
<v-col :cols="8" style="padding:0px">
|
<v-col :cols="8" style="padding:0px">
|
||||||
<!-- 조회기간 -->
|
<!-- 조회기간 -->
|
||||||
<DatePicker :parentPrgmId="parentPrgmId" label="조회기간" />
|
<DatePicker :parentPrgmId="parentPrgmId" label="조회기간" customClass="tab-datepicker" />
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col cols="4" class="d-flex justify-end align-center">
|
<v-col cols="4" class="d-flex justify-end align-center">
|
||||||
<Buttons
|
<Buttons
|
||||||
@ -378,3 +378,10 @@ function numberFormatter({ value }) {
|
|||||||
return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
return value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
::v-deep {
|
||||||
|
.tab-datepicker {
|
||||||
|
width: 64% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
@ -512,7 +512,7 @@
|
|||||||
<v-col cols="12" sm="12" xl="12" style="height: 300px">
|
<v-col cols="12" sm="12" xl="12" style="height: 300px">
|
||||||
<v-card style="border-radius: 4px" class="pb-5">
|
<v-card style="border-radius: 4px" class="pb-5">
|
||||||
<div style="height: 20px"></div>
|
<div style="height: 20px"></div>
|
||||||
<div class="h100 px-5" style="height: calc(100% - 30px)">
|
<div class="h100 px-5" style="height: calc(100% - 70px)">
|
||||||
<div ref="gridParent" class="h100 w100">
|
<div ref="gridParent" class="h100 w100">
|
||||||
<component
|
<component
|
||||||
:is="loadGrid ? 'Grid' : null"
|
:is="loadGrid ? 'Grid' : null"
|
||||||
@ -521,6 +521,16 @@
|
|||||||
:ref="gridName"
|
:ref="gridName"
|
||||||
@dblClick="gridClickEvent"
|
@dblClick="gridClickEvent"
|
||||||
/>
|
/>
|
||||||
|
<div v-if="loadGrid && totalCount > 0" class="pagination-wrapper">
|
||||||
|
<pagination
|
||||||
|
id="pagination"
|
||||||
|
:total-count="totalCount"
|
||||||
|
:page-num="page"
|
||||||
|
:limit="limit"
|
||||||
|
:itemsPerPageArray="itemsPerPageArray"
|
||||||
|
@loadData="changeGrid"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</v-card>
|
</v-card>
|
||||||
@ -539,6 +549,7 @@ import DateUtility from "~/plugins/dateUtility";
|
|||||||
import Utility from "~/plugins/utility";
|
import Utility from "~/plugins/utility";
|
||||||
import Grid from "~/components/common/Grid";
|
import Grid from "~/components/common/Grid";
|
||||||
import Chart from "~/components/common/Chart";
|
import Chart from "~/components/common/Chart";
|
||||||
|
import pagination from "~/components/common/Pagination";
|
||||||
|
|
||||||
import AntCard from "~/components/common/card/AntCard";
|
import AntCard from "~/components/common/card/AntCard";
|
||||||
|
|
||||||
@ -579,7 +590,8 @@ export default {
|
|||||||
Chart,
|
Chart,
|
||||||
UnusedStatPopPage,
|
UnusedStatPopPage,
|
||||||
EtcStatPopPage,
|
EtcStatPopPage,
|
||||||
PageTitle
|
PageTitle,
|
||||||
|
pagination
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState({
|
...mapState({
|
||||||
@ -697,6 +709,10 @@ export default {
|
|||||||
|
|
||||||
gridName: "dashBoard_grid_01",
|
gridName: "dashBoard_grid_01",
|
||||||
loadGrid: false,
|
loadGrid: false,
|
||||||
|
itemsPerPageArray: [10, 20, 50],
|
||||||
|
limit: 10,
|
||||||
|
page: 1,
|
||||||
|
totalCount: 0,
|
||||||
isGridLoading: true,
|
isGridLoading: true,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@ -735,6 +751,11 @@ export default {
|
|||||||
}
|
}
|
||||||
this.timer = setInterval(this.search, 90000); //15분 주기마다 갱신
|
this.timer = setInterval(this.search, 90000); //15분 주기마다 갱신
|
||||||
},
|
},
|
||||||
|
changeGrid: async function (pageNum, limit) {
|
||||||
|
this.page = pageNum;
|
||||||
|
this.limit = limit;
|
||||||
|
await this.getGridData();
|
||||||
|
},
|
||||||
async search() {
|
async search() {
|
||||||
await new Promise((resolve) => setTimeout(resolve, 1500));
|
await new Promise((resolve) => setTimeout(resolve, 1500));
|
||||||
if (this.$router.currentRoute.fullPath == this.myHome.root) {
|
if (this.$router.currentRoute.fullPath == this.myHome.root) {
|
||||||
@ -756,6 +777,41 @@ export default {
|
|||||||
// gridHeight = gridHeight*0.9
|
// gridHeight = gridHeight*0.9
|
||||||
gridHeight = this.$refs.gridParent.offsetHeight - 35;
|
gridHeight = this.$refs.gridParent.offsetHeight - 35;
|
||||||
}
|
}
|
||||||
|
// Define custom button
|
||||||
|
class CustomButton {
|
||||||
|
constructor(props, pageData) {
|
||||||
|
const { grid, rowKey, columnInfo } = props;
|
||||||
|
const gridData = grid.store.data.rawData;
|
||||||
|
const value = gridData[rowKey][columnInfo.name];
|
||||||
|
const onClickCallback = columnInfo.renderer.options.onClick;
|
||||||
|
|
||||||
|
this.disabled = columnInfo.renderer.options.disabled || false;
|
||||||
|
const elDiv = document.createElement("div");
|
||||||
|
elDiv.innerHTML = `<span>${value}</span>`;
|
||||||
|
$(elDiv).addClass("tui-grid-cell-content d-flex justify-space-between");
|
||||||
|
const el2 = document.createElement("button");
|
||||||
|
$(el2).addClass("edit-btn blue--text");
|
||||||
|
el2.innerText = "보기";
|
||||||
|
elDiv.appendChild(el2);
|
||||||
|
this.el = elDiv;
|
||||||
|
if (!this.disabled && typeof onClickCallback === "function") {
|
||||||
|
// click 이벤트
|
||||||
|
this.el.addEventListener("click", function (event) {
|
||||||
|
onClickCallback(rowKey);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getElement() {
|
||||||
|
return this.el;
|
||||||
|
}
|
||||||
|
getValue() {
|
||||||
|
// return this.el.value;
|
||||||
|
}
|
||||||
|
mounted() {
|
||||||
|
// this.el.focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const myOptions = {
|
const myOptions = {
|
||||||
// scrollX: false,
|
// scrollX: false,
|
||||||
setScroll: true,
|
setScroll: true,
|
||||||
@ -840,7 +896,42 @@ export default {
|
|||||||
{ header: "주의", name: "careStndVal", align: "right", width: 40 },
|
{ header: "주의", name: "careStndVal", align: "right", width: 40 },
|
||||||
{ header: "경고", name: "warnStndVal", align: "right", width: 40 },
|
{ header: "경고", name: "warnStndVal", align: "right", width: 40 },
|
||||||
{ header: "가이드", name: "totVal", align: "right", width: 40 },
|
{ header: "가이드", name: "totVal", align: "right", width: 40 },
|
||||||
{ header: "알람 내용", name: "alrmMsg", align: "left", resizable: false },
|
{ header: "알람 내용", name: "alrmMsg", align: "left", resizable: false,
|
||||||
|
// Render custom button to switch page instead of double click on row
|
||||||
|
renderer: {
|
||||||
|
type: CustomButton,
|
||||||
|
options: {
|
||||||
|
value: "보기",
|
||||||
|
onClick: (rowKey) => {
|
||||||
|
var gridInstance = this.$refs[this.gridName].gridInstance;
|
||||||
|
var eventRowData = gridInstance.invoke("getRow", rowKey);
|
||||||
|
var data = {
|
||||||
|
cmCycle: "CYC_DAY",
|
||||||
|
fromDt:
|
||||||
|
eventRowData.totDttm != undefined
|
||||||
|
? eventRowData.totDttm
|
||||||
|
: Utility.setFormatDate(new Date(), "YYYY-MM-DD HH:mm"),
|
||||||
|
fabId: eventRowData.fabId,
|
||||||
|
eqpmKindId: eventRowData.eqpmKindId,
|
||||||
|
eqpmGrpId: eventRowData.eqpmGrpId,
|
||||||
|
eqpmId: eventRowData.eqpmId,
|
||||||
|
};
|
||||||
|
var key = "tick_" + Math.random();
|
||||||
|
this.$router.push({
|
||||||
|
name: "ems-effc-EnrgUseEqpmDetlMntrPage",
|
||||||
|
query: {
|
||||||
|
prgmId: "PRG0082",
|
||||||
|
// tick:key
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
...data,
|
||||||
|
key: key,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{ header: "설비종류", name: "eqpmKindId", align: "left", hidden: true },
|
{ header: "설비종류", name: "eqpmKindId", align: "left", hidden: true },
|
||||||
{ header: "설비종류", name: "eqpmKindNm", align: "left", hidden: true },
|
{ header: "설비종류", name: "eqpmKindNm", align: "left", hidden: true },
|
||||||
];
|
];
|
||||||
@ -855,11 +946,21 @@ export default {
|
|||||||
},
|
},
|
||||||
async getGridData() {
|
async getGridData() {
|
||||||
this.loadGrid = false;
|
this.loadGrid = false;
|
||||||
// console
|
// Get total records of grid
|
||||||
|
const totalRes = await this.postApiReturn({
|
||||||
|
apiKey: "selectIssueGdIdxDataPageTotal",
|
||||||
|
resKey: "issueGdIdxDataPageTotal",
|
||||||
|
});
|
||||||
|
this.totalCount = totalRes[0].totalcount;
|
||||||
|
|
||||||
const res = await this.postApiReturn({
|
const res = await this.postApiReturn({
|
||||||
apiKey: "selectIssueGdIdxData",
|
apiKey: "selectIssueGdIdxData",
|
||||||
resKey: "issueGdIdxData",
|
resKey: "issueGdIdxData",
|
||||||
sendParam: {},
|
sendParam: {
|
||||||
|
limit: this.limit,
|
||||||
|
page: this.page,
|
||||||
|
offset: (this.page - 1) * this.limit,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
// let fakeData = [
|
// let fakeData = [
|
||||||
// {
|
// {
|
||||||
|
@ -84,67 +84,64 @@
|
|||||||
</v-card>
|
</v-card>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row >
|
<v-row align="stretch">
|
||||||
<v-col :cols="5" class="h100">
|
<v-col :cols="5">
|
||||||
<v-card class="pb-5">
|
<v-card class="d-flex flex-column h100">
|
||||||
<v-card-title class="d-flex justify-space-between align-end">
|
<v-card-title class="d-flex justify-space-between align-end">
|
||||||
<span class="tit ft-size_20 ft-weight_600">에너지원 정보</span>
|
<span class="tit ft-size_20 ft-weight_600">에너지원 정보</span>
|
||||||
<Buttons
|
<Buttons
|
||||||
:parentPrgmId="myPrgmId"
|
:parentPrgmId="myPrgmId"
|
||||||
:bindingData="gridName"
|
:bindingData="gridName"
|
||||||
:detailList="detailList"
|
:detailList="detailList"
|
||||||
:btnActionsFnc="btnActions"
|
:btnActionsFnc="btnActions"
|
||||||
/>
|
/>
|
||||||
</v-card-title>
|
</v-card-title>
|
||||||
<div class="px-5" style="height:calc(100% - 106px)">
|
<div class="px-5" style="height: auto;">
|
||||||
<div ref="gridParent" class="w100 h100">
|
<div ref="gridParent" class="w100">
|
||||||
<component
|
<component
|
||||||
:ref="gridName"
|
:ref="gridName"
|
||||||
:is="loadGrid ? 'Grid' : null"
|
:is="loadGrid ? 'Grid' : null"
|
||||||
:gridName="gridName"
|
:gridName="gridName"
|
||||||
:parentPrgmId="myPrgmId"
|
:parentPrgmId="myPrgmId"
|
||||||
@getRowsData="getRowData"
|
@getRowsData="getRowData"
|
||||||
@sendSelectedRowStatInfo="getSelectedRowStatInfo"
|
@sendSelectedRowStatInfo="getSelectedRowStatInfo"
|
||||||
:selectedRowDataWatchFlag="true"
|
:selectedRowDataWatchFlag="true"
|
||||||
/>
|
/>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col :cols="7" class="h100">
|
|
||||||
<v-card class="pb-5">
|
<v-col :cols="7">
|
||||||
<v-card-title>에너지원 상세</v-card-title>
|
<v-card class="d-flex flex-column h100">
|
||||||
<div class="px-5" style="min-height: auto;">
|
<v-card-title>에너지원 상세</v-card-title>
|
||||||
<v-tabs v-model="tab">
|
<div class="px-5" style="height: auto;">
|
||||||
<v-tab
|
<v-tabs v-model="tab">
|
||||||
v-for="item in items"
|
<v-tab
|
||||||
:key="item.id"
|
v-for="item in items"
|
||||||
:disabled="item.disabledFlag"
|
:key="item.id"
|
||||||
>
|
:disabled="item.disabledFlag"
|
||||||
{{ item.name }}
|
>
|
||||||
</v-tab>
|
{{ item.name }}
|
||||||
</v-tabs>
|
</v-tab>
|
||||||
<v-tabs-items
|
</v-tabs>
|
||||||
v-model="tab"
|
<v-tabs-items v-model="tab" class="py-6">
|
||||||
class="py-6"
|
<v-tab-item v-for="(item, idx) in items" :key="item.id">
|
||||||
style="min-height: auto;"
|
<component
|
||||||
>
|
v-if="item.id == 'ercInfoTab'"
|
||||||
<v-tab-item v-for="(item, idx) in items" :key="item.id">
|
:is="'Form'"
|
||||||
<component
|
:parentPrgmId="myPrgmId"
|
||||||
v-if="item.id == 'ercInfoTab'"
|
:detailList="detailList"
|
||||||
:is="'Form'"
|
@gridEditingFinish="gridEditingFinish"
|
||||||
:parentPrgmId="myPrgmId"
|
/>
|
||||||
:detailList="detailList"
|
<ErcChrgInfoTab
|
||||||
@gridEditingFinish="gridEditingFinish"
|
v-if="item.id == 'ercChrgInfoTab'"
|
||||||
/>
|
:parentPrgmId="myPrgmId"
|
||||||
<ErcChrgInfoTab
|
:innerTabGridInfo="{ tab, idx }"
|
||||||
v-if="item.id == 'ercChrgInfoTab'"
|
/>
|
||||||
:parentPrgmId="myPrgmId"
|
</v-tab-item>
|
||||||
:innerTabGridInfo="{ tab, idx }"
|
</v-tabs-items>
|
||||||
/>
|
</div>
|
||||||
</v-tab-item>
|
|
||||||
</v-tabs-items>
|
|
||||||
</div>
|
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
@ -152,16 +152,16 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row class="pa-1" style="height: 52%; width: 100%">
|
<v-row class="pa-1" style="height: 45%; width: 100%">
|
||||||
<v-card class="pa-1" style="height: 100%; width: 100%; overflow: hidden">
|
<v-card class="pa-1" style="height: 100%; width: 100%; overflow: hidden">
|
||||||
<div style="height: 15%">
|
<div style="height: 15%">
|
||||||
<v-card-title class="d-flex align-center justify-space-between pl-3">
|
<v-card-title class="d-flex align-center justify-space-between pl-3 pt-2">
|
||||||
<span class="tit ft-size_20 ft-weight_600">가이드 알람정보</span>
|
<span class="tit ft-size_20 ft-weight_600">가이드 알람정보</span>
|
||||||
</v-card-title>
|
</v-card-title>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
ref="gridParent01"
|
ref="gridParent01"
|
||||||
class="pl-3 mt-5"
|
class="pl-3 mt-3"
|
||||||
style="height: 75%; overflow: hidden;"
|
style="height: 75%; overflow: hidden;"
|
||||||
>
|
>
|
||||||
<component
|
<component
|
||||||
|
@ -970,4 +970,5 @@ const INIT_URL_STATE = {
|
|||||||
selectTodayNgTopTen: 'ems/base/DashboardCtr/selectTodayNgTopTen',
|
selectTodayNgTopTen: 'ems/base/DashboardCtr/selectTodayNgTopTen',
|
||||||
selectCompareEqpmTGdChart: 'ems/base/DashboardCtr/selectCompareEqpmTGdChart',
|
selectCompareEqpmTGdChart: 'ems/base/DashboardCtr/selectCompareEqpmTGdChart',
|
||||||
selectIssueGdIdxData: 'ems/base/DashboardCtr/selectIssueGdIdxData',
|
selectIssueGdIdxData: 'ems/base/DashboardCtr/selectIssueGdIdxData',
|
||||||
|
selectIssueGdIdxDataPageTotal: 'ems/base/DashboardCtr/selectIssueGdIdxDataPageTotal',
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user