장비단속파일 레이아웃 관리 추가
parent
e99ddf4219
commit
c3ecc836ba
@ -0,0 +1,163 @@
|
|||||||
|
package cokr.xit.fims.crdn.web;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import cokr.xit.base.code.CommonCode;
|
||||||
|
import cokr.xit.base.user.ManagedUser;
|
||||||
|
import cokr.xit.base.user.dao.UserMapper;
|
||||||
|
import cokr.xit.base.web.ApplicationController;
|
||||||
|
import cokr.xit.fims.cmmn.CmmnQuery;
|
||||||
|
import cokr.xit.fims.cmmn.ftp.RemoteSystemInfo;
|
||||||
|
import cokr.xit.fims.cmmn.service.bean.StngBean;
|
||||||
|
import cokr.xit.fims.crdn.CrdnQuery;
|
||||||
|
import cokr.xit.fims.crdn.receive.eqpmnt.LayoutDescriptor;
|
||||||
|
import cokr.xit.fims.crdn.service.CrdnStngService;
|
||||||
|
import cokr.xit.foundation.data.DataObject;
|
||||||
|
|
||||||
|
/**장비단속레이아웃 관리 서비스 웹 컨트롤러.<br />
|
||||||
|
* {웹 컨텍스트}/crdn/crdn01 로 접근할 수 있다.
|
||||||
|
* @author leebj
|
||||||
|
*/
|
||||||
|
public class Crdn01Controller extends ApplicationController {
|
||||||
|
|
||||||
|
public static final String CLASS_URL = "/crdn/crdn01";
|
||||||
|
|
||||||
|
public class METHOD_URL {
|
||||||
|
public static final String
|
||||||
|
linkFileLayoutMain = "/010/main.do",
|
||||||
|
getLinkFileLayoutMetadataList = "/010/list.do",
|
||||||
|
getLinkFileLayoutMetadataInfo = "/020/info.do",
|
||||||
|
createLinkFileLayoutMetadata = "/020/create.do",
|
||||||
|
updateLinkFileLayoutMetadata = "/020/update.do",
|
||||||
|
removeLinkFileLayoutMetadata = "/020/remove.do"
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Resource(name = "stngBean")
|
||||||
|
private StngBean stngBean;
|
||||||
|
|
||||||
|
@Resource(name = "userMapper")
|
||||||
|
private UserMapper userMapper;
|
||||||
|
|
||||||
|
@Resource(name = "crdnStngService")
|
||||||
|
private CrdnStngService crdnStngService;
|
||||||
|
|
||||||
|
/** 장비단속레이아웃 관리 메인화면을 연다.
|
||||||
|
* @return fims/crdn/crdn01010-main
|
||||||
|
*/
|
||||||
|
public ModelAndView linkFileLayoutMain() {
|
||||||
|
ModelAndView mav = new ModelAndView();
|
||||||
|
mav.setViewName("fims/crdn/crdn01010-main");
|
||||||
|
mav.addObject("pageName", "crdn01010");
|
||||||
|
|
||||||
|
Map<String, List<CommonCode>> commonCodes = getCodesOf("FIM002", "FIM003","FIM054");
|
||||||
|
mav.addObject("FIM002List", commonCodes.get("FIM002"));
|
||||||
|
mav.addObject("FIM003List", commonCodes.get("FIM003"));
|
||||||
|
mav.addObject("FIM054List", commonCodes.get("FIM054"));
|
||||||
|
mav.addObject("TaskListForSgg", stngBean.filterTaskSectionCodeForSgg(commonCodes.get("FIM054")));
|
||||||
|
addCodes(commonCodes, mav, "FIM002", "FIM003");
|
||||||
|
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**장비단속 레이아웃 목록을 조회한다.<br />
|
||||||
|
* {@link CrdnStngService#getLinkFileLayoutMetadataList(CmmnQuery)} 참고
|
||||||
|
* @param query 장비단속 레이아웃 목록 조회 조건
|
||||||
|
* @return jsonView
|
||||||
|
*/
|
||||||
|
public ModelAndView getLinkFileLayoutMetadataList(CrdnQuery query) {
|
||||||
|
ModelAndView mav = new ModelAndView("jsonView");
|
||||||
|
setFetchSize(query);
|
||||||
|
|
||||||
|
ManagedUser currentUser = userMapper.getUser(currentUser().getAccount(), currentUser().getInstitute());
|
||||||
|
String sggCd = currentUser.getOrgID();
|
||||||
|
query.setSggCd(sggCd);
|
||||||
|
List<DataObject> list = crdnStngService.getLinkFileLayoutMetadataList(query);
|
||||||
|
return setCollectionInfo(mav, list,"","");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**장비단속 레이아웃 상세정보를 조회한다.<br />
|
||||||
|
* @param query 장비단속 레이아웃 목록 조회 조건
|
||||||
|
* @return jsonView
|
||||||
|
*/
|
||||||
|
public ModelAndView getLinkFileLayoutMetadataInfo(HttpServletRequest hReq, String fileLayoutId) {
|
||||||
|
boolean json = jsonResponse();
|
||||||
|
|
||||||
|
ModelAndView mav = new ModelAndView(json ? "jsonView" : "fims/crdn/crdn01020-info");
|
||||||
|
mav.addObject("pageName", "crdn01020");
|
||||||
|
|
||||||
|
ManagedUser currentUser = userMapper.getUser(currentUser().getAccount(), currentUser().getInstitute());
|
||||||
|
String sggCd = currentUser.getOrgID();
|
||||||
|
mav.addObject("sggCd", sggCd);
|
||||||
|
|
||||||
|
DataObject info = new DataObject();
|
||||||
|
if(!ifEmpty(fileLayoutId, ()->"").equals("")) {
|
||||||
|
info = crdnStngService.getLinkFileLayoutMetadataInfo(fileLayoutId);
|
||||||
|
} else {
|
||||||
|
info = null;
|
||||||
|
}
|
||||||
|
mav.addObject("layoutInfo", json ? info : toJson(info));
|
||||||
|
|
||||||
|
String urlTaskSeCd = hReq.getServletPath().split("/")[1];
|
||||||
|
mav.addObject("taskSeCd", urlTaskSeCd);
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**장비단속파일 레이아웃을 등록한다.<br />
|
||||||
|
* @param
|
||||||
|
* @return jsonView
|
||||||
|
*/
|
||||||
|
public ModelAndView createLinkFileLayoutMetadata(LayoutDescriptor layoutDescriptor, RemoteSystemInfo remoteSystemInfo) {
|
||||||
|
|
||||||
|
ModelAndView mav = new ModelAndView("jsonView");
|
||||||
|
boolean saved = false;
|
||||||
|
|
||||||
|
String rtnMsg = crdnStngService.createLinkFileLayoutMetadata(layoutDescriptor,remoteSystemInfo);
|
||||||
|
if(rtnMsg.contains("[S]")) {
|
||||||
|
saved = true;
|
||||||
|
}
|
||||||
|
mav.addObject("saved", saved);
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**장비단속파일 레이아웃을 수정한다.<br />
|
||||||
|
* @param
|
||||||
|
* @return jsonView
|
||||||
|
*/
|
||||||
|
public ModelAndView updateLinkFileLayoutMetadata(LayoutDescriptor layoutDescriptor, RemoteSystemInfo remoteSystemInfo) {
|
||||||
|
|
||||||
|
ModelAndView mav = new ModelAndView("jsonView");
|
||||||
|
boolean saved = false;
|
||||||
|
|
||||||
|
String rtnMsg = crdnStngService.updateLinkFileLayoutMetadata(layoutDescriptor,remoteSystemInfo);
|
||||||
|
if(rtnMsg.contains("[S]")) {
|
||||||
|
saved = true;
|
||||||
|
}
|
||||||
|
mav.addObject("saved", saved);
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**장비단속파일 레이아웃을 삭제한다.<br />
|
||||||
|
* @param fileLayoutId 파일 레이아웃 ID
|
||||||
|
* @return jsonView
|
||||||
|
*/
|
||||||
|
public ModelAndView removeLinkFileLayoutMetadata(String fileLayoutId) {
|
||||||
|
|
||||||
|
ModelAndView mav = new ModelAndView("jsonView");
|
||||||
|
boolean saved = false;
|
||||||
|
|
||||||
|
String rtnMsg = crdnStngService.removeLinkFileLayoutMetadata(fileLayoutId);
|
||||||
|
if(rtnMsg.contains("[S]")) {
|
||||||
|
saved = true;
|
||||||
|
}
|
||||||
|
mav.addObject("saved", saved);
|
||||||
|
return mav;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,334 @@
|
|||||||
|
<%@ 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="pageKorName" scope="request">장비단속레이아웃 관리</c:set>
|
||||||
|
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<div class="container-xxl flex-grow-1 px-0">
|
||||||
|
<div class="card wrapper-list">
|
||||||
|
|
||||||
|
<div class="container-page-btn">
|
||||||
|
<button type="button" id="btnReset--${pageName}" class="btn btn-outline-dark w-px-120" title="초기화">
|
||||||
|
초기화
|
||||||
|
</button>
|
||||||
|
<span class="container-window-btn-right">
|
||||||
|
<button type="button" id="btnSearch--${pageName}" class="btn btn-search w-px-120" title="검색">
|
||||||
|
검색
|
||||||
|
</button>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<form id="frmSearch--${pageName}" name="frmSearch">
|
||||||
|
<div class="container-search">
|
||||||
|
<div class="row g-1">
|
||||||
|
<div class="col-6">
|
||||||
|
<label class="form-label fw-bold form-search-title">업무구분</label>
|
||||||
|
<span class="form-search-linebox">
|
||||||
|
<c:forEach items="${TaskListForSgg}" var="item">
|
||||||
|
<label>
|
||||||
|
<input name="taskSeCd" type="radio" value="${item.code}"
|
||||||
|
class="form-check-input" alt="업무구분"
|
||||||
|
onchange="pageObject['${pageName}'].fnResetAndChangeBiz(this.value);">
|
||||||
|
${item.value}
|
||||||
|
</label>
|
||||||
|
</c:forEach>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-6">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div id="gridbuttonArea--${pageName}" class="container-page-btn">
|
||||||
|
<div class="d-flex flex-row justify-content-between">
|
||||||
|
<label id="layoutPaging--${pageName}PagingInfo" class="dataTables_info" role="status" aria-live="polite"></label>
|
||||||
|
<ul id="layoutPaging--${pageName}" class="pagination pagination-primary">
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<span class="container-window-btn-right">
|
||||||
|
<button type="button" class="btn btn-primary w-px-120"
|
||||||
|
id="btnAdd--${pageName}" title="추가">
|
||||||
|
추가
|
||||||
|
</button>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card-datatable text-nowrap">
|
||||||
|
<div id="DataTables_Table_0_wrapper--${pageName}" class="dataTables_wrapper dt-bootstrap5 no-footer">
|
||||||
|
<div id="table-responsive--${pageName}" class="table-responsive"
|
||||||
|
style="overflow-x: scroll;height:500px;overflow-y: scroll;">
|
||||||
|
<table id="DataTables_Table_0--${pageName}"
|
||||||
|
class="table-layout-fixed datatables-ajax table table-bordered dataTable no-footer">
|
||||||
|
<thead class="sticky-thead">
|
||||||
|
<tr id="layoutThead--${pageName}">
|
||||||
|
<th style="width: 80px;">No.</th>
|
||||||
|
<th style="width: 160px;">업무명</th>
|
||||||
|
<th style="width: 240px;">부서명</th>
|
||||||
|
<th style="width: 240px;">파일형식</th>
|
||||||
|
<th style="width: 160px;">업체명</th>
|
||||||
|
<th style="width: 160px;">업체명(연계)</th>
|
||||||
|
<th class="cmn dummy-th"></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="layoutTbody--${pageName}">
|
||||||
|
</tbody>
|
||||||
|
<template id="layoutRow--${pageName}">
|
||||||
|
<tr data-key="{FILE_LAYOUT_ID}">
|
||||||
|
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-end">{ROW_NUM}</td>
|
||||||
|
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{TASK_SE_NM}</td>
|
||||||
|
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{DEPT_NM}</td>
|
||||||
|
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{DATA_FILE_SE_NM}</td>
|
||||||
|
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{ENT_NM}</td>
|
||||||
|
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center">{LINK_ENT_NM}</td>
|
||||||
|
<td class="dummy-td cmn"></td>
|
||||||
|
</tr>
|
||||||
|
</template>
|
||||||
|
<template id="layoutNotFound--${pageName}">
|
||||||
|
<tr>
|
||||||
|
<td valign="top" colspan="7" class="dataTables_empty text-center">
|
||||||
|
레이아웃 정보를 찾지 못했습니다.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</template>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="content-backdrop fade"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* Global Variable
|
||||||
|
**************************************************************************/
|
||||||
|
pageObject["${pageName}"] = {};
|
||||||
|
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
var $P = pageObject["${pageName}"];
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* DatasetControl
|
||||||
|
**************************************************************************/
|
||||||
|
$P.layoutControl = new DatasetControl({
|
||||||
|
dataGetter : obj => obj["List"], appendData:true,
|
||||||
|
keymapper : info => info ? info.LAYOUT_ID : "",
|
||||||
|
urls : {
|
||||||
|
load : "",
|
||||||
|
getInfo : ""
|
||||||
|
},
|
||||||
|
formats: {
|
||||||
|
REG_DT : datetimeFormat,
|
||||||
|
MDFCN_DT : datetimeFormat
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$P.layoutControl.defaultFetchSize = FETCH_XS;
|
||||||
|
$P.layoutControl.untilPageNum = 0;
|
||||||
|
$P.layoutControl.beforeCurrent = null;
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* Dataset.on
|
||||||
|
**************************************************************************/
|
||||||
|
$P.layoutControl.dataset.onDatasetChange = (obj) => {
|
||||||
|
var t = $P.getGridTemplate();
|
||||||
|
var trs = Apply.fromDataset.getTbody($P.layoutControl.dataset, t.found, t.notFound, t.replacer);
|
||||||
|
$P.renderLayoutList(obj["Total"], $P.layoutControl.dataset.length, trs);
|
||||||
|
|
||||||
|
Apply.fromDataset.paging($P.layoutControl.dataset, obj, "layoutPaging--${pageName}");
|
||||||
|
};
|
||||||
|
|
||||||
|
$P.layoutControl.dataset.onCurrentChange = (dataItem) => {
|
||||||
|
Apply.fromDataset.currentRow($P.layoutControl.dataset, dataItem, $("#layoutTbody--${pageName}")[0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* pageObject.function
|
||||||
|
**************************************************************************/
|
||||||
|
$P.fnResetAndChangeBiz = (taskSeCd) => {
|
||||||
|
$P.layoutControl.urls.load = wctx.url("/"+taskSeCd+"/crdn/crdn01/010/list.do");
|
||||||
|
$P.layoutControl.urls.getInfo = wctx.url("/"+taskSeCd+"/crdn/crdn01/020/info.do");
|
||||||
|
|
||||||
|
$P.fnReset();
|
||||||
|
}
|
||||||
|
|
||||||
|
$P.fnReset = () => {
|
||||||
|
var searchForm = $("#frmSearch--${pageName}");
|
||||||
|
searchForm.find("input[type='radio']").not("[name='taskSeCd']").prop("checked", false);
|
||||||
|
searchForm.find("input[type='checkbox']").prop("checked", false);
|
||||||
|
searchForm.find("input[type='hidden']").val("");
|
||||||
|
searchForm.find("input[type='text']").val("");
|
||||||
|
|
||||||
|
$P.layoutControl.dataset.setData([]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$P.getParams = () => {
|
||||||
|
var formFields = new FimsFormFields("#frmSearch--${pageName}");
|
||||||
|
var data = formFields.get();
|
||||||
|
data.fetchSize = $P.layoutControl.defaultFetchSize;
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
$P.searchLayoutList = () => {
|
||||||
|
$P.layoutControl.query = $P.getParams();
|
||||||
|
$P.layoutControl.load(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
$P.scrollLayoutList = () => {
|
||||||
|
$P.layoutControl.load($P.layoutControl.query.pageNum + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
$P.refreshLayoutList = () => {
|
||||||
|
if($P.layoutControl.query.pageNum == null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$P.layoutControl.untilPageNum = $P.layoutControl.query.pageNum;
|
||||||
|
$P.layoutControl.query.fetchSize = $P.layoutControl.defaultFetchSize * $P.layoutControl.query.pageNum;
|
||||||
|
$P.layoutControl.load(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
$P.getGridTemplate = () => {
|
||||||
|
var notFound = [document.getElementById("layoutNotFound--${pageName}").innerHTML];
|
||||||
|
var found = document.getElementById("layoutRow--${pageName}").innerHTML;
|
||||||
|
var replacer = (str, dataItem) => str
|
||||||
|
.replace(/{onclick}/gi, "pageObject['${pageName}'].clickLayoutList('" + dataItem.getValue("FILE_LAYOUT_ID") + "');")
|
||||||
|
.replace(/{ondblclick}/gi, "pageObject['${pageName}'].dblclickLayoutList('" + dataItem.getValue("FILE_LAYOUT_ID") + "');");
|
||||||
|
|
||||||
|
return {
|
||||||
|
found : found,
|
||||||
|
notFound : notFound,
|
||||||
|
replacer : replacer
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
$P.renderLayoutList = (total, listLength, trs) => {
|
||||||
|
|
||||||
|
var noMore = (total == listLength);
|
||||||
|
var initScroll = ($P.layoutControl.query.pageNum < 2) && ($P.layoutControl.untilPageNum == 0);
|
||||||
|
|
||||||
|
$("#table-responsive--${pageName}")[0].changeContent(trs, initScroll, noMore);
|
||||||
|
|
||||||
|
fn_securityModeToggle($("#securityMode--top").is(":checked")); //보안모드
|
||||||
|
|
||||||
|
if($P.layoutControl.untilPageNum != 0){
|
||||||
|
$P.layoutControl.query.fetchSize = $P.layoutControl.defaultFetchSize;
|
||||||
|
$P.layoutControl.query.pageNum = $P.layoutControl.untilPageNum;
|
||||||
|
$P.layoutControl.untilPageNum = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$P.clickLayoutList = (dataKey) => {
|
||||||
|
if(dataKey == ""){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#layoutTbody--${pageName}").setCurrentRow(dataKey);
|
||||||
|
|
||||||
|
Apply.toDataset.current($P.layoutControl.dataset, dataKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
$P.dblclickLayoutList = (dataKey) => {
|
||||||
|
$P.getInfo(dataKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
$P.createLayout = () => {
|
||||||
|
$P.getInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
$P.getInfo = (fileLayoutId) => {
|
||||||
|
var params = {};
|
||||||
|
if(fileLayoutId != null){
|
||||||
|
params.fileLayoutId = fileLayoutId;
|
||||||
|
}
|
||||||
|
|
||||||
|
ajax.get({
|
||||||
|
url : $P.layoutControl.urls.getInfo,
|
||||||
|
data : params,
|
||||||
|
success : (resp) => {
|
||||||
|
|
||||||
|
dialog.open({
|
||||||
|
id : "layoutInfoDialog",
|
||||||
|
title : "레이아웃 정보",
|
||||||
|
size : "xl",
|
||||||
|
content : resp,
|
||||||
|
init : () => {
|
||||||
|
var parentRes = new Object();
|
||||||
|
var childReq = pageObject.childReq.pop();
|
||||||
|
|
||||||
|
for(var reqKey in childReq) {
|
||||||
|
if($P.provide[reqKey]){
|
||||||
|
parentRes[reqKey] = $P.provide[reqKey];
|
||||||
|
} else {
|
||||||
|
parentRes[reqKey] = function(){};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pageObject.parentRes.push(parentRes);
|
||||||
|
|
||||||
|
setDialogZindex();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$P.provide = {
|
||||||
|
"refreshList" : function(){
|
||||||
|
$P.refreshLayoutList();
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* element.on
|
||||||
|
**************************************************************************/
|
||||||
|
$('#btnReset--${pageName}').on('click', () => $P.fnReset());
|
||||||
|
$('#btnSearch--${pageName}').on('click', () => $P.searchLayoutList());
|
||||||
|
$('#btnAdd--${pageName}').on('click', () => $P.createLayout());
|
||||||
|
$('#btnDel--${pageName}').on('click', () => $P.removeLayout());
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* 초기화
|
||||||
|
**************************************************************************/
|
||||||
|
fnMakeResizableTable($("#table-responsive--${pageName}")[0]);
|
||||||
|
fnMakeScrollableTable($("#table-responsive--${pageName}")[0], $P.scrollLayoutList);
|
||||||
|
|
||||||
|
var defaultBizValue = $("#layout-navbar input[name='taskSeCd']:checked").val();
|
||||||
|
$("#frmSearch--${pageName} input[name='taskSeCd'][value='" + defaultBizValue + "']").prop("checked",true);
|
||||||
|
$P.fnResetAndChangeBiz(defaultBizValue);
|
||||||
|
|
||||||
|
fn_securityModeToggle($("#securityMode--top").is(":checked")); //보안모드
|
||||||
|
|
||||||
|
$("#frmSearch--${pageName} input[name='taskSeCd']").each(function(i) {
|
||||||
|
$(this).prop("disabled", "true");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
@ -0,0 +1,363 @@
|
|||||||
|
<%@ 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="pageKorName" scope="request">장비단속레이아웃 상세</c:set>
|
||||||
|
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<div class="container-xxl flex-grow-1 px-0">
|
||||||
|
<form id="frmEdit--${pageName}" name="frmEdit">
|
||||||
|
|
||||||
|
<div class="card my-2">
|
||||||
|
<div class="card-header">
|
||||||
|
<h5>파일 레이아웃</h5>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<input type="hidden" id="fileLayoutId--${pageName}" name="fileLayoutId" data-map="FILE_LAYOUT_ID" />
|
||||||
|
<input type="hidden" id="sggCd--${pageName}" name="sggCd" data-map="SGG_CD" />
|
||||||
|
<input type="hidden" id="taskSeCd--${pageName}" name="taskSeCd" data-map="TASK_SE_CD" />
|
||||||
|
<input type="hidden" id="instCd--${pageName}" name="instCd" data-map="INST_CD" />
|
||||||
|
<input type="hidden" id="deptCd--${pageName}" name="deptCd" data-map="DEPT_CD" />
|
||||||
|
|
||||||
|
<div class="row g-1">
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label for="fileGroup--${pageName}"
|
||||||
|
class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end required">
|
||||||
|
자료 파일 구분
|
||||||
|
</label>
|
||||||
|
<select id="fileGroup--${pageName}" name="fileGroup" data-map="DATA_FILE_SE"
|
||||||
|
class="form-select" required>
|
||||||
|
<option value="">선택</option>
|
||||||
|
<option value="TXT">텍스트파일 포함</option>
|
||||||
|
<option value="JPG">텍스트파일 미포함</option>
|
||||||
|
<option value="BIN">단일 바이너리 파일</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label for="fileNameLength--${pageName}"
|
||||||
|
class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">
|
||||||
|
파일명 길이
|
||||||
|
</label>
|
||||||
|
<input type="text" id="fileNameLength--${pageName}" name="fileNameLength" data-map="FILE_NM_SZ"
|
||||||
|
class="form-control w-px-70" maxlength="4" data-maxlengthb="4" />
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label for="enterpriseName--${pageName}"
|
||||||
|
class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">
|
||||||
|
업체명
|
||||||
|
</label>
|
||||||
|
<input type="text" id="enterpriseName--${pageName}" name="enterpriseName" data-map="ENT_NM"
|
||||||
|
class="form-control" maxlength="100" data-maxlengthb="100" />
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label for="fileNameSeperator--${pageName}"
|
||||||
|
class="w-px-130 bg-lighter pe-2 ps-2 col-form-label text-sm-start">
|
||||||
|
파일명 구분 유형
|
||||||
|
</label>
|
||||||
|
<select id="fileNameSeperator--${pageName}" name="fileNameSeperator" data-map="FILE_NM_SE_TYPE"
|
||||||
|
class="form-select">
|
||||||
|
<option value=""></option>
|
||||||
|
<option value="_">언더바</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-10">
|
||||||
|
<label for="fileNameItmes--${pageName}"
|
||||||
|
class="w-px-130 bg-lighter pe-2 ps-2 col-form-label text-sm-start">
|
||||||
|
파일명 형식
|
||||||
|
</label>
|
||||||
|
<input type="text" id="fileNameItmes--${pageName}" name="fileNameItmes" data-map="FILE_NM_LAYOUT"
|
||||||
|
class="form-control w-100" maxlength="500" data-maxlengthb="500" />
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label for="contentSeperator--${pageName}"
|
||||||
|
class="w-px-130 bg-lighter pe-2 ps-2 col-form-label text-sm-start">
|
||||||
|
자료 구분 유형1
|
||||||
|
</label>
|
||||||
|
<select id="contentSeperator--${pageName}" name="contentSeperator" data-map="DATA_SE_TYPE1"
|
||||||
|
class="form-select">
|
||||||
|
<option value=""></option>
|
||||||
|
<option value=",">콤마</option>
|
||||||
|
<option value="byte">바이트</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-10">
|
||||||
|
<label for="contentItems--${pageName}"
|
||||||
|
class="w-px-130 bg-lighter pe-2 ps-2 col-form-label text-sm-start">
|
||||||
|
자료 형식1
|
||||||
|
</label>
|
||||||
|
<input type="text" id="contentItems--${pageName}" name="contentItems" data-map="DATA_LAYOUT1"
|
||||||
|
class="form-control w-100" maxlength="500" data-maxlengthb="500" />
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label for="contentSecondSeperator--${pageName}"
|
||||||
|
class="w-px-130 bg-lighter pe-2 ps-2 col-form-label text-sm-start">
|
||||||
|
자료 구분 유형2
|
||||||
|
</label>
|
||||||
|
<select id="contentSecondSeperator--${pageName}" name="contentSecondSeperator" data-map="DATA_SE_TYPE2"
|
||||||
|
class="form-select">
|
||||||
|
<option value=""></option>
|
||||||
|
<option value=",">콤마</option>
|
||||||
|
<option value="LineBreak">줄바꿈문자</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-10">
|
||||||
|
<label for="secondSeperatorStarterItems--${pageName}"
|
||||||
|
class="w-px-130 bg-lighter pe-2 ps-2 col-form-label text-sm-start">
|
||||||
|
자료 형식2
|
||||||
|
</label>
|
||||||
|
<input type="text" id="secondSeperatorStarterItems--${pageName}" name="secondSeperatorStarterItems" data-map="DATA_LAYOUT2"
|
||||||
|
class="form-control w-100" maxlength="500" data-maxlengthb="500" />
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label for="countPerFileGroup--${pageName}"
|
||||||
|
class="w-px-130 bg-lighter pe-2 ps-2 col-form-label text-sm-start">
|
||||||
|
파일 총 건수
|
||||||
|
</label>
|
||||||
|
<input type="text" id="countPerFileGroup--${pageName}" name="countPerFileGroup" data-map="FILE_TNOCS"
|
||||||
|
class="form-control w-50" maxlength="2" data-maxlengthb="2" />
|
||||||
|
</div>
|
||||||
|
<div class="col-md-10">
|
||||||
|
<label for="linkFileLocation--${pageName}"
|
||||||
|
class="w-px-130 bg-lighter pe-2 ps-2 col-form-label text-sm-start">
|
||||||
|
연계 파일 경로
|
||||||
|
</label>
|
||||||
|
<input type="text" id="linkFileLocation--${pageName}" name="linkFileLocation" data-map="LINK_FILE_PATH"
|
||||||
|
class="form-control w-100" maxlength="200" data-maxlengthb="200" />
|
||||||
|
</div>
|
||||||
|
<div class="col-md-9">
|
||||||
|
<label for="sameItemsInFileGroup--${pageName}"
|
||||||
|
class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">
|
||||||
|
동일 항목
|
||||||
|
</label>
|
||||||
|
<input type="text" id="sameItemsInFileGroup--${pageName}" name="sameItemsInFileGroup" data-map="SAME_ITEMS"
|
||||||
|
class="form-control w-px-600" maxlength="300" data-maxlengthb="300" />
|
||||||
|
</div>
|
||||||
|
<div class="col-md-9">
|
||||||
|
<label for="increaseItemInFileGroup--${pageName}"
|
||||||
|
class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">
|
||||||
|
증가 항목
|
||||||
|
</label>
|
||||||
|
<input type="text" id="increaseItemInFileGroup--${pageName}" name="increaseItemInFileGroup" data-map="INCREASE_ITEM"
|
||||||
|
class="form-control w-px-600" maxlength="300" data-maxlengthb="300" />
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label for="increaseTypeInFileGroup--${pageName}"
|
||||||
|
class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">
|
||||||
|
증가 형식
|
||||||
|
</label>
|
||||||
|
<select id="increaseTypeInFileGroup--${pageName}" name="increaseTypeInFileGroup" data-map="INCREASE_TYPE"
|
||||||
|
class="form-select">
|
||||||
|
<option value=""></option>
|
||||||
|
<option value="number">숫자</option>
|
||||||
|
<option value="alphabet">영문자</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card my-2">
|
||||||
|
<div class="card-header">
|
||||||
|
<h5>파일전송 연계 정보</h5>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="row g-1">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<label for="linkEnterpriseName--${pageName}"
|
||||||
|
class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">
|
||||||
|
업체명(연계)
|
||||||
|
</label>
|
||||||
|
<input type="text" id="linkEnterpriseName--${pageName}" name="linkEnterpriseName" data-map="LINK_ENT_NM"
|
||||||
|
class="form-control" maxlength="100" data-maxlengthb="100" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6">
|
||||||
|
<label for="ip--${pageName}"
|
||||||
|
class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">
|
||||||
|
아이피
|
||||||
|
</label>
|
||||||
|
<input type="text" id="ip--${pageName}" name="ip" data-map="REMOTE_IP"
|
||||||
|
class="form-control" maxlength="100" data-maxlengthb="100" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6">
|
||||||
|
<label for="id--${pageName}"
|
||||||
|
class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">
|
||||||
|
아이디
|
||||||
|
</label>
|
||||||
|
<input type="text" id="id--${pageName}" name="id" data-map="REMOTE_ID"
|
||||||
|
class="form-control" maxlength="100" data-maxlengthb="100" />
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<label for="pw--${pageName}"
|
||||||
|
class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">
|
||||||
|
패스워드
|
||||||
|
</label>
|
||||||
|
<input type="text" id="pw--${pageName}" name="pw" data-map="REMOTE_PASSWORD"
|
||||||
|
class="form-control" maxlength="100" data-maxlengthb="100" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label for="osType--${pageName}"
|
||||||
|
class="w-px-130 bg-lighter pe-2 ps-2 col-form-label text-sm-start">
|
||||||
|
운영체제
|
||||||
|
</label>
|
||||||
|
<select id="osType--${pageName}" name="osType" data-map="REMOTE_OS"
|
||||||
|
class="form-select w-100">
|
||||||
|
<option value=""></option>
|
||||||
|
<option value="linux">리눅스</option>
|
||||||
|
<option value="windows">윈도우</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-10">
|
||||||
|
<label for="workPath--${pageName}"
|
||||||
|
class="w-px-130 bg-lighter pe-2 ps-2 col-form-label text-sm-start">
|
||||||
|
파일경로
|
||||||
|
</label>
|
||||||
|
<input type="text" id="workPath--${pageName}" name="workPath" data-map="REMOTE_WORK_PATH"
|
||||||
|
class="form-control w-100" maxlength="100" data-maxlengthb="100" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row m-3">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<span class="float-end">
|
||||||
|
<button type="button" id="btnSave--${pageName}" class="btn btn-primary">저장</button>
|
||||||
|
<button type="button" id="btnDelete--${pageName}" class="btn btn-primary">삭제</button>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
pageObject["${pageName}"] = {};
|
||||||
|
pageObject["${pageName}"].provided = {};
|
||||||
|
|
||||||
|
pageObject.childReq = [];
|
||||||
|
pageObject.childReq.push({
|
||||||
|
refreshList : function(){ },
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
var $P = pageObject["${pageName}"];
|
||||||
|
|
||||||
|
if(pageObject.parentRes.length > 0){
|
||||||
|
$P.provided = pageObject.parentRes.pop();
|
||||||
|
} else {
|
||||||
|
$P.provided = pageObject.childReq.pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* DatasetControl, Dataset, FormFields
|
||||||
|
**************************************************************************/
|
||||||
|
$P.formFields = new FimsFormFields("#frmEdit--${pageName}");
|
||||||
|
|
||||||
|
$P.layoutControl = new DatasetControl({
|
||||||
|
dataGetter : obj => obj["List"], appendData : true,
|
||||||
|
keymapper : info => info ? info.FILE_LAYOUT_ID : "",
|
||||||
|
urls : {
|
||||||
|
create : wctx.url("/${taskSeCd}/crdn/crdn01/020/create.do"),
|
||||||
|
update : wctx.url("/${taskSeCd}/crdn/crdn01/020/update.do"),
|
||||||
|
remove : wctx.url("/${taskSeCd}/crdn/crdn01/020/remove.do")
|
||||||
|
},
|
||||||
|
formats: {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* Dataset.on
|
||||||
|
**************************************************************************/
|
||||||
|
$P.layoutControl.dataset.onCurrentChange = (dataItem) => {
|
||||||
|
if(!dataItem){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$P.formFields.set(dataItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* pageObject.function
|
||||||
|
**************************************************************************/
|
||||||
|
$P.fnSave = () => {
|
||||||
|
|
||||||
|
if(!customValidate($("#frmEdit--${pageName}").find("input,select,textarea"))) return;
|
||||||
|
|
||||||
|
var info = $P.formFields.get();
|
||||||
|
|
||||||
|
var create = $P.layoutControl.dataset.empty;
|
||||||
|
|
||||||
|
ajax.post({
|
||||||
|
url : create ? $P.layoutControl.urls.create : $P.layoutControl.urls.update,
|
||||||
|
data : info,
|
||||||
|
success : (resp) => {
|
||||||
|
if(resp.saved){
|
||||||
|
dialog.close("layoutInfoDialog");
|
||||||
|
dialog.alert({
|
||||||
|
content:"저장되었습니다.",
|
||||||
|
init : () => {
|
||||||
|
setDialogZindex();
|
||||||
|
focusClose();
|
||||||
|
},
|
||||||
|
onClose : () => $P.provided.refreshList()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$P.fnRemove = () => {
|
||||||
|
|
||||||
|
var info = $P.formFields.get();
|
||||||
|
|
||||||
|
ajax.post({
|
||||||
|
url : $P.layoutControl.urls.remove,
|
||||||
|
data : {
|
||||||
|
fileLayoutId : info.fileLayoutId
|
||||||
|
},
|
||||||
|
success : (resp) => {
|
||||||
|
if(resp.saved){
|
||||||
|
dialog.close("layoutInfoDialog");
|
||||||
|
dialog.alert({
|
||||||
|
content:"삭제되었습니다.",
|
||||||
|
init : () => {
|
||||||
|
setDialogZindex();
|
||||||
|
focusClose();
|
||||||
|
},
|
||||||
|
onClose : () => $P.provided.refreshList()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* element.on
|
||||||
|
**************************************************************************/
|
||||||
|
$("#btnSave--${pageName}").on('click', () => $P.fnSave());
|
||||||
|
$("#btnDelete--${pageName}").on('click', () => $P.fnRemove());
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* 초기화
|
||||||
|
**************************************************************************/
|
||||||
|
var layoutInfo = ${layoutInfo};
|
||||||
|
if(layoutInfo != null){
|
||||||
|
$P.layoutControl.dataset.setData([layoutInfo]);
|
||||||
|
} else {
|
||||||
|
$P.layoutControl.dataset.setData([]);
|
||||||
|
$("#sggCd--${pageName}").val(MY_INFO.info.sggCd);
|
||||||
|
$("#instCd--${pageName}").val(MY_INFO.info.instCd);
|
||||||
|
$("#deptCd--${pageName}").val(MY_INFO.info.deptCd);
|
||||||
|
$("#taskSeCd--${pageName}").val("${taskSeCd}");
|
||||||
|
$("#btnDelete--${pageName}").attr("hidden","hidden");
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
Loading…
Reference in New Issue