no message

main
이범준 1 year ago
parent e6b0813161
commit 658a54bf6e

@ -1,4 +0,0 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"
%><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"
%><%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"
%><%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

@ -2,6 +2,6 @@
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!-- FIMS 추가 -->
<%@ taglib prefix="code" uri="/WEB-INF/tlds/code.tld"%>
<%@ taglib prefix="privacy" uri="/WEB-INF/tlds/privacy.tld"%>

@ -25,6 +25,7 @@
<script src="<c:url value="/resources/js/base/base.js?${ver}"/>"></script>
<script src="<c:url value="/resources/js/base/dataset.js?${ver}"/>"></script>
<script src="<c:url value="/resources/js/base/menu-support.js?${ver}"/>"></script>
<script src="<c:url value="/resources/js/base/menu-support-fims.js?${ver}"/>"></script>
<!-- endbuild -->
<c:set var="functions" scope="request">
wctx.path = "${pageContext.request.contextPath}";

@ -1,96 +0,0 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<!-- Menu -->
<aside id="layout-menu" class="layout-menu menu-vertical menu bg-menu-theme">
<div class="app-brand demo">
<a href="javascript:wctx.home();" class="app-brand-link">
<span class="app-brand-logo demo">
<svg
width="25"
viewBox="0 0 25 42"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.7918663,0.358365126 L3.39788168,7.44174259 C0.566865006,9.69408886 -0.379795268,12.4788597 0.557900856,15.7960551 C0.68998853,16.2305145 1.09562888,17.7872135 3.12357076,19.2293357 C3.8146334,19.7207684 5.32369333,20.3834223 7.65075054,21.2172976 L7.59773219,21.2525164 L2.63468769,24.5493413 C0.445452254,26.3002124 0.0884951797,28.5083815 1.56381646,31.1738486 C2.83770406,32.8170431 5.20850219,33.2640127 7.09180128,32.5391577 C8.347334,32.0559211 11.4559176,30.0011079 16.4175519,26.3747182 C18.0338572,24.4997857 18.6973423,22.4544883 18.4080071,20.2388261 C17.963753,17.5346866 16.1776345,15.5799961 13.0496516,14.3747546 L10.9194936,13.4715819 L18.6192054,7.984237 L13.7918663,0.358365126 Z"
id="path-1"
></path>
<path
d="M5.47320593,6.00457225 C4.05321814,8.216144 4.36334763,10.0722806 6.40359441,11.5729822 C8.61520715,12.571656 10.0999176,13.2171421 10.8577257,13.5094407 L15.5088241,14.433041 L18.6192054,7.984237 C15.5364148,3.11535317 13.9273018,0.573395879 13.7918663,0.358365126 C13.5790555,0.511491653 10.8061687,2.3935607 5.47320593,6.00457225 Z"
id="path-3"
></path>
<path
d="M7.50063644,21.2294429 L12.3234468,23.3159332 C14.1688022,24.7579751 14.397098,26.4880487 13.008334,28.506154 C11.6195701,30.5242593 10.3099883,31.790241 9.07958868,32.3040991 C5.78142938,33.4346997 4.13234973,34 4.13234973,34 C4.13234973,34 2.75489982,33.0538207 2.37032616e-14,31.1614621 C-0.55822714,27.8186216 -0.55822714,26.0572515 -4.05231404e-15,25.8773518 C0.83734071,25.6075023 2.77988457,22.8248993 3.3049379,22.52991 C3.65497346,22.3332504 5.05353963,21.8997614 7.50063644,21.2294429 Z"
id="path-4"
></path>
<path
d="M20.6,7.13333333 L25.6,13.8 C26.2627417,14.6836556 26.0836556,15.9372583 25.2,16.6 C24.8538077,16.8596443 24.4327404,17 24,17 L14,17 C12.8954305,17 12,16.1045695 12,15 C12,14.5672596 12.1403557,14.1461923 12.4,13.8 L17.4,7.13333333 C18.0627417,6.24967773 19.3163444,6.07059163 20.2,6.73333333 C20.3516113,6.84704183 20.4862915,6.981722 20.6,7.13333333 Z"
id="path-5"
></path>
</defs>
<g id="g-app-brand" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Brand-Logo" transform="translate(-27.000000, -15.000000)">
<g id="Icon" transform="translate(27.000000, 15.000000)">
<g id="Mask" transform="translate(0.000000, 8.000000)">
<mask id="mask-2" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<use fill="#696cff" xlink:href="#path-1"></use>
<g id="Path-3" mask="url(#mask-2)">
<use fill="#696cff" xlink:href="#path-3"></use>
<use fill-opacity="0.2" fill="#FFFFFF" xlink:href="#path-3"></use>
</g>
<g id="Path-4" mask="url(#mask-2)">
<use fill="#696cff" xlink:href="#path-4"></use>
<use fill-opacity="0.2" fill="#FFFFFF" xlink:href="#path-4"></use>
</g>
</g>
<g
id="Triangle"
transform="translate(19.000000, 11.000000) rotate(-300.000000) translate(-19.000000, -11.000000) "
>
<use fill="#696cff" xlink:href="#path-5"></use>
<use fill-opacity="0.2" fill="#FFFFFF" xlink:href="#path-5"></use>
</g>
</g>
</g>
</g>
</svg>
</span>
<span class="app-brand-text demo menu-text fw-bolder ms-2">XIT Base</span>
</a>
<a href="javascript:void(0);" class="layout-menu-toggle menu-link text-large ms-auto">
<i class="bx bx-chevron-left bx-sm align-middle"></i>
</a>
</div>
<div class="menu-inner-shadow"></div>
<ul id="menus" class="menu-inner py-1">
</ul>
</aside>
<!-- / Menu -->
<c:set var="userMenus" scope="request">let userMenus = ${userMenus};
<%--if (menus.length < 1)
menus = [
{"id":0, "name": "사용자", "url":"/user/main.do", "parentID":null, "description":"사용자 관리", "imagePath":null, "displayWindow":"_self"},
{"id":1, "name": "권한", "url":null, "parentID":null, "description":"권한 관리", "imagePath":null, "displayWindow":"_self",
"children":[
{"id":2, "name": "권한 설정", "url":"/authority/list.do", "parentID":1, "description":"권한 관리", "imagePath":null, "displayWindow":"_self"},
{"id":3, "name": "액션 설정", "url":"/authority/action/list.do", "parentID":1, "description":"액션 관리", "imagePath":null, "displayWindow":"_self"},
]
},
{"id":4, "name": "메뉴", "url":"/menu/list.do", "parentID":null, "description":"메뉴 관리", "imagePath":null, "displayWindow":"_self"}
];--%>
function setUserMenus(menus) {
let menuSupport = new MenuSupport("#layout-menu").setMenuInfo(menus).setActive(wctx.current());
let currentMenu = menuSupport.getMenu(wctx.current());
if (currentMenu)
setPageTitle(currentMenu.name);
}
setUserMenus(userMenus);
</c:set>

