|
|
|
@ -154,9 +154,9 @@ $(document).ready(function(){
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
|
* DatasetControl
|
|
|
|
|
* DatasetControl, DatasetSupport, FormFields
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
$P.ctrl = new DatasetControl({
|
|
|
|
|
var ctrl = $P.ctrl = new DatasetControl({
|
|
|
|
|
dataGetter : obj => obj["List"], appendData:true,
|
|
|
|
|
keymapper : info => info ? info.DEPT_CD : "",
|
|
|
|
|
urls : {
|
|
|
|
@ -168,28 +168,24 @@ $(document).ready(function(){
|
|
|
|
|
MDFCN_DT : datetimeFormat
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
$P.ctrl.defaultFetchSize = FETCH_XS;
|
|
|
|
|
$P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize };
|
|
|
|
|
$P.ctrl.beforeCurrent = null;
|
|
|
|
|
ctrl.defaultFetchSize = FETCH_XS;
|
|
|
|
|
ctrl.query = { pageNum : 1, fetchSize : ctrl.defaultFetchSize };
|
|
|
|
|
ctrl.beforeCurrent = null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
|
* Dataset.on
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
|
|
|
|
|
ctrl.dataset.onDatasetChange = (obj, option) => {
|
|
|
|
|
var t = $P.getGridTemplate();
|
|
|
|
|
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
|
|
|
|
|
$P.renderDeptList(obj["Total"], $P.ctrl.dataset.length, trs, option);
|
|
|
|
|
var trs = Apply.fromDataset.getTbody(ctrl.dataset, t.found, t.notFound, t.replacer);
|
|
|
|
|
$P.renderDeptList(obj["Total"], ctrl.dataset.length, trs, option);
|
|
|
|
|
|
|
|
|
|
Apply.fromDataset.paging($P.ctrl.dataset, obj, $P.findn("deptPaging"), $P.findn("deptPagingInfo"));
|
|
|
|
|
Apply.fromDataset.paging(ctrl.dataset, obj, $P.findn("deptPaging"), $P.findn("deptPagingInfo"));
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$P.ctrl.dataset.onCurrentChange = (dataItem) => {
|
|
|
|
|
Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $P.findn("deptTbody"));
|
|
|
|
|
ctrl.dataset.onCurrentChange = (dataItem) => {
|
|
|
|
|
Apply.fromDataset.currentRow(ctrl.dataset, dataItem, $P.findn("deptTbody"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.ctrl.dataset.onSelectionChange = (selectedArr) => {
|
|
|
|
|
Apply.fromDataset.gridCheckbox($P.ctrl.dataset, $P.findn("deptTbody"), 1, selectedArr);
|
|
|
|
|
ctrl.dataset.onSelectionChange = (selectedArr) => {
|
|
|
|
|
Apply.fromDataset.gridCheckbox(ctrl.dataset, $P.findn("deptTbody"), 1, selectedArr);
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -205,32 +201,32 @@ $(document).ready(function(){
|
|
|
|
|
|
|
|
|
|
searchForm.find("select[name='sggCd']").val(MY_INFO.info.sggCd);
|
|
|
|
|
|
|
|
|
|
$P.ctrl.dataset.setData([]);
|
|
|
|
|
ctrl.dataset.setData([]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.getParams = () => {
|
|
|
|
|
var formFields = new FimsFormFields($P.selectorn("frmSearch"));
|
|
|
|
|
var data = formFields.get();
|
|
|
|
|
data.fetchSize = $P.ctrl.defaultFetchSize;
|
|
|
|
|
data.fetchSize = ctrl.defaultFetchSize;
|
|
|
|
|
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.searchDeptList = () => {
|
|
|
|
|
$P.ctrl.query = $P.getParams();
|
|
|
|
|
$P.ctrl.load(1);
|
|
|
|
|
ctrl.query = $P.getParams();
|
|
|
|
|
ctrl.load(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.scrollDeptList = () => {
|
|
|
|
|
$P.ctrl.load($P.ctrl.query.pageNum + 1);
|
|
|
|
|
ctrl.load(ctrl.query.pageNum + 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.refreshDeptList = () => {
|
|
|
|
|
if($P.ctrl.query.pageNum == null){
|
|
|
|
|
if(ctrl.query.pageNum == null){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.ctrl.reload({all : true});
|
|
|
|
|
ctrl.reload({all : true});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.getGridTemplate = () => {
|
|
|
|
@ -250,7 +246,7 @@ $(document).ready(function(){
|
|
|
|
|
$P.renderDeptList = (total, listLength, trs, option) => {
|
|
|
|
|
|
|
|
|
|
let noMore = (listLength >= total);
|
|
|
|
|
var initScroll = ($P.ctrl.query.pageNum < 2);
|
|
|
|
|
var initScroll = (ctrl.query.pageNum < 2);
|
|
|
|
|
if(option != null && option.reloaded){
|
|
|
|
|
initScroll = false;
|
|
|
|
|
}
|
|
|
|
@ -268,7 +264,7 @@ $(document).ready(function(){
|
|
|
|
|
|
|
|
|
|
$P.$findn("deptTbody").setCurrentRow(dataKey);
|
|
|
|
|
|
|
|
|
|
Apply.toDataset.current($P.ctrl.dataset, dataKey);
|
|
|
|
|
Apply.toDataset.current(ctrl.dataset, dataKey);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.dblclickDeptList = (dataKey) => {
|
|
|
|
@ -282,7 +278,7 @@ $(document).ready(function(){
|
|
|
|
|
params.deptCd = deptCd;
|
|
|
|
|
|
|
|
|
|
ajax.get({
|
|
|
|
|
url : $P.ctrl.urls.getInfo,
|
|
|
|
|
url : ctrl.urls.getInfo,
|
|
|
|
|
data : params,
|
|
|
|
|
success : (resp) => {
|
|
|
|
|
|
|
|
|
|