|
|
|
@ -40,7 +40,13 @@
|
|
|
|
|
<div class="d-flex justify-content-between">
|
|
|
|
|
<span id="currentOtpt--${pageName}" class="bg-lighter h3" style="min-height:30px;">
|
|
|
|
|
</span>
|
|
|
|
|
<form id="frmGlobalEdit--${pageName}">
|
|
|
|
|
<form id="frmEdit--${pageName}">
|
|
|
|
|
<input type="hidden" name="sggCd" />
|
|
|
|
|
<input type="hidden" name="taskSeCd" />
|
|
|
|
|
<input type="hidden" name="sndngSeCd" />
|
|
|
|
|
<input type="hidden" name="paperSeCd" />
|
|
|
|
|
<input type="text" name="dialogId" hidden />
|
|
|
|
|
|
|
|
|
|
<span id="otptGlobalStng--${pageName}">
|
|
|
|
|
</span>
|
|
|
|
|
</form>
|
|
|
|
@ -99,16 +105,6 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<form id="frmEdit--${pageName}" name="frmEdit">
|
|
|
|
|
<input type="hidden" name="sggCd" />
|
|
|
|
|
<input type="hidden" name="taskSeCd" />
|
|
|
|
|
<input type="hidden" name="sndngSeCd" />
|
|
|
|
|
<input type="hidden" name="paperSeCd" />
|
|
|
|
|
|
|
|
|
|
<input type="text" name="dialogId" hidden />
|
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
<span id="tempArea--${pageName}" hidden></span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
@ -239,14 +235,17 @@
|
|
|
|
|
<template id="bcrnTemplate--${pageName}">
|
|
|
|
|
<span class="px-2">
|
|
|
|
|
<label class="col-form-label bg-lighter px-2">배경이미지</label>
|
|
|
|
|
<button type="button">배경이미지</button>
|
|
|
|
|
<output id="fileStatus--${pageName}"></output>
|
|
|
|
|
<button type="button" onclick="$(this).next().click();">업로드</button>
|
|
|
|
|
<input type="file" name="backgroundFile" accept="image/*" hidden onchange="pageObject['${pageName}'].fnBgUpload(this);" />
|
|
|
|
|
<button type="button" id="btnBgDown--${pageName}" onclick="pageObject['${pageName}'].fnBgDown();">다운로드</button>
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template id="photoCntTemplate--${pageName}">
|
|
|
|
|
<span class="px-2">
|
|
|
|
|
<label class="col-form-label bg-lighter px-2">사진 출력</label>
|
|
|
|
|
<input type="text" name="otptPhotoCnt" class="form-control w-px-50" /> 장
|
|
|
|
|
<input type="number" name="otptPhotoCnt" class="form-control w-px-50" min="0" max="6" /> 장
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
@ -297,7 +296,13 @@ $(document).ready(function(){
|
|
|
|
|
if(resp.otptGlobalStng != null){
|
|
|
|
|
$P.otptGlobalStng = resp.otptGlobalStng;
|
|
|
|
|
} else {
|
|
|
|
|
$P.otptGlobalStng = {};
|
|
|
|
|
$P.otptGlobalStng = {
|
|
|
|
|
OTPT_BSC_ID : "",
|
|
|
|
|
FOLD_LINE_PSTN_SE_CD : "",
|
|
|
|
|
BCRN_IMG_PATH : "",
|
|
|
|
|
BCRN_IMG_FILE_NM : "",
|
|
|
|
|
OTPT_PHOTO_CNT : ""
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
$P.otptArtclStngMap = resp.otptArtclStngMap;
|
|
|
|
|
|
|
|
|
@ -317,22 +322,40 @@ $(document).ready(function(){
|
|
|
|
|
//출력 전역 설정 렌더링
|
|
|
|
|
$P.renderOtptGlobalStng = (otptGlobalStng) => {
|
|
|
|
|
var paperSeCd = $("#frmEdit--${pageName}").find("[name='paperSeCd']").val();
|
|
|
|
|
var editForm = $("#frmEdit--${pageName}");
|
|
|
|
|
|
|
|
|
|
if(paperSeCd == "01"){
|
|
|
|
|
$("#otptGlobalStng--${pageName}").append(document.getElementById("foldLinePstnTemplate--${pageName}").innerHTML);
|
|
|
|
|
if(otptGlobalStng.foldLinePstnSeCd == null){
|
|
|
|
|
otptGlobalStng.foldLinePstnSeCd = "";
|
|
|
|
|
}
|
|
|
|
|
//설정ID
|
|
|
|
|
$("#otptGlobalStng--${pageName}").append("<input type='hidden' name='otptBscId' />");
|
|
|
|
|
editForm.find("input[name='otptBscId']").val(otptGlobalStng.OTPT_BSC_ID);
|
|
|
|
|
|
|
|
|
|
$("#frmGlobalEdit--${pageName}")
|
|
|
|
|
.find(":radio[name='foldLinePstnSeCd']")
|
|
|
|
|
.filter("[value='"+otptGlobalStng.foldLinePstnSeCd+"']")
|
|
|
|
|
.prop("checked", true);
|
|
|
|
|
//접는선 위치
|
|
|
|
|
$("#otptGlobalStng--${pageName}").append(document.getElementById("foldLinePstnTemplate--${pageName}").innerHTML);
|
|
|
|
|
if(paperSeCd == "02"){
|
|
|
|
|
$("#otptGlobalStng--${pageName}").find("label").eq(3).remove();
|
|
|
|
|
}
|
|
|
|
|
if(otptGlobalStng.FOLD_LINE_PSTN_SE_CD == null){
|
|
|
|
|
otptGlobalStng.FOLD_LINE_PSTN_SE_CD = "";
|
|
|
|
|
}
|
|
|
|
|
editForm.find(":radio[name='foldLinePstnSeCd']")
|
|
|
|
|
.filter("[value='"+otptGlobalStng.FOLD_LINE_PSTN_SE_CD+"']")
|
|
|
|
|
.prop("checked", true);
|
|
|
|
|
|
|
|
|
|
//배경이미지
|
|
|
|
|
$("#otptGlobalStng--${pageName}").append(document.getElementById("bcrnTemplate--${pageName}").innerHTML);
|
|
|
|
|
$("#otptGlobalStng--${pageName}").append(document.getElementById("photoCntTemplate--${pageName}").innerHTML);
|
|
|
|
|
if(otptGlobalStng.BCRN_IMG_PATH == null || otptGlobalStng.BCRN_IMG_PATH == ""){
|
|
|
|
|
$("#fileStatus--${pageName}").text("없음");
|
|
|
|
|
$("#btnBgDown--${pageName}").attr("hidden","hidden");
|
|
|
|
|
} else {
|
|
|
|
|
$("#fileStatus--${pageName}").text(otptGlobalStng.BCRN_IMG_FILE_NM);
|
|
|
|
|
$("#btnBgDown--${pageName}").removeAttr("hidden");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//출력 사진 건 수
|
|
|
|
|
$("#otptGlobalStng--${pageName}").append(document.getElementById("photoCntTemplate--${pageName}").innerHTML);
|
|
|
|
|
if(otptGlobalStng.OTPT_PHOTO_CNT == null || otptGlobalStng.OTPT_PHOTO_CNT == ""){
|
|
|
|
|
otptGlobalStng.OTPT_PHOTO_CNT = 0;
|
|
|
|
|
}
|
|
|
|
|
editForm.find("input[name='otptPhotoCnt']").val(otptGlobalStng.OTPT_PHOTO_CNT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//출력 요소 그리드 렌더링
|
|
|
|
@ -437,6 +460,7 @@ $(document).ready(function(){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//출력 요소 선택
|
|
|
|
|
$P.choiceOtptArtclNm = () => {
|
|
|
|
|
$("#dropdownUniqueAdd--${pageName}").html("");
|
|
|
|
|
|
|
|
|
@ -580,7 +604,7 @@ $(document).ready(function(){
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//출력 요소 변경
|
|
|
|
|
$P.fnChangeComponent = (selectElement) => {
|
|
|
|
|
if($("#tbodyMultiple--${pageName}").find(selectElement).length <= 0){
|
|
|
|
|
return;
|
|
|
|
@ -615,55 +639,46 @@ $(document).ready(function(){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.getRowData = (tbodyId, query) => {
|
|
|
|
|
//출력 요소 설정 값 추출
|
|
|
|
|
$P.getRowData = (tbodyId, formData) => {
|
|
|
|
|
var rowArr = [];
|
|
|
|
|
$("#"+tbodyId+" tr").each(function(){
|
|
|
|
|
var otptFormId = this.dataset.key;
|
|
|
|
|
var otptArtclNm = $($P.fnGetElement(this,"otptArtclNm")).val();
|
|
|
|
|
var leftPstn = $($P.fnGetElement(this,"leftPstn")).val();
|
|
|
|
|
var topPstn = $($P.fnGetElement(this,"topPstn")).val();
|
|
|
|
|
var widthSz = $($P.fnGetElement(this,"widthSz")).val();
|
|
|
|
|
var heightSz = $($P.fnGetElement(this,"heightSz")).val();
|
|
|
|
|
var textSort = $($P.fnGetElement(this,"textSort")).val();
|
|
|
|
|
var fontNm = $($P.fnGetElement(this,"fontNm")).val();
|
|
|
|
|
var fontSz = $($P.fnGetElement(this,"fontSz")).val();
|
|
|
|
|
var fontColor = $($P.fnGetElement(this,"fontColor")).val();
|
|
|
|
|
var fontStyle = $($P.fnGetElement(this,"fontStyle")).val();
|
|
|
|
|
var otptArtclOrdr = $($P.fnGetElement(this,"otptArtclOrdr")).val();
|
|
|
|
|
|
|
|
|
|
var row = {
|
|
|
|
|
otptFormId : otptFormId,
|
|
|
|
|
otptArtclNm : otptArtclNm,
|
|
|
|
|
leftPstn : leftPstn,
|
|
|
|
|
topPstn : topPstn,
|
|
|
|
|
widthSz : widthSz,
|
|
|
|
|
heightSz : heightSz,
|
|
|
|
|
textSort : textSort,
|
|
|
|
|
fontNm : fontNm,
|
|
|
|
|
fontSz : fontSz,
|
|
|
|
|
fontColor : fontColor,
|
|
|
|
|
fontStyle : fontStyle,
|
|
|
|
|
otptArtclOrdr : otptArtclOrdr,
|
|
|
|
|
|
|
|
|
|
sggCd : query.sggCd,
|
|
|
|
|
taskSeCd : query.taskSeCd,
|
|
|
|
|
sndngSeCd : query.sndngSeCd,
|
|
|
|
|
paperSeCd : query.paperSeCd
|
|
|
|
|
};
|
|
|
|
|
var row = {};
|
|
|
|
|
|
|
|
|
|
row.otptFormId = this.dataset.key;
|
|
|
|
|
row.otptArtclNm = $($P.fnGetElement(this,"otptArtclNm")).val();
|
|
|
|
|
row.leftPstn = $($P.fnGetElement(this,"leftPstn")).val();
|
|
|
|
|
row.topPstn = $($P.fnGetElement(this,"topPstn")).val();
|
|
|
|
|
row.widthSz = $($P.fnGetElement(this,"widthSz")).val();
|
|
|
|
|
row.heightSz = $($P.fnGetElement(this,"heightSz")).val();
|
|
|
|
|
row.textSort = $($P.fnGetElement(this,"textSort")).val();
|
|
|
|
|
row.fontNm = $($P.fnGetElement(this,"fontNm")).val();
|
|
|
|
|
row.fontSz = $($P.fnGetElement(this,"fontSz")).val();
|
|
|
|
|
row.fontColor = $($P.fnGetElement(this,"fontColor")).val();
|
|
|
|
|
row.fontStyle = $($P.fnGetElement(this,"fontStyle")).val();
|
|
|
|
|
row.otptArtclOrdr = $($P.fnGetElement(this,"otptArtclOrdr")).val();
|
|
|
|
|
|
|
|
|
|
row.sggCd = formData.get("sggCd");
|
|
|
|
|
row.taskSeCd = formData.get("taskSeCd");
|
|
|
|
|
row.sndngSeCd = formData.get("sndngSeCd");
|
|
|
|
|
row.paperSeCd = formData.get("paperSeCd");
|
|
|
|
|
|
|
|
|
|
rowArr.push(row);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return rowArr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//출력 설정 저장
|
|
|
|
|
$P.fnSave = () => {
|
|
|
|
|
var ff = new FimsFormFields("#frmEdit--${pageName}");
|
|
|
|
|
var query = ff.get();
|
|
|
|
|
|
|
|
|
|
var rowArr1 = $P.getRowData("tbodyUnique--${pageName}", query);
|
|
|
|
|
var rowArr2 = $P.getRowData("tbodyMultiple--${pageName}", query);
|
|
|
|
|
var rowArr = [...rowArr1, ...rowArr2];
|
|
|
|
|
//출력물 전역설정
|
|
|
|
|
var formData = new FormData(document.getElementById("frmEdit--sprt01200-main"));
|
|
|
|
|
|
|
|
|
|
//출력 요소 설정
|
|
|
|
|
var rowArr1 = $P.getRowData("tbodyUnique--${pageName}", formData);
|
|
|
|
|
var rowArr2 = $P.getRowData("tbodyMultiple--${pageName}", formData);
|
|
|
|
|
var rowArr = [...rowArr1, ...rowArr2];
|
|
|
|
|
for(var i=0; i<rowArr.length; i++){
|
|
|
|
|
if(rowArr[i].otptArtclNm == ""){
|
|
|
|
|
alert("출력항목명을 선택하세요.");
|
|
|
|
@ -671,23 +686,27 @@ $(document).ready(function(){
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
query.otptArtclStngList = rowArr;
|
|
|
|
|
|
|
|
|
|
query = fnJsonToFormData(query,"otptArtclStngList");
|
|
|
|
|
var otptArtclStngList = fnJsonArrayToFormData(rowArr,"otptArtclStngList");
|
|
|
|
|
var keys = Object.keys(otptArtclStngList);
|
|
|
|
|
for(var i=0; i < keys.length; i++){
|
|
|
|
|
formData.append(keys[i], otptArtclStngList[keys[i]]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ajax.post({
|
|
|
|
|
url : wctx.url("/sprt/sprt01/200/save.do"),
|
|
|
|
|
data : query,
|
|
|
|
|
data : formData,
|
|
|
|
|
contentType : false, processData : false,
|
|
|
|
|
success : (resp) => {
|
|
|
|
|
if(resp.saved){
|
|
|
|
|
if(!$("#viewSample--${pageName}").is(":checked")){
|
|
|
|
|
dialog.alert("저장되었습니다.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$("#frmSearch--${pageName}").find("[name='sggCd']").val(query.sggCd);
|
|
|
|
|
$("#frmSearch--${pageName}").find("[name='taskSeCd']").val(query.taskSeCd);
|
|
|
|
|
$("#frmSearch--${pageName}").find("[name='sndngSeCd']").val(query.sndngSeCd);
|
|
|
|
|
$("#frmSearch--${pageName}").find("[name='paperSeCd']").val(query.paperSeCd);
|
|
|
|
|
var ff = new FimsFormFields("#frmEdit--${pageName}").get();
|
|
|
|
|
$("#frmSearch--${pageName}").find("[name='sggCd']").val(ff.sggCd);
|
|
|
|
|
$("#frmSearch--${pageName}").find("[name='taskSeCd']").val(ff.taskSeCd);
|
|
|
|
|
$("#frmSearch--${pageName}").find("[name='sndngSeCd']").val(ff.sndngSeCd);
|
|
|
|
|
$("#frmSearch--${pageName}").find("[name='paperSeCd']").val(ff.paperSeCd);
|
|
|
|
|
|
|
|
|
|
$("#btnLoad--${pageName}").click();
|
|
|
|
|
|
|
|
|
@ -699,6 +718,7 @@ $(document).ready(function(){
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//샘플파일 생성
|
|
|
|
|
$P.fnMakeSampleFile = () => {
|
|
|
|
|
|
|
|
|
|
var formFields = new FimsFormFields("#frmEdit--${pageName}");
|
|
|
|
@ -734,6 +754,7 @@ $(document).ready(function(){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//배경이미지 출력 순서 고정
|
|
|
|
|
$P.validForBackground = (eventInfo) => {
|
|
|
|
|
if(eventInfo.clickedButtonType == "up"){
|
|
|
|
|
if($P.fnGetElement(eventInfo.siblingRow,"otptArtclNm").value == "background"){
|
|
|
|
@ -751,6 +772,30 @@ $(document).ready(function(){
|
|
|
|
|
return true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$P.fnBgDown = () => {
|
|
|
|
|
var a = document.createElement("a");
|
|
|
|
|
a.href = $P.otptGlobalStng.BCRN_IMG_PATH;
|
|
|
|
|
a.download = $P.otptGlobalStng.BCRN_IMG_FILE_NM;
|
|
|
|
|
document.getElementById("tempArea--${pageName}").appendChild(a);
|
|
|
|
|
a.click();
|
|
|
|
|
document.getElementById("tempArea--${pageName}").removeChild(a);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$P.fnBgUpload = (fileElement) => {
|
|
|
|
|
if(fileElement.files == null || fileElement.files.length == 0){
|
|
|
|
|
if($P.otptGlobalStng.BCRN_IMG_PATH == null || $P.otptGlobalStng.BCRN_IMG_PATH == ""){
|
|
|
|
|
$("#fileStatus--sprt01200-main").text("없음");
|
|
|
|
|
$("#btnBgDown--${pageName}").attr("hidden","hidden");
|
|
|
|
|
} else {
|
|
|
|
|
$("#fileStatus--sprt01200-main").text($P.otptGlobalStng.BCRN_IMG_FILE_NM);
|
|
|
|
|
$("#btnBgDown--${pageName}").removeAttr("hidden");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
$("#fileStatus--sprt01200-main").text("이미지 변경됨");
|
|
|
|
|
$("#btnBgDown--${pageName}").attr("hidden","hidden");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$("#theadUnique--${pageName}").html($("#theadTr--${pageName}")[0].innerHTML);
|
|
|
|
|
$("#theadMultiple--${pageName}").html($("#theadTr--${pageName}")[0].innerHTML);
|
|
|
|
|
|
|
|
|
|