Merge remote-tracking branch 'origin/main'

dev
Jonguk. Lim 5 months ago
commit 1ec7a2b45c

@ -244,8 +244,7 @@
// 초기 화면 설정
$P.initForm = () => {
// Dialog 마우스로 드래그 할 수 있도록 설정.
fnMakeDraggableDialog(document.getElementById($P.control.prefix + "Dialog"));
}
/**************************************************************************

@ -386,8 +386,7 @@
// 초기 화면 설정
$P.initForm = () => {
// Dialog 마우스로 드래그 할 수 있도록 설정.
fnMakeDraggableDialog(document.getElementById($P.control.prefix + "Dialog"));
}

@ -0,0 +1,479 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<c:set var="prefixName" scope="request">폐기관리 등록</c:set>
<!-- inner page html -->
<div class="content-wrapper">
<!-- Content -->
<div class="container flex-grow-1 px-0 row g-1">
<!-- Page Body -->
<div class="card col-6">
<label class="form-label fw-bold form-search-title" for="Receipt--${pageName}">신청서 정보</label>
<div class="card-datatable text-nowrap">
<div class="dataTables_wrapper dt-bootstrap5 no-footer" id="DataTables_Table_0_wrapper--${pageName}">
<div class="table-responsive ox-scroll oy-scroll h-px-250" id="table-responsive--${pageName}">
<table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer" id="DataTables_Table_0--${pageName}" aria-describedby="DataTables_Table_0_info">
<thead class="sticky-thead">
<tr id="theadTr--${pageName}"
data-by="by--${pageName}" data-by-output="byOutput--${pageName}" data-main-option="mainOption--${pageName}" data-sub-option="subOption--${pageName}">
<th class="cmn" style="width: 72px;">No.</th>
<th class="cmn" style="width: 160.141px;">취급일자</th>
<th class="cmn" style="width: 160.141px;">관리번호</th>
<th class="cmn" style="width: 230.469px;">업체명</th>
<th class="cmn" style="width: 100px;">보고건수</th>
<th class="cmn" style="width: 230.469px;">처리상태</th>
<th class="cmn" style="width: 180px;">폐기구분</th>
<th class="cmn" style="width: 230.469px;">폐기사유</th>
<th class="cmn" style="width: 180px;">폐기방법</th>
<th class="cmn" style="width: 230.469px;">폐기장소</th>
<th class="cmn" style="width: 230.469px;">폐기일자</th>
</tr>
</thead>
<tbody id="tbody--${pageName}">
</tbody>
<template id="${infoPrefix}Row--${pageName}">
<tr data-key="{USR_RPT_ID_NO}">
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{ROW_NUM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{HDR_DE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSCDMNG_ID}</td>
<td class="cmn text-start" onclick="{onclick}" ondblclick="{ondblclick}">{BSSH_NM}</td>
<td class="cmn text-end" onclick="{onclick}" ondblclick="{ondblclick}">{RND_DTL_RPT_CNT}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{PRGRS_STTS_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_SE_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_PRV_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_MTH_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_LOC}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_DE}</td>
</tr>
</template>
<template id="${infoPrefix}NotFound--${pageName}">
<tr class="odd">
<td valign="top" colspan="13" class="dataTables_empty text-center">${prefixName} 정보를 찾지 못했습니다.</td>
</tr>
</template>
</table>
</div>
</div>
</div>
<!-- / DataTables(그리드) -->
<div class="card">
<label class="form-label fw-bold form-search-title" for="ReceiptDetail--${pageName}">제품 정보</label>
<div class="row g-1">
<div class="card-datatable text-nowrap">
<div class="dataTables_wrapper dt-bootstrap5 no-footer" id="DataTables_Table_1_wrapper--${pageName}">
<div class="table-responsive ox-scroll oy-scroll h-px-300" id="table-responsive-1--${pageName}">
<table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer"
id="DataTables_Table_1--${pageName}" aria-describedby="DataTables_Table_0_info">
<thead class="sticky-thead">
<tr>
<th class="cmn" style="width: 72px;">No.</th>
<th class="sorting sorting_asc" aria-sort="ascending" style="width: 223.719px;">제품명</th>
<th class="sorting" style="width: 146.156px;">제품코드</th>
<th class="sorting" style="width: 160.141px;">폐기수량</th>
<th class="sorting" style="width: 230.469px;">유효기간</th>
<th class="sorting" style="width: 230.469px;">최소 유통단위 수량</th>
<th class="sorting" style="width: 230.469px;">낱개 단위 수량</th>
<th class="sorting" style="width: 230.469px;">폐기 수량</th>
</tr>
</thead>
<tbody id="tbody--${pageName}Detail">
</tbody>
<template id="${infoPrefix}Row--${pageName}Detail">
<tr data-key="{USR_RPT_ID_NO}">
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{ROW_NUM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{PRDUCT_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{PRDUCT_CD}</td>
<td class="cmn text-start" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_QY}</td>
<td class="cmn text-end" onclick="{onclick}" ondblclick="{ondblclick}">{PRD_VALID_DE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{MIN_DISTB}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{PCE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_QY}</td>
</tr>
</template>
<template id="${infoPrefix}NotFound--${pageName}Detail">
<tr class="odd">
<td valign="top" colspan="5" class="dataTables_empty text-center">${prefixName} 상세 정보를 찾지 못했습니다.</td>
</tr>
</template>
</table>
</div>
</div>
</div> <!-- / DataTables(그리드) -->
</div> <!-- <div class="row g-1"> -->
</div>
</div> <!-- <div class="card"> -->
<div class="card col-6">
<label class="form-label fw-bold form-search-title" for="Rslt--${pageName}">결과 정보</label>
<div class="card-datatable text-nowrap">
<div class="dataTables_wrapper dt-bootstrap5 no-footer" id="DataTables_Table_0_wrapper--${pageName}">
<div class="table-responsive ox-scroll oy-scroll h-px-250" id="table-responsive--${pageName}">
<table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer" id="DataTables_Table_0--${pageName}" aria-describedby="DataTables_Table_0_info">
<thead class="sticky-thead">
<tr id="theadTr--${pageName}"
data-by="by--${pageName}" data-by-output="byOutput--${pageName}" data-main-option="mainOption--${pageName}" data-sub-option="subOption--${pageName}">
<th class="cmn" style="width: 72px;">No.</th>
<th class="cmn" style="width: 160.141px;">취급일자</th>
<th class="cmn" style="width: 160.141px;">관리번호</th>
<th class="cmn" style="width: 230.469px;">업체명</th>
<th class="cmn" style="width: 100px;">보고건수</th>
<th class="cmn" style="width: 230.469px;">처리상태</th>
<th class="cmn" style="width: 180px;">폐기구분</th>
<th class="cmn" style="width: 230.469px;">폐기사유</th>
<th class="cmn" style="width: 180px;">폐기방법</th>
<th class="cmn" style="width: 230.469px;">폐기장소</th>
<th class="cmn" style="width: 230.469px;">폐기일자</th>
</tr>
</thead>
<tbody id="tbody--${pageName}">
</tbody>
<template id="${infoPrefix}Row--${pageName}">
<tr data-key="{USR_RPT_ID_NO}">
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{ROW_NUM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{HDR_DE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSCDMNG_ID}</td>
<td class="cmn text-start" onclick="{onclick}" ondblclick="{ondblclick}">{BSSH_NM}</td>
<td class="cmn text-end" onclick="{onclick}" ondblclick="{ondblclick}">{RND_DTL_RPT_CNT}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{PRGRS_STTS_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_SE_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_PRV_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_MTH_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_LOC}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_DE}</td>
</tr>
</template>
<template id="${infoPrefix}NotFound--${pageName}">
<tr class="odd">
<td valign="top" colspan="13" class="dataTables_empty text-center">${prefixName} 정보를 찾지 못했습니다.</td>
</tr>
</template>
</table>
</div>
</div>
</div>
<!-- / DataTables(그리드) -->
<div class="card">
<label class="form-label fw-bold form-search-title" for="RsltDetail--${pageName}">제품 정보</label>
<div class="row g-1">
<div class="card-datatable text-nowrap">
<div class="dataTables_wrapper dt-bootstrap5 no-footer" id="DataTables_Table_1_wrapper--${pageName}">
<div class="table-responsive ox-scroll oy-scroll h-px-300" id="table-responsive-1--${pageName}">
<table class="table-layout-fixed dataTable datatables-ajax table table-bordered no-footer"
id="DataTables_Table_1--${pageName}" aria-describedby="DataTables_Table_0_info">
<thead class="sticky-thead">
<tr>
<th class="cmn" style="width: 72px;">No.</th>
<th class="sorting sorting_asc" aria-sort="ascending" style="width: 223.719px;">제품명</th>
<th class="sorting" style="width: 146.156px;">제품코드</th>
<th class="sorting" style="width: 160.141px;">폐기수량</th>
<th class="sorting" style="width: 230.469px;">유효기간</th>
<th class="sorting" style="width: 230.469px;">최소 유통단위 수량</th>
<th class="sorting" style="width: 230.469px;">낱개 단위 수량</th>
<th class="sorting" style="width: 230.469px;">폐기 수량</th>
</tr>
</thead>
<tbody id="tbody--${pageName}Detail">
</tbody>
<template id="${infoPrefix}Row--${pageName}Detail">
<tr data-key="{USR_RPT_ID_NO}">
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{ROW_NUM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{PRDUCT_NM}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{PRDUCT_CD}</td>
<td class="cmn text-start" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_QY}</td>
<td class="cmn text-end" onclick="{onclick}" ondblclick="{ondblclick}">{PRD_VALID_DE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{MIN_DISTB}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{PCE}</td>
<td class="cmn text-center" onclick="{onclick}" ondblclick="{ondblclick}">{DSUSE_QY}</td>
</tr>
</template>
<template id="${infoPrefix}NotFound--${pageName}Detail">
<tr class="odd">
<td valign="top" colspan="5" class="dataTables_empty text-center">${prefixName} 상세 정보를 찾지 못했습니다.</td>
</tr>
</template>
</table>
</div>
</div>
</div> <!-- / DataTables(그리드) -->
</div> <!-- <div class="row g-1"> -->
</div> <!-- <div class="card"> -->
</div> <!-- <div class="card"> -->
<!-- 업무 버튼 표시 -->
<div>
<span class="container-page-btn">
<span class="container-window-btn-right">
<!-- 업무 버튼 -->
<button type="button" class="btn btn-primary w-px-80" id="btnSave--${pageName}" title="저장">저장</button>
</span>
</span>
</div>
<!-- / 업무 버튼 표시 -->
</div> <!-- / Content <div class="container flex-grow-1 px-0"> -->
</div> <!-- / inner page html <div class="content-wrapper"> -->
<script>
/**************************************************************************
* Global Variable
**************************************************************************/
pageObject["${pageName}"] = {};
/**************************************************************************
* script 진입
**************************************************************************/
$(document).ready(function() {
// pageObject
let $P = pageObject["${pageName}"];
// FormFields
$P.bsshFormFields = new FimsFormFields("#bssh--${pageName}");
$P.productFormFields = new FimsFormFields("#product--${pageName}");
/**************************************************************************
* DatasetControl
**************************************************************************/
$P.control = new DatasetControl({
prefix: "dsuseMgtReceiptBssh"
, prefixName: "마약류 취급업체 조회"
, keymapper: info => info ? info.bsshCd : ""
, dataGetter: obj => obj.${infoPrefix}Info
, infoSize: "xl"
});
$P.productControl = new DatasetControl({
prefix: "dsuseMgtReceiptProduct"
, prefixName: "마약류 제품 조회"
, keymapper: info => info ? info.prductCd : ""
, dataGetter: obj => obj.${infoPrefix}Info
, infoSize: "xl"
});
$P.productList = new Dataset({
prefix: "dsuseMgtReceiptProductList"
, prefixName: "마약류 제품 조회"
, keymapper: info => info ? info.prductCd : ""
, dataGetter: obj => obj
, infoSize: "xl"
});
/**************************************************************************
* DatasetControl 이벤트
**************************************************************************/
// 현재 선택 자료 변경 이벤트
$P.control.onCurrentChange = item => {
if (!item) return;
$P.bsshFormFields.set($P.control, item);
// 업무구분에 따른 URL 변경
//$P.fnSetURL(item.data.bsshCd);
}
$P.productControl.onCurrentChange = item => {
if (!item) return;
// Dataset 셋팅
$P.productFormFields.set($P.productControl, item);
// 업무구분에 따른 URL 변경
//$P.fnSetURL(item.data.bsshCd);
}
// 저장 callback
$P.control.onSave = (resp) => {
let dialogTitle = $("#" + $P.control.prefix + "Dialog--${openerPageName}").find("h5.modal-title").html();
let showMessage = resp.rtnMsg.replace(/[S]|[F]/g, dialogTitle);
// 메시지 출력
dialog.alert({
content: showMessage
, init: () => { setDialogZindex(); }
, onOK: () => { }
});
if (resp.saved) {
dialog.close($P.control.prefix + "Dialog--${openerPageName}");
}
}
$P.control.getBsshInfo = () => {
let dialogTitle = "마약류 취급업체 조회";
let params = {openPage : "bssh--${pageName}"};
ajax.get({
url : wctx.url("/adds/nims/bssh-main.do")
, data : params
, success : resp => {
dialog.open({
id : "bsshMainDialog"
, title : dialogTitle
, content : resp
, size : $P.control.infoSize
, onClose : () => { $P.control.setData(); }
});
}
});
}
$P.productControl.getProductInfo = () => {
let dialogTitle = "마약류 제품 조회";
let params = {openPage : "product--${pageName}"};
ajax.get({
url : wctx.url("/adds/nims/product-main.do")
, data : params
, success : resp => {
dialog.open({
id : "productMainDialog"
, title : dialogTitle
, content : resp
, size : $P.productControl.infoSize
, onClose : () => { $P.productControl.setData(); }
});
}
});
}
// 저장
$P.control.save = (info) => {
if (!info) return;
let create = (info.mngId == "");
ajax.post({
url: !create ? $P.control.urls.update : $P.control.urls.create
, data: info || {}
, success: resp => $P.control.onSave(resp)
});
}
$P.productList.onDatasetChange = item => {
if (!item) return;
let empty = $P.productListList.empty;
// 업무별 DataTables(그리드) tr, td
let foundContent = document.getElementById("productListRow--productList").content;
let foundTr = $(foundContent).find("tr")[0].cloneNode(false);
let foundTds = $(foundContent).find("td");
foundTds.each(function() {
foundTr.appendChild(this.cloneNode(true));
});
//
let replacer = (str, dataItem) => str
.replace(/{onclick}/gi, "pageObject['${pageName}'].productList.setCurrent('" + dataItem.getValue("prductCd") + "');");
let trs = empty ? [document.getElementById("$productListNotFound--productList").content.outerHTML]
: $P.productList.inStrings(foundTr.outerHTML, replacer);
$("#table-responsive--${pageName}")[0].changeContent(trs.join(), initScroll, noMore);
}
/**************************************************************************
* DataTables 이벤트
**************************************************************************/
/**************************************************************************
* 사용자 함수(function)
**************************************************************************/
// 검색 자료 재조회
$P.fnRefreshList = () => {
$P.control.untilPageNum = $P.control.query.pageNum;
$P.control.query.fetchSize = $P.control.defaultFetchSize * $P.control.query.pageNum;
$P.control.load(1);
}
// 업무구분에 따른 URL 설정
$P.fnSetURL = (taskSeCd) => {
// $P.control.urls.create = wctx.url("/" + taskSeCd + "${infoPrefixUrl}" + "/040/create.do"); // 등록
// $P.control.urls.update = wctx.url("/" + taskSeCd + "${infoPrefixUrl}" + "/040/update.do"); // 수정
}
// 전자우편 안내문 등록 버튼 이벤트
$P.fnSearchBssh = (title) => {
$P.control.getBsshInfo();
}
$P.fnSearchProduct = (title) => {
$P.productControl.getProductInfo();
}
/**************************************************************************
* 버튼 clickEvent
**************************************************************************/
// 저장
$P.fnSave = () => {
// validate 확인
if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
dialog.alert({
content: "현재 " + $P.control.prefixName + " 정보를 저장하시겠습니까?"
, init: () => { setDialogZindex(); }
, onOK: () => {
$P.control.save($P.bsshFormFields.get()); // formFields
}
});
}
//추가
$P.fnAdd = () => {
$P.productList.addData($P.productFormFields.get());
}
$P.fnDel = () => {
// validate 확인
if (!customValidate($("#frmEdit--${pageName}").find("input, select, textarea"))) return;
dialog.alert({
content: "현재 " + $P.control.prefixName + " 정보를 저장하시겠습니까?"
, init: () => { setDialogZindex(); }
, onOK: () => {
$P.control.save($P.bsshFormFields.get()); // formFields
}
});
}
/**************************************************************************
* 초기 셋팅
**************************************************************************/
// 이벤트 설정
$P.setEvent = () => {
// 안내문 등록 버튼 이벤트
$("#btnBsshSearch--${pageName}").on("click", function() {
$P.fnSearchBssh($(this).attr("title"));
});
$("#btnProductSearch--${pageName}").on("click", function() {
$P.fnSearchProduct($(this).attr("title"));
});
// 버튼 이벤트
$("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장
$("#btnAdd--${pageName}").on("click", () => $P.fnAdd()); // 추가
$("#btnDel--${pageName}").on("click", () => $P.fnDel()); // 추가
}
// 초기 화면 설정
$P.initForm = () => {
fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollDataList);
// Dialog 마우스로 드래그 할 수 있도록 설정.
//fnMakeDraggableDialog(document.getElementById($P.control.prefix + "Dialog"));
}
/**************************************************************************
* 최초 실행 함수
**************************************************************************/
// 1. 이벤트 설정
$P.setEvent();
// 2. 초기 화면 설정
$P.initForm();
// 3. Dataset 설정
$P.control.setData([${opnnDlbrMbrInfo}]);
$P.productControl.setData([${opnnDlbrMbrInfo}]);
});
</script>

