메뉴관리 > eng 영역 추가
@03b6c6a93f3260437bc53416d0a4ae31a984ed27
+++ GEMINI.md
... | ... | @@ -0,0 +1,0 @@ |
--- src/main/java/kcc/let/sym/mnu/mcm/web/EgovMenuCreateManageController.java
+++ src/main/java/kcc/let/sym/mnu/mcm/web/EgovMenuCreateManageController.java
... | ... | @@ -302,28 +302,26 @@ |
| 302 | 302 |
|
| 303 | 303 |
List<MenuManageJTreeVO> resultList = null ; |
| 304 | 304 |
|
| 305 |
-// if(request.getServletPath().equals("/sym/mnu/mcm/EgovMenuQuickSelectJtreeAjax.do")) { //즐겨찾기
|
|
| 306 |
-// resultList = menuCreateManageService.selectQuickListJtree(menuManageVO) ; |
|
| 307 |
-// }else {
|
|
| 308 | 305 |
resultList = menuCreateManageService.selectMenuListJtree(menuManageVO) ; |
| 309 |
-// } |
|
| 306 |
+ |
|
| 310 | 307 |
MenuManageJTreeVO menuManageTopVO = new MenuManageJTreeVO(); |
| 311 | 308 |
menuManageTopVO.setUpperMenuId("#");
|
| 312 |
- /* menuManageTopVO.setMenuNo("0"); */
|
|
| 309 |
+ menuManageTopVO.setMenuNo("2");
|
|
| 310 |
+ menuManageTopVO.setMenuNm("사용자메뉴(영문)");
|
|
| 311 |
+ resultList.add(0, menuManageTopVO); |
|
| 312 |
+ |
|
| 313 |
+ menuManageTopVO = new MenuManageJTreeVO(); |
|
| 314 |
+ menuManageTopVO.setUpperMenuId("#");
|
|
| 313 | 315 |
menuManageTopVO.setMenuNo("1");
|
| 314 | 316 |
menuManageTopVO.setMenuNm("사용자메뉴");
|
| 315 |
- /* resultList.add(resultList.size()-4, menuManageTopVO); */ |
|
| 316 | 317 |
resultList.add(0, menuManageTopVO); |
| 317 | 318 |
|
| 318 |
- |
|
| 319 |
-// if("ROLE_ADMIN".equals(menuManageVO.getAuthorCode())){
|
|
| 320 |
-// menuManageTopVO.setMenuNm("관리자메뉴");
|
|
| 321 |
-// } |
|
| 322 | 319 |
menuManageTopVO = new MenuManageJTreeVO(); |
| 323 | 320 |
menuManageTopVO.setUpperMenuId("#");
|
| 324 | 321 |
menuManageTopVO.setMenuNo("0");
|
| 325 | 322 |
menuManageTopVO.setMenuNm("관리자메뉴");
|
| 326 | 323 |
resultList.add(0, menuManageTopVO); |
| 324 |
+ |
|
| 327 | 325 |
System.out.println("resultList :: "+resultList);
|
| 328 | 326 |
mapper.writeValue(out, resultList); |
| 329 | 327 |
out.flush(); |
... | ... | @@ -415,6 +413,8 @@ |
| 415 | 413 |
insertMenNo = (9990000+"").replaceFirst("0" , i+"") ;
|
| 416 | 414 |
}else if(1==menuManageVO.getUpperMenuId()){ //루트매뉴가 0이면 9990000
|
| 417 | 415 |
insertMenNo = (999000000+"").replaceFirst("0" , i+"") ;
|
| 416 |
+ }else if(2==menuManageVO.getUpperMenuId()){ //루트매뉴가 2이면 998000000
|
|
| 417 |
+ insertMenNo = (998000000+"").replaceFirst("0" , i+"") ;
|
|
| 418 | 418 |
} |
| 419 | 419 |
else {
|
| 420 | 420 |
insertMenNo = (menuManageVO.getUpperMenuId()+"").replaceFirst("0" , i+"") ;
|
... | ... | @@ -454,10 +454,13 @@ |
| 454 | 454 |
menuManageVO.setSiteId(user.getSiteId()); |
| 455 | 455 |
}*/ |
| 456 | 456 |
|
| 457 |
+ System.out.println(" + menuManageVO.getRootMenuId() : "+ menuManageVO.getRootMenuId());
|
|
| 457 | 458 |
if(menuManageVO.getRootMenuId().equals("0")) {
|
| 458 | 459 |
menuManageVO.setMenuUserType("A");
|
| 459 |
- }else if(menuManageVO.getRootMenuId().equals("1")) {
|
|
| 460 |
+ }else if(menuManageVO.getRootMenuId().equals("1")) {
|
|
| 460 | 461 |
menuManageVO.setMenuUserType("U");
|
| 462 |
+ }else if(menuManageVO.getRootMenuId().equals("2")) {
|
|
| 463 |
+ menuManageVO.setMenuUserType("E");
|
|
| 461 | 464 |
} |
| 462 | 465 |
|
| 463 | 466 |
menuManageService.insertMenuManage(menuManageVO); |
--- src/main/java/kcc/let/sym/mnu/mpm/service/MenuManageJTreeVO.java
+++ src/main/java/kcc/let/sym/mnu/mpm/service/MenuManageJTreeVO.java
... | ... | @@ -87,10 +87,11 @@ |
| 87 | 87 |
/** tmp_Cmd */ |
| 88 | 88 |
private String tmp_Cmd; |
| 89 | 89 |
|
| 90 |
- private String menuUserType; |
|
| 91 |
- |
|
| 92 |
- private String useYn; |
|
| 93 |
- |
|
| 90 |
+ private String menuUserType; |
|
| 91 |
+ |
|
| 92 |
+ private Integer upperMenuNo; // 추가된 필드 |
|
| 93 |
+ |
|
| 94 |
+ private String useYn; |
|
| 94 | 95 |
private String depths; |
| 95 | 96 |
|
| 96 | 97 |
private String depth; |
... | ... | @@ -413,6 +414,14 @@ |
| 413 | 414 |
public void setMenuUserType(String menuUserType) {
|
| 414 | 415 |
this.menuUserType = menuUserType; |
| 415 | 416 |
} |
| 417 |
+ |
|
| 418 |
+ public Integer getUpperMenuNo() {
|
|
| 419 |
+ return upperMenuNo; |
|
| 420 |
+ } |
|
| 421 |
+ |
|
| 422 |
+ public void setUpperMenuNo(Integer upperMenuNo) {
|
|
| 423 |
+ this.upperMenuNo = upperMenuNo; |
|
| 424 |
+ } |
|
| 416 | 425 |
public String getUseYn() {
|
| 417 | 426 |
return useYn; |
| 418 | 427 |
} |
--- src/main/java/kcc/web/MainController.java
+++ src/main/java/kcc/web/MainController.java
... | ... | @@ -249,6 +249,19 @@ |
| 249 | 249 |
} else {
|
| 250 | 250 |
menuManageVO.setAuthorCode("ROLE_ANONYMOUS");
|
| 251 | 251 |
} |
| 252 |
+ |
|
| 253 |
+ String menuUserType = request.getParameter("menuUserType");
|
|
| 254 |
+ if (menuUserType == null || menuUserType.isEmpty()) {
|
|
| 255 |
+ menuUserType = "KOR"; |
|
| 256 |
+ } |
|
| 257 |
+ menuManageVO.setMenuUserType(menuUserType); |
|
| 258 |
+ |
|
| 259 |
+ // upperMenuNo 설정 |
|
| 260 |
+ if ("ENG".equals(menuUserType)) {
|
|
| 261 |
+ menuManageVO.setUpperMenuNo(2); // 사용자메뉴(영문) |
|
| 262 |
+ } else {
|
|
| 263 |
+ menuManageVO.setUpperMenuNo(1); // 사용자메뉴 |
|
| 264 |
+ } |
|
| 252 | 265 |
|
| 253 | 266 |
List<MenuManageJTreeVO> menuResultList = menuCreateManageService.selectMenuListJtreeWeb(menuManageVO); |
| 254 | 267 |
menuDepth2ChildCnt(menuResultList); |
--- src/main/resources/egovframework/sqlmap/let/sym/mnu/mcm/EgovMenuCreat_SQL_Mysql.xml
+++ src/main/resources/egovframework/sqlmap/let/sym/mnu/mcm/EgovMenuCreat_SQL_Mysql.xml
... | ... | @@ -150,7 +150,7 @@ |
| 150 | 150 |
<!-- <select id="menuManageDAO.selectMenuListJtree" ...> ... </select> --> |
| 151 | 151 |
|
| 152 | 152 |
<select id="menuManageDAO.selectMenuListJtree" parameterClass="menuManageJTreeVO" resultClass="menuManageJTreeVO"> |
| 153 |
- /* 임시.*NOT_SQL_LOG.* */ |
|
| 153 |
+ /* menuManageDAO.selectMenuListJtree */ |
|
| 154 | 154 |
|
| 155 | 155 |
SELECT |
| 156 | 156 |
MENU_NM menuNm , |
... | ... | @@ -226,7 +226,7 @@ |
| 226 | 226 |
INNER JOIN LETTNPROGRMLIST C |
| 227 | 227 |
ON A.PROGRM_FILE_NM = C.PROGRM_FILE_NM |
| 228 | 228 |
WHERE |
| 229 |
- A.UPPER_MENU_NO = 1 |
|
| 229 |
+ A.UPPER_MENU_NO = #upperMenuNo# |
|
| 230 | 230 |
AND A.MENU_NO != 1 |
| 231 | 231 |
AND B.USE_YN = 'Y' |
| 232 | 232 |
UNION |
... | ... | @@ -276,7 +276,7 @@ |
| 276 | 276 |
INNER JOIN LETTNPROGRMLIST C |
| 277 | 277 |
ON A.PROGRM_FILE_NM = C.PROGRM_FILE_NM |
| 278 | 278 |
WHERE |
| 279 |
- A.UPPER_MENU_NO = 1 |
|
| 279 |
+ A.UPPER_MENU_NO = #upperMenuNo# |
|
| 280 | 280 |
AND A.MENU_NO != 1 |
| 281 | 281 |
AND B.USE_YN = 'Y' |
| 282 | 282 |
) AA, |
... | ... | @@ -352,7 +352,7 @@ |
| 352 | 352 |
INNER JOIN LETTNPROGRMLIST C |
| 353 | 353 |
ON A.PROGRM_FILE_NM = C.PROGRM_FILE_NM |
| 354 | 354 |
WHERE |
| 355 |
- A.UPPER_MENU_NO = 1 |
|
| 355 |
+ A.UPPER_MENU_NO = #upperMenuNo# |
|
| 356 | 356 |
AND A.MENU_NO != 1 |
| 357 | 357 |
AND B.AUTHOR_CODE = #authorCode# |
| 358 | 358 |
AND B.USE_YN = 'Y' |
--- src/main/webapp/WEB-INF/jsp/web/com/webCommonHeader.jsp
+++ src/main/webapp/WEB-INF/jsp/web/com/webCommonHeader.jsp
... | ... | @@ -130,9 +130,58 @@ |
| 130 | 130 |
<li> |
| 131 | 131 |
<div class="lang_switch"> |
| 132 | 132 |
<i class="icon lang"></i> |
| 133 |
- <button type="button" class="active">KOR</button> |
|
| 134 |
- <button type="button" class="">ENG</button> |
|
| 133 |
+ <button type="button" id="lang-kor" class="${param.menuUserType ne 'ENG' ? 'active' : ''}">KOR</button>
|
|
| 134 |
+ <button type="button" id="lang-eng" class="${param.menuUserType eq 'ENG' ? 'active' : ''}">ENG</button>
|
|
| 135 | 135 |
</div> |
| 136 |
+<script type="text/javascript"> |
|
| 137 |
+$(document).ready(function() {
|
|
| 138 |
+ // Language selection handling |
|
| 139 |
+ var menuUserType = sessionStorage.getItem('menuUserType');
|
|
| 140 |
+ if (!menuUserType) {
|
|
| 141 |
+ const urlParams = new URLSearchParams(window.location.search); |
|
| 142 |
+ menuUserType = urlParams.get('menuUserType') || 'KOR';
|
|
| 143 |
+ sessionStorage.setItem('menuUserType', menuUserType);
|
|
| 144 |
+ } |
|
| 145 |
+ |
|
| 146 |
+ if (menuUserType === 'ENG') {
|
|
| 147 |
+ $('#lang-kor').removeClass('active');
|
|
| 148 |
+ $('#lang-eng').addClass('active');
|
|
| 149 |
+ } else {
|
|
| 150 |
+ $('#lang-eng').removeClass('active');
|
|
| 151 |
+ $('#lang-kor').addClass('active');
|
|
| 152 |
+ } |
|
| 153 |
+ |
|
| 154 |
+ $('#lang-kor').on('click', function() {
|
|
| 155 |
+ sessionStorage.setItem('menuUserType', 'KOR');
|
|
| 156 |
+ var url = new URL(window.location.href); |
|
| 157 |
+ url.searchParams.set('menuUserType', 'KOR');
|
|
| 158 |
+ window.location.href = url.href; |
|
| 159 |
+ }); |
|
| 160 |
+ |
|
| 161 |
+ $('#lang-eng').on('click', function() {
|
|
| 162 |
+ sessionStorage.setItem('menuUserType', 'ENG');
|
|
| 163 |
+ var url = new URL(window.location.href); |
|
| 164 |
+ url.searchParams.set('menuUserType', 'ENG');
|
|
| 165 |
+ window.location.href = url.href; |
|
| 166 |
+ }); |
|
| 167 |
+ |
|
| 168 |
+ // Append menuUserType to menu links |
|
| 169 |
+ var currentLang = sessionStorage.getItem('menuUserType') || 'KOR';
|
|
| 170 |
+ $('a.depth02').each(function() {
|
|
| 171 |
+ var href = $(this).attr('href');
|
|
| 172 |
+ if (href && href !== '#') {
|
|
| 173 |
+ var newHref = href; |
|
| 174 |
+ if (href.indexOf('?') > -1) {
|
|
| 175 |
+ newHref += '&menuUserType=' + currentLang; |
|
| 176 |
+ } else {
|
|
| 177 |
+ newHref += '?menuUserType=' + currentLang; |
|
| 178 |
+ } |
|
| 179 |
+ $(this).attr('href', newHref);
|
|
| 180 |
+ } |
|
| 181 |
+ }); |
|
| 182 |
+}); |
|
| 183 |
+</script> |
|
| 184 |
+ |
|
| 136 | 185 |
</li> |
| 137 | 186 |
<li><button type="button" class="btn_sitemap" title="전체메뉴 보기"> |
| 138 | 187 |
<i></i> |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?