diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/StandardCodeList.jsx b/egovframe-template-simple-react-contribution/src/pages/standardCode/StandardCodeList.jsx index d5d0942..7a32865 100644 --- a/egovframe-template-simple-react-contribution/src/pages/standardCode/StandardCodeList.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/standardCode/StandardCodeList.jsx @@ -82,6 +82,10 @@ function StandardCodeList(props) { const [listTag, setListTag] = useState([]); + /* 검색기능 추가 변수*/ + const [listdata,setlistdata] = useState([]); + const [filterData,setfilterData] = useState(''); + const retrieveList = useCallback((searchCondition) => { console.groupCollapsed("StandardCodeList.retrieveList()"); @@ -99,35 +103,9 @@ function StandardCodeList(props) { (resp) => { setMasterBoard(resp.result.tnDocumentInfo); setPaginationInfo(resp.result.paginationInfo); - - let mutListTag = []; - mutListTag.push(

검색된 결과가 없습니다.

); // 게시판 목록 초기값 - - const resultCnt = parseInt(resp.result.resultCnt); - const currentPageNo = resp.result.paginationInfo.currentPageNo; - const pageSize = resp.result.paginationInfo.pageSize; - console.log(resp) + /*검색을 위한 리스트 state에 저장*/ + setlistdata(resp.result.resultList); // 리스트 항목 구성 - resp.result.resultList.forEach(function (item, index) { - if (index === 0) mutListTag = []; // 목록 초기화 - const listIdx = itemIdxByPage(resultCnt , currentPageNo, pageSize, index); - - mutListTag.push( -
-
{item.mainCategory}
-
{item.middleCategory}
-
{item.kcscCd}
-
{item.groupNm}
-
개정이력
-
{item.contentcount>0?내용보기:null}
-
{item.docFileGrpId==null?null:}
-
-
- ); - }); - setListTag(mutListTag); }, function (resp) { console.log("err response : ", resp); @@ -190,7 +168,8 @@ function StandardCodeList(props) { { - wrdRef.current.value = e.target.value; + + setfilterData(e.target.value); }} />