내정보 공지사항 : 검색 제외

This commit is contained in:
DESKTOP-E9DJS27\etribe
2025-06-14 15:45:37 +09:00
parent 75f1d1eb23
commit 966cca98cf
20 changed files with 329 additions and 123 deletions

View File

@@ -26,11 +26,13 @@
<dd class="location" th:text="${userInfo?.address}"></dd><!-- TODO 임가 주소 위치 임시로 . 처리함. -->
<dd class="date" th:if="${latestRegisteredDate != null or !#strings.isEmpty(latestRegisteredDate)}" th:text="${'최근등록: '+latestRegisteredDate}"></dd>
</dl>
<th:block th:if="${notice != null}">
<a th:href="@{'/info/notice/' + ${notice.id}}" class="notice-box">
<p class="tit">공지사항</p>
<p class="txt" th:text="${notice.title}"></p>
</a>
</th:block>
<a href="/info/notice/1" class="notice-box"><!-- TODO 공지사항 작성후 처리 필요 -->
<p class="tit">공지사항</p>
<p class="txt">2025 임가경제조사 실시 안내</p>
</a>
</div>
</section>

View File

@@ -2,127 +2,88 @@
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
xmlns:th="http://www.thymeleaf.org">
<div layout:fragment="content">
<main id="content" role="main">
<div layout:fragment="content" th:classappend="'mypage-wrap'">
<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">
<button type="button" class="select-box">
<span class="select-txt">제목 + 내용</span>
</button>
<div class="select-options">
<div class="select-header">
<p>검색 분류 선택</p>
<button type="button" class="select-close">
<span class="hide-txt">닫기</span>
</button>
</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>
</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>
</div>
</div>
</section>
<hr>
<style>
label {
display: inline-block;
width: 150px;
}
<section class="list-area" th:unless="${notices.content.size() > 0}">
<div class="no-data">
<i class="ico-nodata ico-large" aria-hidden="true"></i>
<p>조회 가능한 목록이 없습니다.</p>
</div>
</section>
div {
margin-bottom: 15px;
}
<section class="list-area" th:if="${notices.content.size() > 0}">
<p class="total-num">
총 <strong th:text="${notices.totalElements}"></strong>건
</p>
<ul>
.invalid-feedback {
display: none;
font-size: 12px;
font-weight: bold;
}
<li th:each="item : ${notices.content}">
<a th:href="@{'/info/notice/' + ${item.id}}">
<p class="list-tit" th:text="${item.title}"></p>
<p class="list-info">
<span class="date" th:text="${#temporals.format(item.createdAt, 'yyyy.MM.dd')}">2025.05.28</span>
<span class="badge" th:if="${item.newDate}">NEW</span>
</p>
</a>
</li>
.is-invalid + .invalid-feedback {
display: block;
}
</ul>
input[readonly] {
background-color: #e9ecef;
color: #6c757d;
cursor: not-allowed;
}
</style>
<div>
<form
method="get"
name="reqForm"
th:action="@{/user/info}" th:object="${userInfo}">
<input type="hidden" name="id" th:value="*{seq}">
<div th:replace="common/list-components :: paginationCommon(${notices})"></div>
<div>
<label for="householdNum">임가번호</label>
<input id="householdNum" name="householdNum" placeholder="아이디" readonly="readonly" th:field="*{householdNum}"
type="text">
<div class="invalid-feedback field-id"></div>
</div>
<div>
<label for="ownerName">경영주</label>
<input id="ownerName" name="ownerName" placeholder="경영주 이름" th:field="*{ownerName}" type="text">
<div class="invalid-feedback field-id"></div>
</div>
<div>
<label for="ownerAge">만나이</label>
<input id="ownerAge" name="ownerAge" placeholder="나이" th:field="*{ownerAge}" type="text">
<div class="invalid-feedback field-id"></div>
</div>
<div>
<label for="tel">가구연락처</label>
<input id="tel" name="tel" placeholder="가구연락처" th:field="*{tel}" type="text">
<div class="invalid-feedback field-id"></div>
</div>
<div>
<label for="phone">핸드폰번호</label>
<input id="phone" name="phone" placeholder="핸드폰번호" th:field="*{phone}" type="text">
<div class="invalid-feedback field-id"></div>
</div>
<!-- <div>-->
<!-- <label for="region">시.도</label>-->
<!-- <input id="region" name="region" placeholder="시.도" th:field="*{region}" type="text">-->
<!-- <div class="invalid-feedback field-id"></div>-->
<!-- </div>-->
<!-- <div>-->
<!-- <label for="city">시.군.도</label>-->
<!-- <input id="city" name="city" placeholder="시.군.도" th:field="*{city}" type="text">-->
<!-- <div class="invalid-feedback field-id"></div>-->
<!-- </div>-->
<div>
<label for="addressDetail">전체 주소</label>
<input id="addressDetail" name="addressDetail" placeholder="세부 주소" th:field="*{address}" type="text">
<div class="invalid-feedback field-id"></div>
</div>
</form>
<button onclick="updateUser();">수정하기</button>
</div>
</main>
</section>
</div>
</main>
</div>
<section layout:fragment="script">
<script>
const updateUser = () => {
const f = document.reqForm;
const obj = $(f).serializeObject();
// 기존 에러 메세지 초기화
$('.is-invalid').removeClass('is-invalid');
$.ajax({
method: 'PATCH',
url: '/api/front/household/update',
data: obj,
beforeSend: function (xhr) {
xhr.setRequestHeader(
$("meta[name='_csrf_header']").attr("content"),
$("meta[name='_csrf']").attr("content"));
},
success(res) {
if (confirm(`'${res.ownerName} 님의' 정보가 수정되었습니다.`)) {
location.reload();
}
},
statusCode: {
'422': (res) => {
const fieldErrors = res.responseJSON.fieldErrors;
$(fieldErrors).each(function (idx, error) {
let target = $(f).find('[name=' + error.field + ']');
target.addClass('is-invalid');
target.parent().find('.invalid-feedback').text(error.message);
});
}
}
})
}
<script th:inline="javascript">
let ENV = {
httpUrl: {
root: /*[[#{uri.front.info.notice.path}]]*/'detailUrl',
notice: /*[[#{uri.front.info.notice.path}]]*/'noticeUrl'
},
module:{
confirmPopup : null
},
submitted: false,
};
</script>
</section>

