메뉴관리 검색, 수정, 삭제 기능 추가.

강석 최 2022-08-24 17:27:30 +09:00
parent 7854e71f82
commit 278c16306e
10 changed files with 303 additions and 118 deletions

View File

@ -6,6 +6,8 @@ import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import java.util.List;
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@ -25,9 +27,23 @@ public class MenuMgtController {
return mav; return mav;
} }
@GetMapping("/menuEditModal")
public ModelAndView menuEditModal(MenuMgt menuMgt){
ModelAndView mav = new ModelAndView("/adminPage/menuMgt/menuEditModal");
mav.addObject("menuMgt", menuMgt);
return mav;
}
@PostMapping("/saveMenuMgt") @PostMapping("/saveMenuMgt")
public String saveMenuMgt(MenuMgt menuMgt){ public String saveMenuMgt(MenuMgt menuMgt){
return menuMgtService.saveMenuMgt(menuMgt); return menuMgtService.saveMenuMgt(menuMgt);
} }
@PostMapping("/deleteMenuMgt")
@ResponseBody
public String deleteMenuMgt(@RequestBody List<MenuMgt> menuMgt){
menuMgtService.deleteMenuMgt(menuMgt);
return "";
}
} }

View File

@ -17,7 +17,8 @@ public class MenuMgtService {
private final MenuMgtMapper menuMgtMapper; private final MenuMgtMapper menuMgtMapper;
public List<MenuMgt> selectMenuMgtList(MenuMgt menuMgt){ public List<MenuMgt> selectMenuMgtList(MenuMgt menuMgt){
return menuMgtMapper.selectMenuMgtList(menuMgt); List<MenuMgt> menuList = menuMgtMapper.selectMenuMgtList(menuMgt);
return menuListRowspanSet(menuList);
} }
public Integer selectMenuMgtListCnt(MenuMgt menuMgt){ public Integer selectMenuMgtListCnt(MenuMgt menuMgt){
@ -26,12 +27,59 @@ public class MenuMgtService {
@Transient @Transient
public String saveMenuMgt(MenuMgt menuMgt) { public String saveMenuMgt(MenuMgt menuMgt) {
MenuMgt duplMenu = menuMgtRepository.findTopByCat1CdAndCat2CdAndCat3Cd(menuMgt.getCat1Cd(), menuMgt.getCat2Cd(), menuMgt.getCat3Cd()); if(menuMgt.getMenuKey()==null){
if(duplMenu!=null){ MenuMgt duplMenu = menuMgtRepository.findTopByCat1CdAndCat2CdAndCat3Cd(menuMgt.getCat1Cd(), menuMgt.getCat2Cd(), menuMgt.getCat3Cd());
return duplMenu.getMenuUrl(); if(duplMenu!=null){
return duplMenu.getMenuUrl();
}else{
menuMgtRepository.save(menuMgt);
return "";
}
}else{ }else{
menuMgtRepository.save(menuMgt); menuMgtRepository.save(menuMgt);
return ""; return "";
} }
} }
@Transient
public void deleteMenuMgt(List<MenuMgt> menuList) {
menuMgtRepository.deleteAll(menuList);
}
private List<MenuMgt> menuListRowspanSet(List<MenuMgt> menuList){
for(int i=0; i<menuList.size()-1; i++){
int rowspanCnt = 1;
for(int j=i+1; j<menuList.size(); j++){
if(menuList.get(i).getCat1Cd().equals(menuList.get(j).getCat1Cd())){
menuList.get(j).setCat1RowspanCnt(0);
rowspanCnt++;
}else{
menuList.get(i).setCat1RowspanCnt(rowspanCnt);
i=j-1;
break;
}
}
if(menuList.get(i).getCat1RowspanCnt()==null){
menuList.get(i).setCat1RowspanCnt(rowspanCnt);
}
}
for(int i=0; i<menuList.size()-1; i++){
int rowspanCnt = 1;
for(int j=i+1; j<menuList.size(); j++){
if(menuList.get(i).getCat2Cd().equals(menuList.get(j).getCat2Cd())){
menuList.get(j).setCat2RowspanCnt(0);
rowspanCnt++;
}else{
menuList.get(i).setCat2RowspanCnt(rowspanCnt);
i=j-1;
break;
}
}
if(menuList.get(i).getCat2RowspanCnt()==null){
menuList.get(i).setCat2RowspanCnt(rowspanCnt);
}
}
return menuList;
}
} }

View File

@ -20,7 +20,7 @@ public class MenuMgt extends BaseModel {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "menu_key") @Column(name = "menu_key")
private String menuKey; private Integer menuKey;
@Column(name = "cat1_cd", nullable = false) @Column(name = "cat1_cd", nullable = false)
private String cat1Cd; private String cat1Cd;
@Column(name = "cat2_cd", nullable = false) @Column(name = "cat2_cd", nullable = false)
@ -30,4 +30,9 @@ public class MenuMgt extends BaseModel {
@Column(name = "menu_url", nullable = false) @Column(name = "menu_url", nullable = false)
private String menuUrl; private String menuUrl;
@Transient
private Integer cat1RowspanCnt;
@Transient
private Integer cat2RowspanCnt;
} }

View File

@ -17,7 +17,7 @@ spring.datasource.hikari.maximum-pool-size=4
spring.sql.init.encoding=utf-8 spring.sql.init.encoding=utf-8
spring.datasource.driverClassName=net.sf.log4jdbc.sql.jdbcapi.DriverSpy spring.datasource.driverClassName=net.sf.log4jdbc.sql.jdbcapi.DriverSpy
#spring.datasource.driverClassName=org.postgresql.Driver #spring.datasource.driverClassName=org.postgresql.Driver
spring.datasource.url=jdbc:log4jdbc:postgresql://106.247.244.146:50503/faisp spring.datasource.url=jdbc:log4jdbc:postgresql://118.219.150.34:50503/faisp
#spring.datasource.url=jdbc:postgresql://106.247.244.146:50503/faisp #spring.datasource.url=jdbc:postgresql://106.247.244.146:50503/faisp
spring.datasource.username=dbnt0031 spring.datasource.username=dbnt0031
spring.datasource.password=dbnt0928! spring.datasource.password=dbnt0928!

View File

@ -5,7 +5,8 @@
<mapper namespace="com.dbnt.faisp.menuMgt.mapper.MenuMgtMapper"> <mapper namespace="com.dbnt.faisp.menuMgt.mapper.MenuMgtMapper">
<select id="selectMenuMgtList" resultType="MenuMgt" parameterType="MenuMgt"> <select id="selectMenuMgtList" resultType="MenuMgt" parameterType="MenuMgt">
select cat1_cd as cat1Cd, select menu_key as menuKey,
cat1_cd as cat1Cd,
cat2_cd as cat2Cd, cat2_cd as cat2Cd,
cat3_cd as cat3Cd, cat3_cd as cat3Cd,
menu_url as menuUrl menu_url as menuUrl
@ -21,7 +22,7 @@
and cat3_cd = #{cat3Cd} and cat3_cd = #{cat3Cd}
</if> </if>
<if test='menuUrl != null and menuUrl != ""'> <if test='menuUrl != null and menuUrl != ""'>
and menu_url = #{menuUrl} and menu_url like '%'||#{menuUrl}||'%'
</if> </if>
</where> </where>
order by cat1_cd, cat2_cd, cat3_cd order by cat1_cd, cat2_cd, cat3_cd
@ -41,7 +42,7 @@
and cat3_cd = #{cat3Cd} and cat3_cd = #{cat3Cd}
</if> </if>
<if test='menuUrl != null and menuUrl != ""'> <if test='menuUrl != null and menuUrl != ""'>
and menu_url = #{menuUrl} and menu_url like '%'||#{menuUrl}||'%'
</if> </if>
</where> </where>
</select> </select>

View File

@ -17,4 +17,14 @@ function sessionReload(){
$(document).on('click', '.allChk', function (){ $(document).on('click', '.allChk', function (){
$(this).parents('table').find('[type="checkbox"]').prop("checked", this.checked); $(this).parents('table').find('[type="checkbox"]').prop("checked", this.checked);
}) })
$(document).on('click', '.page-item', function (){
searchFormSubmit($(this).attr("data-pageindex"))
})
$(document).on('change', '#rowCnt', function (){
searchFormSubmit(1)
})
function searchFormSubmit(pageIndex){
$("#pageIndex").val(pageIndex);
$("#searchBtn").click();
}

View File

@ -1,5 +1,23 @@
$(document).on('click', '#addMenuBtn', function (){
$("#menuEditModalLabel").text("메뉴 추가")
getModalForm();
})
$(document).on('click', '.menuTr', function (event){
if(event.target.classList.value!=="menuCheckBox"){
if(event.target.cellIndex !== 0){
$("#menuEditModalLabel").text("메뉴 수정")
const row = $(this)
getModalForm({
menuKey: row.find(".menuKey").val(),
cat1Cd: row.find(".cat1Cd").val(),
cat2Cd: row.find(".cat2Cd").val(),
cat3Cd: row.find(".cat3Cd").val(),
menuUrl: row.find(".menuUrl").val()
})
}
}
})
$(document).on('click', '#saveMenuBtn', function (){ $(document).on('click', '#saveMenuBtn', function (){
let valueChk = true; let valueChk = true;
if(!$("#cat1Cd").val()){ if(!$("#cat1Cd").val()){
@ -30,7 +48,7 @@ $(document).on('click', '#saveMenuBtn', function (){
if(result!==""){ if(result!==""){
alert("url: "+result+"로 저장되어있습니다.") alert("url: "+result+"로 저장되어있습니다.")
}else{ }else{
location.reload(); // location.reload();
alert("저장되었습니다.") alert("저장되었습니다.")
} }
contentFade("out"); contentFade("out");
@ -41,4 +59,57 @@ $(document).on('click', '#saveMenuBtn', function (){
} }
}) })
} }
}) })
$(document).on('click', '#deleteMenuBtn', function (){
if(confirm("삭제 하시겠습니까?")){
deleteMenu([{menuKey: Number($("#menuKey").val())}])
}
})
$(document).on('click', '#deleteCheckedBtn', function (){
if(confirm("선택된 대상을 모두 삭제 하시겠습니까?")){
const menuList = [];
$(".menuCheckBox:checked").each(function (idx, el){
menuList.push({});
const target = $(el);
menuList[idx].menuKey = Number(target.parents('tr').find('.menuKey').val());
})
deleteMenu(menuList)
}
})
function getModalForm(menuMgt){
$.ajax({
url: '/menuMgt/menuEditModal',
data: menuMgt,
type: 'GET',
dataType:"html",
success: function(html){
$("#menuEditModalContent").empty().append(html)
$("#menuEditModal").modal('show')
},
error:function(){
}
});
}
function deleteMenu(menuList){
contentFade("in");
$.ajax({
type : 'POST',
url : "/menuMgt/deleteMenuMgt",
data : JSON.stringify(menuList),
contentType: 'application/json',
beforeSend: function (xhr){
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
},
success : function(data) {
alert("삭제되었습니다.");
contentFade("out");
location.reload();
},
error : function(xhr, status) {
alert("삭제를 실패하였습니다.")
contentFade("out");
}
})
}

