게시판 분류 관리 작업중.

master
강석 최 2021-12-06 18:46:00 +09:00
parent f25aaa3c69
commit 3942e7ba0e
7 changed files with 297 additions and 2 deletions

View File

@ -23,7 +23,12 @@ public class adminController {
ModelAndView mav = new ModelAndView("admin/main"); ModelAndView mav = new ModelAndView("admin/main");
return mav; return mav;
} }
@GetMapping("/categoryMgt")
public ModelAndView categoryMgt(){
ModelAndView mav = new ModelAndView("admin/categoryMgt");
return mav;
}
@GetMapping("/userMgt") @GetMapping("/userMgt")
public ModelAndView userMgt(UserInfo userInfo) { public ModelAndView userMgt(UserInfo userInfo) {
userInfo.setQueryInfo(); userInfo.setQueryInfo();
@ -51,6 +56,7 @@ public class adminController {
mav.addObject("userInfo", userInfoService.selectUserInfo(userInfo)); mav.addObject("userInfo", userInfoService.selectUserInfo(userInfo));
return mav; return mav;
} }
@GetMapping("/modifyRequest") @GetMapping("/modifyRequest")
public ModelAndView modifyRequest() { public ModelAndView modifyRequest() {
ModelAndView mav = new ModelAndView("admin/modifyRequest"); ModelAndView mav = new ModelAndView("admin/modifyRequest");

View File

@ -0,0 +1,32 @@
package com.dbnt.kcgfilemanager.model;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import java.util.List;
@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "BOARD_CATEGORY")
public class BoardCategory {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "CATEGORY_SEQ")
private Integer categorySeq;
@Column(name = "DEPTH", nullable = false)
private Integer depth;
@Column(name = "PARENT_CATEGORY")
private Integer parentCategory;
@Column(name = "CATEGORY_NAME", nullable = false)
private String categoryName;
@Transient
private List<BoardCategory> childCategoryList;
}

View File

@ -0,0 +1,4 @@
$(document).on('click', '.addCategoryBtn', function (){
const depth = $(this).attr("data-depth")
$("#depth"+depth+"Category").append($("#appendTr").children().clone())
})

View File

@ -0,0 +1,105 @@
<!DOCTYPE html>
<html lang="ko"
xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout/layout}">
<th:block layout:fragment="script">
<script type="text/javascript" th:src="@{/js/admin/categoryMgt.js}"></script>
</th:block>
<div layout:fragment="content">
<main class="pt-3">
<h4>게시판 분류 관리</h4>
<div class="row mx-0">
<div class="col-auto card text-center">
<div class="card-body">
<div class="row justify-content-end">
<input type="button" class="col-auto btn btn-primary mx-3" value="저장">
</div>
<div class="row justify-content-start">
<div class="col-auto m-3 p-3 border">
<table class="table table-striped">
<thead>
<tr>
<th></th>
<th>대분류</th>
</tr>
</thead>
<tbody id="depth1Category">
</tbody>
</table>
<div class="row justify-content-end">
<div class="col-auto">
<input type="button" class="btn btn-success addCategoryBtn" value="추가" data-depth="1">
</div>
</div>
</div>
<div class="col-auto m-3 p-3 border">
<table class="table table-striped">
<thead>
<tr>
<th></th>
<th>연도</th>
</tr>
</thead>
<tbody id="depth2Category">
</tbody>
</table>
<div class="row justify-content-end">
<div class="col-auto">
<input type="button" class="btn btn-success addCategoryBtn" value="추가" data-depth="2">
</div>
</div>
</div>
<div class="col-auto m-3 p-3 border">
<table class="table table-striped">
<thead>
<tr>
<th></th>
<th>중분류</th>
</tr>
</thead>
<tbody id="depth3Category">
</tbody>
</table>
<div class="row justify-content-end">
<div class="col-auto">
<input type="button" class="btn btn-success addCategoryBtn" value="추가" data-depth="3">
</div>
</div>
</div>
<div class="col-auto m-3 p-3 border">
<table class="table table-striped">
<thead>
<tr>
<th></th>
<th>소분류</th>
</tr>
</thead>
<tbody id="depth4Category">
</tbody>
</table>
<div class="row justify-content-end">
<div class="col-auto">
<input type="button" class="btn btn-success addCategoryBtn" value="추가" data-depth="4">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<div style="display: none;">
<table>
<tbody id="appendTr">
<tr>
<td colspan="2">
<input type="text" class="form-control">
</td>
</tr>
</tbody>
</table>
</div>
</div>
</html>

View File

@ -8,7 +8,7 @@
<script type="text/javascript" th:src="@{/js/admin/codeMgt.js}"></script> <script type="text/javascript" th:src="@{/js/admin/codeMgt.js}"></script>
</th:block> </th:block>
<div layout:fragment="content"> <div layout:fragment="content">
<main> <main class="pt-3">
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/> <input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/> <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<h4>코드 관리</h4> <h4>코드 관리</h4>

View File