View File

@@ -0,0 +1,72 @@
<!DOCTYPE html>
<html layout:decorate="~{layout/layout}" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
xmlns:th="http://www.thymeleaf.org">
<div layout:fragment="content" th:classappend="'mypage-wrap'">
<main id="content" role="main">
<div class="detail-wrap">
<div class="inner">
<dl class="detail-tit-group">
<dt th:text="${notice.title}"></dt>
<dd>[[${#temporals.format(notice.createdAt, 'yyyy.MM.dd')}]] <span class="badge" th:if="${notice.newDate}">new</span></dd>
</dl>
<div class="detail-content">
<p th:utext="${notice.content}"></p>
</div>
<div class="download-file" th:if="${!#lists.isEmpty(notice.uploadFiles)}">
<p class="tit">첨부파일</p>
<ul>
<li th:each="item : ${notice.uploadFiles}"><a th:href="${item.attachmentURL}" download th:text="${item.originName}"></a></li>
</ul>
</div>
<button type="button" class="btn btn-list btn-full" onclick="formControl.goList()">
<span class="btn-txt">목록</span>
</button>
</div>
</div>
</main>
</div>
root: /*[[|#{uri.front.info.user.path}/password|]]*/'rootUrl',
<section layout:fragment="script">
<script th:inline="javascript">
let ENV = {
httpUrl: {
root: /*[[#{uri.front.info.notice.path}]]*/'detailUrl',
notice: /*[[#{uri.front.info.notice.path}]]*/'noticeUrl'
},
module:{
confirmPopup : null
},
submitted: false,
};
let formControl = {
init() {
},
goList(){
/**
* TODO 외부 유입에 따라 history.back과 location.href 가 적절하게 사용되어야함...
* 전체적인 수정 필요.(이전 페이지
*/
const previousUrl = document.referrer;
if (previousUrl.includes('/info/notice')) {
history.back();
} else {
location.href = '/info/notice';
}
}
}
</script>
</section>
</html>

View File

@@ -47,6 +47,10 @@
user: /*[[#{uri.front.info.user.path}]]*/'userUrl',
},
submitted: false,
};