다이얼로그 관련 소스정리
parent
8f37ef29db
commit
981362504b
@ -1,64 +1,73 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
<form id="frmEdit--${pageName}">
|
||||
<div class="d-flex flex-row justify-content-evenly">
|
||||
<div class="card" style="width:1000px;min-height:200px;">
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<label class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">업무</label>
|
||||
<select id="taskSeCd--${pageName}" name="taskSeCd" class="form-select">
|
||||
<c:forEach items="${taskSeCdList}" var="item">
|
||||
<option value="${item.CODE}">${item.CODE_VAL}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<label class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">소스 시군구</label>
|
||||
<select id="srcSgg--${pageName}" name="srcSgg" class="form-select">
|
||||
<c:forEach items="${sggList}" var="item">
|
||||
<option value="${item.SGG_CD}">${item.SGG_NM}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<label class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">타겟 시군구</label>
|
||||
<select id="trgtSgg--${pageName}" name="trgtSgg" class="form-select">
|
||||
<c:forEach items="${sggList}" var="item">
|
||||
<option value="${item.SGG_CD}">${item.SGG_NM}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<span class="float-end p-4">
|
||||
<button type="button" id="btnCopyStng--${pageName}" class="btn btn-primary">업무,위반 설정 복사</button>
|
||||
</span>
|
||||
<span data-doctx="${pageName}">
|
||||
<form name="frmEdit">
|
||||
<div class="d-flex flex-row justify-content-evenly">
|
||||
<div class="card" style="width:1000px;min-height:200px;">
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<label is="name-label" for="taskSeCd"
|
||||
class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">업무</label>
|
||||
<select is="id-select" name="taskSeCd" class="form-select">
|
||||
<c:forEach items="${taskSeCdList}" var="item">
|
||||
<option value="${item.CODE}">${item.CODE_VAL}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<label is="name-label" for="srcSgg"
|
||||
class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">소스 시군구</label>
|
||||
<select is="id-select" name="srcSgg" class="form-select">
|
||||
<c:forEach items="${sggList}" var="item">
|
||||
<option value="${item.SGG_CD}">${item.SGG_NM}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<label is="name-label" for="trgtSgg"
|
||||
class="w-px-130 bg-lighter pe-2 col-form-label text-sm-end">타겟 시군구</label>
|
||||
<select is="id-select" name="trgtSgg" class="form-select">
|
||||
<c:forEach items="${sggList}" var="item">
|
||||
<option value="${item.SGG_CD}">${item.SGG_NM}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<span class="float-end p-4">
|
||||
<button type="button" name="btnCopyStng" class="btn btn-primary">업무,위반 설정 복사</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</form>
|
||||
</span>
|
||||
<script>
|
||||
$("#btnCopyStng--${pageName}").on("click", function(){
|
||||
|
||||
if($("#srcSgg--${pageName}").val() == $("#trgtSgg--${pageName}").val()){
|
||||
alert("동일한 시군구 선택 불가");
|
||||
return;
|
||||
}
|
||||
|
||||
ajax.get({
|
||||
url : wctx.url("admin/copySggStng.do"),
|
||||
data : {
|
||||
taskSeCd : $("#taskSeCd--${pageName}").val(),
|
||||
srcSgg : $("#srcSgg--${pageName}").val(),
|
||||
trgtSgg : $("#trgtSgg--${pageName}").val()
|
||||
},
|
||||
success : (resp) => {
|
||||
if(resp.saved){
|
||||
alert('완료');
|
||||
}
|
||||
pageObject['${pageName}'] = newDoctxFinder("${pageName}");
|
||||
$(document).ready(function() {
|
||||
let $P = pageObject['${pageName}'];
|
||||
$P.$find("btnCopyStng").on("click", function(){
|
||||
|
||||
if($P.$find("srcSgg").val() == $P.$find("trgtSgg").val()){
|
||||
alert("동일한 시군구 선택 불가");
|
||||
return;
|
||||
}
|
||||
|
||||
ajax.get({
|
||||
url : wctx.url("admin/copySggStng.do"),
|
||||
data : {
|
||||
taskSeCd : $P.$find("taskSeCd").val(),
|
||||
srcSgg : $P.$find("srcSgg").val(),
|
||||
trgtSgg : $P.$find("trgtSgg").val()
|
||||
},
|
||||
success : (resp) => {
|
||||
if(resp.saved){
|
||||
alert('완료');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
@ -1,192 +1,188 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
|
||||
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
|
||||
<form id="frmEdit--${pageName}">
|
||||
<div class="d-flex flex-row justify-content-evenly">
|
||||
<div class="card" style="width:500px;">
|
||||
<h3>시군구 백업</h3>
|
||||
|
||||
<div class="card-datatable text-nowrap">
|
||||
<div id="backupSgg-DataTables_Table_0_wrapper--${pageName}" class="dataTables_wrapper dt-bootstrap5 no-footer">
|
||||
<div id="backupSgg-table-responsive--${pageName}" class="table-responsive"
|
||||
style="overflow-x: scroll;height:500px;overflow-y: scroll;">
|
||||
<table id="backupSgg-DataTables_Table_0--${pageName}"
|
||||
class="table-layout-fixed datatables-ajax table table-bordered dataTable no-footer">
|
||||
<thead class="sticky-thead">
|
||||
<tr data-key="{SGG_CD}">
|
||||
<th style="width: 50px;"></th>
|
||||
<th style="width: 140px;" >시군구코드</th>
|
||||
<th style="width: 300px;" >시군구명</th>
|
||||
<th class="cmn dummy-th"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="backupSggTbody--${pageName}">
|
||||
</tbody>
|
||||
</table>
|
||||
<span data-doctx="${pageName}">
|
||||
<form name="frmEdit">
|
||||
<div class="d-flex flex-row justify-content-evenly">
|
||||
<div class="card" style="width:500px;">
|
||||
<h3>시군구 백업</h3>
|
||||
|
||||
<div class="card-datatable text-nowrap">
|
||||
<div class="dataTables_wrapper dt-bootstrap5 no-footer">
|
||||
<div class="table-responsive"
|
||||
style="overflow-x: scroll;height:500px;overflow-y: scroll;">
|
||||
<table class="table-layout-fixed datatables-ajax table table-bordered dataTable no-footer">
|
||||
<thead class="sticky-thead">
|
||||
<tr data-key="{SGG_CD}">
|
||||
<th style="width: 50px;"></th>
|
||||
<th style="width: 140px;" >시군구코드</th>
|
||||
<th style="width: 300px;" >시군구명</th>
|
||||
<th class="cmn dummy-th"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody name="backupSggTbody">
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="card" style="width:100px;">
|
||||
<div style="display: flex;flex-direction: column;justify-content: space-evenly;height: 100%;">
|
||||
<button type="button" id="btnAdd--${pageName}">추가 >></button>
|
||||
<button type="button" id="btnDel--${pageName}"><< 삭제</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card" style="width:500px;">
|
||||
<h3>시군구</h3>
|
||||
|
||||
<div class="card-datatable text-nowrap">
|
||||
<div id="originalSgg-DataTables_Table_0_wrapper--${pageName}" class="dataTables_wrapper dt-bootstrap5 no-footer">
|
||||
<div id="originalSgg-table-responsive--${pageName}" class="table-responsive"
|
||||
style="overflow-x: scroll;height:500px;overflow-y: scroll;">
|
||||
<table id="originalSgg-DataTables_Table_0--${pageName}"
|
||||
class="table-layout-fixed datatables-ajax table table-bordered dataTable no-footer">
|
||||
<thead class="sticky-thead">
|
||||
<tr data-key="{SGG_CD}">
|
||||
<th style="width: 50px;"></th>
|
||||
<th style="width: 140px;" >시군구코드</th>
|
||||
<th style="width: 300px;" >시군구명</th>
|
||||
<th class="cmn dummy-th"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="originalSggTbody--${pageName}">
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="card" style="width:100px;">
|
||||
<div style="display: flex;flex-direction: column;justify-content: space-evenly;height: 100%;">
|
||||
<button type="button" name="btnAdd">추가 >></button>
|
||||
<button type="button" name="btnDel"><< 삭제</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card" style="width:500px;">
|
||||
<h3>시군구</h3>
|
||||
|
||||
<div class="card-datatable text-nowrap">
|
||||
<div class="dataTables_wrapper dt-bootstrap5 no-footer">
|
||||
<div class="table-responsive"
|
||||
style="overflow-x: scroll;height:500px;overflow-y: scroll;">
|
||||
<table class="table-layout-fixed datatables-ajax table table-bordered dataTable no-footer">
|
||||
<thead class="sticky-thead">
|
||||
<tr data-key="{SGG_CD}">
|
||||
<th style="width: 50px;"></th>
|
||||
<th style="width: 140px;" >시군구코드</th>
|
||||
<th style="width: 300px;" >시군구명</th>
|
||||
<th class="cmn dummy-th"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody name="originalSggTbody">
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<template id="sggRow--${pageName}">
|
||||
<tr data-key="{SGG_CD}">
|
||||
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center cmn">
|
||||
<input type="checkbox" value="{SGG_CD}" />
|
||||
</td>
|
||||
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center cmn">{SGG_CD}</td>
|
||||
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center cmn">{SGG_NM}</td>
|
||||
<td class="dummy-td cmn"></td>
|
||||
</tr>
|
||||
</template>
|
||||
<template id="sggNotFound--${pageName}">
|
||||
<tr>
|
||||
<td valign="top" colspan="14" class="dataTables_empty text-center">
|
||||
정보를 찾지 못했습니다.
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
|
||||
<template name="sggRow">
|
||||
<tr data-key="{SGG_CD}">
|
||||
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center cmn">
|
||||
<input type="checkbox" value="{SGG_CD}" />
|
||||
</td>
|
||||
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center cmn">{SGG_CD}</td>
|
||||
<td onclick="{onclick}" ondblclick="{ondblclick}" class="text-center cmn">{SGG_NM}</td>
|
||||
<td class="dummy-td cmn"></td>
|
||||
</tr>
|
||||
</template>
|
||||
<template name="sggNotFound">
|
||||
<tr>
|
||||
<td valign="top" colspan="14" class="dataTables_empty text-center">
|
||||
정보를 찾지 못했습니다.
|
||||
</td>
|
||||
</tr>
|
||||
</template>
|
||||
</span>
|
||||
<script>
|
||||
pageObject['${pageName}'] = {};
|
||||
|
||||
pageObject['${pageName}'].originalDataset = new Dataset({
|
||||
keymapper : info => info ? info.SGG_CD : ""
|
||||
});
|
||||
pageObject['${pageName}'].backupDataset = new Dataset({
|
||||
keymapper : info => info ? info.SGG_CD : ""
|
||||
});
|
||||
|
||||
pageObject['${pageName}'] = newDoctxFinder("${pageName}");
|
||||
|
||||
function fnRenderBackupAndOriginal(list,tbodyId,dataset){
|
||||
$("#"+tbodyId).html("");
|
||||
|
||||
if(list != null && list.length > 0){
|
||||
dataset.setData(list);
|
||||
} else {
|
||||
dataset.setData([]);
|
||||
}
|
||||
$(document).ready(function(){
|
||||
let $P = pageObject['${pageName}'];
|
||||
|
||||
var empty = dataset.empty;
|
||||
var notFound = [document.getElementById("sggNotFound--${pageName}").innerHTML];
|
||||
var found = document.getElementById("sggRow--${pageName}").innerHTML;
|
||||
var replacer = (str, dataItem) => str.replace(/{onclick}/gi, "");
|
||||
var trs = empty ? notFound : dataset.inStrings(found, replacer);
|
||||
$("#"+tbodyId).html(trs.join());
|
||||
}
|
||||
|
||||
function getBackupAndOriginalDataList(){
|
||||
ajax.get({
|
||||
url : wctx.url("/admin/sggBackup/list.do"),
|
||||
data : {
|
||||
originalTable : "TB_SGG",
|
||||
backupTable : "TB_SGG_ORG",
|
||||
pkName : "SGG_CD"
|
||||
},
|
||||
success : (resp) => {
|
||||
|
||||
fnRenderBackupAndOriginal(resp.originalDataList,"originalSggTbody--${pageName}", pageObject['${pageName}'].originalDataset);
|
||||
fnRenderBackupAndOriginal(resp.backupDataList,"backupSggTbody--${pageName}", pageObject['${pageName}'].backupDataset);
|
||||
|
||||
}
|
||||
$P.originalDataset = new Dataset({
|
||||
keymapper : info => info ? info.SGG_CD : ""
|
||||
});
|
||||
}
|
||||
|
||||
$("#btnAdd--${pageName}").on("click", function(){
|
||||
var checked = $("#backupSggTbody--${pageName}").find("input[type='checkbox']:checked");
|
||||
if(checked.length < 1){
|
||||
return;
|
||||
}
|
||||
|
||||
var arr = [];
|
||||
checked.each(function(){
|
||||
arr.push(this.value);
|
||||
$P.backupDataset = new Dataset({
|
||||
keymapper : info => info ? info.SGG_CD : ""
|
||||
});
|
||||
|
||||
ajax.post({
|
||||
url : wctx.url("/admin/sggBackup/activate.do"),
|
||||
data : {
|
||||
originalTable : "TB_SGG",
|
||||
backupTable : "TB_SGG_ORG",
|
||||
pkName : "SGG_CD",
|
||||
pks : arr.join(",")
|
||||
},
|
||||
success : (resp) => {
|
||||
if(resp.saved){
|
||||
getBackupAndOriginalDataList();
|
||||
}
|
||||
$P.fnRenderBackupAndOriginal = (list,tbodyName, dataset) => {
|
||||
$P.$find(tbodyName).html("");
|
||||
|
||||
if(list != null && list.length > 0){
|
||||
dataset.setData(list);
|
||||
} else {
|
||||
dataset.setData([]);
|
||||
}
|
||||
});
|
||||
|
||||
var empty = dataset.empty;
|
||||
var notFound = [$P.find("sggNotFound").innerHTML];
|
||||
var found = $P.find("sggRow").innerHTML;
|
||||
var replacer = (str, dataItem) => str.replace(/{onclick}/gi, "");
|
||||
var trs = empty ? notFound : dataset.inStrings(found, replacer);
|
||||
$P.$find(tbodyName).html(trs.join());
|
||||
};
|
||||
|
||||
});
|
||||
$("#btnDel--${pageName}").on("click", function(){
|
||||
var checked = $("#originalSggTbody--${pageName}").find("input[type='checkbox']:checked");
|
||||
if(checked.length < 1){
|
||||
return;
|
||||
}
|
||||
var arr = [];
|
||||
checked.each(function(){
|
||||
arr.push(this.value);
|
||||
});
|
||||
$P.getBackupAndOriginalDataList = () => {
|
||||
ajax.get({
|
||||
url : wctx.url("/admin/sggBackup/list.do"),
|
||||
data : {
|
||||
originalTable : "TB_SGG",
|
||||
backupTable : "TB_SGG_ORG",
|
||||
pkName : "SGG_CD"
|
||||
},
|
||||
success : (resp) => {
|
||||
|
||||
$P.fnRenderBackupAndOriginal(resp.originalDataList,"originalSggTbody", $P.originalDataset);
|
||||
$P.fnRenderBackupAndOriginal(resp.backupDataList,"backupSggTbody", $P.backupDataset);
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
ajax.post({
|
||||
url : wctx.url("/admin/sggBackup/deactivate.do"),
|
||||
data : {
|
||||
originalTable : "TB_SGG",
|
||||
backupTable : "TB_SGG_ORG",
|
||||
pkName : "SGG_CD",
|
||||
pks : arr.join(",")
|
||||
},
|
||||
success : (resp) => {
|
||||
if(resp.saved){
|
||||
getBackupAndOriginalDataList();
|
||||
$P.$find("btnAdd").on("click", function(){
|
||||
var checked = $P.$find("backupSggTbody").find("input[type='checkbox']:checked");
|
||||
if(checked.length < 1){
|
||||
return;
|
||||
}
|
||||
|
||||
var arr = [];
|
||||
checked.each(function(){
|
||||
arr.push(this.value);
|
||||
});
|
||||
|
||||
ajax.post({
|
||||
url : wctx.url("/admin/sggBackup/activate.do"),
|
||||
data : {
|
||||
originalTable : "TB_SGG",
|
||||
backupTable : "TB_SGG_ORG",
|
||||
pkName : "SGG_CD",
|
||||
pks : arr.join(",")
|
||||
},
|
||||
success : (resp) => {
|
||||
if(resp.saved){
|
||||
$P.getBackupAndOriginalDataList();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
$P.$find("btnDel").on("click", function(){
|
||||
var checked = $P.$find("originalSggTbody").find("input[type='checkbox']:checked");
|
||||
if(checked.length < 1){
|
||||
return;
|
||||
}
|
||||
var arr = [];
|
||||
checked.each(function(){
|
||||
arr.push(this.value);
|
||||
});
|
||||
|
||||
ajax.post({
|
||||
url : wctx.url("/admin/sggBackup/deactivate.do"),
|
||||
data : {
|
||||
originalTable : "TB_SGG",
|
||||
backupTable : "TB_SGG_ORG",
|
||||
pkName : "SGG_CD",
|
||||
pks : arr.join(",")
|
||||
},
|
||||
success : (resp) => {
|
||||
if(resp.saved){
|
||||
$P.getBackupAndOriginalDataList();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
getBackupAndOriginalDataList();
|
||||
$P.getBackupAndOriginalDataList();
|
||||
});
|
||||
|
||||
</script>
|
Loading…
Reference in New Issue