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