민원 원본보기 팝업 화면 수정

main
이범준 1 year ago
parent dcce8af4bd
commit 38bc7678f3

@ -4,6 +4,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@ -75,11 +76,14 @@ public class Crdn01Controller extends ApplicationController {
* @return fims/crdn/crdn01050-info * @return fims/crdn/crdn01050-info
*/ */
@RequestMapping(name="민원내역 원본 보기", value="/050/info.do") @RequestMapping(name="민원내역 원본 보기", value="/050/info.do")
public ModelAndView getCivilComplaintOriginalInfo(CrdnQuery req) { public ModelAndView getCivilComplaintOriginalInfo(CrdnQuery req, HttpServletRequest request) {
boolean json = jsonResponse(); boolean json = jsonResponse();
ModelAndView mav = new ModelAndView(json ? "jsonView" : "fims/crdn/crdn01050-info"); ModelAndView mav = new ModelAndView(json ? "jsonView" : "fims/crdn/crdn01050-info");
mav.addObject("pageName", "crdn01050-info"); mav.addObject("pageName", "crdn01050-info");
String urlTaskSeCd = request.getServletPath().split("/")[1];
mav.addObject("taskSeCd", urlTaskSeCd);
Map<String, List<CommonCode>> commonCodes = getCodesOf("FIM039"); Map<String, List<CommonCode>> commonCodes = getCodesOf("FIM039");
mav.addObject("FIM039List", commonCodes.get("FIM039")); mav.addObject("FIM039List", commonCodes.get("FIM039"));

@ -386,16 +386,59 @@ $(document).ready(function(){
var taskSeCd = $("#frmSearch--${pageName} input[name='taskSeCd']:checked").val(); var taskSeCd = $("#frmSearch--${pageName} input[name='taskSeCd']:checked").val();
var dialogId = "cvlcptOrgnlDialog--${pageName}";
ajax.get({ ajax.get({
url : wctx.url("/"+taskSeCd+"/crdn/crdn01/050/info.do"), url : wctx.url("/"+taskSeCd+"/crdn/crdn01/050/info.do"),
data : { crdnId : cur["CRDN_ID"] }, data : { crdnId : cur["CRDN_ID"] },
success : resp => { success : resp => {
dialog.open({ dialog.open({
id : "cvlcptOrgnlDialog--${pageName}" id : dialogId,
, title : "민원내역 원본" title : "민원내역 원본",
, content : resp content : resp,
, size : "xl" size : "xl",
, init : () => {} init : () => {
var parentRes = new Object();
var childReq = pageObject.childReq.pop();
for(var reqKey in childReq) {
if(reqKey == "getCountStatus"){
parentRes[reqKey] = function(currentKey){
var ds = $P.crdnControl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey);
return (index+1) + " of " + ds.length;
};
}
if(reqKey == "getNextKey"){
parentRes[reqKey] = function(currentKey){
var ds = $P.crdnControl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey);
if(ds.length > index+1){
return ds[index+1]["CRDN_ID"];
} else {
return "";
}
};
}
if(reqKey == "getPrevKey"){
parentRes[reqKey] = function(currentKey){
var ds = $P.crdnControl.dataset.getDataset();
var index = ds.findIndex(item => item.CRDN_ID == currentKey);
if(index != 0 && ds.length > 1){
return ds[index-1]["CRDN_ID"];
} else {
return "";
}
};
}
if(reqKey == "selectRow"){
parentRes[reqKey] = function(currentKey){
$P.clickCrdnList(currentKey);
};
}
}
pageObject.parentRes.push(parentRes);
}
}); });
} }
}); });

@ -59,16 +59,37 @@
</c:forEach> </c:forEach>
</select> </select>
</div> </div>
<div class="col-md-6">
<input type="text" id="countStauts--${pageName}" class="form-control w-px-150 text-center fw-bold" readonly />
<button type="button" class="w-px-50" id="btnPrev--${pageName}">◀</button>
<button type="button" class="w-px-50" id="btnNext--${pageName}">▶</button>
</div>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
<script> <script>
pageObject["${pageName}"] = {}; pageObject["${pageName}"] = {};
pageObject["${pageName}"].parentRes = {};
pageObject.childReq = [];
pageObject.childReq.push({
getCountStatus : function(){},
getNextKey : function(){},
getPrevKey : function(){},
selectRow : function(){}
});
$(document).ready(function() { $(document).ready(function() {
var $P = pageObject["${pageName}"]; var $P = pageObject["${pageName}"];
$P.taskSeCd = "${taskSeCd}";
if(pageObject.parentRes.length > 0){
$P.parentRes = pageObject.parentRes.pop();
} else {
$P.parentRes = pageObject.childReq.pop();
}
/************************************************************************** /**************************************************************************
* DatasetControl, Dataset, FormFields * DatasetControl, Dataset, FormFields
@ -77,10 +98,13 @@ $(document).ready(function() {
$P.cvlcptControl = new DatasetControl({ $P.cvlcptControl = new DatasetControl({
prefix:"cvlcpt", prefixName:"민원", infoSize:"xl", prefix:"cvlcpt", prefixName:"민원", infoSize:"xl",
urls : { load : "" }, urls : { load : "", getInfo : wctx.url("/"+$P.taskSeCd+"/crdn/crdn01/050/info.do") },
keymapper:info => info ? info.CRDN_ID : "", keymapper:info => info ? info.CRDN_ID : "",
dataGetter:obj => obj.cvlcptInfo, dataGetter:obj => obj.cvlcptInfo,
formats: { } formats: {
CVLCPT_RCPT_YMD : dateFormat,
CVLCPT_PRCS_PRNMNT_DT : dateFormat
}
}); });
/************************************************************************** /**************************************************************************
@ -90,10 +114,52 @@ $(document).ready(function() {
$P.formFields.set(item); $P.formFields.set(item);
} }
/**************************************************************************
* pageObject.function
**************************************************************************/
$P.fnPrev = () => {
var prevKey = $P.parentRes.getPrevKey($("#crdnId--${pageName}").val());
if(prevKey != ""){
$P.fnGo(prevKey);
}
}
$P.fnNext = () => {
var nextKey = $P.parentRes.getNextKey($("#crdnId--${pageName}").val());
if(nextKey != ""){
$P.fnGo(nextKey);
}
}
$P.fnGo = (crdnId) => {
ajax.get({
url: $P.cvlcptControl.urls.getInfo,
data: { "crdnId" : crdnId },
headers: {
Accept: "application/json; charset=utf-8"
},
success : resp => {
$P.cvlcptControl.setData([resp.cvlcptInfo]);
var cs = $P.parentRes.getCountStatus($("#crdnId--${pageName}").val());
$("#countStauts--${pageName}").val(cs);
$P.parentRes.selectRow(crdnId);
}
});
}
/**************************************************************************
* element.on
**************************************************************************/
$("#btnPrev--${pageName}").on("click", () => $P.fnPrev() );
$("#btnNext--${pageName}").on("click", () => $P.fnNext() );
/************************************************************************** /**************************************************************************
* 초기화 * 초기화
**************************************************************************/ **************************************************************************/
$P.cvlcptControl.setData([${cvlcptInfo}]); $P.cvlcptControl.setData([${cvlcptInfo}]);
var cs = $P.parentRes.getCountStatus($("#crdnId--${pageName}").val());
$("#countStauts--${pageName}").val(cs);
}); });
</script> </script>

@ -41,6 +41,8 @@
<script> <script>
var pageObject = {}; var pageObject = {};
pageObject.childReq = [];
pageObject.parentRes = [];
function getBrowserName() { function getBrowserName() {
var agent = navigator.userAgent.toUpperCase(); var agent = navigator.userAgent.toUpperCase();

Loading…
Cancel
Save