일단 커밋
This commit is contained in:
@@ -1,9 +1,265 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.thymeleaf.org"
|
||||
layout:decorate="~{layout/layout}">
|
||||
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<section layout:fragment="content">
|
||||
<h1>/researcher/researchers</h1>
|
||||
<form autocomplete="off" method="get" name="reqForm" th:action="@{/researcher/researchers}" th:object="${reqVO}">
|
||||
<section class="filter-wrap">
|
||||
|
||||
<div class="form-area">
|
||||
<!-- hidden parameters -->
|
||||
<input name="sort" th:field="*{sort}" type="hidden"/>
|
||||
<input name="page" th:field="*{page}" type="hidden"/>
|
||||
|
||||
<div class="input-group">
|
||||
<div class="input-label">
|
||||
<p class="label-txt">
|
||||
조사원
|
||||
</p>
|
||||
</div>
|
||||
<div class="d-flex">
|
||||
<div class="component-select">
|
||||
<select class="select-list" required th:field="*{searchField}">
|
||||
<option value="" selected>전체</option>
|
||||
<option value="name">이름</option>
|
||||
<option value="phone">전화번호</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="component-input">
|
||||
<div class="input-field">
|
||||
<input type="text" id="temp_input_0001" th:field="*{searchValue}" placeholder="검색어를 입력하세요.">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<div class="input-label">
|
||||
<p class="label-txt">
|
||||
실사지역
|
||||
</p>
|
||||
</div>
|
||||
<div class="component-select">
|
||||
<select class="select-list" required th:field="*{searchArea}">
|
||||
<option selected value="">전체</option>
|
||||
<option
|
||||
th:each="item : ${inspectionArea}"
|
||||
th:text="${item.codeText}" th:value="${item.codeValue}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<div class="input-label">
|
||||
<p class="label-txt">
|
||||
계정사용여부
|
||||
</p>
|
||||
</div>
|
||||
<div class="component-select">
|
||||
<select class="select-list" required th:field="*{searchAccountDisabled}">
|
||||
<option selected value="">전체</option>
|
||||
<option value="0">사용</option>
|
||||
<option value="1">미사용</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-btns">
|
||||
<div class="btns-row">
|
||||
<button type="button" class="btn" onclick="goInit();">
|
||||
<span class="btn-txt">초기화</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary" onclick="goSearch();" >
|
||||
<i class="bi bi-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
||||
<div class="row">
|
||||
<div class="col text-start">
|
||||
<div class="fw-bolder text-muted">
|
||||
TOTAL. <span id="totalElements"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<section>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>이름</th>
|
||||
<th>전화번호</th>
|
||||
<th>실사지역</th>
|
||||
<th>임가수</th>
|
||||
<th>사용여부</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="listTBody">
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<div class="row paging"></div>
|
||||
|
||||
|
||||
<div class="component-btns bottom-btn-group">
|
||||
<div class="btns-row align-right">
|
||||
<button type="button" class="btn" onclick="goExcel();">
|
||||
<span class="btn-txt">엑셀 다운로드 <i class="ico-download ico-small" aria-hidden="true"></i></span>
|
||||
</button>
|
||||
<button type="button" class="btn" onclick="goSave();">
|
||||
<span class="btn-txt">등록</span>
|
||||
</button>
|
||||
<button type="button" class="btn" >
|
||||
<span class="btn-txt">조사원 매핑</span>
|
||||
</button>
|
||||
<button type="button" class="btn" onclick="goRemove();">
|
||||
<span class="btn-txt">비활성화</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section layout:fragment="script">
|
||||
<script>
|
||||
const getResearchers = (pageNo) => {
|
||||
const f = document.reqForm;
|
||||
f.page.value = pageNo;
|
||||
|
||||
let dataOj = $(f).serializeObject();
|
||||
|
||||
ajaxUtil._ajaxMethod(
|
||||
'/researcher/list',
|
||||
dataOj,
|
||||
function (response) {
|
||||
$('#totalElements').text(response.totalElements);
|
||||
|
||||
// List 구성하기
|
||||
const tbody = $('#listTBody');
|
||||
tbody.empty();
|
||||
|
||||
$(response.content).each((idx, ct) => {
|
||||
tbody.append(
|
||||
`
|
||||
<tr data-order-no="${ct.orderNo}"
|
||||
data-id="${ct.id}">
|
||||
<td><a href="javascript:goUpdate(${ct.id})">${ct.name}</a></td>
|
||||
<td>${ct.phone}</td>
|
||||
<td>${ct.regionMainCodeName}</td>
|
||||
<td>${ct.householdCount}</td>
|
||||
<td>${ct.accountDisabledFlag}</td>
|
||||
</tr>
|
||||
`
|
||||
);
|
||||
});
|
||||
|
||||
if (!$(response.content).length) {
|
||||
tbody.append(`
|
||||
<tr>
|
||||
<td colspan="10" class="text-center text-muted">조사원이 존재하지 않습니다.</td>
|
||||
</tr>
|
||||
`);
|
||||
}
|
||||
|
||||
// Pagination 구성하기
|
||||
const paging = $('.paging');
|
||||
paging.empty();
|
||||
paging.append(
|
||||
uiUtil.getPagingUI(pageNo, f.size.value, response.totalPages,
|
||||
(movePageNo) => {
|
||||
f.page.value = movePageNo;
|
||||
goSearch();
|
||||
}));
|
||||
|
||||
},
|
||||
function (code, rstData) {
|
||||
console.log("왜지 ");
|
||||
|
||||
},
|
||||
'get',
|
||||
'json',
|
||||
null
|
||||
);
|
||||
}
|
||||
// 최초 리스트 로드
|
||||
getResearchers(document.reqForm.page.value);
|
||||
</script>
|
||||
|
||||
<script th:inline="javascript">
|
||||
const goSearch = () => {
|
||||
const f = document.reqForm;
|
||||
f.method = 'GET';
|
||||
f.submit();
|
||||
}
|
||||
|
||||
// 초기화
|
||||
function goInit() {
|
||||
const f = document.reqForm;
|
||||
f.searchField.value = '';
|
||||
f.searchValue.value = '';
|
||||
f.searchArea.value = '';
|
||||
f.searchAccountDisabled.value = '';
|
||||
}
|
||||
|
||||
// 저장페이지 이동
|
||||
function goSave() {
|
||||
location.href = '/board/articles/create';
|
||||
}
|
||||
|
||||
// 수정페이지 이동
|
||||
function goUpdate(itemId) {
|
||||
location.href = '/board/articles/' + itemId;
|
||||
}
|
||||
|
||||
// 상세페이지 이동
|
||||
function goDetail(seq) {
|
||||
location.href = '/researcher/researchers/' + seq;
|
||||
}
|
||||
|
||||
function goExcel() {
|
||||
const f = document.reqForm;
|
||||
const data = $(f).serializeObject();
|
||||
|
||||
// size 를 제거하면 전체 목록을 가져온다.
|
||||
delete data.size;
|
||||
|
||||
location.href = '/admin/researchers/excel?' + new URLSearchParams(data).toString();
|
||||
}
|
||||
|
||||
// 체크박스 선택/해제
|
||||
function toggleCheckbox(oj) {
|
||||
$('input[name=selectIds]').prop("checked", oj.checked);
|
||||
}
|
||||
|
||||
function goRemove() {
|
||||
if (!$('input[name=selectIds]').is(':checked')) {
|
||||
alert(/*[[#{operation.common.remove.choose}]]*/);
|
||||
return;
|
||||
}
|
||||
|
||||
if (confirm(/*[[#{operation.common.remove.ask}]]*/)) {
|
||||
const f = document.reqForm;
|
||||
const data = $(f).serializeObject();
|
||||
|
||||
$.ajax({
|
||||
'method': 'DELETE',
|
||||
'url': '/researchers/remove',
|
||||
'data': {
|
||||
'selectIds': data.selectIds
|
||||
},
|
||||
beforeSend: function (xhr) {
|
||||
xhr.setRequestHeader(
|
||||
$("meta[name='_csrf_header']").attr("content"),
|
||||
$("meta[name='_csrf']").attr("content"));
|
||||
},
|
||||
success(res) {
|
||||
alert('선택한 아이템이 삭제되었습니다.');
|
||||
f.method = 'GET';
|
||||
f.submit();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</section>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user