코드리스트 탭 추가 탭+분류로 조회되게 수정
parent
fd0bcbeef7
commit
36232d6748
|
|
@ -220,6 +220,15 @@ select::-ms-expand {display:none;}
|
|||
.f_select::after {content: ""; display: block; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); width: 15px; height: 9px; background: url(css/images/ico_arrow_gray_15x9.png) no-repeat;}
|
||||
.f_select select {width: 100%; height: 100%; padding: 0 40px 0 20px; border: 0; color: #222; font-size: 16px; background: transparent;}
|
||||
|
||||
/* 건설기준코드list 설계기준 표준시방서 전문시방서 통합 다운로드 탭 */
|
||||
/*.mini_board {position: relative;}
|
||||
.mini_board .tab::after {content: ""; display: block; clear: both;}
|
||||
.mini_board .tab li {float: left;}
|
||||
.mini_board .tab li + li {margin-left: 40px;}
|
||||
.mini_board .tab li a {display: block; position: relative; padding-bottom: 12px; color: #ccc; font-size: 30px; font-weight: 700;}
|
||||
.mini_board .tab li a.on {color: #222;}
|
||||
.mini_board .tab li a.on::after {content: ""; display: block; position: absolute; left: 0; bottom: 0; width: 100%; height: 4px; background: #0465be;}*/
|
||||
|
||||
.f_input {height: 46px; padding: 0 20px; border: 0; border-radius: 5px; color: #222; font-size: 16px; background: #f7f7f7;}
|
||||
.f_input2 {height: 46px; padding: 0 20px; border: 1px solid #dde2e5; border-radius: 5px !important; color: #222; font-size: 16px; background: #fff;}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import React, { useState, useEffect, useCallback, useRef } from 'react';
|
||||
import React, {useState, useEffect, useCallback, useRef} from 'react';
|
||||
import {Link, useLocation, useParams} from 'react-router-dom';
|
||||
|
||||
import * as EgovNet from 'api/egovFetch';
|
||||
import URL from 'constants/url';
|
||||
import { NOTICE_BBS_ID } from 'config';
|
||||
import {NOTICE_BBS_ID} from 'config';
|
||||
|
||||
import { itemIdxByPage } from 'utils/calc';
|
||||
import {itemIdxByPage} from 'utils/calc';
|
||||
|
||||
import {StandardCodeListModal, StandardCodeListModalTable} from './StandardCodeListModal'
|
||||
import {AiFillFileMarkdown, AiFillStar} from "react-icons/ai";
|
||||
|
|
@ -13,8 +13,9 @@ import {AiFillFileMarkdown, AiFillStar} from "react-icons/ai";
|
|||
function StandardCodeList(props) {
|
||||
const {listCode} = useParams();
|
||||
const [show, setshow] = useState(false);
|
||||
const [groupseq,setgroupseq] = useState();
|
||||
function showhandling(e){
|
||||
const [groupseq, setgroupseq] = useState();
|
||||
|
||||
function showhandling(e) {
|
||||
const param = e.currentTarget.dataset;
|
||||
const groupseq = param.groupseq;
|
||||
console.log(groupseq);
|
||||
|
|
@ -28,15 +29,15 @@ function StandardCodeList(props) {
|
|||
body: JSON.stringify(
|
||||
groupseq
|
||||
)
|
||||
},(resp) =>{
|
||||
console.log(resp+"------------------------resp")
|
||||
const body =[];
|
||||
const head =[];
|
||||
if(resp.length>0){
|
||||
}, (resp) => {
|
||||
console.log(resp + "------------------------resp")
|
||||
const body = [];
|
||||
const head = [];
|
||||
if (resp.length > 0) {
|
||||
|
||||
resp.forEach(function (item,index){
|
||||
resp.forEach(function (item, index) {
|
||||
const formattedDate = item.aplcnBgngYmd.match(/\d{4}-\d{2}-\d{2}/)[0];
|
||||
const url = "https://www.kcsc.re.kr/file/DownloadGrp/"+item.docFileGrpId;
|
||||
const url = "https://www.kcsc.re.kr/file/DownloadGrp/" + item.docFileGrpId;
|
||||
body.push(
|
||||
<tr>
|
||||
<td>{formattedDate}</td>
|
||||
|
|
@ -59,13 +60,15 @@ function StandardCodeList(props) {
|
|||
setshow(true);
|
||||
|
||||
}
|
||||
function close () {
|
||||
|
||||
function close() {
|
||||
setshow(false);
|
||||
}
|
||||
|
||||
console.group("StandardCodeList");
|
||||
console.log("[Start] StandardCodeList ------------------------------");
|
||||
console.log("StandardCodeList [props] : ", props);
|
||||
console.log("listcode----------------------------"+listCode);
|
||||
console.log("listcode----------------------------" + listCode);
|
||||
|
||||
const location = useLocation();
|
||||
console.log("StandardCodeList [location] : ", location);
|
||||
|
|
@ -76,15 +79,29 @@ function StandardCodeList(props) {
|
|||
const bbsId = location.state?.bbsId || NOTICE_BBS_ID;
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const [searchCondition, setSearchCondition] = useState(location.state?.searchCondition || { listCode: listCode, pageIndex: 1, searchCnd: '', searchWrd: '' });// 기존 조회에서 접근 했을 시 || 신규로 접근 했을 시
|
||||
const [searchCondition, setSearchCondition] = useState(location.state?.searchCondition || {listCode: listCode, pageIndex: 1, category1: '', searchWrd: ''});// 기존 조회에서 접근 했을 시 || 신규로 접근 했을 시
|
||||
const [masterBoard, setMasterBoard] = useState({});
|
||||
const [paginationInfo, setPaginationInfo] = useState({});
|
||||
|
||||
const [listTag, setListTag] = useState([]);
|
||||
|
||||
/* 검색기능 추가 변수*/
|
||||
const [listdata,setlistdata] = useState([]);
|
||||
const [filterData,setfilterData] = useState('');
|
||||
const [listdata, setlistdata] = useState([]);
|
||||
const [filterData, setfilterData] = useState('');
|
||||
|
||||
/* 탭 */
|
||||
const [activeTab, setActiveTab] = useState('10');
|
||||
|
||||
const handleTabClick = (tabName) => {
|
||||
setActiveTab(tabName);
|
||||
|
||||
retrieveList({
|
||||
...searchCondition,
|
||||
category1: cndRef.current.value,
|
||||
searchWrd: wrdRef.current.value,
|
||||
tab: tabName
|
||||
});
|
||||
};
|
||||
|
||||
const retrieveList = useCallback((searchCondition) => {
|
||||
console.groupCollapsed("StandardCodeList.retrieveList()");
|
||||
|
|
@ -112,7 +129,7 @@ function StandardCodeList(props) {
|
|||
}
|
||||
);
|
||||
console.groupEnd("StandardCodeList.retrieveList()");
|
||||
},[]);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
retrieveList(searchCondition);
|
||||
|
|
@ -161,16 +178,30 @@ function StandardCodeList(props) {
|
|||
/>
|
||||
<button type="button"
|
||||
onClick={() => {
|
||||
retrieveList({ ...searchCondition, pageIndex: 1, searchCnd: cndRef.current.value, searchWrd: wrdRef.current.value });
|
||||
retrieveList({...searchCondition, pageIndex: 1, category1: cndRef.current.value, searchWrd: wrdRef.current.value, tab: activeTab});
|
||||
}}>조회</button>
|
||||
</span>
|
||||
</li>
|
||||
<li className="third_1 L">
|
||||
<label className="f_select" htmlFor="sel1">
|
||||
<select id="sel1" title="조건" defaultValue={searchCondition.searchCnd} ref={cndRef}
|
||||
<select id="sel1" title="조건" defaultValue={listCode.substring(2, 4)} ref={cndRef}
|
||||
onChange={e => {
|
||||
cndRef.current.value = e.target.value;
|
||||
retrieveList({ ...searchCondition, pageIndex: 1, searchCnd: cndRef.current.value, searchWrd: wrdRef.current.value });
|
||||
retrieveList({...searchCondition, pageIndex: 1, category1: cndRef.current.value, searchWrd: wrdRef.current.value, tab: activeTab});
|
||||
}}
|
||||
>
|
||||
<option value="">전체</option>
|
||||
<option value="10">공통편</option>
|
||||
<option value="20">시설물편</option>
|
||||
</select>
|
||||
</label>
|
||||
</li>
|
||||
{/*<li className="third_1 L">
|
||||
<label className="f_select" htmlFor="sel1">
|
||||
<select id="sel2" title="조건" defaultValue={searchCondition.category1} ref={cndRef}
|
||||
onChange={e => {
|
||||
cndRef.current.value = e.target.value;
|
||||
retrieveList({...searchCondition, pageIndex: 1, category1: cndRef.current.value, searchWrd: wrdRef.current.value});
|
||||
}}
|
||||
>
|
||||
<option value="10">전체</option>
|
||||
|
|
@ -179,10 +210,33 @@ function StandardCodeList(props) {
|
|||
</select>
|
||||
</label>
|
||||
</li>
|
||||
<li className="third_1 L">
|
||||
<label className="f_select" htmlFor="sel1">
|
||||
<select id="sel3" title="조건" defaultValue={searchCondition.category1} ref={cndRef}
|
||||
onChange={e => {
|
||||
cndRef.current.value = e.target.value;
|
||||
retrieveList({...searchCondition, pageIndex: 1, category1: cndRef.current.value, searchWrd: wrdRef.current.value});
|
||||
}}
|
||||
>
|
||||
<option value="10">전체</option>
|
||||
<option value="1010">공통편</option>
|
||||
<option value="1020">시설물편</option>
|
||||
</select>
|
||||
</label>
|
||||
</li>*/}
|
||||
</ul>
|
||||
</div>
|
||||
{/* <!--// 검색조건 --> */}
|
||||
|
||||
<div className="right_col">
|
||||
<div className="mini_board">
|
||||
<ul>
|
||||
<div className={`tab ${activeTab === 10 ? 'active' : ''}`} onClick={() => handleTabClick(10)}>설계기준</div>
|
||||
<div className={`tab ${activeTab === 20 ? 'active' : ''}`} onClick={() => handleTabClick(20)}>표준시방서</div>
|
||||
<div className={`tab ${activeTab === 40 ? 'active' : ''}`} onClick={() => handleTabClick(40)}>전문시방서</div>
|
||||
<div className={`tab ${activeTab === 50 ? 'active' : ''}`} onClick={() => handleTabClick(50)}>통합 다운로드</div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{/* <!-- 게시판목록 --> */}
|
||||
<div className="board_list BRD002 code_list">
|
||||
<div className="head">
|
||||
|
|
@ -198,21 +252,22 @@ function StandardCodeList(props) {
|
|||
<div className="result">
|
||||
|
||||
{/*검색기능 filterData가 없는경우 모든 데이터 출력*/}
|
||||
{listdata.filter(item=>{
|
||||
if (item.groupNm.includes(filterData)){
|
||||
{listdata.filter(item => {
|
||||
if (item.groupNm.includes(filterData)) {
|
||||
return item
|
||||
}
|
||||
return null
|
||||
}).map(item=>{
|
||||
return(
|
||||
<div className="list_item List_Codes" >
|
||||
}).map(item => {
|
||||
return (
|
||||
<div className="list_item List_Codes">
|
||||
<div className="mainCategory">{item.mainCategory}</div>
|
||||
<div className="middleCategory">{item.middleCategory}</div>
|
||||
<div className="kcscCd">{item.kcscCd}</div>
|
||||
<div className="groupNm">{item.groupNm}</div>
|
||||
<div className="Revisionhistory"><a className="vieweratag" href = {'#'} onClick={showhandling} data-groupseq = {item.groupSeq} >개정이력</a></div>
|
||||
<div className="fille">{item.contentcount>0?<a className="vieweratag" href = {"/standardCode/viewer/"+item.kcscCd}>내용보기</a>:null}</div>
|
||||
<div className="viewer">{item.docFileGrpId==null?null:<a href ={"https://www.kcsc.re.kr/file/DownloadGrp/"+item.docFileGrpId}><AiFillFileMarkdown/></a>}</div>
|
||||
<div className="Revisionhistory"><a className="vieweratag" href={'#'} onClick={showhandling} data-groupseq={item.groupSeq}>개정이력</a></div>
|
||||
<div className="fille">{item.contentcount > 0 ? <a className="vieweratag" href={"/standardCode/viewer/" + item.kcscCd}>내용보기</a> : null}</div>
|
||||
<div className="viewer">{item.docFileGrpId == null ? null :
|
||||
<a href={"https://www.kcsc.re.kr/file/DownloadGrp/" + item.docFileGrpId}><AiFillFileMarkdown/></a>}</div>
|
||||
<div className="star"><AiFillStar/></div>
|
||||
</div>
|
||||
)
|
||||
|
|
@ -225,7 +280,7 @@ function StandardCodeList(props) {
|
|||
{/* <!-- Paging --> */}
|
||||
|
||||
{/* <!--/ Paging --> */}
|
||||
<StandardCodeListModal size={"lg"} show ={show} content ={groupseq} onClose = {close} title={"개정이력"}/>
|
||||
<StandardCodeListModal size={"lg"} show={show} content={groupseq} onClose={close} title={"개정이력"}/>
|
||||
|
||||
|
||||
{/* <!--// 본문 --> */}
|
||||
|
|
|
|||
|
|
@ -157,9 +157,11 @@ public class StandardCodeController extends BaseController {
|
|||
paginationInfo.setPageSize(propertyService.getInt("Globals.pageSize"));
|
||||
resultMap.put("paginationInfo", paginationInfo);
|
||||
|
||||
System.out.println("@@@ searchCnd : " + tnDocumentInfo.getSearchCnd());
|
||||
if (!tnDocumentInfo.getSearchCnd().isEmpty()) {
|
||||
tnDocumentInfo.setListCode(tnDocumentInfo.getSearchCnd());
|
||||
System.out.println("@@@ category1 : " + tnDocumentInfo.getCategory1());
|
||||
System.out.println("@@@ searchWrd : " + tnDocumentInfo.getSearchWrd());
|
||||
System.out.println("@@@ tab : " + tnDocumentInfo.getTab());
|
||||
if (!tnDocumentInfo.getCategory1().isEmpty()) {
|
||||
tnDocumentInfo.setListCode(tnDocumentInfo.getTab() + tnDocumentInfo.getCategory1());
|
||||
}
|
||||
List<TnDocumentCodeList> tnDocumentCodeList = standardCodeService.selectStandardCodeList(tnDocumentInfo);
|
||||
resultMap.put("resultList", tnDocumentCodeList);
|
||||
|
|
|
|||
|
|
@ -108,5 +108,7 @@ public class TnDocumentInfo {
|
|||
@Transient
|
||||
private String searchWrd;
|
||||
@Transient
|
||||
private String searchCnd;
|
||||
private String tab;
|
||||
@Transient
|
||||
private String category1;
|
||||
}
|
||||
Loading…
Reference in New Issue