View File

@ -3,7 +3,7 @@
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout/layout}"> layout:decorate="~{layout/layout}">
<th:block layout:fragment="script"> <th:block layout:fragment="script">
<script type="text/javascript" th:src="@{/js/codeMgt/menuMgt.js}"></script> <script type="text/javascript" th:src="@{/js/codeMgt/codeMgt.js}"></script>
</th:block> </th:block>
<div layout:fragment="content"> <div layout:fragment="content">
<main class="pt-3"> <main class="pt-3">

View File

@ -0,0 +1,71 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header">
<h5 class="modal-title" id="menuEditModalLabel" th:text="${menuMgt.menuKey eq null?'메뉴 추가':'메뉴 수정'}"></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form id="menuEditForm" action="#" method="post">
<th:block th:if="${menuMgt.menuKey ne null}">
<input type="hidden" name="menuKey" id="menuKey" th:value="${menuMgt.menuKey}">
</th:block>
<div class="row mb-3">
<label for="cat1Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">대분류</label>
<div class="col-sm-6">
<select class="form-select form-select-sm" id="cat1Cd" name="cat1Cd">
<option value="">대분류 선택</option>
<th:block th:each="commonCode:${session.commonCodeList}">
<th:block th:if="${commonCode.categoryCd=='CAT1'}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd==menuMgt.cat1Cd}"></option>
</th:block>
</th:block>
</select>
</div>
</div>
<div class="row mb-3">
<label for="cat2Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">중분류</label>
<div class="col-sm-6">
<select class="form-select form-select-sm" id="cat2Cd" name="cat2Cd">
<option value="">중분류 선택</option>
<th:block th:each="commonCode:${session.commonCodeList}">
<th:block th:if="${commonCode.categoryCd=='CAT2'}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd==menuMgt.cat2Cd}"></option>
</th:block>
</th:block>
</select>
</div>
</div>
<div class="row mb-3">
<label for="cat3Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">소분류</label>
<div class="col-sm-6">
<select class="form-select form-select-sm" id="cat3Cd" name="cat3Cd">
<option value="">소분류 선택</option>
<th:block th:each="commonCode:${session.commonCodeList}">
<th:block th:if="${commonCode.categoryCd=='CAT3'}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd==menuMgt.cat3Cd}"></option>
</th:block>
</th:block>
</select>
</div>
</div>
<div class="row mb-3">
<label for="menuUrl" class="col-sm-4 col-form-label col-form-label-sm text-center">URL</label>
<div class="col-sm-6">
<input type="text" class="form-control form-control-sm" id="menuUrl" name="menuUrl" th:value="${menuMgt.menuUrl}">
</div>
</div>
</form>
</div>
<div class="modal-footer justify-content-between">
<div class="col-auto">
<th:block th:if="${menuMgt.menuKey ne null}">
<button type="button" class="btn btn-danger" id="deleteMenuBtn">삭제</button>
</th:block>
</div>
<div class="col-auto">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
<button type="button" class="btn btn-primary" id="saveMenuBtn">저장</button>
</div>
</div>
</html>

