From 2caaad4e2400de4225c1054e412be992e5ec4433 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Thu, 30 Nov 2023 14:15:14 +0900 Subject: [PATCH] =?UTF-8?q?=EC=85=80=EB=A0=89=ED=8A=B8=EB=B0=95=EC=8A=A4?= =?UTF-8?q?=20=EC=98=B5=EC=85=98=20=EC=84=A0=ED=83=9D=20=EB=B2=84=ED=8A=BC?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/fims/cmmn/pdf/DefaultOtptStng.java | 16 +- .../cokr/xit/fims/cmmn/pdf/PDFPrintUtil.java | 4 +- .../WEB-INF/jsp/fims/sprt/sprt01200-main.jsp | 168 +++++++++--------- src/main/webapp/WEB-INF/jsp/include/tail.jsp | 2 + .../js/fims/framework/cmm/componentization.js | 20 +++ 5 files changed, 117 insertions(+), 93 deletions(-) create mode 100644 src/main/webapp/resources/js/fims/framework/cmm/componentization.js diff --git a/src/main/java/cokr/xit/fims/cmmn/pdf/DefaultOtptStng.java b/src/main/java/cokr/xit/fims/cmmn/pdf/DefaultOtptStng.java index 92c40385..73effc38 100644 --- a/src/main/java/cokr/xit/fims/cmmn/pdf/DefaultOtptStng.java +++ b/src/main/java/cokr/xit/fims/cmmn/pdf/DefaultOtptStng.java @@ -19,11 +19,11 @@ public class DefaultOtptStng { this.heightSz=0; this.fontNm="gulimche"; - this.fontSize=10; + this.fontSz=10; this.fontColor="BLACK"; this.fontStyle="FILL"; - this.align = "left"; + this.textSort = "left"; this.forPost = false; this.unique = false; } @@ -57,8 +57,8 @@ public class DefaultOtptStng { /** * 출력요소의 기본 텍스트정렬을 설정한다. */ - public DefaultOtptStng align(String type) { - this.align = type; + public DefaultOtptStng align(String alignValue) { + this.textSort = alignValue; return this; } @@ -74,9 +74,9 @@ public class DefaultOtptStng { /** * 출력요소의 기본 글꼴을 설정한다. */ - public DefaultOtptStng font(String fontNm, int fontSize, String fontColor, String fontStyle) { + public DefaultOtptStng font(String fontNm, int fontSz, String fontColor, String fontStyle) { this.fontNm = fontNm; - this.fontSize = fontSize; + this.fontSz = fontSz; this.fontColor = fontColor; this.fontStyle = fontStyle; return this; @@ -123,9 +123,9 @@ public class DefaultOtptStng { private Pstn letter; //레터 위치값 private float widthSz; //영역크기 길이 private float heightSz; //영역크기 높이 - private String align; //텍스트정렬 + private String textSort; //텍스트정렬 private String fontNm; //글꼴명 - private int fontSize; //글꼴크기 + private int fontSz; //글꼴크기 private String fontColor; //글꼴색 private String fontStyle; //글꼴스타일 } diff --git a/src/main/java/cokr/xit/fims/cmmn/pdf/PDFPrintUtil.java b/src/main/java/cokr/xit/fims/cmmn/pdf/PDFPrintUtil.java index ab52d1eb..6dc5374b 100644 --- a/src/main/java/cokr/xit/fims/cmmn/pdf/PDFPrintUtil.java +++ b/src/main/java/cokr/xit/fims/cmmn/pdf/PDFPrintUtil.java @@ -176,7 +176,7 @@ public class PDFPrintUtil extends PrintUtil { if(!sggStng.string("FONT_SZ").equals("")) { return sggStng.number("FONT_SZ").intValue(); } else { - return prototypeStng.getFontSize(); + return prototypeStng.getFontSz(); } } @@ -214,7 +214,7 @@ public class PDFPrintUtil extends PrintUtil { if(!sggStng.string("TEXT_SORT").equals("")) { return sggStng.string("TEXT_SORT"); } else { - return prototypeStng.getAlign(); + return prototypeStng.getTextSort(); } } diff --git a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01200-main.jsp b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01200-main.jsp index e18887db..f60a07d8 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01200-main.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/sprt/sprt01200-main.jsp @@ -51,23 +51,10 @@ @@ -128,40 +101,60 @@ + + @@ -260,8 +240,12 @@ $(document).ready(function(){ $("#currentOtpt--${pageName}").text(resp.otptStngTitle); $P.otptStngMap = resp.otptStngMap; - $P.renderOtptStngGrid("tbodyUnique--${pageName}",$P.otptStngMap.unique.prototypeList,$P.otptStngMap.unique.dataList); - $P.renderOtptStngGrid("tbodyMultiple--${pageName}",$P.otptStngMap.multiple.prototypeList,$P.otptStngMap.multiple.dataList); + $P.renderOtptStngGrid("tbodyUnique--${pageName}", + $P.otptStngMap.unique.prototypeList, + $P.otptStngMap.unique.dataList); + $P.renderOtptStngGrid("tbodyMultiple--${pageName}", + $P.otptStngMap.multiple.prototypeList, + $P.otptStngMap.multiple.dataList); } }); @@ -292,23 +276,39 @@ $(document).ready(function(){ $($P.fnGetElement(lastTr,"widthSz")).val(data.WIDTH_SZ); $($P.fnGetElement(lastTr,"heightSz")).val(data.HEIGHT_SZ); - $($P.fnGetElement(lastTr,"textSort")).val(!isEmpty(data.TEXT_SORT) ? data.TEXT_SORT : "left"); - $($P.fnGetElement(lastTr,"fontNm")).val(!isEmpty(data.FONT_NM) ? data.FONT_NM : "gulimche"); - $($P.fnGetElement(lastTr,"fontSz")).val(!isEmpty(data.FONT_SZ) ? data.FONT_SZ : 10); - $($P.fnGetElement(lastTr,"fontColor")).val(!isEmpty(data.FONT_COLOR) ? data.FONT_COLOR : "BLACK"); - $($P.fnGetElement(lastTr,"fontStyle")).val(!isEmpty(data.FONT_STYLE) ? data.FONT_STYLE : "FILL"); + $($P.fnGetElement(lastTr,"textSort")) + .val(!isEmpty(data.TEXT_SORT) ? data.TEXT_SORT : $P.fnGetProto(prototypeList, data, "textSort")); + $($P.fnGetElement(lastTr,"fontNm")) + .val(!isEmpty(data.FONT_NM) ? data.FONT_NM : $P.fnGetProto(prototypeList, data, "fontNm")); + $($P.fnGetElement(lastTr,"fontSz")) + .val(!isEmpty(data.FONT_SZ) ? data.FONT_SZ : $P.fnGetProto(prototypeList, data, "fontSz")); + $($P.fnGetElement(lastTr,"fontColor")) + .val(!isEmpty(data.FONT_COLOR) ? data.FONT_COLOR : $P.fnGetProto(prototypeList, data, "fontColor")); + $($P.fnGetElement(lastTr,"fontStyle")) + .val(!isEmpty(data.FONT_STYLE) ? data.FONT_STYLE : $P.fnGetProto(prototypeList, data, "fontStyle")); } - if(tbodyId == "tbodyUnique--${pageName}"){ - $("#"+tbodyId).find("tr").each(function(){ + $("#"+tbodyId).find("tr").each(function(){ + + if(tbodyId == "tbodyUnique--${pageName}"){ var el = $P.fnGetElement(this,"otptNm"); $(el).attr("disabled","disabled"); - }); - } + $(el).addClass("no-bgi"); + } + + var sel = $P.fnGetElement(this,"textSort"); + var toPrev = $(sel).siblings()[0]; + var toNext = $(sel).siblings()[1]; + fnMakeSpinnerSelect(sel, toPrev, toNext); + }); } $P.fnGetElement = (tableRow, colName) => { - return $(tableRow).find("td[data-col='"+colName+"']").children().first()[0]; + return $(tableRow).find("td[data-col='"+colName+"']").children("input, select").first()[0]; + } + + $P.fnGetProto = (prototypeList, sggData, colName) => { + return prototypeList.find((item) => item.otptNm == sggData.OTPT_NM)[colName]; } $P.fnChangeComponent = (selectElement) => { @@ -318,13 +318,15 @@ $(document).ready(function(){ var selectedOption = $(selectElement).find("option:selected")[0]; $(componentTypeEl).val(selectedOption.dataset.componentType); - } $P.fnSave = () => { } + $("#theadUnique--${pageName}").html($("#theadTr--${pageName}")[0].innerHTML); + $("#theadMultiple--${pageName}").html($("#theadTr--${pageName}")[0].innerHTML); + $("#btnLoad--${pageName}").on("click", () => $P.fnLoad() ); $("#btnSave--${pageName}").on("click", () => $P.fnSave() ); diff --git a/src/main/webapp/WEB-INF/jsp/include/tail.jsp b/src/main/webapp/WEB-INF/jsp/include/tail.jsp index 152e081f..0774c68d 100644 --- a/src/main/webapp/WEB-INF/jsp/include/tail.jsp +++ b/src/main/webapp/WEB-INF/jsp/include/tail.jsp @@ -59,6 +59,8 @@ + + diff --git a/src/main/webapp/resources/js/fims/framework/cmm/componentization.js b/src/main/webapp/resources/js/fims/framework/cmm/componentization.js new file mode 100644 index 00000000..3bea7542 --- /dev/null +++ b/src/main/webapp/resources/js/fims/framework/cmm/componentization.js @@ -0,0 +1,20 @@ +function fnMakeSpinnerSelect(selectEl, prevBtnEl, nextBtnEl){ + $(prevBtnEl).on("click", function(){ + var selected = $(selectEl).find("option:selected"); + var prev = selected.prev(); + if(prev.length >= 1){ + $(selectEl).val(prev.val()); + } else { + $(selectEl).effect("highlight"); + } + }); + $(nextBtnEl).on("click", function(){ + var selected = $(selectEl).find("option:selected"); + var next = selected.next(); + if(next.length >= 1){ + $(selectEl).val(next.val()); + } else { + $(selectEl).effect("highlight"); + } + }); +} \ No newline at end of file