|
|
|
@ -175,7 +175,7 @@ $(document).ready(function(){
|
|
|
|
|
/**************************************************************************
|
|
|
|
|
* DatasetControl
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
$P.dmndControl = new DatasetControl({
|
|
|
|
|
$P.ctrl = new DatasetControl({
|
|
|
|
|
dataGetter : obj => obj["List"], appendData:true,
|
|
|
|
|
keymapper : info => info ? info.INDIV_ID : "",
|
|
|
|
|
urls : {
|
|
|
|
@ -189,23 +189,23 @@ $(document).ready(function(){
|
|
|
|
|
RSPNS_DT : datetimeFormat
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
$P.dmndControl.defaultFetchSize = FETCH_XS;
|
|
|
|
|
$P.dmndControl.query = { pageNum : 1, fetchSize : $P.dmndControl.defaultFetchSize };
|
|
|
|
|
$P.dmndControl.beforeCurrent = null;
|
|
|
|
|
$P.ctrl.defaultFetchSize = FETCH_XS;
|
|
|
|
|
$P.ctrl.query = { pageNum : 1, fetchSize : $P.ctrl.defaultFetchSize };
|
|
|
|
|
$P.ctrl.beforeCurrent = null;
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
|
* Dataset.on
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
$P.dmndControl.dataset.onDatasetChange = (obj, option) => {
|
|
|
|
|
$P.ctrl.dataset.onDatasetChange = (obj, option) => {
|
|
|
|
|
var t = $P.getGridTemplate();
|
|
|
|
|
var trs = Apply.fromDataset.getTbody($P.dmndControl.dataset, t.found, t.notFound, t.replacer);
|
|
|
|
|
$P.renderDmndList(obj["Total"], $P.dmndControl.dataset.length, trs, option);
|
|
|
|
|
var trs = Apply.fromDataset.getTbody($P.ctrl.dataset, t.found, t.notFound, t.replacer);
|
|
|
|
|
$P.renderDmndList(obj["Total"], $P.ctrl.dataset.length, trs, option);
|
|
|
|
|
|
|
|
|
|
Apply.fromDataset.paging($P.dmndControl.dataset, obj, "dmndPaging--${pageName}");
|
|
|
|
|
Apply.fromDataset.paging($P.ctrl.dataset, obj, "dmndPaging--${pageName}");
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$P.dmndControl.dataset.onCurrentChange = (dataItem) => {
|
|
|
|
|
Apply.fromDataset.currentRow($P.dmndControl.dataset, dataItem, $("#dmndTbody--${pageName}")[0]);
|
|
|
|
|
$P.ctrl.dataset.onCurrentChange = (dataItem) => {
|
|
|
|
|
Apply.fromDataset.currentRow($P.ctrl.dataset, dataItem, $("#dmndTbody--${pageName}")[0]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**************************************************************************
|
|
|
|
@ -215,65 +215,65 @@ $(document).ready(function(){
|
|
|
|
|
|
|
|
|
|
$('#schDmndYmdFrom--${pageName}').datepicker('setDate', DateUtil.getDateDay(-5475).date);
|
|
|
|
|
$('#schDmndYmdTo--${pageName}').datepicker('setDate', TODAY());
|
|
|
|
|
$P.dmndControl.dataset.setData([]);
|
|
|
|
|
$P.ctrl.dataset.setData([]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.fnResetAndChangeBiz = (taskSeCd) => {
|
|
|
|
|
$P.fnReset();
|
|
|
|
|
$P.dmndControl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/list.do");
|
|
|
|
|
$P.dmndControl.urls.create = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/create.do");
|
|
|
|
|
$P.dmndControl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/remove.do");
|
|
|
|
|
$P.ctrl.urls.load = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/list.do");
|
|
|
|
|
$P.ctrl.urls.create = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/create.do");
|
|
|
|
|
$P.ctrl.urls.remove = wctx.url("/"+taskSeCd+"/cvlc/cvlc04/010/remove.do");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.getParams = () => {
|
|
|
|
|
var formFields = new FimsFormFields("#frmSearch--${pageName}");
|
|
|
|
|
var data = formFields.get();
|
|
|
|
|
data.fetchSize = $P.dmndControl.defaultFetchSize;
|
|
|
|
|
data.fetchSize = $P.ctrl.defaultFetchSize;
|
|
|
|
|
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.searchDmndList = () => {
|
|
|
|
|
$P.dmndControl.query = $P.getParams();
|
|
|
|
|
$P.dmndControl.load(1);
|
|
|
|
|
$P.ctrl.query = $P.getParams();
|
|
|
|
|
$P.ctrl.load(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.scrollDmndList = () => {
|
|
|
|
|
$P.dmndControl.load($P.dmndControl.query.pageNum + 1);
|
|
|
|
|
$P.ctrl.load($P.ctrl.query.pageNum + 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.refreshDmndList = () => {
|
|
|
|
|
|
|
|
|
|
if(!$P.dmndControl.dataset.empty){
|
|
|
|
|
$P.dmndControl.beforeCurrent = {
|
|
|
|
|
key : $P.dmndControl.dataset.getCurrent()["INDIV_ID"],
|
|
|
|
|
index : $P.dmndControl.dataset.getCurrent()["ROW_NUM"] - 1
|
|
|
|
|
if(!$P.ctrl.dataset.empty){
|
|
|
|
|
$P.ctrl.beforeCurrent = {
|
|
|
|
|
key : $P.ctrl.dataset.getCurrent()["INDIV_ID"],
|
|
|
|
|
index : $P.ctrl.dataset.getCurrent()["ROW_NUM"] - 1
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Apply.fromDatasetControl.reload($P.dmndControl).then((resp)=>{
|
|
|
|
|
Apply.toDataset.set($P.dmndControl.dataset, resp);
|
|
|
|
|
$P.dmndControl.dataset.onDatasetChange(resp, {reloaded : true});
|
|
|
|
|
Apply.fromDatasetControl.reload($P.ctrl).then((resp)=>{
|
|
|
|
|
Apply.toDataset.set($P.ctrl.dataset, resp);
|
|
|
|
|
$P.ctrl.dataset.onDatasetChange(resp, {reloaded : true});
|
|
|
|
|
|
|
|
|
|
if($P.dmndControl.beforeCurrent != null){
|
|
|
|
|
var beforeCurrentKey = $P.dmndControl.beforeCurrent.key;
|
|
|
|
|
var beforeCurrentIndex = $P.dmndControl.beforeCurrent.index;
|
|
|
|
|
$P.dmndControl.beforeCurrent = null;
|
|
|
|
|
if($P.ctrl.beforeCurrent != null){
|
|
|
|
|
var beforeCurrentKey = $P.ctrl.beforeCurrent.key;
|
|
|
|
|
var beforeCurrentIndex = $P.ctrl.beforeCurrent.index;
|
|
|
|
|
$P.ctrl.beforeCurrent = null;
|
|
|
|
|
|
|
|
|
|
if(!$P.dmndControl.dataset.empty){
|
|
|
|
|
var info = $P.dmndControl.dataset.getData(beforeCurrentKey);
|
|
|
|
|
if(!$P.ctrl.dataset.empty){
|
|
|
|
|
var info = $P.ctrl.dataset.getData(beforeCurrentKey);
|
|
|
|
|
|
|
|
|
|
if(info != null){
|
|
|
|
|
$P.dmndControl.dataset.setCurrent(beforeCurrentKey,true);
|
|
|
|
|
$P.ctrl.dataset.setCurrent(beforeCurrentKey,true);
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
if(beforeCurrentIndex > ($P.dmndControl.dataset.length - 1)){
|
|
|
|
|
info = $P.dmndControl.dataset.getDataset()[$P.dmndControl.dataset.length - 1];
|
|
|
|
|
if(beforeCurrentIndex > ($P.ctrl.dataset.length - 1)){
|
|
|
|
|
info = $P.ctrl.dataset.getDataset()[$P.ctrl.dataset.length - 1];
|
|
|
|
|
} else {
|
|
|
|
|
info = $P.dmndControl.dataset.getDataset()[beforeCurrentIndex];
|
|
|
|
|
info = $P.ctrl.dataset.getDataset()[beforeCurrentIndex];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.dmndControl.dataset.setCurrent(info["INDIV_ID"],true);
|
|
|
|
|
$P.ctrl.dataset.setCurrent(info["INDIV_ID"],true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -297,7 +297,7 @@ $(document).ready(function(){
|
|
|
|
|
$P.renderDmndList = (total, listLength, trs, option) => {
|
|
|
|
|
|
|
|
|
|
let noMore = (listLength >= total);
|
|
|
|
|
var initScroll = ($P.dmndControl.query.pageNum < 2);
|
|
|
|
|
var initScroll = ($P.ctrl.query.pageNum < 2);
|
|
|
|
|
if(option != null && option.reloaded){
|
|
|
|
|
initScroll = false;
|
|
|
|
|
}
|
|
|
|
@ -311,24 +311,24 @@ $(document).ready(function(){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$("#dmndTbody--${pageName}").setCurrentRow(dataKey);
|
|
|
|
|
Apply.toDataset.current($P.dmndControl.dataset, dataKey);
|
|
|
|
|
Apply.toDataset.current($P.ctrl.dataset, dataKey);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.fnRemove = (allCompleteDataIds) => {
|
|
|
|
|
|
|
|
|
|
if(allCompleteDataIds != null){
|
|
|
|
|
$P.dmndControl.dataset.select(allCompleteDataIds,true);
|
|
|
|
|
$P.ctrl.dataset.select(allCompleteDataIds,true);
|
|
|
|
|
} else {
|
|
|
|
|
var cur = $P.dmndControl.dataset.getCurrent();
|
|
|
|
|
var cur = $P.ctrl.dataset.getCurrent();
|
|
|
|
|
if(cur == null){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var curKey = cur["INDIV_ID"];
|
|
|
|
|
$P.dmndControl.dataset.select(curKey,true);
|
|
|
|
|
$P.ctrl.dataset.select(curKey,true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var selected = $P.dmndControl.dataset.getKeys("selected");
|
|
|
|
|
var selected = $P.ctrl.dataset.getKeys("selected");
|
|
|
|
|
if (selected.length < 1) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -338,7 +338,7 @@ $(document).ready(function(){
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ajax.post({
|
|
|
|
|
url : $P.dmndControl.urls.remove,
|
|
|
|
|
url : $P.ctrl.urls.remove,
|
|
|
|
|
data : params,
|
|
|
|
|
success : (resp) => {
|
|
|
|
|
$P.removeCallback(selected, resp);
|
|
|
|
@ -356,12 +356,12 @@ $(document).ready(function(){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.fnRemoveAllCompleteData = () => {
|
|
|
|
|
var cur = $P.dmndControl.dataset.getCurrent();
|
|
|
|
|
var cur = $P.ctrl.dataset.getCurrent();
|
|
|
|
|
if(cur == null){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var ds = $P.dmndControl.dataset.getDataset();
|
|
|
|
|
var ds = $P.ctrl.dataset.getDataset();
|
|
|
|
|
|
|
|
|
|
var indivIds = ds.filter(function(item){
|
|
|
|
|
if(item['STTS_CD'] == '9' || item['STTS_CD'] == 'B'){
|
|
|
|
@ -416,7 +416,7 @@ $(document).ready(function(){
|
|
|
|
|
info.taskSeCd = $("#frmSearch--${pageName} input[name='taskSeCd']:checked").val();
|
|
|
|
|
|
|
|
|
|
ajax.get({
|
|
|
|
|
url : $P.dmndControl.urls.create,
|
|
|
|
|
url : $P.ctrl.urls.create,
|
|
|
|
|
data : info,
|
|
|
|
|
success : (resp) => {
|
|
|
|
|
if(resp.saved){
|
|
|
|
@ -425,7 +425,7 @@ $(document).ready(function(){
|
|
|
|
|
$("#toastText--${pageName}").html("등록 되었습니다.");
|
|
|
|
|
$P.toast.show();
|
|
|
|
|
|
|
|
|
|
if(!$P.dmndControl.dataset.empty){
|
|
|
|
|
if(!$P.ctrl.dataset.empty){
|
|
|
|
|
sleep(1000).then(() => $P.refreshDmndList());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|