공지사항 검색, 페이징 추가.
This commit is contained in:
@@ -39,10 +39,10 @@
|
||||
|
||||
<div th:fragment="paginationCommon(items)">
|
||||
<nav class="component-pagination" aria-label="페이지네이션">
|
||||
|
||||
<a th:href="|javascript:goPageable(0, ${items.pageable.pageSize}, '${items.pageable.sort}')|" class="pagination-item first"><span class="hide-txt">첫 페이지로 이동</span></a>
|
||||
<a th:href="|javascript:goPageable(${items.pageable.pageNumber - 1}, ${items.pageable.pageSize}, '${items.pageable.sort}')|" class="pagination-item prev"><span class="hide-txt">이전 페이지로 이동</span></a>
|
||||
|
||||
<th:block th:if="${items.totalPages != 1}">
|
||||
<a th:href="|javascript:goPageable(0, ${items.pageable.pageSize}, '${items.pageable.sort}')|" class="pagination-item first"><span class="hide-txt">첫 페이지로 이동</span></a>
|
||||
<a th:href="|javascript:goPageable(${items.pageable.pageNumber - 1}, ${items.pageable.pageSize}, '${items.pageable.sort}')|" class="pagination-item prev"><span class="hide-txt">이전 페이지로 이동</span></a>
|
||||
</th:block>
|
||||
|
||||
<th:block th:each="idx : ${#numbers.sequence(0, items.totalPages == 0 ? 0 : items.totalPages - 1)}">
|
||||
<th:block th:if="${idx == items.pageable.pageNumber}">
|
||||
@@ -52,9 +52,10 @@
|
||||
<a th:href="|javascript:goPageable(${idx}, ${items.pageable.pageSize}, '${items.pageable.sort}')|" class="pagination-item" th:text="${idx+1}"></a>
|
||||
</th:block>
|
||||
</th:block>
|
||||
|
||||
<a th:href="|javascript:goPageable(${items.pageable.pageNumber + 1}, ${items.pageable.pageSize}, '${items.pageable.sort}')|" class="pagination-item next"><span class="hide-txt">다음 페이지로 이동</span></a>
|
||||
<a th:href="|javascript:goPageable(${items.pageable.pageNumber-1}, ${items.pageable.pageSize}, '${items.pageable.sort}')|" class="pagination-item last"><span class="hide-txt">마지막 페이지로 이동</span></a>
|
||||
<th:block th:if="${items.totalPages != 1}">
|
||||
<a th:href="|javascript:goPageable(${items.pageable.pageNumber + 1}, ${items.pageable.pageSize}, '${items.pageable.sort}')|" class="pagination-item next"><span class="hide-txt">다음 페이지로 이동</span></a>
|
||||
<a th:href="|javascript:goPageable(${items.pageable.pageNumber-1}, ${items.pageable.pageSize}, '${items.pageable.sort}')|" class="pagination-item last"><span class="hide-txt">마지막 페이지로 이동</span></a>
|
||||
</th:block>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -6,7 +6,14 @@
|
||||
<main id="content" role="main">
|
||||
<div class="inner">
|
||||
<section class="search-area">
|
||||
<div id="select3" class="component-select bottom-sheet" data-props-default="제목 + 내용" data-props-type="bottomSheet">
|
||||
<form autocomplete="off" method="get" name="reqForm" action="/info/notice" onsubmit="formControl.goSearch()"
|
||||
th:object="${reqVO}"
|
||||
>
|
||||
<input type="hidden" name="sort" id="sort" value="createdAt,DESC"/>
|
||||
<input type="hidden" name="page" id="page" th:value="${notices != null} ? ${notices.number} : 0"/>
|
||||
|
||||
<div id="searchFieldId" class="component-select bottom-sheet" data-props-default="제목 + 내용" data-props-type="bottomSheet">
|
||||
<input type="hidden" name="searchField"/>
|
||||
<button type="button" class="select-box">
|
||||
<span class="select-txt">제목 + 내용</span>
|
||||
</button>
|
||||
@@ -19,19 +26,20 @@
|
||||
</div>
|
||||
<div class="select-scroll">
|
||||
<ul class="">
|
||||
<li class="option current" data-value="option1">제목 + 내용</li>
|
||||
<li class="option" data-value="option2">제목</li>
|
||||
<li class="option" data-value="option3">내용</li>
|
||||
<li class="option" th:classappend="*{searchField == null or searchField == 'titleContent'} ? ' current' : ''" data-value="titleContent">제목 + 내용</li>
|
||||
<li class="option" th:classappend="*{searchField == 'title'} ? ' current' : ''" data-value="title">제목</li>
|
||||
<li class="option" th:classappend="*{searchField == 'content'} ? ' current' : ''" data-value="content">내용</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-input">
|
||||
<div class="input-field">
|
||||
<input type="text" id="temp_input_ico_id_0001" placeholder="검색어를 입력해 주세요">
|
||||
<i class="input-field-ico ico-search" aria-hidden="true"></i>
|
||||
<input type="text" id="temp_input_ico_id_0001" placeholder="검색어를 입력해 주세요" name="searchValue" th:field="*{searchValue}"/>
|
||||
<i class="input-field-ico ico-search" aria-hidden="true" onclick="formControl.goSearch()"></i>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
<hr>
|
||||
|
||||
@@ -84,6 +92,27 @@
|
||||
},
|
||||
submitted: false,
|
||||
};
|
||||
let formControl = {
|
||||
init(){
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* TODO 검색할때 각 페이지에 함수 구현 필요.
|
||||
* TODO 일단 뒤로가기에 대한 부분 정의가 없기에 페이지 이동으로 처리해둠...
|
||||
*/
|
||||
goSearch(){
|
||||
const f = document.reqForm;
|
||||
|
||||
f.searchField.value = document.getElementById('searchFieldId').value;
|
||||
f.submit();
|
||||
},
|
||||
goPageable(page, size, sort){
|
||||
const f = document.reqForm;
|
||||
f.page.value = page;
|
||||
f.submit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user