@ -0,0 +1,148 @@
<!DOCTYPE html>
<html lang="ko"
xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout/layout}">
<th:block layout:fragment="script">
<script type="text/javascript" th:src="@{/js/admin/userMgt.js}"></script>
</th:block>
<div layout:fragment="content">
<main class="pt-3">
<h4>페이지 이름</h4>
<div class="row mx-0">
<div class="col-12 card text-center">
<div class="card-body">
<div class="row justify-content-start">
<div class="col-7">
<!--검색 form-->
<!--<form method="get" th:action="@{/admin/userMgt}">
<input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}">
<div class="row justify-content-between">
<div class="col-auto row">
<div class="col-auto">
<label for="viewCnt" class="col-form-label">데이터 수</label>
</div>
<div class="col-auto">
<select class="form-select" name="viewCnt" id="viewCnt">
<th:block th:each="num : ${#numbers.sequence(1,5)}">
<option th:value="${num*10}" th:text="${num*10}" th:selected="${searchParams.viewCnt==num*10}"></option>
</th:block>
</select>
</div>
</div>
<div class="col-auto">
<div class="row justify-content-end">
<div class="col-auto">
<select class="form-select" id="searchConditionSelector">
<option value="userId" th:selected="${searchParams.userId!=null and searchParams.userId!=''}">아이디</option>
<option value="name" th:selected="${searchParams.name!=null and searchParams.name!=''}">이름</option>
<option value="positionName" th:selected="${searchParams.positionName!=null and searchParams.positionName!=''}">부서</option>
<option value="departmentName" th:selected="${searchParams.departmentName!=null and searchParams.departmentName!=''}">직급</option>
<option value="createDate" th:selected="${searchParams.startDate!=null and searchParams.startDate!=''} or ${searchParams.endDate!=null and searchParams.endDate!=''}">생성일</option>
</select>
</div>
<div class="col-auto" id="searchTextDiv">
<input type="text" class="form-control" id="textSearch" th:value="${
(searchParams.userId!=null and searchParams.userId!='')?searchParams.userId:(
(searchParams.name!=null and searchParams.name!='')?searchParams.name:(
(searchParams.positionName!=null and searchParams.positionName!='')?searchParams.positionName:(
(searchParams.departmentName!=null and searchParams.departmentName!='')?searchParams.departmentName:''
)
)
)
}">
</div>
<div class="col-auto input-group w-auto input-daterange" id="dateSelectorDiv" style="display: none">
<input type="text" class="form-control" id="startDate" name="startDate" placeholder="시작일" autocomplete="off" disabled th:value="${searchParams.startDate}">
<input type="text" class="form-control" id="endDate" name="endDate" placeholder="종료일" autocomplete="off" disabled th:value="${searchParams.endDate}">
</div>
<div class="col-auto">
<input type="submit" class="btn btn-primary" id="searchBtn" value="검색">
</div>
</div>
</div>
</div>
</form>-->
<div class="row-cols-6">
<table class="table table-striped">
<thead>
<tr>
<th></th>
<th>아이디</th>
<th>이름</th>
<th>부서</th>
<th>직급</th>
<th>생성일</th>
<th>상태</th>
</tr>
</thead>
<tbody>
<!--<tr class="userInfoTr" th:each="userInfo:${userInfoList}">
<td>
<input type="checkbox" class="userInfoCheckBox" th:value="${userInfo.userSeq}">
</td>
<td th:text="${userInfo.userId}"></td>
<td th:text="|${userInfo.name}${#strings.contains(userInfo.userRole,'ADMIN')?'(관리자)':''}|"></td>
<td th:text="${userInfo.positionName}"></td>
<td th:text="${userInfo.departmentName}"></td>
<td th:text="${#temporals.format(userInfo.createDate, 'yyyy-MM-dd')}"></td>
<td th:text="${#strings.contains(userInfo.userStatus,'T')?'활성화':'비활성화'}"></td>
</tr>-->
</tbody>
</table>
</div>
<div class="row justify-content-between">
<div class="col-auto"></div>
<div class="col-auto">
<nav aria-label="Page navigation">
<ul class="pagination">
<!--<th:block th:if="${searchParams.pageIndex>3}">
<li class="page-item" th:data-pageindex="${(searchParams.pageIndex)-3}">
<a class="page-link" href="#" aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
</a>
</li>
</th:block>
<th:block th:each="num : ${#numbers.sequence(searchParams.startNum, searchParams.endNum)}">
<li class="page-item" th:data-pageindex="${num}" th:classappend="${searchParams.pageIndex==num?'active':''}">
<a class="page-link" href="#" th:text="${num}"></a>
</li>
</th:block>
<th:block th:if="${searchParams.maxNum>searchParams.endNum+2}">
<li class="page-item" th:data-pageindex="${(searchParams.pageIndex)+3}">
<a class="page-link" href="#" aria-label="Next">
<span aria-hidden="true">&raquo;</span>
</a>
</li>
</th:block>-->
</ul>
</nav>
</div>
<div class="col-auto">
<input type="button" class="btn btn-success" value="사용자 생성" data-bs-toggle="modal" data-bs-target="#userInfoModal">
</div>
</div>
</div>
<div class="col-5">
<ul class="nav nav-tabs" id="userTab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="infoTab" data-bs-toggle="tab" type="button" role="tab">개인정보</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" id="categoryTab" data-bs-toggle="tab" type="button" role="tab">권한</button>
</li>
</ul>
<div class="tab-content border border-top-0" id="userContent">
<div class="py-5">
<h3>왼쪽 목록에서 선택해주세요.</h3>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
</div>
</html>

View File

@ -3,7 +3,7 @@
xmlns:th="http://www.thymeleaf.org" xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5"> xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<footer th:fragment="footerFragment" class="d-flex flex-wrap py-2 mt-auto border-top bg-dark"> <footer th:fragment="footerFragment" class="d-flex flex-wrap py-2 mt-auto border-top bg-dark">
<div class="row"> <div class="row mx-3">
<div class="col-auto"> <div class="col-auto">
<img th:src="@{/img/f_logo.png}" alt="logo" title="logo" style="height: 50px;"/> <img th:src="@{/img/f_logo.png}" alt="logo" title="logo" style="height: 50px;"/>
</div> </div>