|
|
|
|
@ -39,10 +39,10 @@
|
|
|
|
|
|
|
|
|
|
<div class="page-indicator"><span id="pageNow">2</span> of <span id="pageTotal">4</span></div>
|
|
|
|
|
<div class="nav-group">
|
|
|
|
|
<button type="button" class="nav-btn" data-act="first" id="first">◀◀</button>
|
|
|
|
|
<button type="button" class="nav-btn" data-act="prev">◀</button>
|
|
|
|
|
<button type="button" class="nav-btn" data-act="next">▶</button>
|
|
|
|
|
<button type="button" class="nav-btn" data-act="last">▶▶</button>
|
|
|
|
|
<button type="button" class="nav-btn" name="navigate" data-act="first" id="first">◀◀</button>
|
|
|
|
|
<button type="button" class="nav-btn" name="navigate" data-act="prev">◀</button>
|
|
|
|
|
<button type="button" class="nav-btn" name="navigate" data-act="next">▶</button>
|
|
|
|
|
<button type="button" class="nav-btn" name="navigate" data-act="last">▶▶</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@ -184,6 +184,10 @@
|
|
|
|
|
<img id="photoPreview" src="${pageContext.request.contextPath}/static/img/sample-1.jpg" alt="미리보기">
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<button type="button" class="btn btn-light" id="btnPrev">위반정보수정</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="statusbar">
|
|
|
|
|
@ -216,21 +220,20 @@
|
|
|
|
|
<%--<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"></script>--%>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
|
|
const fnBiz = {
|
|
|
|
|
init: () => {
|
|
|
|
|
// fnBiz.search();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// 조회결과 바인딩 샘플
|
|
|
|
|
//해당 객체는 팝업으로 인한 브라우저 전역선언이다.
|
|
|
|
|
//일반적으로 함수를 선언할땐 그냥 fnBiz로 선언하면 된다.
|
|
|
|
|
//window 전역을 그냥 복사하면 덮어씌워져서 난리남.
|
|
|
|
|
//sample.jsp 형태로 하면됨
|
|
|
|
|
window.TOTAL_INFO_POPUP_API = {
|
|
|
|
|
search: () => {
|
|
|
|
|
console.log("search!!!!")
|
|
|
|
|
console.log("Total Info Search!!!!")
|
|
|
|
|
|
|
|
|
|
const { cursor, mmCodes } = JSON.parse(localStorage.getItem("TOTAL_INFO_STATE"));
|
|
|
|
|
|
|
|
|
|
let mmCode = $("#cursor").val();
|
|
|
|
|
console.log('mmcode check', mmCode)
|
|
|
|
|
$.ajax({
|
|
|
|
|
// PathVariable 형태로 url를 동적으로 쓰는방식이다.
|
|
|
|
|
// 해당 방식 이외에 그냥 쿼리스트링으로 넘기는 방법도 있다.
|
|
|
|
|
url: "/total/info/" + mmCode + "/info.ajax",
|
|
|
|
|
url: "/total/info/" + cursor + "/info.ajax",
|
|
|
|
|
type: "GET",
|
|
|
|
|
dataType: 'json',
|
|
|
|
|
success: function(response) {
|
|
|
|
|
@ -280,35 +283,72 @@
|
|
|
|
|
$("#result").text("조회 실패");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let fnBiz = {
|
|
|
|
|
init: () => {
|
|
|
|
|
// fnBiz.search();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
eventListener: () => {
|
|
|
|
|
$("button[name=navigate]").on("click", (e) => {
|
|
|
|
|
let flag = $(e.currentTarget).data("act");
|
|
|
|
|
let { cursor, mmCodes } = JSON.parse(localStorage.getItem("TOTAL_INFO_STATE"));
|
|
|
|
|
if (!cursor || !mmCodes) return;
|
|
|
|
|
|
|
|
|
|
const idx = mmCodes.indexOf(cursor);
|
|
|
|
|
let nextCursor = cursor;
|
|
|
|
|
|
|
|
|
|
switch (flag) {
|
|
|
|
|
case "first":
|
|
|
|
|
nextCursor = mmCodes[0];
|
|
|
|
|
break;
|
|
|
|
|
case "prev":
|
|
|
|
|
nextCursor = mmCodes[Math.max(0, idx - 1)];
|
|
|
|
|
break;
|
|
|
|
|
case "next":
|
|
|
|
|
nextCursor = mmCodes[Math.min(mmCodes.length - 1, idx + 1)];
|
|
|
|
|
break;
|
|
|
|
|
case "last":
|
|
|
|
|
nextCursor = mmCodes[mmCodes.length - 1];
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 스토리지 업데이트
|
|
|
|
|
localStorage.setItem("TOTAL_INFO_STATE", JSON.stringify({ cursor: nextCursor, mmCodes: mmCodes }))
|
|
|
|
|
//커서로 조회
|
|
|
|
|
TOTAL_INFO_POPUP_API.search();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(function () {
|
|
|
|
|
console.log("init")
|
|
|
|
|
|
|
|
|
|
$("#tabs").tabs();
|
|
|
|
|
|
|
|
|
|
TOTAL_INFO_POPUP_API.search();
|
|
|
|
|
fnBiz.eventListener();
|
|
|
|
|
//mmcode 리스트 가져오기
|
|
|
|
|
$("#cursor").val(window.cursor);
|
|
|
|
|
$("#mmCodes").val(window.mmCodes);
|
|
|
|
|
console.log($('#mmCodes').val());
|
|
|
|
|
// $("#cursor").val(window.cursor);
|
|
|
|
|
// $("#mmCodes").val(window.mmCodes);
|
|
|
|
|
// console.log($('#mmCodes').val());
|
|
|
|
|
|
|
|
|
|
// mmCodes 값이 세팅되면 search() 호출
|
|
|
|
|
const checkMmCode = setInterval(() => {
|
|
|
|
|
const cursor = $("#mmCodes").val();
|
|
|
|
|
const mmCodes = $("#mmCodes").val();
|
|
|
|
|
if (cursor && mmCodes) {
|
|
|
|
|
clearInterval(checkMmCode);
|
|
|
|
|
fnBiz.search(); // 값이 들어온 시점에 호출
|
|
|
|
|
}
|
|
|
|
|
}, 100);
|
|
|
|
|
// const checkMmCode = setInterval(() => {
|
|
|
|
|
// const cursor = $("#mmCodes").val();
|
|
|
|
|
// const mmCodes = $("#mmCodes").val();
|
|
|
|
|
// if (cursor && mmCodes) {
|
|
|
|
|
// clearInterval(checkMmCode);
|
|
|
|
|
// fnBiz.search(); // 값이 들어온 시점에 호출
|
|
|
|
|
// }
|
|
|
|
|
// }, 100);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|