View File

@ -8,46 +8,61 @@
<div layout:fragment="content"> <div layout:fragment="content">
<main class="pt-3"> <main class="pt-3">
<h4>메뉴 관리</h4> <h4>메뉴 관리</h4>
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<div class="row mx-0"> <div class="row mx-0">
<div class="col-12 card text-center"> <div class="col-12 card text-center">
<div class="card-body"> <div class="card-body">
<div class="row justify-content-end px-3 py-1"> <form method="get" th:action="@{/menuMgt/menuMgtPage}">
<div class="col-auto"> <input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}">
<select class="form-select form-select-sm"> <div class="row justify-content-between pe-3 py-1">
<option>대분류 선택</option> <div class="col-auto">
<th:block th:each="commonCode:${session.commonCodeList}"> <select class="form-select" name="rowCnt" id="rowCnt">
<th:block th:if="${commonCode.categoryCd=='CAT1'}"> <th:block th:each="num : ${#numbers.sequence(1,5)}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option> <option th:value="${num*10}" th:text="${num*10}" th:selected="${searchParams.rowCnt==num*10}"></option>
</th:block> </th:block>
</th:block> </select>
<option></option> </div>
</select> <div class="col-auto">
<div class="row justify-content-end">
<div class="col-auto">
<select class="form-select form-select-sm" name="cat1Cd">
<option value="">대분류 선택</option>
<th:block th:each="commonCode:${session.commonCodeList}">
<th:block th:if="${commonCode.categoryCd=='CAT1'}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${searchParams.cat1Cd==commonCode.itemCd}"></option>
</th:block>
</th:block>
</select>
</div>
<div class="col-auto">
<select class="form-select form-select-sm" name="cat2Cd">
<option value="">중분류 선택</option>
<th:block th:each="commonCode:${session.commonCodeList}">
<th:block th:if="${commonCode.categoryCd=='CAT2'}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${searchParams.cat2Cd==commonCode.itemCd}"></option>
</th:block>
</th:block>
</select>
</div>
<div class="col-auto">
<select class="form-select form-select-sm" name="cat3Cd">
<option value="">소분류 선택</option>
<th:block th:each="commonCode:${session.commonCodeList}">
<th:block th:if="${commonCode.categoryCd=='CAT3'}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${searchParams.cat3Cd==commonCode.itemCd}"></option>
</th:block>
</th:block>
</select>
</div>
<div class="col-auto">
<input type="text" class="form-control form-control-sm" name="menuUrl" placeholder="url" th:value="${searchParams.menuUrl}">
</div>
<input type="submit" class="btn btn-sm btn-primary col-auto" id="searchBtn" value="검색">
</div>
</div>
</div> </div>
<div class="col-auto"> </form>
<select class="form-select form-select-sm">
<option>중분류 선택</option>
<th:block th:each="commonCode:${session.commonCodeList}">
<th:block th:if="${commonCode.categoryCd=='CAT2'}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
</th:block>
</th:block>
</select>
</div>
<div class="col-auto">
<select class="form-select form-select-sm">
<option>소분류 선택</option>
<th:block th:each="commonCode:${session.commonCodeList}">
<th:block th:if="${commonCode.categoryCd=='CAT3'}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
</th:block>
</th:block>
</select>
</div>
<div class="col-auto">
<input type="text" class="form-control form-control-sm" placeholder="url">
</div>
<button class="btn btn-sm btn-primary col-auto" id="searchBtn">검색</button>
</div>
<div class="row justify-content-start"> <div class="row justify-content-start">
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
@ -56,7 +71,7 @@
<table class="table table-striped"> <table class="table table-striped">
<thead> <thead>
<tr> <tr>
<th></th> <th><input type="checkbox" class="allChk"></th>
<th>대분류</th> <th>대분류</th>
<th>중분류</th> <th>중분류</th>
<th>소분류</th> <th>소분류</th>
@ -64,18 +79,23 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr class="userInfoTr" th:each="menuMgt:${menuMgtList}"> <tr class="menuTr" th:each="menuMgt:${menuMgtList}">
<input type="hidden" class="menuKey" th:value="${menuMgt.menuKey}">
<input type="hidden" class="cat1Cd" th:value="${menuMgt.cat1Cd}">
<input type="hidden" class="cat2Cd" th:value="${menuMgt.cat2Cd}">
<input type="hidden" class="cat3Cd" th:value="${menuMgt.cat3Cd}">
<input type="hidden" class="menuUrl" th:value="${menuMgt.menuUrl}">
<td> <td>
<input type="checkbox" class="userInfoCheckBox" th:value="${menuMgt.menuKey}"> <input type="checkbox" class="menuCheckBox" th:value="${menuMgt.menuKey}">
</td> </td>
<th:block th:each="commonCode:${session.commonCodeList}"> <th:block th:if="${menuMgt.cat1RowspanCnt ne 0}" th:each="commonCode:${session.commonCodeList}">
<th:block th:if="${commonCode.itemCd == menuMgt.cat1Cd}"> <th:block th:if="${commonCode.itemCd == menuMgt.cat1Cd}">
<td th:text="${commonCode.itemValue}"></td> <td th:text="${commonCode.itemValue}" th:rowspan="${menuMgt.cat1RowspanCnt}"></td>
</th:block> </th:block>
</th:block> </th:block>
<th:block th:each="commonCode:${session.commonCodeList}"> <th:block th:if="${menuMgt.cat2RowspanCnt ne 0}" th:each="commonCode:${session.commonCodeList}">
<th:block th:if="${commonCode.itemCd == menuMgt.cat2Cd}"> <th:block th:if="${commonCode.itemCd == menuMgt.cat2Cd}">
<td th:text="${commonCode.itemValue}"></td> <td th:text="${commonCode.itemValue}" th:rowspan="${menuMgt.cat2RowspanCnt}"></td>
</th:block> </th:block>
</th:block> </th:block>
<th:block th:each="commonCode:${session.commonCodeList}"> <th:block th:each="commonCode:${session.commonCodeList}">
@ -92,7 +112,9 @@
</table> </table>
</div> </div>
<div class="row justify-content-between"> <div class="row justify-content-between">
<div class="col-auto"></div> <div class="col-auto">
<input type="button" class="btn btn-success" value="선택 삭제" id="deleteCheckedBtn">
</div>
<div class="col-auto"> <div class="col-auto">
<nav aria-label="Page navigation"> <nav aria-label="Page navigation">
<ul class="pagination"> <ul class="pagination">
@ -119,7 +141,7 @@
</nav> </nav>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<input type="button" class="btn btn-success" value="메뉴 추가" data-bs-toggle="modal" data-bs-target="#menuEditModal"> <input type="button" class="btn btn-success" value="메뉴 추가" id="addMenuBtn">
</div> </div>
</div> </div>
</div> </div>
@ -133,66 +155,7 @@
<div class="modal fade" id="menuEditModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="menuEditModalLabel" aria-hidden="true"> <div class="modal fade" id="menuEditModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="menuEditModalLabel" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content" id="menuEditModalContent">
<div class="modal-header">
<h5 class="modal-title" id="menuEditModalLabel">메뉴 추가</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form id="menuEditForm" action="#" method="post">
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<div class="row mb-3">
<label for="cat1Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">대분류</label>
<div class="col-sm-6">
<select class="form-select form-select-sm" id="cat1Cd" name="cat1Cd">
<option value="">대분류 선택</option>
<th:block th:each="commonCode:${session.commonCodeList}">
<th:block th:if="${commonCode.categoryCd=='CAT1'}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
</th:block>
</th:block>
</select>
</div>
</div>
<div class="row mb-3">
<label for="cat2Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">중분류</label>
<div class="col-sm-6">
<select class="form-select form-select-sm" id="cat2Cd" name="cat2Cd">
<option value="">중분류 선택</option>
<th:block th:each="commonCode:${session.commonCodeList}">
<th:block th:if="${commonCode.categoryCd=='CAT2'}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
</th:block>
</th:block>
</select>
</div>
</div>
<div class="row mb-3">
<label for="cat3Cd" class="col-sm-4 col-form-label col-form-label-sm text-center">소분류</label>
<div class="col-sm-6">
<select class="form-select form-select-sm" id="cat3Cd" name="cat3Cd">
<option value="">소분류 선택</option>
<th:block th:each="commonCode:${session.commonCodeList}">
<th:block th:if="${commonCode.categoryCd=='CAT3'}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}"></option>
</th:block>
</th:block>
</select>
</div>
</div>
<div class="row mb-3">
<label for="menuUrl" class="col-sm-4 col-form-label col-form-label-sm text-center">URL</label>
<div class="col-sm-6">
<input type="text" class="form-control form-control-sm" id="menuUrl" name="menuUrl">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
<button type="button" class="btn btn-primary" id="saveMenuBtn">저장</button>
</div>
</div> </div>
</div> </div>
</div> </div>