[FO] 일계부 월별 현황 package 구조 변경, 달력 UI 적용
This commit is contained in:
@@ -1,33 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
xmlns:th="http://www.thymeleaf.org">
|
||||
|
||||
<div>
|
||||
<div>
|
||||
reqVO: [[${reqVO}]]
|
||||
</div>
|
||||
<div>
|
||||
<th:block th:if="${not #strings.isEmpty(detail)}">
|
||||
[[${#temporals.format(detail.startDate, 'yyyy년 MM월 dd일')}]] ~ [[${#temporals.format(detail.endDate, 'yyyy년 MM월 dd일')}]]<br/>
|
||||
|
||||
수입 : [[${detail.incomeStatus}]], [[${detail.incomeCount}]]
|
||||
<span th:onclick="formControl.incomeDetail([[${reqVO.searchDay}]])">수정</span>
|
||||
<br/>
|
||||
|
||||
<br/><br/>
|
||||
detail: [[${detail}]]
|
||||
</th:block>
|
||||
|
||||
<th:block th:if="${#strings.isEmpty(detail)}">
|
||||
<th:block th:with="searchDate=${#temporals.createDate(reqVO.searchDay, 'yyyyMMdd')}">
|
||||
[[${#temporals.format(searchDate, 'yyyy년 MM월 dd일')}]]
|
||||
</th:block>
|
||||
<br/>
|
||||
|
||||
<input type="button" value="등록" th:onclick="formControl.recordCreate([[${reqVO.searchMonth}]], [[${reqVO.groupNo}]])">
|
||||
</th:block>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</html>
|
||||
@@ -3,36 +3,6 @@
|
||||
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
||||
|
||||
<div layout:fragment="content" th:classappend="acco-wrap">
|
||||
<th:block th:if="${@systemProperties['spring.profiles.active'] eq 'local'}">
|
||||
<div>
|
||||
reqVO: [[${reqVO}]]
|
||||
</div>
|
||||
<div>
|
||||
<th:block th:each="calendar, calendarStatus : ${calendarList}">
|
||||
<th:block th:if="${not #strings.isEmpty(calendar.children)}">
|
||||
<span th:onclick="formControl.getDetail([[${reqVO.searchMonth}]], [[${calendar.no}]])">
|
||||
No=[[${calendar.no}]], Start=[[${calendar.start}]], End=[[${calendar.end}]], children=[[${calendar.children}]]<br/>
|
||||
<th:block th:each="children, childrenStatus : ${calendar.children}">
|
||||
<a th:href="${children.path}">
|
||||
>> Text=[[${children.codeLabel}]], Path=[[${children.path}]], Count=[[${children.total}]]<br/>
|
||||
</a>
|
||||
</th:block>
|
||||
</span>
|
||||
</th:block>
|
||||
<th:block th:if="${#strings.isEmpty(calendar.children)}">
|
||||
<span th:onclick="formControl.getDetail([[${reqVO.searchMonth}]], [[${calendar.no}]])">
|
||||
No=[[${calendar.no}]], Start=[[${calendar.start}]], End=[[${calendar.end}]]<br/>
|
||||
</span>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</div>
|
||||
|
||||
<hr/>
|
||||
|
||||
<div id="selectedDay">
|
||||
|
||||
</div>
|
||||
</th:block>
|
||||
<main id="content" role="main">
|
||||
<!-- alert-box 클래스 리스트트
|
||||
fail : 실패(빨강)
|
||||
@@ -54,7 +24,7 @@
|
||||
<div class="datepicker-loading"><i class="ico-spinner" aria-hidden="true"></i></div>
|
||||
<button type="button" class="btn-week-month month"><span>월</span> <span>주</span></button>
|
||||
<div class="component-datepicker kri" data-props-type="inline" data-init="false"></div>
|
||||
<script>
|
||||
<script th:inline="javascript">
|
||||
class DatepickerComponent {
|
||||
$datepicker
|
||||
$datepickerLoading
|
||||
@@ -435,13 +405,16 @@
|
||||
|
||||
async getData (month) {
|
||||
await new Promise(resolve => setTimeout(resolve, 50))
|
||||
const data = await fetch(`http://localhost:8888/assets/json/${month}.json`)
|
||||
const data = await fetch(`/api/record/calendar/${month}`)
|
||||
return await data.json()
|
||||
}
|
||||
}
|
||||
|
||||
new DatepickerComponent(function(list, currentDate, viewDate){
|
||||
console.log('changeDateCallback', list, currentDate, viewDate);
|
||||
|
||||
formControl.setDetail(list, currentDate, viewDate);
|
||||
|
||||
}, function(monthKey, currentDate){
|
||||
console.log('changeMonthCallback', monthKey, currentDate);
|
||||
});
|
||||
@@ -450,63 +423,8 @@
|
||||
</section>
|
||||
|
||||
<section class="daily-report-area bg-gray bg-lround">
|
||||
<div class="inner">
|
||||
<p class="date">2025. 5. 19 ~ 2025. 5. 20</p>
|
||||
<ul class="btn-column-list">
|
||||
<li>
|
||||
<a href="">
|
||||
<p class="label">수입</p>
|
||||
<p class="value"><em>총 <b>4</b>건</em></p>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="">
|
||||
<p class="label">노동투입</p>
|
||||
<p class="value">없음</p>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="">
|
||||
<p class="label">지출</p>
|
||||
<p class="value">없음</p>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="">
|
||||
<p class="label">동력사용시간</p>
|
||||
<p class="value"><em>총 <b>4</b>건</em></p>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="">
|
||||
<p class="label">임업생산물 중 자가소비량</p>
|
||||
<p class="value">없음</p>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="">
|
||||
<p class="label">농업생산물 중 자가소비량</p>
|
||||
<p class="value">없음</p>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="component-btns btn-add">
|
||||
<button type="button">
|
||||
<p class="txt">일계부 등록하기</p>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="regist-btn-area">
|
||||
<a href="" class="btn complete">
|
||||
<p>임산물 현황 등록</p>
|
||||
<span>등록완료</span>
|
||||
</a>
|
||||
<a href="" class="btn">
|
||||
<p>은행 자동이체 내역 등록</p>
|
||||
<span>미등록</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="inner" id="selectedDay">
|
||||
<!--/* jsRender */-->
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -514,6 +432,7 @@
|
||||
</div>
|
||||
|
||||
<section layout:fragment="script">
|
||||
<script th:src="@{/static/library/jsRender/jsrender.min.js}"></script>
|
||||
<script th:src="@{/static/ui/page/daily-record.js}"></script>
|
||||
<script th:inline="javascript">
|
||||
let ENV = {
|
||||
@@ -526,32 +445,89 @@
|
||||
};
|
||||
|
||||
let formControl = {
|
||||
getDetail(searchMonth, groupNo) {
|
||||
console.log('searchMonth=', searchMonth, 'groupNo=', groupNo);
|
||||
setDetail(list, currentDate, viewDate) {
|
||||
const todoList = list.filter(f => !(f.code === 'MONTHLY' || f.code === 'BANK'));
|
||||
const etcList = list.filter(f => f.code === 'MONTHLY' || f.code === 'BANK');
|
||||
console.log(todoList)
|
||||
console.log(etcList)
|
||||
|
||||
ajaxUtil._ajaxAsync(
|
||||
ENV.httpUrl.list.replace('{searchMonth}', searchMonth).replace('{groupNo}', groupNo),
|
||||
{},
|
||||
function(rstHtml, status) {
|
||||
$('#selectedDay').html(rstHtml);
|
||||
},
|
||||
function(code, rstData) {
|
||||
kri.logger.error('Do nothing. code: '+ code, rstData);
|
||||
},
|
||||
'html'
|
||||
);
|
||||
let tmpl = $.templates('#dailyNoneTmpl');
|
||||
let html = '';
|
||||
if (todoList === undefined || todoList.length === 0) {
|
||||
html = tmpl.render({
|
||||
date: currentDate,
|
||||
etcList: etcList,
|
||||
});
|
||||
} else {
|
||||
tmpl = $.templates('#dailyListTmpl');
|
||||
html = tmpl.render({
|
||||
date: currentDate,
|
||||
list: todoList,
|
||||
etcList: etcList,
|
||||
});
|
||||
}
|
||||
console.log(html)
|
||||
|
||||
$('#selectedDay').html(html);
|
||||
},
|
||||
incomeDetail(selectedDay) {
|
||||
// TODO
|
||||
alert('TODO : ' + selectedDay);
|
||||
},
|
||||
|
||||
recordCreate(searchMonth, groupNo) {
|
||||
location.href = ENV.httpUrl.create.replace('{searchMonth}', searchMonth).replace('{groupNo}', groupNo);
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<script id="dailyNoneTmpl" type="text/x-jsrender">
|
||||
{{include tmpl="#titleTmpl" /}}
|
||||
|
||||
<div class="component-btns btn-add">
|
||||
<button type="button" onclick="alert('TODO');">
|
||||
<p class="txt">일계부 등록하기</p>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{{include tmpl="#etcRowTmpl" /}}
|
||||
</script>
|
||||
<script id="dailyListTmpl" type="text/x-jsrender">
|
||||
{{include tmpl="#titleTmpl" /}}
|
||||
|
||||
<ul class="btn-column-list">
|
||||
{{for list tmpl="#basicRowTmpl" /}}
|
||||
</ul>
|
||||
|
||||
{{include tmpl="#etcRowTmpl" /}}
|
||||
</script>
|
||||
<script id="titleTmpl" type="text/x-jsrender">
|
||||
{{if date.start == date.end}}
|
||||
<p class="date">{{:date.start}}</p>
|
||||
{{else}}
|
||||
<p class="date">{{:date.start}} ~ {{:date.end}}</p>
|
||||
{{/if}}
|
||||
</script>
|
||||
<script id="basicRowTmpl" type="text/x-jsrender">
|
||||
<li>
|
||||
<a href="{{:path}}">
|
||||
<p class="label">{{:codeLabel}}</p>
|
||||
{{if total != null && total != 0}}
|
||||
<p class="value"><em>총 <b>{{:total}}</b>건</em></p>
|
||||
{{else}}
|
||||
<p class="value">없음</p>
|
||||
{{/if}}
|
||||
</a>
|
||||
</li>
|
||||
</script>
|
||||
<script id="etcRowTmpl" type="text/x-jsrender">
|
||||
<div class="regist-btn-area">
|
||||
{{for etcList}}
|
||||
<a href="{{:path}}" class="btn{{if total != null && total != 0}} complete{{/if}}">
|
||||
<p>{{:codeLabel}}</p>
|
||||
{{if total != null && total != 0}}
|
||||
<span>등록완료</span>
|
||||
{{else}}
|
||||
<span>미등록</span>
|
||||
{{/if}}
|
||||
</a>
|
||||
{{/for}}
|
||||
</div>
|
||||
</script>
|
||||
</section>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user