From d1e0cbc18674a0830583470fd438c2635ef6be29 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Thu, 27 Jul 2023 13:21:37 +0900 Subject: [PATCH] =?UTF-8?q?=EC=86=8C=EC=8A=A4=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sql/mapper/fims/crdn/crdn06-mapper.xml | 2 +- .../WEB-INF/jsp/fims/crdn/crdn05030-info.jsp | 23 +----------- .../WEB-INF/jsp/fims/crdn/crdn06010-main.jsp | 18 +-------- .../WEB-INF/jsp/fims/crdn/crdn06020-main.jsp | 37 +------------------ src/main/webapp/WEB-INF/jsp/include/tail.jsp | 6 ++- .../js/fims/framework/cmm/cmmUtil.js | 15 ++++++++ .../cmm/{initGrid.js => searchUtil.js} | 12 ------ .../js/fims/framework/cmm/taskUtil.js | 18 +++++++++ 8 files changed, 43 insertions(+), 88 deletions(-) rename src/main/webapp/resources/js/fims/framework/cmm/{initGrid.js => searchUtil.js} (67%) create mode 100644 src/main/webapp/resources/js/fims/framework/cmm/taskUtil.js diff --git a/src/main/resources/sql/mapper/fims/crdn/crdn06-mapper.xml b/src/main/resources/sql/mapper/fims/crdn/crdn06-mapper.xml index 6225dce2..7ffa445f 100644 --- a/src/main/resources/sql/mapper/fims/crdn/crdn06-mapper.xml +++ b/src/main/resources/sql/mapper/fims/crdn/crdn06-mapper.xml @@ -269,7 +269,7 @@ SELECT C.CRDN_ID - + AND OVTIME_YN = 'N' diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05030-info.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05030-info.jsp index 017977e0..06ffc024 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05030-info.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn05030-info.jsp @@ -404,25 +404,8 @@ $(document).ready(function(){ var clsForTask = $("#taskSeCd--${pageName}").val().toLowerCase(); //업무별 입력 항목 - var editSlotAreas = $("#frmEdit--${pageName}").find("[slot='edit']"); - editSlotAreas.each(function(){ - - var tempHtml = ""; - $(this).find("template").each(function(){ - tempHtml += this.cloneNode(true).outerHTML; - }); - - var taskTemplate = $(this).find("template."+clsForTask); - if(taskTemplate.length < 1){ - this.innerHTML = tempHtml; - return; - } - - var inHtml = $(taskTemplate[0].content).find("slot")[0].innerHTML; - this.innerHTML = tempHtml + inHtml; - }); - - + renderForTask('frmEdit--${pageName}', clsForTask); + initDatepicker("frmEdit--${pageName}"); //달력 초기화 $("#frmEdit--${pageName}").find(".form-date").each(function(){ @@ -456,6 +439,4 @@ $(document).ready(function(){ $P.crdnControl.dataset.append({}); }); - - \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06010-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06010-main.jsp index ecfdaaa6..f07268a4 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06010-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06010-main.jsp @@ -302,23 +302,7 @@ $(document).ready(function(){ var clsForTask = taskSeCd.toLowerCase(); //업무별 조회조건 - var searchSlotAreas = $("#frmSearch--${pageName}").find("[slot='search']"); - searchSlotAreas.each(function(){ - - var tempHtml = ""; - $(this).find("template").each(function(){ - tempHtml += this.cloneNode(true).outerHTML; - }); - - var taskTemplate = $(this).find("template."+clsForTask); - if(taskTemplate.length < 1){ - this.innerHTML = tempHtml; - return; - } - - var inHtml = $(taskTemplate[0].content).find("slot")[0].innerHTML; - this.innerHTML = tempHtml + inHtml; - }); + renderForTask("frmSearch--${pageName}", clsForTask); //업무별 그리드 var colsContent = document.getElementById("crdnCols--${pageName}").content; diff --git a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06020-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06020-main.jsp index 5beaf5af..c9a49dfb 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06020-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/crdn/crdn06020-main.jsp @@ -437,42 +437,9 @@ $(document).ready(function(){ var clsForTask = taskSeCd.toLowerCase(); //업무별 조회조건 - var searchSlotAreas = $("#frmSearch--${pageName}").find("[slot='search']"); - searchSlotAreas.each(function(){ - - var tempHtml = ""; - $(this).find("template").each(function(){ - tempHtml += this.cloneNode(true).outerHTML; - }); - - var taskTemplate = $(this).find("template."+clsForTask); - if(taskTemplate.length < 1){ - this.innerHTML = tempHtml; - return; - } - - var inHtml = $(taskTemplate[0].content).find("slot")[0].innerHTML; - this.innerHTML = tempHtml + inHtml; - }); - + renderForTask("frmSearch--${pageName}", clsForTask); //업무별 버튼 - var buttonSlotAreas = $("#gridbuttonArea--${pageName}").find("[slot='button']"); - buttonSlotAreas.each(function(){ - - var tempHtml = ""; - $(this).find("template").each(function(){ - tempHtml += this.cloneNode(true).outerHTML; - }); - - var taskTemplate = $(this).find("template."+clsForTask); - if(taskTemplate.length < 1){ - this.innerHTML = tempHtml; - return; - } - - var inHtml = $(taskTemplate[0].content).find("slot")[0].innerHTML; - this.innerHTML = tempHtml + inHtml; - }); + renderForTask("gridbuttonArea--${pageName}", clsForTask); $('#btnPhotoInspection--${pageName}').trigger("click"); } diff --git a/src/main/webapp/WEB-INF/jsp/include/tail.jsp b/src/main/webapp/WEB-INF/jsp/include/tail.jsp index 8b5e8cde..8a744695 100644 --- a/src/main/webapp/WEB-INF/jsp/include/tail.jsp +++ b/src/main/webapp/WEB-INF/jsp/include/tail.jsp @@ -46,12 +46,14 @@ + + - - + + diff --git a/src/main/webapp/resources/js/fims/framework/cmm/cmmUtil.js b/src/main/webapp/resources/js/fims/framework/cmm/cmmUtil.js index 26bb7162..14a65c4c 100644 --- a/src/main/webapp/resources/js/fims/framework/cmm/cmmUtil.js +++ b/src/main/webapp/resources/js/fims/framework/cmm/cmmUtil.js @@ -247,3 +247,18 @@ function escapeHTMLEntity(str) { return str; } } + +/** + * 스네이크 표기법을 카멜 표기법으로 변경한다. + * @return 치환된 문자열 + */ +function snakeToCamel(text){ + text = text.toLowerCase(); + var arrUnderbar = text.match(/\_[a-zA-Z]/g); + if(arrUnderbar){ + for(var j = 0; j < arrUnderbar.length; j++) { + text = text.replace(arrUnderbar[j], arrUnderbar[j].toUpperCase().replace("_", "")); + } + } + return text; +} diff --git a/src/main/webapp/resources/js/fims/framework/cmm/initGrid.js b/src/main/webapp/resources/js/fims/framework/cmm/searchUtil.js similarity index 67% rename from src/main/webapp/resources/js/fims/framework/cmm/initGrid.js rename to src/main/webapp/resources/js/fims/framework/cmm/searchUtil.js index bb77a6d3..6c34bceb 100644 --- a/src/main/webapp/resources/js/fims/framework/cmm/initGrid.js +++ b/src/main/webapp/resources/js/fims/framework/cmm/searchUtil.js @@ -13,15 +13,3 @@ function searchFromGridTitle(byValue, byOutputValue, mainOption, subOption){ document.getElementById(mainOptionElementId).value = mainOption; document.getElementById(subOptionElementId).value = subOption; } - - -function snakeToCamel(text){ - text = text.toLowerCase(); - var arrUnderbar = text.match(/\_[a-zA-Z]/g); - if(arrUnderbar){ - for(var j = 0; j < arrUnderbar.length; j++) { - text = text.replace(arrUnderbar[j], arrUnderbar[j].toUpperCase().replace("_", "")); - } - } - return text; -} diff --git a/src/main/webapp/resources/js/fims/framework/cmm/taskUtil.js b/src/main/webapp/resources/js/fims/framework/cmm/taskUtil.js new file mode 100644 index 00000000..90791924 --- /dev/null +++ b/src/main/webapp/resources/js/fims/framework/cmm/taskUtil.js @@ -0,0 +1,18 @@ +function renderForTask(areaId, taskClass){ + var slotAreas = $("#"+areaId).find("[slot]"); + slotAreas.each(function(){ + var tempHtml = ""; + $(this).find("template").each(function(){ + tempHtml += this.cloneNode(true).outerHTML; + }); + + var taskTemplate = $(this).find("template."+taskClass); + if(taskTemplate.length < 1){ + this.innerHTML = tempHtml; + return; + } + + var inHtml = $(taskTemplate[0].content).find("slot")[0].innerHTML; + this.innerHTML = tempHtml + inHtml; + }); +} \ No newline at end of file