메뉴 아이콘 추가

main
이범준 1 year ago
parent 28b946d61b
commit 0bd2fca496

@ -11,6 +11,7 @@
<%-- <script src="<c:url value="/resources/3rd-party/sneat/js/template-customizer.js"/>"></script> --%> <%-- <script src="<c:url value="/resources/3rd-party/sneat/js/template-customizer.js"/>"></script> --%>
<%--? Config: Mandatory theme config file contain global vars & default theme options, Set your preferred theme option in this file. --> <%--? Config: Mandatory theme config file contain global vars & default theme options, Set your preferred theme option in this file. -->
<script src="../../assets/js/config.js"></script--%> <script src="../../assets/js/config.js"></script--%>
<script src="<c:url value='/resources/3rd-party/sneat/js/config.js'/>"></script>
<!-- Core JS --> <!-- Core JS -->
<!-- build:js assets/vendor/js/core.js --> <!-- build:js assets/vendor/js/core.js -->
@ -24,11 +25,9 @@
<script src="<c:url value="/resources/3rd-party/sneat/js/menu.js"/>"></script> <script src="<c:url value="/resources/3rd-party/sneat/js/menu.js"/>"></script>
<script src="<c:url value="/resources/3rd-party/sneat/libs/jstree/jstree.js"/>"></script> <script src="<c:url value="/resources/3rd-party/sneat/libs/jstree/jstree.js"/>"></script>
<script src="<c:url value="/resources/3rd-party/jstree/jstree-support.js"/>"></script> <script src="<c:url value="/resources/3rd-party/jstree/jstree-support.js"/>"></script>
<script src="<c:url value='/resources/3rd-party/sneat/js/config.js'/>"></script>
<script src="<c:url value='/resources/3rd-party/sneat/libs/chartjs/chartjs.js'/>"></script> <script src="<c:url value='/resources/3rd-party/sneat/libs/chartjs/chartjs.js'/>"></script>
<!-- base -->
<script src="<c:url value="/resources/js/base/base.js?${ver}"/>"></script> <script src="<c:url value="/resources/js/base/base.js?${ver}"/>"></script>
<script src="<c:url value="/resources/js/base/base-fims.js?${ver}"/>"></script> <script src="<c:url value="/resources/js/base/base-fims.js?${ver}"/>"></script>
<script src="<c:url value="/resources/js/base/dataset.js?${ver}"/>"></script> <script src="<c:url value="/resources/js/base/dataset.js?${ver}"/>"></script>
@ -48,9 +47,9 @@
<script src="<c:url value="/resources/js/fims/framework/cmm/cmmDateUtil.js"/>?${ver}"></script> <script src="<c:url value="/resources/js/fims/framework/cmm/cmmDateUtil.js"/>?${ver}"></script>
<!-- 업무별 기능 유틸 --> <!-- 업무별 기능 유틸 -->
<script src="<c:url value="/resources/js/fims/framework/cmm/taskUtil.js"/>?${ver}"></script> <script src="<c:url value="/resources/js/fims/framework/cmm/taskUtil.js"/>?${ver}"></script>
<!-- 데이트픽커 --> <!-- 데이트픽커 -->
<script src="<c:url value="/resources/lib/fims/framework/datepicker/datepicker.js?${ver}"/>"></script> <script src="<c:url value="/resources/lib/fims/framework/datepicker/datepicker.js?${ver}"/>"></script>
<!-- 초기화 유틸 -->
<script src="<c:url value="/resources/js/fims/framework/cmm/initAfterPageLoad.js?${ver}"/>"></script> <script src="<c:url value="/resources/js/fims/framework/cmm/initAfterPageLoad.js?${ver}"/>"></script>
<!-- 검색 유틸 --> <!-- 검색 유틸 -->
<script src="<c:url value="/resources/js/fims/framework/cmm/searchUtil.js"/>?${ver}"></script> <script src="<c:url value="/resources/js/fims/framework/cmm/searchUtil.js"/>?${ver}"></script>

@ -7,13 +7,47 @@ class FimsMenuSupport extends MenuSupport {
this._menuItem = '<li data-key="{menuID}" class="menu-item">' this._menuItem = '<li data-key="{menuID}" class="menu-item">'
+'<a data-url="{url}" onclick="openMenu(this)" class="menu-link{toggle}">' +'<a data-url="{url}" onclick="openMenu(this)" class="menu-link{toggle}">'
+'<i class="menu-icon tf-icons bx bx-layout"></i>' +'<i class="menu-icon tf-icons {imageConf}"></i>'
+'<div data-i18n="{menuName}">{menuName}</div>' +'<div data-i18n="{menuName}">{menuName}</div>'
+'</a>' +'</a>'
+'{menuSub}' +'{menuSub}'
+'</li>'; +'</li>';
} }
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))
.replace(/{imageConf}/gi, !menu.imageConf ? "bx bx-layout" : menu.imageConf);
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();
}
} }

Loading…
Cancel
Save