[FO] 전체메뉴
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package app.module.front.usecase.menu.adapters.web;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@Controller
|
||||
public class MenuController {
|
||||
|
||||
/**
|
||||
* FRONT 메인 페이지
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(path = "/menu")
|
||||
ResponseEntity<?> allMenu() {
|
||||
// TODO
|
||||
HashMap<String, String> resVO = new HashMap<>();
|
||||
// resVO.put("daily", "2025년 5월 16~17일");
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK).body(resVO);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package app.module.front.usecase.policy.work.adapters.web;
|
||||
package app.module.front.usecase.policy.adapters.web;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -11,10 +11,10 @@ uri.front.statistics=\uD1B5\uACC4
|
||||
|
||||
|
||||
# \uB0B4\uC815\uBCF4
|
||||
uri.front.info=\uB0B4\uC815\uBCF4
|
||||
uri.front.info=\uB0B4 \uC815\uBCF4
|
||||
uri.front.info.path=/info
|
||||
|
||||
uri.front.info.user=\uAC1C\uC778\uC815\uBCF4 \uBCC0\uACBD
|
||||
uri.front.info.user=\uAC1C\uC778\uC815\uBCF4
|
||||
uri.front.info.user.path=/info/user
|
||||
uri.front.info.user.password=\uAC1C\uC778\uC815\uBCF4 \uBCC0\uACBD
|
||||
uri.front.info.notice=\uACF5\uC9C0\uC0AC\uD56D
|
||||
@@ -33,6 +33,7 @@ uri.front.info.bank.create.output.month.{{pathVar}}=\uC740\uD589 \uC790\uB3D9\uC
|
||||
|
||||
# \uC77C\uACC4\uBD80
|
||||
uri.front.record.calendar=\uC784\uAC00\uACBD\uC81C\uC870\uC0AC \uC77C\uACC4\uBD80
|
||||
uri.front.record.calendar.path=/record/calendar
|
||||
uri.front.record.calendar.{{pathVar}}.{{pathVar}}=\uC77C\uACC4\uBD80 \uC6D4\uBCC4 \uD604\uD669
|
||||
uri.front.record.daily=\uC77C\uACC4\uBD80 \uB4F1\uB85D
|
||||
uri.front.record.daily.{{pathVar}}=\uC77C\uACC4\uBD80 \uB4F1\uB85D
|
||||
|
||||
@@ -4,6 +4,7 @@ let kri = {
|
||||
kri.menu = new Object;
|
||||
kri.logger = new Object();
|
||||
kri.form = new Object();
|
||||
|
||||
/* kri.menu */
|
||||
/**
|
||||
* 스크립트로 페이지 이동
|
||||
@@ -11,13 +12,50 @@ kri.form = new Object();
|
||||
kri.menu.main = function() {
|
||||
location.href = '/';
|
||||
}
|
||||
kri.menu.daily = function() {
|
||||
location.href = '/record/calendar';
|
||||
}
|
||||
kri.menu.my = function() {
|
||||
location.href = '/info';
|
||||
kri.menu.logout = function() {
|
||||
etUI.dialog.alert({
|
||||
title: '로그아웃 확인',
|
||||
message: '로그아웃 하시겠어요?<br>서비스를 다시 이용하시려면 로그인이 필요합니다.',
|
||||
type: 'confirm',
|
||||
dialogType: 'confirm',
|
||||
callback: function () {
|
||||
location.href = '/logout';
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 전체 메뉴
|
||||
*/
|
||||
kri.menu.open = function() {
|
||||
ajaxUtil._ajaxAsyncMethod(
|
||||
'/menu',
|
||||
{},
|
||||
function(rstData, status) {
|
||||
if (rstData != null && rstData.daily !== undefined && rstData.daily !== null) {
|
||||
$('.menuModal').find('.date').html('최근등록 : <span>' + rstData.daily + '</span>');
|
||||
} else {
|
||||
$('.menuModal').find('.date').html('등록된 일계부가 없습니다.');
|
||||
}
|
||||
|
||||
$('.detail-menu').each(function (index, item) {
|
||||
if ($(item).find('li').length == 0) {
|
||||
$(item).hide();
|
||||
}
|
||||
});
|
||||
|
||||
const menuModal = document.querySelector('.menuModal').ui;
|
||||
menuModal.open();
|
||||
},
|
||||
function(code, rstData) {
|
||||
kri.logger.error('Do nothing. code: '+ code, rstData);
|
||||
$('.menuModal').find('.date').hide();
|
||||
},
|
||||
'get',
|
||||
'json'
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* 뒤로가기
|
||||
*/
|
||||
|
||||
@@ -110,8 +110,7 @@
|
||||
<h2>[[${#messages.msg(currentURI.id)}]]</h2>
|
||||
</div>
|
||||
</div>
|
||||
<!--/* TODO 전체메뉴 선택 2차 */-->
|
||||
<!--<button type="button" class="btn-allmenu"><span class="hide-txt">전체메뉴 열기</span></button>-->
|
||||
<button type="button" class="btn-allmenu" onclick="kri.menu.open()"><span class="hide-txt">전체메뉴 열기</span></button>
|
||||
</div>
|
||||
</header>
|
||||
</th:block>
|
||||
@@ -192,8 +191,8 @@
|
||||
<ul>
|
||||
<li class="menu-acco"
|
||||
th:classappend="${#strings.equals(currentURI?.uri, '/')
|
||||
or #strings.containsIgnoreCase(currentURI?.uri, '/record/') ? 'active' : ''}">
|
||||
<a href="javascript:void(0);" onclick="kri.menu.daily();">일계부</a>
|
||||
or #strings.containsIgnoreCase(currentURI?.uri, '/record/')} ? 'active'">
|
||||
<a th:href="#{uri.front.record.calendar.path}">일계부</a>
|
||||
</li>
|
||||
<!--/* TODO : 2차 오픈 s */-->
|
||||
<li class="menu-regi disabled"><a href="javascript:void(0)">입력현황</a></li>
|
||||
@@ -201,8 +200,8 @@
|
||||
<!--/* TODO : 2차 오픈 e */-->
|
||||
<li class="menu-info"
|
||||
th:classappend="${#strings.equals(currentURI?.uri, '/info')
|
||||
or #strings.containsIgnoreCase(currentURI?.uri, '/info/') ? 'active' : ''}">
|
||||
<a href="javascript:void(0);" onclick="kri.menu.my();">내정보</a>
|
||||
or #strings.containsIgnoreCase(currentURI?.uri, '/info/')} ? 'active'">
|
||||
<a th:href="#{uri.front.info.path}">내정보</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
49
front/src/main/resources/templates/common/menu-modal.html
Normal file
49
front/src/main/resources/templates/common/menu-modal.html
Normal file
@@ -0,0 +1,49 @@
|
||||
<div class="layer-wrap">
|
||||
<div class="component-modal allmenu-wrap menuModal" data-props-dimm-click="true">
|
||||
<div class="modal-dimm"></div>
|
||||
<div class="modal-frame">
|
||||
<div class="modal-container">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-tit"
|
||||
sec:authorize="isAuthenticated()"
|
||||
th:text="${#authentication.principal.ownerName}">
|
||||
</h3>
|
||||
<p class="date"></p>
|
||||
</div>
|
||||
<div class="modal-content">
|
||||
<div class="modal-content-inner">
|
||||
<ul class="allmenu-list" th:if="${topNode != null}">
|
||||
<li th:each="menu : ${topNode.children}" th:if="${menu.showOnNavi}"
|
||||
th:with="accoClass=${#strings.containsIgnoreCase(menu.uri, '/record') ? 'acco': ''}
|
||||
, infoClass=${#strings.containsIgnoreCase(menu.uri, '/info') ? 'info': ''}"
|
||||
th:class="|${accoClass}${infoClass}|"
|
||||
th:classappend="${@coreUtil.containsCurrentURI(menuHierarchy, menu.id)}? 'active'">
|
||||
<!--/* 자식 nodes 가 없는 경우 */-->
|
||||
<a th:classappend="${currentURI.id == menu.id}? 'active'"
|
||||
th:href="${menu.uri}" th:if="${#lists.size(menu.children) == 0}"
|
||||
th:text="${menu.id == 'uri.front.record.calendar'} ? '일계부' : ${#messages.msg(menu.id)}">메뉴명</a>
|
||||
<!--/* 자식 nodes 가 있는 경우 */-->
|
||||
<a th:classappend="${@coreUtil.containsCurrentURI(menuHierarchy, menu.id)}? 'active'"
|
||||
th:href="${menu.uri}"
|
||||
th:if="${#lists.size(menu.children) > 0}"
|
||||
th:text="${menu.id == 'uri.front.record.calendar'} ? '일계부' : ${#messages.msg(menu.id)}">메뉴명</a>
|
||||
<ul class="detail-menu" th:if="${#lists.size(menu.children) > 0}">
|
||||
<li th:each="child : ${menu.children}" th:if="${child.showOnNavi}"
|
||||
th:classappend="${@coreUtil.containsCurrentURI(menuHierarchy, child.id)}? 'active'"
|
||||
>
|
||||
<a class="dropdown-item"
|
||||
th:href="${child.uri}" th:text="${#messages.msg(child.id)}">메뉴명</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<section class="menu-footer">
|
||||
<button type="button" class="btn-logout" onclick="kri.menu.logout()">로그아웃</button>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="modal-close"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -12,6 +12,10 @@
|
||||
</div>
|
||||
|
||||
<section th:replace="common/components :: floating-totop"></section>
|
||||
<div id="bindWrap"><!--/* 공통으로 사용하는 영역 */--></div>
|
||||
<!--/* 전체 메뉴 모달 팝업 */-->
|
||||
<th:block th:replace="~{/common/menu-modal}"></th:block>
|
||||
<!--/* //전체 메뉴 모달 팝업 */-->
|
||||
<!--/* TODO 필요유무 판단 s */-->
|
||||
<!--/* <div>
|
||||
<div th:replace="~{common/components :: operationMessage}"></div>
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
|
||||
<section th:replace="~{common/components :: footer}"></section>
|
||||
<section th:replace="common/components :: floating-totop"></section>
|
||||
<div id="bindWrap"><!--/* 공통으로 사용하는 영역 */--></div>
|
||||
<!--/* 전체 메뉴 모달 팝업 */-->
|
||||
<th:block th:replace="~{/common/menu-modal}"></th:block>
|
||||
<!--/* //전체 메뉴 모달 팝업 */-->
|
||||
<!--/* TODO 필요유무 판단 s */-->
|
||||
<!--/* <div>
|
||||
<div th:replace="~{common/components :: operationMessage}"></div>
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
|
||||
<section th:replace="~{common/components :: footer}"></section>
|
||||
<section th:replace="common/components :: floating-totop"></section>
|
||||
<div id="bindWrap"><!--/* 공통으로 사용하는 영역 */--></div>
|
||||
<!--/* 전체 메뉴 모달 팝업 */-->
|
||||
<th:block th:replace="~{/common/menu-modal}"></th:block>
|
||||
<!--/* //전체 메뉴 모달 팝업 */-->
|
||||
<!--/* TODO 필요유무 판단 s */-->
|
||||
<!--/* <div>
|
||||
<div th:replace="~{common/components :: operationMessage}"></div>
|
||||
|
||||
Reference in New Issue
Block a user