fix: 폐기보고통계 - 페이징 정보 추가

dev
Jonguk. Lim 4 months ago
parent 2684ea2945
commit 07c3f08ccc

@ -146,7 +146,6 @@
* script 진입
**************************************************************************/
$(document).ready(function() {
let totalDs = null;
// pageObject
let $P = pageObject["${pageName}"];
@ -163,18 +162,7 @@
, prefix: "dsuseMgtDsuseQyByBsshStatistics"
, prefixName: "제품별 폐기 현황"
, keymapper: info => info ? info.dept_cd : ""
, dataGetter: obj => {
let list = obj.${infoPrefix}List;
// TOTAL 데이터
totalDs = new Dataset({
keymapper: info => info? info.bssh_cd : ''
, dataGetter: obj => obj
});
totalDs.setData(list.filter(d => d.dept_cd === 'TOTAL'));
return list.filter(d => d.dept_cd !== 'TOTAL');
}
, dataGetter: obj => obj.${infoPrefix}List
, appendData: true
, infoSize: "xl"
});
@ -191,11 +179,12 @@
$P.control.onDatasetChange = (obj) => {
$P.renderList(obj.${infoPrefix}Total);
$("#${infoPrefix}Paging--${pageName}").setPagingInfo({
list: $P.control.dataset
, prefix: "${infoPrefix}Paging--${pageName}"
//list: $P.control.dataset
prefix: "${infoPrefix}Paging--${pageName}"
, start: obj.${infoPrefix}Start
, totalSize: $P.control.dataset.length
, totalSize: $P.control.dataset.length - 1
, fetchSize: obj.${infoPrefix}Fetch
, dataLength: $P.control.dataset.length - 1
, func: "pageObject['${pageName}'].control.load({index})"
});
};
@ -230,26 +219,18 @@
let replacer = (str, dataItem) => {
str = str.replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("bssh_cd") + "');")
str = str.replace(/{fw-bold-if-total}/gi, "");
if(dataItem.getValue("dept_cd") === "TOTAL"){
str = str.replace(/{fw-bold-if-total}/gi, "fw-bold");
str = str.replace(/{ROW_NUM}/gi, "")
} else {
str = str.replace(/{fw-bold-if-total}/gi, "");
}
return str;
}
let trs = empty ? [document.getElementById("${infoPrefix}NotFound--${pageName}").content.outerHTML]
: ${infoPrefix}List.inStrings(foundTr.outerHTML, replacer);
$("#tbody--${pageName}").html(trs.join());
// TOTAL 데이터 추가
let replacer2 = (str, dataItem) => {
str = str.replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("prduct_cd") + "');")
str = str.replace(/{fw-bold-if-total}/gi, "fw-bold");
str = str.replace(/{ROW_NUM}/gi, "");
return str;
}
let tr = totalDs.inStrings(foundTr.outerHTML, replacer2);
$("#tbody--${pageName}").append(tr);
}
$P.control.getBsshInfo = (gdccId) => {

@ -173,6 +173,14 @@
// Dataset 변경 이벤트
$P.control.onDatasetChange = (obj) => {
$P.renderList(obj.${infoPrefix}Total);
$("#${infoPrefix}Paging--${pageName}").setPagingInfo({
prefix: "${infoPrefix}Paging--${pageName}"
, start: obj.${infoPrefix}Start
, totalSize: $P.control.dataset.length - 1
, fetchSize: obj.${infoPrefix}Fetch
, dataLength: $P.control.dataset.length - 1
, func: "pageObject['${pageName}'].control.load({index})"
});
};
// 현재 선택 자료 변경 이벤트

@ -145,7 +145,6 @@
* script 진입
**************************************************************************/
$(document).ready(function() {
let totalDs = null;
// pageObject
let $P = pageObject["${pageName}"];
@ -162,18 +161,7 @@
, prefix: "dsuseMgtDsuseQyByPrdStatistics"
, prefixName: "제품별 폐기 현황"
, keymapper: info => info ? info.prduct_cd : ""
, dataGetter: obj => {
let list = obj.${infoPrefix}List;
// TOTAL 데이터
totalDs = new Dataset({
keymapper: info => info? info.dept_cd : ''
, dataGetter: obj => obj
});
totalDs.setData(list.filter(d => d.dept_cd === 'TOTAL'));
return list.filter(d => d.dept_cd !== 'TOTAL');
}
, dataGetter: obj => obj.${infoPrefix}List
, appendData: true
, infoSize: "xl"
});
@ -190,11 +178,12 @@
$P.control.onDatasetChange = (obj) => {
$P.renderList(obj.${infoPrefix}Total);
$("#${infoPrefix}Paging--${pageName}").setPagingInfo({
list: $P.control.dataset
, prefix: "${infoPrefix}Paging--${pageName}"
//list: $P.control.dataset
prefix: "${infoPrefix}Paging--${pageName}"
, start: obj.${infoPrefix}Start
, totalSize: $P.control.dataset.length
, totalSize: $P.control.dataset.length - 1
, fetchSize: obj.${infoPrefix}Fetch
, dataLength: $P.control.dataset.length - 1
, func: "pageObject['${pageName}'].control.load({index})"
});
};
@ -229,28 +218,21 @@
let replacer = (str, dataItem) => {
str = str.replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("prduct_cd") + "');")
str = str.replace(/{fw-bold-if-total}/gi, "");
return str;
if(dataItem.getValue("dept_cd") === "TOTAL"){
str = str.replace(/{fw-bold-if-total}/gi, "fw-bold");
str = str.replace(/{ROW_NUM}/gi, "")
} else {
str = str.replace(/{fw-bold-if-total}/gi, "");
}
return str;
}
let trs = empty ? [document.getElementById("${infoPrefix}NotFound--${pageName}").content.outerHTML]
: ${infoPrefix}List.inStrings(foundTr.outerHTML, replacer);
$("#tbody--${pageName}").html(trs.join());
// TOTAL 데이터 추가
let replacer2 = (str, dataItem) => {
str = str.replace(/{onclick}/gi, "pageObject['${pageName}'].control.setCurrent('" + dataItem.getValue("prduct_cd") + "');")
str = str.replace(/{fw-bold-if-total}/gi, "fw-bold");
str = str.replace(/{ROW_NUM}/gi, "");
return str;
}
let tr = totalDs.inStrings(foundTr.outerHTML, replacer2);
$("#tbody--${pageName}").append(tr);
}
$P.control.getBsshInfo = (gdccId) => {
let dialogTitle = "마약류 취급업체 조회";
let params = {openPage : "frmSearch--${pageName}"};

@ -184,6 +184,14 @@
// Dataset 변경 이벤트
$P.control.onDatasetChange = (obj) => {
$P.renderList();
$("#${infoPrefix}Paging--${pageName}").setPagingInfo({
prefix: "${infoPrefix}Paging--${pageName}"
, start: obj.${infoPrefix}Start
, totalSize: $P.control.dataset.length - 1
, fetchSize: obj.${infoPrefix}Fetch
, dataLength: $P.control.dataset.length - 1
, func: "pageObject['${pageName}'].control.load({index})"
});
};
// 현재 선택 자료 변경 이벤트

Loading…
Cancel
Save