@ -4,37 +4,22 @@
<aside id="layout-menu" class="layout-menu menu-vertical menu bg-menu-theme">
<div class="app-brand demo">
<a href="javascript:wctx.home();" class="app-brand-link">
<span class="app-brand-logo demo">
<img src="<c:url value='/'/>resources/image/fims/framework/login/mainLogo_01.png" width="42px" height="42px" alt="logo" />
</span>
<span class="app-brand-logo demo">
<img src="<c:url value='/'/>resources/image/fims/framework/login/mainLogo_01.png" width="42px" height="42px" alt="logo" />
</span>
<span class="app-brand-text demo menu-text fw-bolder ms-2">과태료통합관리시스템</span>
</a>
<a href="javascript:void(0);" class="layout-menu-toggle menu-link text-large ms-auto">
<i class="bx bx-chevron-left bx-sm align-middle"></i>
</a>
</div>
<div class="menu-inner-shadow"></div>
<ul id="menus" class="menu-inner py-1">
</ul>
</aside>
<script src="<c:url value="/resources/js/base/menu-support-fims.js" />"></script>
<script src="<c:url value="/resources/js/base/menu-support-fims-innerPage.js" />"></script>
<!-- / Menu -->
<c:set var="userMenus" scope="request">let userMenus = ${userMenus};
<%--if (menus.length < 1)
menus = [
{"id":0, "name": "사용자", "url":"/user/main.do", "parentID":null, "description":"사용자 관리", "imagePath":null, "displayWindow":"_self"},
{"id":1, "name": "권한", "url":null, "parentID":null, "description":"권한 관리", "imagePath":null, "displayWindow":"_self",
"children":[
{"id":2, "name": "권한 설정", "url":"/authority/list.do", "parentID":1, "description":"권한 관리", "imagePath":null, "displayWindow":"_self"},
{"id":3, "name": "액션 설정", "url":"/authority/action/list.do", "parentID":1, "description":"액션 관리", "imagePath":null, "displayWindow":"_self"},
]
},
{"id":4, "name": "메뉴", "url":"/menu/list.do", "parentID":null, "description":"메뉴 관리", "imagePath":null, "displayWindow":"_self"}
];--%>
function setUserMenus(menus) {
let menuSupport = new FimsMenuSupport("#layout-menu").setMenuInfo(menus).setActive(wctx.current());

@ -1,29 +0,0 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@ include file="/WEB-INF/jsp/include/taglib.jsp"%>
<jsp:include page="/WEB-INF/jsp/include/head.jsp" />
<body>
<!-- Layout wrapper -->
<div class="layout-wrapper layout-content-navbar">
<div class="layout-container">
<jsp:include page="/WEB-INF/jsp/include/userMenus.jsp" />
<!-- Layout container -->
<div class="layout-page">
<jsp:include page="/WEB-INF/jsp/include/top.jsp" />
</div>
<!-- / Layout page -->
</div>
</div>
<!-- / Layout wrapper -->
<jsp:include page="/WEB-INF/jsp/include/tail.jsp" />
<script >
${functions}
${userMenus}
$(function(){
${onload}
});
</script>
</body>
</html>

@ -20,15 +20,14 @@
<!-- 스크롤바 -->
<script src="${ctx}/resources/3rd-party/sneat/libs/perfect-scrollbar/perfect-scrollbar.js"></script>
<!-- 메뉴바 생성 -->
<script src="${pageContext.request.contextPath}/resources/js/fims/biz/layout/fims-menu-support.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/fims/biz/layout/menu-support.js"></script>
<script src="${pageContext.request.contextPath}/resources/js/fims/biz/layout/menu-support-fims.js"></script>
<!-- [JS] rolling -->
<script type="text/javascript" src="${ctx}/resources/3rd-party/rolling/js/jquery.vticker-min.js"></script>
<%@include file="/WEB-INF/jsp/include/fims/tail-biz.jsp" %>
<!-- iframe탭 -->
<script src="/resources/js/base/menu-support-fims-innerPage.js"></script>
<!-- 계정정보 화면 오픈 -->
<script src="${pageContext.request.contextPath}/resources/js/fims/biz/layout/myView.js"></script>

@ -1,6 +1,6 @@
/** .
*/
class FimsMenuSupport {
class FimsMenuSupport extends MenuSupport {
/** MenuSupport .
* @param selector {string} 메뉴를 담을 컨테이너에 대한 css selector
*/
@ -22,161 +22,151 @@ class FimsMenuSupport {
this._menus = [];
}
/** .
* @param menus {array} 메뉴 정보 배열<br />
* 메뉴 정보의 레이아웃은 다음과 같다.<br />
* {"id":메뉴 아이디, "name":"메뉴 이름", "url":"실행 url", "parentID":"상위 메뉴 아이디", "description":"메뉴 설명", "imagePath":"이미지 경로", "displayWindow":"표시 창", "children":[하위 메뉴 배열]}
* @returns MenuSupport
*/
setMenuInfo(menus) {
let setParent = menu => {
let children = menu.children || [];
if (children.length < 1) return;
children.forEach(child => {
child.parent = menu;
setParent(child);
});
};
menus.forEach(menu => setParent(menu));
this._menus = menus;
let menuItemTag = menu => {
let tag = this._menuItem
.replace(/{menuID}/gi, menu.id)
.replace(/{menuName}/gi, menu.name)
.replace(/{url}/gi, !menu.url ? "javascript:void(0);" : wctx.url(menu.url));
let parent = menu.children && menu.children.length > 0;
tag = tag.replace(/{toggle}/gi, !parent ? "" : " menu-toggle");
if (!parent)
return tag.replace(/{menuSub}/gi, "");
let children = menu.children.map(child => menuItemTag(child)).join("\n\t")
return tag.replace(/{menuSub}/gi, this._menuSub.replace(/{children}/gi, children));
}
let tags = (menus || []).map(menu => menuItemTag(menu));
document.querySelector("#menus").innerHTML = tags.join("");
return this._init();
}
}
/**************************************************************************
* Global Variable
***************************************************************************/
const innerPageMap = {},
openMax = 8;
function openMenu(obj, params) {
_init() {
document.querySelectorAll(this._selector).forEach(element => {
let menu = new Menu(element, {
orientation: this._orientation,
closeChildren: this._horizontal,
showDropdownOnHover: localStorage.getItem('templateCustomizer-' + this._template + '--ShowDropdownOnHover')
? localStorage.getItem('templateCustomizer-' + this._template + '--ShowDropdownOnHover') === 'true'
: window.templateCustomizer !== undefined
? window.templateCustomizer.settings.defaultShowDropdownOnHover
: true
});
window.Helpers.scrollToActive(false); //animate = false
window.Helpers.mainMenu = menu;
});
//Sets toggler
document.querySelectorAll('.layout-menu-toggle').forEach(item => {
item.addEventListener('click', event => {
event.preventDefault();
window.Helpers.toggleCollapsed();
if (config.enableMenuLocalStorage && !window.Helpers.isSmallScreen()) {
try {
localStorage.setItem(
'templateCustomizer-' + this._template + '--LayoutCollapsed',
String(window.Helpers.isCollapsed())
);
} catch (e) {}
}
});
});
// Display menu toggle (layout-menu-toggle) on hover with delay
let delay = (elem, callback) => {
let timeout = null;
elem.onmouseenter = () => {
// Set timeout to be a timer which will invoke callback after 300ms (not for small screen)
timeout = !Helpers.isSmallScreen() ? setTimeout(callback, 300) : setTimeout(callback, 0);
};
elem.onmouseleave = () => {
// Clear any timers set to timeout
document.querySelector('.layout-menu-toggle').classList.remove('d-block');
clearTimeout(timeout);
};
};
if (this._container) {
delay(this._container, () => {
// not for small screen
if (!Helpers.isSmallScreen()) {
document.querySelector('.layout-menu-toggle').classList.add('d-block');
}
});
}
return this;
let menuUrl = $(obj)[0].dataset.url;
if(menuUrl == "javascript:void(0);"){
return;
}
let menuNm = $(obj).find("div")[0].dataset.i18n;
let dataKey = $(obj).parent()[0].dataset.key;
/** url .
* @param url {string} 메뉴 url
* @returns MenuSupport
*/
setActive(url) {
document
.querySelectorAll(this._selector + " li")
.forEach(li => li.classList.remove("active", "open"));
let a = document.querySelector(this._selector + ' a[href=\"' + wctx.url(url) + '\"]');
if (!a) return this;
let activate = (e, open) => {
let p = e.parentNode;
let tag = (p != this._container ? p : null) ? p.tagName : "";
if (!tag) return;
if ("li" == tag.toLowerCase()) {
p.classList.add("active");
if (open)
p.classList.add("open");
}
activate(p, true);
};
activate(a);
return this;
}
const OPEN_TAB_CNT = $('div#tabsForInnerPage > ul > li').length;
if(innerPageMap[dataKey]){
// 해당 tab 활성화
$("#tabsForInnerPage").find("ul li button.nav-link").each((idx, data) => {
if(data.dataset.bsTarget == ("#tab-"+dataKey)) {
$(data).trigger("click");
}
});
let innerPageObj = document.getElementById("div"+dataKey);
return innerPageObj;
}
if(OPEN_TAB_CNT === openMax){
alert(`메뉴는 최대 ${openMax -1}까지만 열 수 있습니다.`)
return null;
}
const num_tabs = OPEN_TAB_CNT + 1;
let liEl = '<li id="li-'+ dataKey +'" class="nav-item">';
let linkClass = 'nav-link';
if(dataKey != "main"){
linkClass += ' nav-link-closeable';
}
liEl +='<button type="button" data-bs-toggle="tab" data-bs-target="#tab-'+ dataKey + '" class="' + linkClass + '">' + menuNm + '</button>';
if(dataKey != "main"){
liEl += '<button type="button" title="닫기" class="btn btn-close" onclick="closeTab('+ dataKey + ')"></button>'
}
liEl += '</li>';
$('div#tabsForInnerPage ul').append(liEl);
$('div#ifrTabContents').append('<div id="tab-' + dataKey + '" class="tab-pane"></div>');
if(params != null){
menuUrl = menuUrl + params;
}
let dynamicPage = document.createElement("div");
dynamicPage.setAttribute("id","div"+dataKey);
dynamicPage.setAttribute("name","div"+dataKey);
dynamicPage.setAttribute("title",menuNm);
// .attr("frameborder" , "0")
// .attr("scrolling" , "no")
// .attr("width" , "100%")
// .css("border" , "0")
// .css("height" , "100%")
// .css("min-height" , "800px")
// .css("overflow" , "auto")
// .css("overflow-x" , "no")
;
$("#formForInnerPage").remove();
$("#tab-" + dataKey)[0].appendChild(dynamicPage);
/** url .
* @param url {string} 메뉴 url
* @returns 지정하는 url의 메뉴 정보
*/
getMenu(url) {
let find = menus => {
for (let i = 0; i < menus.length; ++i) {
let menu = menus[i];
if (url == menu.url)
return menu;
let found = find(menu.children || []);
if (found)
return found;
}
return null;
};
return find(this._menus);
}
breadcrumb(url, separator = " / ") {
let menu = this.getMenu(url);
if (!menu)
return "";
let getName = menu => {
let name = menu.name;
let parent = !menu.parent ? "" : getName(menu.parent);
return parent ? parent + separator + name : name;
}
innerPageMap[dataKey] = dynamicPage;
ajax.request({
type:"POST",
url:menuUrl,
data:{},
success:resp => {
var cw = resp.split("<!-- Content wrapper -->")[1];
var pb = cw.split("<!-- Page Body -->")[1];
var scriptAterTail1 = resp.split("<!-- script after tail1 -->")[1];
var scriptAterTail2 = resp.split("//script after tail2")[1];
$("#div"+dataKey).html(pb + " " + scriptAterTail1 + " " + "<script>"+ scriptAterTail2 + "</script>");
}
});
return getName(menu);
}
$("div#tabsForInnerPage ul li button.nav-link").last().trigger("click");
}
function closeTab(menuId) {
if(menuId === 'main' || menuId?.id === 'main') return;
const num_tabs = $('div#tabsForInnerPage ul li').length;
// click한 tab
const selIdx = id2Index("div#tabsForInnerPage","tab-"+menuId);
// active tab
let activeTab = $('div#tabsForInnerPage ul li button.nav-link').filter(".active");
let activeIdx = $('div#tabsForInnerPage ul li button.nav-link').index(activeTab);
if(selIdx === activeIdx) {
if (num_tabs - 1 > activeIdx) {
$('div#tabsForInnerPage ul li button.nav-link').eq(activeIdx + 1).trigger("click");
} else {
$('div#tabsForInnerPage ul li button.nav-link').eq(activeIdx - 1).trigger("click");
}
}
document.getElementById("div"+menuId).remove();
delete innerPageMap[menuId];
$("#tab-" + activeIdx).remove();
$('#tabsForInnerPage').find('#li-'+menuId).remove();
}
function id2Index(tabsId, srcId) {
let index = -1;
const nls = $(tabsId).find("li > button.nav-link");
if(nls.length > 0) {
nls.each((idx, nl) => {
if (nl.dataset.bsTarget.search(srcId) > 0) {
index = idx;
return false;
}
});
}
return index;
}
Loading…
Cancel
Save