관리자 퍼블 입히기

This commit is contained in:
주수현
2025-06-20 09:26:07 +09:00
parent 6153f03e66
commit c8123527d9
5 changed files with 42 additions and 44 deletions

View File

@@ -72,74 +72,66 @@
</select>
</div>
</div>
<div class="component-btns">
<div class="btns-row">
<button class="btn" onclick="goSearch();"
type="button">
검색
</button>
<button class="btn" onclick="goInit();"
type="button">초기화
</button>
</div>
</div>
<div class="component-btns">
<div class="btns-row">
<button class="btn" onclick="goInit();" type="button">
<span class="btn-txt">초기화</span>
</button>
<button class="btn btn-primary" onclick="goSearch();" type="button">
<span class="btn-txt">검색</span>
</button>
</div>
</div>
</section>
<div class="row">
<div class="col text-start">
<div class="fw-bolder text-muted">Total: <span
th:text="${listOutput.totalElements}"></span></div>
</div>
</div>
<section>
<p class="input-label" style="font-size: 16px;">
총 <span th:text="${listOutput.totalElements}"></span>건
</p>
<table>
<thead>
<tr>
<th >#</th>
<th scope="col">
<label><input class="form-check-input" onchange="toggleCheckbox(this);"
type="checkbox"/></label>
</th>
<th scope="col"><a class="order-able" data-sort-field="id" href="#">ID</a></th>
<th class="text-secondary" scope="col">권한</th>
</th>
<th scope="col"><a class="order-able" data-sort-field="accountDisabled"
href="#">활성화</a>
</th>
<th scope="col"><a class="order-able" data-sort-field="createdAt" href="#">등록일</a>
</th>
<th scope="col"><a class="order-able" data-sort-field="updatedAt" href="#">수정일</a>
<th scope="col"><a class="order-able" data-sort-field="id" href="#">아이디</a></th>
<th scope="col"><a class="order-able" data-sort-field="id" href="#">이름</a></th>
<th class="text-secondary" scope="col">권한</th></th>
<th scope="col"><a class="order-able" data-sort-field="id" href="#">실사</a></th>
<th scope="col"><a class="order-able" data-sort-field="accountDisabled" href="#">계정사용여부</a></th>
<th scope="col"><a class="order-able" data-sort-field="createdAt" href="#">생성일</a>
</th>
</tr>
</thead>
<tbody>
<tr th:each="item, status : ${listOutput.content}">
<th th:text="${status.count + (listOutput.pageable.pageNumber * listOutput.pageable.pageSize)}">
<!-- <th th:text="${status.count + (listOutput.pageable.pageNumber * listOutput.pageable.pageSize)}">
게시물번호
</th>
</th>-->
<td><label><input class="form-check-input" name="checkedIds" th:value="${item.id}"
type="checkbox"/></label>
</td>
<td class="underline"><a th:href="|javascript:goUpdate('${item.id}')|" th:text="${item.id}">아이디</a>
</td>
<td class="underline"><a th:href="|javascript:goUpdate('${item.id}')|" th:text="${item.id}">아이디</a></td>
<td th:text="${item.name}">이름</td>
<td>
<span th:each="role, status : ${item.roles}"
th:text="${role.getDescription()} + ${!status.last ? ', ': ''}"></span>
<span th:each="role, status : ${item.roles}" th:text="${role.getDescription()} + ${!status.last ? ', ': ''}"></span>
</td>
<td th:text="${item.accountDisabled == null || !item.accountDisabled ? 'Y' : 'N' }"></td>
<td th:text="${#temporals.format(item.createdAt, 'yyyy-MM-dd hh:mm')}">등록일</td>
<td th:text="${#temporals.format(item.updatedAt, 'yyyy-MM-dd hh:mm')}">수정일</td>
<td th:text="${item.regionMainCodeName}">실사</td>
<td th:text="${item.accountDisabled == null || !item.accountDisabled ? '사용' : '미사용' }"></td>
<td th:text="${#temporals.format(item.createdAt, 'yyyy-MM-dd hh:mm')}">생성일</td>
</tr>
</tbody>
</table>
<div th:replace="common/list-components :: pagination(${listOutput})"></div>
<div class="component-btns bottom-btn-group">
<div class="btns-row align-right">
<button class="btn btn-success" onclick="goExcel();" type="button">엑셀 다운로드</button>
<button class="btn" onclick="location.href='/settings/admins/create';" type="button">등록</button>
<button class="btn" onclick="goRemove();" type="button">삭제</button>
<button class="btn" onclick="goExcel();" type="button"><span class="btn-txt">엑셀 다운로드</span></button>
<button class="btn" onclick="location.href='/settings/admins/create';" type="button"><span class="btn-txt">등록</span></button>
<button class="btn" onclick="goRemove();" type="button"><span class="btn-txt">삭제</span></button>
</div>
</div>
</section>

View File

@@ -3,12 +3,11 @@
xmlns:th="http://www.thymeleaf.org">
<section layout:fragment="content">
<form
method="post"
th:action="${'/settings/admins/update/' + bindingVO.id}"
th:object="${bindingVO}">
<div class="content-inner">
<input type="hidden" name="seq" th:field="*{seq}"/>
<table class="type-form">
@@ -152,7 +151,7 @@
<!-- <div th:replace="common/components :: auditArea"></div>-->
<div class="component-btns bottom-btn-group">
<div class="btns-row align-right">
<div class="btns-row">
<button type="button" class="btn btn-secondary" onclick="gotoList();return false;">
<span class="btn-txt">목록</span>
</button>
@@ -161,6 +160,7 @@
</button>
</div>
</div>
</div>
</form>
<!-- 이전 목록페이지의 검색 및 정렬조건 폼 -->

View File

@@ -42,6 +42,9 @@ class GetAdminsDao implements GetAdminsPortOut {
admins.stream()
.map(admin -> new GetAdmins(
admin.getId(),
admin.getName(),
admin.getPhone(),
admin.getRegionMainCodeName(),
admin.getCreatedBy(),
admin.getCreatedAt(),
admin.getUpdatedBy(),

View File

@@ -12,6 +12,9 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
public class GetAdmins implements AuditOutput {
private String id;
private String name;
private String phone;
private String regionMainCodeName;
private String createdBy;
private LocalDateTime createdAt;
private String updatedBy;

View File

@@ -7,10 +7,10 @@
SELECT
a.seq,
a.id AS id,
a.name,
COALESCE(a.name,'-') as name,
a.region_main_code,
u.code_text as region_main_code_name,
a.phone,
COALESCE(u.code_text,'-') as region_main_code_name,
COALESCE(a.phone,'-') as phone,
a.created_by,
a.created_at,
a.updated_by,