|
|
|
@ -8,7 +8,7 @@
|
|
|
|
|
<div class="row mb-3 justify-content-start">
|
|
|
|
|
<div class="col-md-12">
|
|
|
|
|
<div class="float-start">
|
|
|
|
|
<form id="frmSearch--${pageName}" name="frmSearch">
|
|
|
|
|
<form name="frmSearch">
|
|
|
|
|
<input type="hidden" name="sggCd" />
|
|
|
|
|
업무
|
|
|
|
|
<select class="form-select" name="taskSeCd">
|
|
|
|
@ -27,28 +27,28 @@
|
|
|
|
|
<option value="${item.code}">${item.value}</option>
|
|
|
|
|
</c:forEach>
|
|
|
|
|
</select>
|
|
|
|
|
<button type="button" id="btnLoad--${pageName}" class="btn btn-primary">불러오기</button>
|
|
|
|
|
<button type="button" name="btnLoad" class="btn btn-primary">불러오기</button>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="float-end">
|
|
|
|
|
<input type="checkbox" id="viewSample--${pageName}" />
|
|
|
|
|
<label for="viewSample--${pageName}">저장 후 샘플 보기</label>
|
|
|
|
|
<button type="button" id="btnSave--${pageName}" class="btn btn-primary">저장</button>
|
|
|
|
|
<input type="checkbox" is="id-input" name="viewSample" />
|
|
|
|
|
<label is="name-label" for="viewSample">저장 후 샘플 보기</label>
|
|
|
|
|
<button type="button" name="btnSave" class="btn btn-primary">저장</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="d-flex justify-content-between">
|
|
|
|
|
<span id="currentOtpt--${pageName}" class="bg-lighter h3 h-px-30">
|
|
|
|
|
<span name="currentOtpt" class="bg-lighter h3 h-px-30">
|
|
|
|
|
</span>
|
|
|
|
|
<form id="frmEdit--${pageName}">
|
|
|
|
|
<form name="frmEdit">
|
|
|
|
|
<input type="hidden" name="sggCd" />
|
|
|
|
|
<input type="hidden" name="taskSeCd" />
|
|
|
|
|
<input type="hidden" name="sndngSeCd" />
|
|
|
|
|
<input type="hidden" name="paperSeCd" />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<span id="otptGlobalStng--${pageName}">
|
|
|
|
|
<span name="otptGlobalStng">
|
|
|
|
|
</span>
|
|
|
|
|
</form>
|
|
|
|
|
</div>
|
|
|
|
@ -57,23 +57,24 @@
|
|
|
|
|
<div class="col-md-12">
|
|
|
|
|
<div class="float-start">
|
|
|
|
|
<strong>단일 출력 항목</strong>
|
|
|
|
|
<button type="button" id="btnUniqueAdd--${pageName}"
|
|
|
|
|
<button type="button" name="btnUniqueAdd"
|
|
|
|
|
class="btn btn-info dropdown-toggle" data-bs-toggle="dropdown">추가</button>
|
|
|
|
|
<ul id="dropdownUniqueAdd--${pageName}" class="dropdown-menu oy-scroll mh-px-250">
|
|
|
|
|
<ul name="dropdownUniqueAdd" class="dropdown-menu oy-scroll mh-px-250">
|
|
|
|
|
</ul>
|
|
|
|
|
<button type="button" id="btnUniqueDel--${pageName}" class="btn btn-info">☑ 삭제</button>
|
|
|
|
|
<button type="button" name="btnUniqueDel"
|
|
|
|
|
class="btn btn-info">☑ 삭제</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="card-datatable text-nowrap mb-3">
|
|
|
|
|
<div class="dataTables_wrapper dt-bootstrap5 no-footer">
|
|
|
|
|
<div id="scrollUnique--${pageName}" class="table-responsive ox-scroll oy-scroll h-px-300">
|
|
|
|
|
<table
|
|
|
|
|
class="table-layout-fixed compress-cell dataTable table table-bordered"
|
|
|
|
|
id="tableUnique--${pageName}" aria-describedby="DataTables_Table_0_info">
|
|
|
|
|
<thead class="sticky-thead" id="theadUnique--${pageName}">
|
|
|
|
|
<div name="scrollUnique"
|
|
|
|
|
class="table-responsive ox-scroll oy-scroll h-px-300">
|
|
|
|
|
<table name="tableUnique"
|
|
|
|
|
class="table-layout-fixed compress-cell dataTable table table-bordered">
|
|
|
|
|
<thead class="sticky-thead" name="theadUnique">
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody id="tbodyUnique--${pageName}">
|
|
|
|
|
<tbody name="tbodyUnique">
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
@ -84,20 +85,22 @@
|
|
|
|
|
<div class="col-md-12">
|
|
|
|
|
<div class="float-start">
|
|
|
|
|
<strong>복수 출력 가능 항목</strong>
|
|
|
|
|
<button type="button" id="btnMultipleAdd--${pageName}" class="btn btn-info">+ 추가</button>
|
|
|
|
|
<button type="button" id="btnMultipleDel--${pageName}" class="btn btn-info">☑ 삭제</button>
|
|
|
|
|
<button type="button" name="btnMultipleAdd"
|
|
|
|
|
class="btn btn-info">+ 추가</button>
|
|
|
|
|
<button type="button" name="btnMultipleDel"
|
|
|
|
|
class="btn btn-info">☑ 삭제</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="card-datatable text-nowrap mb-3">
|
|
|
|
|
<div class="dataTables_wrapper dt-bootstrap5 no-footer">
|
|
|
|
|
<div id="scrollMultiple--${pageName}" class="table-responsive ox-scroll oy-scroll h-px-300">
|
|
|
|
|
<table
|
|
|
|
|
class="table-layout-fixed compress-cell dataTable table table-bordered"
|
|
|
|
|
id="tableMultiple--${pageName}" aria-describedby="DataTables_Table_0_info">
|
|
|
|
|
<thead class="sticky-thead" id="theadMultiple--${pageName}">
|
|
|
|
|
<div name="scrollMultiple"
|
|
|
|
|
class="table-responsive ox-scroll oy-scroll h-px-300">
|
|
|
|
|
<table name="tableMultiple"
|
|
|
|
|
class="table-layout-fixed compress-cell dataTable table table-bordered">
|
|
|
|
|
<thead class="sticky-thead" name="theadMultiple">
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody id="tbodyMultiple--${pageName}">
|
|
|
|
|
<tbody name="tbodyMultiple">
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
@ -107,9 +110,9 @@
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<span id="tempArea--${pageName}" hidden></span>
|
|
|
|
|
<span name="tempArea" hidden></span>
|
|
|
|
|
|
|
|
|
|
<template id="theadTr--${pageName}">
|
|
|
|
|
<template name="theadTr">
|
|
|
|
|
<tr>
|
|
|
|
|
<th style="width:150px">순서</th>
|
|
|
|
|
<th style="width:40px"></th>
|
|
|
|
@ -129,7 +132,7 @@
|
|
|
|
|
</tr>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template id="found--${pageName}">
|
|
|
|
|
<template name="found">
|
|
|
|
|
<tr data-key="{OTPT_FORM_ID}">
|
|
|
|
|
<td data-col="otptArtclSeq" class="text-center">
|
|
|
|
|
<button type="button">▲</button>
|
|
|
|
@ -215,11 +218,11 @@
|
|
|
|
|
</tr>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template id="dropdownTemplate--${pageName}">
|
|
|
|
|
<template name="dropdownTemplate">
|
|
|
|
|
<li><a class="dropdown-item" onclick="{onclick}">{DSCRP}</a></li>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template id="foldLinePstnTemplate--${pageName}">
|
|
|
|
|
<template name="foldLinePstnTemplate">
|
|
|
|
|
<span class="px-2">
|
|
|
|
|
<label class="col-form-label bg-lighter px-2">접는선 위치</label>
|
|
|
|
|
<label>
|
|
|
|
@ -235,17 +238,17 @@
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template id="bcrnTemplate--${pageName}">
|
|
|
|
|
<template name="bcrnTemplate">
|
|
|
|
|
<span class="px-2">
|
|
|
|
|
<label class="col-form-label bg-lighter px-2">배경이미지</label>
|
|
|
|
|
<output id="fileStatus--${pageName}"></output>
|
|
|
|
|
<output name="fileStatus"></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>
|
|
|
|
|
<button type="button" name="btnBgDown" onclick="pageObject['${pageName}'].fnBgDown();">다운로드</button>
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<template id="photoCntTemplate--${pageName}">
|
|
|
|
|
<template name="photoCntTemplate">
|
|
|
|
|
<span class="px-2">
|
|
|
|
|
<label class="col-form-label bg-lighter px-2">사진 출력 영역</label>
|
|
|
|
|
<input type="number" name="otptPhotoCnt" class="form-control w-px-50" min="0" max="6" /> 장
|
|
|
|
@ -266,36 +269,36 @@ $(document).ready(function(){
|
|
|
|
|
$P.otptGlobalStng = {};
|
|
|
|
|
$P.otptArtclStngMap = {};
|
|
|
|
|
|
|
|
|
|
$("#btnSave--${pageName}").attr("disabled","disabled");
|
|
|
|
|
$("#btnUniqueAdd--${pageName}").attr("disabled","disabled");
|
|
|
|
|
$("#btnUniqueDel--${pageName}").attr("disabled","disabled");
|
|
|
|
|
$("#btnMultipleAdd--${pageName}").attr("disabled","disabled");
|
|
|
|
|
$("#btnMultipleDel--${pageName}").attr("disabled","disabled");
|
|
|
|
|
$P.$find("btnSave").attr("disabled","disabled");
|
|
|
|
|
$P.$find("btnUniqueAdd").attr("disabled","disabled");
|
|
|
|
|
$P.$find("btnUniqueDel").attr("disabled","disabled");
|
|
|
|
|
$P.$find("btnMultipleAdd").attr("disabled","disabled");
|
|
|
|
|
$P.$find("btnMultipleDel").attr("disabled","disabled");
|
|
|
|
|
|
|
|
|
|
$P.fnLoad = () => {
|
|
|
|
|
|
|
|
|
|
var formFields = new FimsFormFields("#frmSearch--${pageName}");
|
|
|
|
|
var formFields = new FimsFormFields($P.selector("frmSearch"));
|
|
|
|
|
var query = formFields.get();
|
|
|
|
|
ajax.post({
|
|
|
|
|
url : wctx.url("/stng/stng01/010/info.do"),
|
|
|
|
|
data : query,
|
|
|
|
|
success : (resp) => {
|
|
|
|
|
$("#btnSave--${pageName}").removeAttr("disabled");
|
|
|
|
|
$("#btnUniqueAdd--${pageName}").removeAttr("disabled");
|
|
|
|
|
$("#btnUniqueDel--${pageName}").removeAttr("disabled");
|
|
|
|
|
$("#btnMultipleAdd--${pageName}").removeAttr("disabled");
|
|
|
|
|
$("#btnMultipleDel--${pageName}").removeAttr("disabled");
|
|
|
|
|
$("#currentOtpt--${pageName}").text("");
|
|
|
|
|
$("#otptGlobalStng--${pageName}").html("");
|
|
|
|
|
$("#tbodyUnique--${pageName}").html("");
|
|
|
|
|
$("#tbodyMultiple--${pageName}").html("");
|
|
|
|
|
|
|
|
|
|
$("#frmEdit--${pageName}").find("[name='sggCd']").val(query.sggCd);
|
|
|
|
|
$("#frmEdit--${pageName}").find("[name='taskSeCd']").val(query.taskSeCd);
|
|
|
|
|
$("#frmEdit--${pageName}").find("[name='sndngSeCd']").val(query.sndngSeCd);
|
|
|
|
|
$("#frmEdit--${pageName}").find("[name='paperSeCd']").val(query.paperSeCd);
|
|
|
|
|
|
|
|
|
|
$("#currentOtpt--${pageName}").text(resp.otptStngTitle);
|
|
|
|
|
$P.$find("btnSave").removeAttr("disabled");
|
|
|
|
|
$P.$find("btnUniqueAdd").removeAttr("disabled");
|
|
|
|
|
$P.$find("btnUniqueDel").removeAttr("disabled");
|
|
|
|
|
$P.$find("btnMultipleAdd").removeAttr("disabled");
|
|
|
|
|
$P.$find("btnMultipleDel").removeAttr("disabled");
|
|
|
|
|
$P.$find("currentOtpt").text("");
|
|
|
|
|
$P.$find("otptGlobalStng").html("");
|
|
|
|
|
$P.$find("tbodyUnique").html("");
|
|
|
|
|
$P.$find("tbodyMultiple").html("");
|
|
|
|
|
|
|
|
|
|
$P.$find("frmEdit").find("[name='sggCd']").val(query.sggCd);
|
|
|
|
|
$P.$find("frmEdit").find("[name='taskSeCd']").val(query.taskSeCd);
|
|
|
|
|
$P.$find("frmEdit").find("[name='sndngSeCd']").val(query.sndngSeCd);
|
|
|
|
|
$P.$find("frmEdit").find("[name='paperSeCd']").val(query.paperSeCd);
|
|
|
|
|
|
|
|
|
|
$P.$find("currentOtpt").text(resp.otptStngTitle);
|
|
|
|
|
if(resp.otptGlobalStng != null){
|
|
|
|
|
$P.otptGlobalStng = resp.otptGlobalStng;
|
|
|
|
|
} else {
|
|
|
|
@ -311,10 +314,10 @@ $(document).ready(function(){
|
|
|
|
|
|
|
|
|
|
$P.renderOtptGlobalStng($P.otptGlobalStng);
|
|
|
|
|
|
|
|
|
|
$P.renderOtptArtclStngGrid("tbodyUnique--${pageName}",
|
|
|
|
|
$P.renderOtptArtclStngGrid("tbodyUnique",
|
|
|
|
|
$P.otptArtclStngMap.unique.prototypeList,
|
|
|
|
|
$P.otptArtclStngMap.unique.dataList);
|
|
|
|
|
$P.renderOtptArtclStngGrid("tbodyMultiple--${pageName}",
|
|
|
|
|
$P.renderOtptArtclStngGrid("tbodyMultiple",
|
|
|
|
|
$P.otptArtclStngMap.multiple.prototypeList,
|
|
|
|
|
$P.otptArtclStngMap.multiple.dataList);
|
|
|
|
|
}
|
|
|
|
@ -324,17 +327,17 @@ $(document).ready(function(){
|
|
|
|
|
|
|
|
|
|
//출력 전역 설정 렌더링
|
|
|
|
|
$P.renderOtptGlobalStng = (otptGlobalStng) => {
|
|
|
|
|
var paperSeCd = $("#frmEdit--${pageName}").find("[name='paperSeCd']").val();
|
|
|
|
|
var editForm = $("#frmEdit--${pageName}");
|
|
|
|
|
var paperSeCd = $P.$find("frmEdit").find("[name='paperSeCd']").val();
|
|
|
|
|
var editForm = $P.$find("frmEdit");
|
|
|
|
|
|
|
|
|
|
//설정ID
|
|
|
|
|
$("#otptGlobalStng--${pageName}").append("<input type='hidden' name='otptBscId' />");
|
|
|
|
|
$P.$find("otptGlobalStng").append("<input type='hidden' name='otptBscId' />");
|
|
|
|
|
editForm.find("input[name='otptBscId']").val(otptGlobalStng.OTPT_BSC_ID);
|
|
|
|
|
|
|
|
|
|
//접는선 위치
|
|
|
|
|
$("#otptGlobalStng--${pageName}").append(document.getElementById("foldLinePstnTemplate--${pageName}").innerHTML);
|
|
|
|
|
$P.$find("otptGlobalStng").append($P.find("foldLinePstnTemplate").innerHTML);
|
|
|
|
|
if(paperSeCd == "02"){
|
|
|
|
|
$("#otptGlobalStng--${pageName}").find("label").eq(3).remove();
|
|
|
|
|
$P.$find("otptGlobalStng").find("label").eq(3).remove();
|
|
|
|
|
}
|
|
|
|
|
if(otptGlobalStng.FOLD_LINE_PSTN_SE_CD == null){
|
|
|
|
|
otptGlobalStng.FOLD_LINE_PSTN_SE_CD = "";
|
|
|
|
@ -344,19 +347,19 @@ $(document).ready(function(){
|
|
|
|
|
.prop("checked", true);
|
|
|
|
|
|
|
|
|
|
//배경이미지
|
|
|
|
|
$("#otptGlobalStng--${pageName}").append(document.getElementById("bcrnTemplate--${pageName}").innerHTML);
|
|
|
|
|
$P.$find("otptGlobalStng").append($P.find("bcrnTemplate").innerHTML);
|
|
|
|
|
if(otptGlobalStng.BCRN_IMG_PATH == null || otptGlobalStng.BCRN_IMG_PATH == ""){
|
|
|
|
|
$("#fileStatus--${pageName}").text("없음");
|
|
|
|
|
$("#fileStatus--${pageName}").attr("title","");
|
|
|
|
|
$("#btnBgDown--${pageName}").attr("hidden","hidden");
|
|
|
|
|
$P.$find("fileStatus").text("없음");
|
|
|
|
|
$P.$find("fileStatus").attr("title","");
|
|
|
|
|
$P.$find("btnBgDown").attr("hidden","hidden");
|
|
|
|
|
} else {
|
|
|
|
|
$("#fileStatus--${pageName}").text("있음");
|
|
|
|
|
$("#fileStatus--${pageName}").attr("title",otptGlobalStng.BCRN_IMG_FILE_NM);
|
|
|
|
|
$("#btnBgDown--${pageName}").removeAttr("hidden");
|
|
|
|
|
$P.$find("fileStatus").text("있음");
|
|
|
|
|
$P.$find("fileStatus").attr("title",otptGlobalStng.BCRN_IMG_FILE_NM);
|
|
|
|
|
$P.$find("btnBgDown").removeAttr("hidden");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//출력 사진 건 수
|
|
|
|
|
$("#otptGlobalStng--${pageName}").append(document.getElementById("photoCntTemplate--${pageName}").innerHTML);
|
|
|
|
|
$P.$find("otptGlobalStng").append($P.find("photoCntTemplate").innerHTML);
|
|
|
|
|
if(otptGlobalStng.OTPT_PHOTO_CNT == null || otptGlobalStng.OTPT_PHOTO_CNT == ""){
|
|
|
|
|
otptGlobalStng.OTPT_PHOTO_CNT = 0;
|
|
|
|
|
}
|
|
|
|
@ -364,7 +367,7 @@ $(document).ready(function(){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//출력 요소 그리드 렌더링
|
|
|
|
|
$P.renderOtptArtclStngGrid = (tbodyId, prototypeList, dataList) => {
|
|
|
|
|
$P.renderOtptArtclStngGrid = (tbodyName, prototypeList, dataList) => {
|
|
|
|
|
|
|
|
|
|
var components = "<option value='' data-component-type=''>선택</option>";
|
|
|
|
|
|
|
|
|
@ -375,13 +378,13 @@ $(document).ready(function(){
|
|
|
|
|
|
|
|
|
|
for(var i=0; i < dataList.length; i++){
|
|
|
|
|
var data = dataList[i];
|
|
|
|
|
var found = document.getElementById("found--${pageName}").innerHTML;
|
|
|
|
|
var found = $P.find("found").innerHTML;
|
|
|
|
|
|
|
|
|
|
found = found.replace(/{OTPT_FORM_ID}/gi, data.OTPT_FORM_ID);
|
|
|
|
|
found = found.replace(/{COMPONENTS}/gi, components);
|
|
|
|
|
$("#"+tbodyId).append(found);
|
|
|
|
|
$P.$find(tbodyName).append(found);
|
|
|
|
|
|
|
|
|
|
var lastTr = $("#"+tbodyId).find("tr").last()[0];
|
|
|
|
|
var lastTr = $P.$find(tbodyName).find("tr").last()[0];
|
|
|
|
|
|
|
|
|
|
fnMakeOptionStyleSelect($P.fnGetElement(lastTr,"fontNm"));
|
|
|
|
|
fnMakeOptionStyleSelect($P.fnGetElement(lastTr,"fontColr"));
|
|
|
|
@ -413,9 +416,9 @@ $(document).ready(function(){
|
|
|
|
|
.set(!isEmpty(data.FONT_STYLE) ? data.FONT_STYLE : $P.fnGetProto(prototypeList, data.OTPT_ARTCL_NM, "fontStyle"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$("#"+tbodyId).find("tr").each(function(){
|
|
|
|
|
$P.$find(tbodyName).find("tr").each(function(){
|
|
|
|
|
|
|
|
|
|
if(tbodyId == "tbodyUnique--${pageName}"){
|
|
|
|
|
if(tbodyName == "tbodyUnique"){
|
|
|
|
|
var el = $P.fnGetElement(this,"otptArtclNm");
|
|
|
|
|
$(el).attr("disabled","disabled");
|
|
|
|
|
$(el).addClass("no-bgi");
|
|
|
|
@ -426,16 +429,16 @@ $(document).ready(function(){
|
|
|
|
|
var toNext = $(sel).siblings()[1];
|
|
|
|
|
fnMakeSpinnerSelect(sel, toPrev, toNext);
|
|
|
|
|
|
|
|
|
|
var scrollDiv = "";
|
|
|
|
|
if(tbodyId == "tbodyUnique--${pageName}"){
|
|
|
|
|
scrollDiv = "scrollUnique--${pageName}";
|
|
|
|
|
var scrollDivName = "";
|
|
|
|
|
if(tbodyName == "tbodyUnique"){
|
|
|
|
|
scrollDivName = "scrollUnique";
|
|
|
|
|
} else {
|
|
|
|
|
scrollDiv = "scrollMultiple--${pageName}";
|
|
|
|
|
scrollDivName = "scrollMultiple";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var rowSpinButtons = $(this).find("td[data-col='otptArtclSeq']").find("button");
|
|
|
|
|
|
|
|
|
|
fnMakeRowSpinner(this,rowSpinButtons[0],rowSpinButtons[1],document.getElementById(scrollDiv), $P.validForBackground);
|
|
|
|
|
fnMakeRowSpinner(this,rowSpinButtons[0],rowSpinButtons[1],$P.find(scrollDivName), $P.validForBackground);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -445,7 +448,7 @@ $(document).ready(function(){
|
|
|
|
|
|
|
|
|
|
$P.fnGetProto = (prototypeList, otptArtclNm, stngItemAttrNm) => {
|
|
|
|
|
if(stngItemAttrNm == "leftPstn" || stngItemAttrNm == "topPstn"){
|
|
|
|
|
var paperSeCd = $("#frmEdit--${pageName}").find("[name='paperSeCd']").val();
|
|
|
|
|
var paperSeCd = $P.$find("frmEdit").find("[name='paperSeCd']").val();
|
|
|
|
|
var paperNm = "";
|
|
|
|
|
if(paperSeCd == "01"){
|
|
|
|
|
paperNm = "a4";
|
|
|
|
@ -469,47 +472,47 @@ $(document).ready(function(){
|
|
|
|
|
|
|
|
|
|
//출력 요소 선택
|
|
|
|
|
$P.choiceOtptArtclNm = () => {
|
|
|
|
|
$("#dropdownUniqueAdd--${pageName}").html("");
|
|
|
|
|
$P.$find("dropdownUniqueAdd").html("");
|
|
|
|
|
|
|
|
|
|
var prototypeList = $P.otptArtclStngMap.unique.prototypeList;
|
|
|
|
|
var existArr = [];
|
|
|
|
|
|
|
|
|
|
$("#tbodyUnique--${pageName} tr").each(function(){
|
|
|
|
|
$P.$find("tbodyUnique").find("tr").each(function(){
|
|
|
|
|
var el = $P.fnGetElement(this,"otptArtclNm");
|
|
|
|
|
existArr.push($(el).val());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var selectableArr = prototypeList.filter(item => existArr.indexOf(item.artclNm) == -1);
|
|
|
|
|
|
|
|
|
|
var template = document.getElementById("dropdownTemplate--${pageName}");
|
|
|
|
|
var template = $P.find("dropdownTemplate");
|
|
|
|
|
|
|
|
|
|
if(selectableArr.length < 1){
|
|
|
|
|
var li = template.innerHTML;
|
|
|
|
|
li = li.replace(/{onclick}/gi, "");
|
|
|
|
|
li = li.replace(/{DSCRP}/gi, "추가할 수 있는 항목이 없습니다.");
|
|
|
|
|
$("#dropdownUniqueAdd--${pageName}").append(li);
|
|
|
|
|
$P.$find("dropdownUniqueAdd").append(li);
|
|
|
|
|
} else {
|
|
|
|
|
for(var i=0; i < selectableArr.length; i++){
|
|
|
|
|
var li = template.innerHTML;
|
|
|
|
|
li = li.replace(/{onclick}/gi, "pageObject['${pageName}'].addRow('" + selectableArr[i].artclNm + "')");
|
|
|
|
|
li = li.replace(/{DSCRP}/gi, selectableArr[i].artclDscrp);
|
|
|
|
|
$("#dropdownUniqueAdd--${pageName}").append(li);
|
|
|
|
|
$P.$find("dropdownUniqueAdd").append(li);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//행 추가
|
|
|
|
|
$P.addRow = (otptArtclNm) => {
|
|
|
|
|
var paperSeCd = $("#frmEdit--${pageName}").find("[name='paperSeCd']").val();
|
|
|
|
|
var paperSeCd = $P.$find("frmEdit").find("[name='paperSeCd']").val();
|
|
|
|
|
var prototypeList;
|
|
|
|
|
var tbodyId;
|
|
|
|
|
var tbodyName;
|
|
|
|
|
|
|
|
|
|
if(otptArtclNm == null || otptArtclNm == ""){
|
|
|
|
|
prototypeList = $P.otptArtclStngMap.multiple.prototypeList;
|
|
|
|
|
tbodyId = "tbodyMultiple--${pageName}";
|
|
|
|
|
tbodyName = "tbodyMultiple";
|
|
|
|
|
} else {
|
|
|
|
|
prototypeList = $P.otptArtclStngMap.unique.prototypeList;
|
|
|
|
|
tbodyId = "tbodyUnique--${pageName}";
|
|
|
|
|
tbodyName = "tbodyUnique";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var components = "<option value='' data-component-type=''>선택</option>";
|
|
|
|
@ -517,25 +520,25 @@ $(document).ready(function(){
|
|
|
|
|
var p = prototypeList[i];
|
|
|
|
|
components += "<option value='"+p.artclNm+"' data-component-type='"+p.componentType+"'>"+p.artclDscrp+"</option>";
|
|
|
|
|
}
|
|
|
|
|
var template = document.getElementById("found--${pageName}").innerHTML;
|
|
|
|
|
var template = $P.find("found").innerHTML;
|
|
|
|
|
template = template.replace(/{OTPT_FORM_ID}/gi, "");
|
|
|
|
|
template = template.replace(/{COMPONENTS}/gi, components);
|
|
|
|
|
$("#"+tbodyId).append(template);
|
|
|
|
|
$P.$find(tbodyName).append(template);
|
|
|
|
|
|
|
|
|
|
var lastTr = $("#"+tbodyId).find("tr").last()[0];
|
|
|
|
|
var lastTr = $P.$find(tbodyName).find("tr").last()[0];
|
|
|
|
|
|
|
|
|
|
fnMakeOptionStyleSelect($P.fnGetElement(lastTr,"fontNm"));
|
|
|
|
|
fnMakeOptionStyleSelect($P.fnGetElement(lastTr,"fontColr"));
|
|
|
|
|
fnMakeOptionStyleSelect($P.fnGetElement(lastTr,"fontStyle"));
|
|
|
|
|
|
|
|
|
|
var scrollDiv = "";
|
|
|
|
|
if(tbodyId == "tbodyUnique--${pageName}"){
|
|
|
|
|
scrollDiv = "scrollUnique--${pageName}";
|
|
|
|
|
var scrollDivName = "";
|
|
|
|
|
if(tbodyName == "tbodyUnique"){
|
|
|
|
|
scrollDivName = "scrollUnique";
|
|
|
|
|
} else {
|
|
|
|
|
scrollDiv = "scrollMultiple--${pageName}";
|
|
|
|
|
scrollDivName = "scrollMultiple";
|
|
|
|
|
}
|
|
|
|
|
var rowSpinButtons = $(lastTr).find("td[data-col='otptArtclSeq']").find("button");
|
|
|
|
|
fnMakeRowSpinner(lastTr,rowSpinButtons[0],rowSpinButtons[1],document.getElementById(scrollDiv), $P.validForBackground);
|
|
|
|
|
fnMakeRowSpinner(lastTr,rowSpinButtons[0],rowSpinButtons[1],$P.find(scrollDivName), $P.validForBackground);
|
|
|
|
|
|
|
|
|
|
if(otptArtclNm != null && otptArtclNm != ""){
|
|
|
|
|
|
|
|
|
@ -567,7 +570,7 @@ $(document).ready(function(){
|
|
|
|
|
.set($P.fnGetProto(prototypeList, otptArtclNm, "fontStyle"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(tbodyId == "tbodyUnique--${pageName}"){
|
|
|
|
|
if(tbodyName == "tbodyUnique"){
|
|
|
|
|
var el = $P.fnGetElement(lastTr,"otptArtclNm");
|
|
|
|
|
$(el).attr("disabled","disabled");
|
|
|
|
|
$(el).addClass("no-bgi");
|
|
|
|
@ -579,43 +582,43 @@ $(document).ready(function(){
|
|
|
|
|
var toNext = $(sel).siblings()[1];
|
|
|
|
|
fnMakeSpinnerSelect(sel, toPrev, toNext);
|
|
|
|
|
|
|
|
|
|
if(tbodyId == "tbodyUnique--${pageName}"){
|
|
|
|
|
$("#scrollUnique--${pageName}").scrollTop($("#scrollUnique--${pageName}")[0].scrollHeight);
|
|
|
|
|
if(tbodyName == "tbodyUnique"){
|
|
|
|
|
$P.$find("scrollUnique").scrollTop($P.find("scrollUnique").scrollHeight);
|
|
|
|
|
} else {
|
|
|
|
|
$("#scrollMultiple--${pageName}").scrollTop($("#scrollMultiple--${pageName}")[0].scrollHeight);
|
|
|
|
|
$P.$find("scrollMultiple").scrollTop($P.find("scrollMultiple").scrollHeight);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(otptArtclNm == "background"){ //배경이미지 순서 보정
|
|
|
|
|
if($("#tbodyUnique--${pageName}").find("tr").length >= 2){
|
|
|
|
|
$("#tbodyUnique--${pageName}").find("tr").eq(0).before(lastTr);
|
|
|
|
|
if($P.$find("tbodyUnique").find("tr").length >= 2){
|
|
|
|
|
$P.$find("tbodyUnique").find("tr").eq(0).before(lastTr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//행 삭제
|
|
|
|
|
$P.delRow = (tbodyId) => {
|
|
|
|
|
$P.delRow = (tbodyName) => {
|
|
|
|
|
|
|
|
|
|
if($("#"+tbodyId).find("tr").length <= 0){
|
|
|
|
|
if($P.$find(tbodyName).find("tr").length <= 0){
|
|
|
|
|
alert('삭제할 항목이 없습니다.');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($("#"+tbodyId).find("input[name='del'][type='checkbox']:checked").length <= 0){
|
|
|
|
|
if($P.$find(tbodyName).find("input[name='del'][type='checkbox']:checked").length <= 0){
|
|
|
|
|
alert('체크된 항목이 없습니다.');
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$("#"+tbodyId).find("tr").filter(function(index, selector){
|
|
|
|
|
if($(selector).find("input[name='del'][type='checkbox']").is(":checked")){
|
|
|
|
|
$(selector).remove();
|
|
|
|
|
$P.$find(tbodyName).find("tr").filter(function(index, item){
|
|
|
|
|
if($(item).find("input[name='del'][type='checkbox']").is(":checked")){
|
|
|
|
|
$(item).remove();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//출력 요소 변경
|
|
|
|
|
$P.fnChangeComponent = (selectElement) => {
|
|
|
|
|
if($("#tbodyMultiple--${pageName}").find(selectElement).length <= 0){
|
|
|
|
|
if($P.$find("tbodyMultiple").find(selectElement).length <= 0){
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -652,9 +655,9 @@ $(document).ready(function(){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//출력 요소 설정 값 추출
|
|
|
|
|
$P.getRowData = (tbodyId, formData) => {
|
|
|
|
|
$P.getRowData = (tbodyName, formData) => {
|
|
|
|
|
var rowArr = [];
|
|
|
|
|
$("#"+tbodyId+" tr").each(function(){
|
|
|
|
|
$P.$find(tbodyName).find("tr").each(function(){
|
|
|
|
|
var row = {};
|
|
|
|
|
|
|
|
|
|
row.otptFormId = this.dataset.key;
|
|
|
|
@ -694,11 +697,11 @@ $(document).ready(function(){
|
|
|
|
|
$P.fnSave = () => {
|
|
|
|
|
|
|
|
|
|
//출력물 전역설정
|
|
|
|
|
var formData = new FormData(document.getElementById("frmEdit--${pageName}"));
|
|
|
|
|
var formData = new FormData($P.find("frmEdit"));
|
|
|
|
|
|
|
|
|
|
//출력 요소 설정
|
|
|
|
|
var rowArr1 = $P.getRowData("tbodyUnique--${pageName}", formData);
|
|
|
|
|
var rowArr2 = $P.getRowData("tbodyMultiple--${pageName}", formData);
|
|
|
|
|
var rowArr1 = $P.getRowData("tbodyUnique", formData);
|
|
|
|
|
var rowArr2 = $P.getRowData("tbodyMultiple", formData);
|
|
|
|
|
var rowArr = [...rowArr1, ...rowArr2];
|
|
|
|
|
for(var i=0; i<rowArr.length; i++){
|
|
|
|
|
if(rowArr[i].otptArtclNm == ""){
|
|
|
|
@ -719,19 +722,19 @@ $(document).ready(function(){
|
|
|
|
|
contentType : false, processData : false,
|
|
|
|
|
success : (resp) => {
|
|
|
|
|
if(resp.saved){
|
|
|
|
|
if(!$("#viewSample--${pageName}").is(":checked")){
|
|
|
|
|
if(!$P.$find("viewSample").is(":checked")){
|
|
|
|
|
dialog.alert("저장되었습니다.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var formFields = new FimsFormFields("#frmEdit--${pageName}").get();
|
|
|
|
|
$("#frmSearch--${pageName}").find("[name='sggCd']").val(formFields.sggCd);
|
|
|
|
|
$("#frmSearch--${pageName}").find("[name='taskSeCd']").val(formFields.taskSeCd);
|
|
|
|
|
$("#frmSearch--${pageName}").find("[name='sndngSeCd']").val(formFields.sndngSeCd);
|
|
|
|
|
$("#frmSearch--${pageName}").find("[name='paperSeCd']").val(formFields.paperSeCd);
|
|
|
|
|
var formFields = new FimsFormFields($P.selector("frmEdit")).get();
|
|
|
|
|
$P.$find("frmSearch").find("[name='sggCd']").val(formFields.sggCd);
|
|
|
|
|
$P.$find("frmSearch").find("[name='taskSeCd']").val(formFields.taskSeCd);
|
|
|
|
|
$P.$find("frmSearch").find("[name='sndngSeCd']").val(formFields.sndngSeCd);
|
|
|
|
|
$P.$find("frmSearch").find("[name='paperSeCd']").val(formFields.paperSeCd);
|
|
|
|
|
|
|
|
|
|
$("#btnLoad--${pageName}").click();
|
|
|
|
|
$P.$find("btnLoad").click();
|
|
|
|
|
|
|
|
|
|
if($("#viewSample--${pageName}").is(":checked")){
|
|
|
|
|
if($P.$find("viewSample").is(":checked")){
|
|
|
|
|
$P.fnMakeSampleFile();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -742,7 +745,7 @@ $(document).ready(function(){
|
|
|
|
|
//샘플파일 생성
|
|
|
|
|
$P.fnMakeSampleFile = () => {
|
|
|
|
|
|
|
|
|
|
var formFields = new FimsFormFields("#frmEdit--${pageName}");
|
|
|
|
|
var formFields = new FimsFormFields($P.selector("frmEdit"));
|
|
|
|
|
var submitParam = formFields.get();
|
|
|
|
|
submitParam.crdnIds = "sample";
|
|
|
|
|
|
|
|
|
@ -808,41 +811,41 @@ $(document).ready(function(){
|
|
|
|
|
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);
|
|
|
|
|
$P.find("tempArea").appendChild(a);
|
|
|
|
|
a.click();
|
|
|
|
|
document.getElementById("tempArea--${pageName}").removeChild(a);
|
|
|
|
|
$P.find("tempArea").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--${pageName}").text("없음");
|
|
|
|
|
$("#fileStatus--${pageName}").attr("title","");
|
|
|
|
|
$("#btnBgDown--${pageName}").attr("hidden","hidden");
|
|
|
|
|
$P.$find("fileStatus").text("없음");
|
|
|
|
|
$P.$find("fileStatus").attr("title","");
|
|
|
|
|
$P.$find("btnBgDown").attr("hidden","hidden");
|
|
|
|
|
} else {
|
|
|
|
|
$("#fileStatus--${pageName}").text("있음");
|
|
|
|
|
$("#fileStatus--${pageName}").attr("title", $P.otptGlobalStng.BCRN_IMG_FILE_NM);
|
|
|
|
|
$("#btnBgDown--${pageName}").removeAttr("hidden");
|
|
|
|
|
$P.$find("fileStatus").text("있음");
|
|
|
|
|
$P.$find("fileStatus").attr("title", $P.otptGlobalStng.BCRN_IMG_FILE_NM);
|
|
|
|
|
$P.$find("btnBgDown").removeAttr("hidden");
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
$("#fileStatus--${pageName}").text("이미지 변경됨");
|
|
|
|
|
$("#fileStatus--${pageName}").attr("title","");
|
|
|
|
|
$("#btnBgDown--${pageName}").attr("hidden","hidden");
|
|
|
|
|
$P.$find("fileStatus").text("이미지 변경됨");
|
|
|
|
|
$P.$find("fileStatus").attr("title","");
|
|
|
|
|
$P.$find("btnBgDown").attr("hidden","hidden");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$("#theadUnique--${pageName}").html($("#theadTr--${pageName}")[0].innerHTML);
|
|
|
|
|
$("#theadMultiple--${pageName}").html($("#theadTr--${pageName}")[0].innerHTML);
|
|
|
|
|
$P.$find("theadUnique").html($P.find("theadTr").innerHTML);
|
|
|
|
|
$P.$find("theadMultiple").html($P.find("theadTr").innerHTML);
|
|
|
|
|
|
|
|
|
|
$("#btnLoad--${pageName}").on("click", () => $P.fnLoad() );
|
|
|
|
|
$P.$find("btnLoad").on("click", () => $P.fnLoad() );
|
|
|
|
|
|
|
|
|
|
$("#btnUniqueAdd--${pageName}").on("click", () => $P.choiceOtptArtclNm() );
|
|
|
|
|
$("#btnMultipleAdd--${pageName}").on("click", () => $P.addRow() );
|
|
|
|
|
$P.$find("btnUniqueAdd").on("click", () => $P.choiceOtptArtclNm() );
|
|
|
|
|
$P.$find("btnMultipleAdd").on("click", () => $P.addRow() );
|
|
|
|
|
|
|
|
|
|
$("#btnUniqueDel--${pageName}").on("click", () => $P.delRow('tbodyUnique--${pageName}') );
|
|
|
|
|
$("#btnMultipleDel--${pageName}").on("click", () => $P.delRow('tbodyMultiple--${pageName}') );
|
|
|
|
|
$P.$find("btnUniqueDel").on("click", () => $P.delRow('tbodyUnique') );
|
|
|
|
|
$P.$find("btnMultipleDel").on("click", () => $P.delRow('tbodyMultiple') );
|
|
|
|
|
|
|
|
|
|
$("#btnSave--${pageName}").on("click", () => $P.fnSave() );
|
|
|
|
|
$P.$find("btnSave").on("click", () => $P.fnSave() );
|
|
|
|
|
|
|
|
|
|
var markerFinder = function(tr){
|
|
|
|
|
return $P.fnGetElement(tr,"otptArtclSeq");
|
|
|
|
@ -851,8 +854,8 @@ $(document).ready(function(){
|
|
|
|
|
marker.value = value;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
fnMakeRowNumberingTable(document.getElementById('tbodyUnique--${pageName}'), markerFinder, markerSetter);
|
|
|
|
|
fnMakeRowNumberingTable(document.getElementById('tbodyMultiple--${pageName}'), markerFinder, markerSetter);
|
|
|
|
|
fnMakeRowNumberingTable($P.find("tbodyUnique"), markerFinder, markerSetter);
|
|
|
|
|
fnMakeRowNumberingTable($P.find("tbodyMultiple"), markerFinder, markerSetter);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|