@ -439,8 +439,7 @@
// 초기 화면 설정
$P.initForm = () => {
fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollDataList);
// Dialog 마우스로 드래그 할 수 있도록 설정.
//fnMakeDraggableDialog(document.getElementById($P.control.prefix + "Dialog"));
}

@ -75,13 +75,28 @@
<label for="dsuseLoc--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">폐기장소</label>
<input type="text" class="form-control w-80" id="dsuseLoc--${pageName}" name="dsuseLoc" data-map="DSUSE_LOC">
</div>
<div class="col-md-4">
<label for="dsuseImg--${pageName}" class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">폐기이미지</label>
<input type="text" class="form-control w-60" id="dsuseImg--${pageName}" name="dsuseImg" data-map="DSUSE_IMG" readonly>
<div class="col-md-12">
<span class="d-inline-flex">
<label for="dsuseImg--${pageName}"
class="w-px-130 h-px-30 bg-lighter pe-2 col-form-label text-sm-end">폐기이미지</label>
<button type="button" class="btn btn-primary mx-1"
onclick="$('#inputUploadSet--${pageName}').trigger('click');">추가</button>
<button type="button" class="btn btn-primary mx-1"
id="btnImageDel--${pageName}" hidden>삭제</button>
</span>
</div>
<div class="col-md-12">
<div class="border-card rounded w-100 h-px-250 ox-scroll align-content-center">
<ul id="dragAndDrop--${pageName}" class="d-inline-flex">
</ul>
</div>
</div>
</div>
<div class="row my-1 mx-1 g-1 border-card rounded"></div>
</form> <!-- /입력 영역 -->
<input type="file" accept="image/*" id="inputUploadSet--${pageName}" hidden multiple />
</div> <!-- <div class="card"> -->
<!-- 업무 버튼 표시 -->
@ -98,6 +113,17 @@
</div> <!-- / Content <div class="container flex-grow-1 px-0"> -->
</div> <!-- / inner page html <div class="content-wrapper"> -->
<template id="imgCheckboxTemplate--${pageName}">
<li class="d-flex">
<label class='mx-1 d-flex flex-row'>
<input type="checkbox" name="{name}" class="form-check-input" value="{value}" />
<div class="position-relative">
<img src="{src}" width='200' height='200' />
</div>
</label>
</li>
</template>
<script>
/**************************************************************************
* Global Variable
@ -110,7 +136,9 @@
$(document).ready(function() {
// pageObject
let $P = pageObject["${pageName}"];
$P.fileArr = [];
// FormFields
$P.formFields = new FimsFormFields("#frmEdit--${pageName}");
@ -164,8 +192,7 @@
// Dataset 셋팅
$P.formFields.set($P.control, item);
// 업무구분에 따른 URL 변경
$P.fnSetURL(item.data.TASK_SE_CD);
}
// 저장 callback
@ -217,7 +244,22 @@
});
}
//uploadSupport 생성
$P.uploadSet = uploadSupport("#inputUploadSet--${pageName}");
$P.uploadSet.onDatasetChange = () => {
var files = $P.uploadSet.getDataset();
if(files != null && files.length > 0){
for(var i=0;i < files.length; i++){
$P.fileArr.push(files[i]);
}
}
$P.fnDisplay();
};
/**************************************************************************
* DataTables 이벤트
**************************************************************************/
@ -266,12 +308,41 @@
/**************************************************************************
* 사용자 함수(function)
**************************************************************************/
// 업무구분에 따른 URL 설정
$P.fnSetURL = (taskSeCd) => {
//$P.control.urls.create = wctx.url("/" + taskSeCd + "${infoPrefixUrl}" + "/040/create.do"); // 등록
//$P.control.urls.update = wctx.url("/" + taskSeCd + "${infoPrefixUrl}" + "/040/update.do"); // 수정
// 이미지 표시
$P.fnDisplay = () => {
if($P.fileArr.length > 0){
var tagsText = $P.fnMakeImgTags($P.fileArr);
document.querySelector("#dragAndDrop--${pageName}").innerHTML = tagsText;
$("#btnImageDel--${pageName}").removeAttr("hidden");
} else {
document.querySelector("#dragAndDrop--${pageName}").innerHTML = "";
$("#btnImageDel--${pageName}").attr("hidden","hidden");
}
}
// HTML 태그(img,checkbox) 문자열 생성
$P.fnMakeImgTags = (fileArr) => {
var tagsTextArr = [];
for(var index = 0; index < fileArr.length; index++){
var item = fileArr[index];
var template = document.getElementById("imgCheckboxTemplate--${pageName}").innerHTML;
template = template.replace(/{name}/gi, "dsusePrdImgFilesSlector");
template = template.replace(/{value}/gi, item.id);
template = template.replace(/{src}/gi, item.url);
tagsTextArr.push(template);
}
return tagsTextArr.join("");
}
// 전자우편 안내문 등록 버튼 이벤트
$P.fnSearchBssh = (title) => {
$P.control.getBsshInfo();
@ -304,14 +375,42 @@
$P.fnSearchBssh($(this).attr("title"));
});
//이미지 삭제 버튼
$("#btnImageDel--${pageName}").on("click", function() {
var checkeds = $("#dragAndDrop--${pageName}").find(":checkbox[name='dsusePrdImgFilesSlector']:checked");
if(checkeds.length > 0){
var keys = [];
checkeds.each(function(){
keys.push(this.value);
});
$P.fileArr = $P.fileArr.filter((element) => keys.indexOf(element.id) == -1);
$P.fnDisplay();
}
});
// 버튼 이벤트
$("#btnSave--${pageName}").on("click", () => $P.fnSave()); // 저장
}
// 초기 화면 설정
$P.initForm = () => {
// Dialog 마우스로 드래그 할 수 있도록 설정.
// fnMakeDraggableDialog(document.getElementById($P.control.prefix + "Dialog"));
//드래그로 이미지 순서 변경
Sortable.create(document.getElementById("dragAndDrop--${pageName}"), {
onEnd : function(evt){
if(evt.oldIndex != evt.newIndex){
let tmp = $P.fileArr[evt.oldIndex];
$P.fileArr[evt.oldIndex] = $P.fileArr[evt.newIndex];
$P.fileArr[evt.newIndex] = tmp;
$P.fnDisplay();
}
}
});
console.log("#${usrRptIdNo}");

@ -265,8 +265,7 @@
// 초기 화면 설정
$P.initForm = () => {
// Dialog 마우스로 드래그 할 수 있도록 설정.
fnMakeDraggableDialog(document.getElementById($P.control.prefix + "Dialog"));
}
/**************************************************************************

@ -33,6 +33,7 @@
<!-- 전체화면 비활성화 -->
<script src="<c:url value="/webjars/3rd-party/sneat/libs/block-ui/block-ui.js"/>"></script>
<script src="<c:url value="/webjars/3rd-party/sneat/libs/sortablejs/sortable.js"/>"></script>
<script src="<c:url value="/resources/js/base/fimsFormFields.js?${ver}"/>"></script>
@ -46,6 +47,7 @@
<script src="<c:url value="/webjars/applib/js/componentization.js?${ver}"/>"></script>
<script src="<c:url value="/resources/js/adds/cmmn/componentization.js?${ver}"/>"></script>
<!-- endbuild -->
<c:set var="functions" scope="request">
wctx.path = "${pageContext.request.contextPath}";

Loading…
Cancel
Save