Compare commits

...

3 Commits

4 changed files with 104 additions and 28 deletions

View File

@ -13,8 +13,37 @@ import EgovPagingPaginationInfo from 'components/EgovPagingPaginationInfo';
import styled from "styled-components";
const StyledDiv = styled.div`
.board_btn_area {
margin: 12px 0px;
.BRD008 {
.head > span:nth-child(3) {
width: 180px;
}
.result .list_item > div:nth-child(3) {
width: 180px;
}
}
.board-bot {
margin-top: 20px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: flex-start;
align-items: stretch;
justify-content: center;
& > *:nth-child(1) {
width: 16%;
justify-content: left;
}
& > *:nth-child(2) {
width: 68%;
justify-content: center;
}
& > *:nth-child(3) {
width: 16%;
justify-content: right;
}
}
`;
@ -112,14 +141,6 @@ function PopUp(props) {
<div className="top_tit">
<h1 className="tit_1">팝업 관리</h1>
</div>
{/* <!-- 버튼영역 --> */}
<div className="board_btn_area">
<div className="right_col btn1">
<Link to={URL.ADMIN__CONTENTS__POP_UP__CREATE} className="btn btn_blue_h46 w_100">팝업 추가</Link>
</div>
</div>
{/* <!--// 버튼영역 --> */}
{/* <!-- 게시판목록 --> */}
<div className="board_list BRD008">
@ -136,7 +157,7 @@ function PopUp(props) {
}
{listPopup.map((it)=>(
<div className='list_item' key={it.seq}>
<div>{it.seq}</div>
<div>{it.number}</div>
<div className="al"><Link to={URL.ADMIN__CONTENTS__POP_UP__MODIFY} state={{popupId: it.seq} } key={it.seq}>{it.popupTitle}</Link></div>
<div>{it.startDate} ~ {it.endDate}</div>
<div>{it.useYn === 'Y' ? <Switch {...label} key={it.seq} onChange={(e) => onChangeActivationSwitch(e, it.seq)} defaultChecked /> : <Switch key={it.seq} onChange={(e) => onChangeActivationSwitch(e, it.seq)} {...label} />}</div>
@ -146,13 +167,24 @@ function PopUp(props) {
</div>
{/* <!--// 게시판목록 --> */}
<div className="board_bot">
{/* <!-- Paging --> */}
{/* <!-- Paging --> */}
<div className="board-bot">
<div></div>
<EgovPagingPaginationInfo pagination={paginationInfo} setPaginationInfo={setPaginationInfo} moveToPage={passedPage => {
getList({ ...searchCondition, pageIndex: passedPage })
}} />
{/* <!--/ Paging --> */}
<div className="right_col btn1">
<Link to={URL.ADMIN__CONTENTS__POP_UP__CREATE} className="btn btn_blue_h46 w_100">등록</Link>
</div>
</div>
{/* <!--/ Paging --> */}
</StyledDiv>
{/* <!--// 본문 --> */}
</div>

View File

@ -13,8 +13,36 @@ import EgovPagingPaginationInfo from 'components/EgovPagingPaginationInfo';
import styled from "styled-components";
const StyledDiv = styled.div`
.board_btn_area {
margin: 12px 0px;
.BRD008 {
.head > span:nth-child(3) {
width: 200px;
}
.result .list_item > div:nth-child(3) {
width: 200px;
}
}
.board-bot {
margin-top: 20px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: flex-start;
align-items: stretch;
justify-content: center;
& > *:nth-child(1) {
width: 16%;
justify-content: left;
}
& > *:nth-child(2) {
width: 68%;
justify-content: center;
}
& > *:nth-child(3) {
width: 16%;
justify-content: right;
}
}
`;
@ -110,14 +138,10 @@ function StandardResearch(props) {
<StyledDiv>
<div className="top_tit">
<h1 className="tit_1">건설기준연구 관리</h1>
</div>
{/* <!-- 버튼영역 --> */}
<div className="board_btn_area">
<div className="right_col btn1">
<Link to={URL.ADMIN__CONTENTS__STANDARDS_RESEARCH__CREATE} className="btn btn_blue_h46 w_100"> 작성</Link>
</div>
</div>
{/* <!--// 버튼영역 --> */}
{/* <!-- 게시판목록 --> */}
<div className="board_list BRD008">
@ -134,7 +158,7 @@ function StandardResearch(props) {
}
{list.map((it)=>(
<div className='list_item' key={it.id}>
<div>{it.id}</div>
<div>{it.number}</div>
<div className="al"><Link to={URL.ADMIN__CONTENTS__STANDARDS_RESEARCH__MODIFY} state={{rsId: it.id} } key={it.id}>{it.title}</Link></div>
<div>{it.researchStartDate} ~ {it.researchEndDate}</div>
<div>{it.director}</div>
@ -144,13 +168,27 @@ function StandardResearch(props) {
</div>
{/* <!--// 게시판목록 --> */}
<div className="board_bot">
{/* <!-- Paging --> */}
{/* <!-- Paging --> */}
<div className="board-bot">
<div></div>
<EgovPagingPaginationInfo pagination={paginationInfo} setPaginationInfo={setPaginationInfo} moveToPage={passedPage => {
getList({ ...searchCondition, pageIndex: passedPage })
}} />
{/* <!--/ Paging --> */}
<div className="right_col btn1">
<Link to={URL.ADMIN__CONTENTS__STANDARDS_RESEARCH__CREATE} className="btn btn_blue_h46 w_100">등록</Link>
</div>
</div>
{/* <!--/ Paging --> */}
</StyledDiv>
{/* <!--// 본문 --> */}
</div>

View File

@ -24,6 +24,7 @@ import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
@Service("popUpApiService")
@ -47,12 +48,14 @@ public class PopUpApiServiceImpl extends EgovAbstractServiceImpl implements PopU
);
Long totalRecordCount = tnPopupMngRepositoryWithoutPopupContents.count();
Long totalRecordCount = tnPopupMngRepositoryWithoutPopupContents.count();
AtomicInteger index = new AtomicInteger();
//List<Map<String, Object>> listPopup = tnPopupMngRepositoryWithoutPopupContents.findAll(Sort.by(Sort.Direction.DESC, "popupSeq"))
List<Map<String, Object>> listPopup = tnPopupMngRepositoryWithoutPopupContents.findAll(pageable)
.stream()
.map(item -> {
Map<String, Object> codeMap = new HashMap<>();
codeMap.put("number", totalRecordCount - (long) pageable.getPageNumber() * pageable.getPageSize() - index.getAndIncrement());
codeMap.put("seq", item.getPopupSeq());
codeMap.put("popupTitle", item.getPopupTitle());
codeMap.put("startDate", item.getPopupStartDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));

View File

@ -31,6 +31,7 @@ import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
@Service("adminStandardResearchService")
@ -55,10 +56,12 @@ public class AdminStandardResearchServiceImpl extends EgovAbstractServiceImpl im
long totalRecordCount = tnResearchRepositoryLightweight.countByUseYn("Y");
AtomicInteger index = new AtomicInteger();
List<Map<String, Object>> list = tnResearchRepositoryLightweight.findByUseYn("Y", pageable)
.stream()
.map(item -> {
Map<String, Object> codeMap = new HashMap<>();
codeMap.put("number", totalRecordCount - (long) pageable.getPageNumber() * pageable.getPageSize() - index.getAndIncrement());
codeMap.put("id", item.getRsSeq());
codeMap.put("title", item.getRsTitle());
codeMap.put("researchStartDate", item.getRsStartDate().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));