diff --git a/egovframe-template-simple-react-contribution/src/css/Custom/customMain.css b/egovframe-template-simple-react-contribution/src/css/Custom/customMain.css index e7f5e49..243c0c5 100644 --- a/egovframe-template-simple-react-contribution/src/css/Custom/customMain.css +++ b/egovframe-template-simple-react-contribution/src/css/Custom/customMain.css @@ -29,25 +29,21 @@ text-align: left; } .code_list .head >span:nth-child(5),.code_list .result .List_Codes >div:nth-child(5){ - width: 7%; + width: 15%; } .code_list .head >span:nth-child(6),.code_list .result .List_Codes >div:nth-child(6){ - width: 7%; + width: 15%; } .code_list .head > span:nth-child(7),.code_list .result .List_Codes >div:nth-child(7){ width: 7%; } -.code_list .head >span:nth-child(8),.code_list .result .List_Codes >div:nth-child(8){ - width: 8%; -} .code_list .result .List_Codes >div:nth-child(1), .code_list .result .List_Codes >div:nth-child(2), .code_list .result .List_Codes >div:nth-child(3), .code_list .result .List_Codes >div:nth-child(4), .code_list .result .List_Codes >div:nth-child(5), .code_list .result .List_Codes >div:nth-child(6), -.code_list .result .List_Codes >div:nth-child(7), -.code_list .result .List_Codes >div:nth-child(8){ +.code_list .result .List_Codes >div:nth-child(7){ font-size: 14px; } .codelistcontent{ diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/list/StandardCodeList.jsx b/egovframe-template-simple-react-contribution/src/pages/standardCode/list/StandardCodeList.jsx index d742d88..e738869 100644 --- a/egovframe-template-simple-react-contribution/src/pages/standardCode/list/StandardCodeList.jsx +++ b/egovframe-template-simple-react-contribution/src/pages/standardCode/list/StandardCodeList.jsx @@ -5,47 +5,16 @@ import * as EgovNet from 'api/egovFetch'; import URL from 'constants/url'; import {StandardCodeListModal, StandardCodeListModalTable} from './StandardCodeListModal' import {AiFillFileMarkdown, AiFillStar} from "react-icons/ai"; +import StandardCodeSearchForm from "./StandardCodeSearchForm"; -function StandardCodeList(props) { +function StandardCodeList({}) { const {listCode} = useParams(); - const [show, setShow] = useState(false); - const [groupSeq, setgroupSeq] = useState(); - - console.group("StandardCodeList"); - console.log("[Start] StandardCodeList ------------------------------"); - console.log("StandardCodeList [props] : ", props); - console.log("listcode----------------------------" + listCode); - - const location = useLocation(); - console.log("StandardCodeList [location] : ", location); - - const category1Ref = useRef(); - const category2Ref = useRef(); - const category3Ref = useRef(); - const wrdRef = useRef(); - - // eslint-disable-next-line no-unused-vars - const [searchCondition, setSearchCondition] = useState(location.state?.searchCondition || { - pageIndex: 1, - tab: listCode?.substring(0, 2), - category1: listCode?.substring(2, 4), - category2: listCode?.substring(4, 6), - searchWrd: '' - });// 기존 조회에서 접근 했을 시 || 신규로 접근 했을 시 - const [masterBoard, setMasterBoard] = useState({}); - - /* 검색기능 추가 변수*/ - const [listData, setlistData] = useState([]); + const [listData, setListData] = useState([]) const [filterData, setFilterData] = useState(''); - const [category1List, setCategory1List] = useState([]); - const [category2List, setCategory2List] = useState([]); - const [category3List, setCategory3List] = useState([]); const [resultCnt, setResultCnt] = useState(0); + const [groupSeq, setGroupSeq] = useState(); - /* 탭 */ - const [activeTab, setActiveTab] = useState(10); - const [subTabsVisible, setSubTabsVisible] = useState(false); - + const [show, setShow] = useState(false); function close() { setShow(false); } @@ -89,74 +58,33 @@ function StandardCodeList(props) { ) } - setgroupSeq(); + setGroupSeq(); } ) setShow(true); - } - - const handleTabClick = (tabName) => { - setActiveTab(tabName); - - const updatedCondition = { - ...searchCondition, - tab: tabName, - category1: '', - category2: '', - category3: '', - searchWrd: '', - }; - - setSearchCondition(updatedCondition); - retrieveList(updatedCondition); - - if ([40, 50, 60, 70, 80, 90].includes(tabName)) { - setSubTabsVisible(true); - } else { - setSubTabsVisible(false); - } - }; - const retrieveList = useCallback((searchCondition) => { - console.groupCollapsed("StandardCodeList.retrieveList()"); - - const retrieveListURL = '/standardCode/selectStandardCodeList.do'; - const requestOptions = { - method: "POST", - headers: { - 'Content-type': 'application/json', - }, - body: JSON.stringify(searchCondition) + if(searchCondition?.tab){ + EgovNet.requestFetch('/standardCode/standard-code-list'+EgovNet.convParams(searchCondition), + { + method: "GET", + headers: { + 'Content-type': 'application/json', + } + }, + (resp) => { + setListData(resp.result.resultList); + setResultCnt(resp.result.resultCnt); + }, + function (resp) { + console.log("err response : ", resp); + } + ); } - EgovNet.requestFetch(retrieveListURL, - requestOptions, - (resp) => { - setMasterBoard(resp.result.tnDocumentInfo); - /*검색을 위한 리스트 state에 저장*/ - setlistData(resp.result.resultList); - setCategory1List(resp.result.category1List); - setCategory2List(resp.result.category2List); - setCategory3List(resp.result.category3List); - setResultCnt(resp.result.resultCnt); - // 리스트 항목 구성 - }, - function (resp) { - console.log("err response : ", resp); - } - ); - console.groupEnd("StandardCodeList.retrieveList()"); }, []); - useEffect(() => { - retrieveList(searchCondition); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - - console.log("------------------------------StandardCodeList [End]"); - console.groupEnd("StandardCodeList"); return (
@@ -172,112 +100,10 @@ function StandardCodeList(props) {

건설기준코드 검색

-
-
    -
  • -
    handleTabClick(10)}>설계기준
    -
  • -
  • -
    handleTabClick(20)}>표준시방서
    -
  • -
  • -
    handleTabClick(40)}>전문시방서
    -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • -
    통합 다운로드
    -
  • -
-
- {/* */} - {subTabsVisible && ( -
-
-
    -
    handleTabClick(40)}>서울특별시
    -
    handleTabClick(50)}>고속도로공사
    -
    handleTabClick(60)}>한국농어촌공사
    -
    handleTabClick(70)}>철도건설공사
    -
    handleTabClick(80)}>LH한국토지주택공사
    -
    handleTabClick(90)}>K-Water
    -
-
-
- )} +
전체 {resultCnt} 건
{/* */} -
+
대분류 중분류 @@ -285,12 +111,9 @@ function StandardCodeList(props) { 코드명 개정이력 보기 - 다운로드 즐겨찾기
- - {/*검색기능 filterData가 없는경우 모든 데이터 출력*/} {listData.filter(item => { if (item.groupNm.includes(filterData)) { return item @@ -305,24 +128,13 @@ function StandardCodeList(props) {
{item.groupNm}
{item.contentcount > 0 ? 내용보기 : null}
-
{item.docFileGrpId == null ? null : - }
) })}
- {/* */} - - - {/* */} - - {/* */} - - - {/* */}
diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/list/StandardCodeSearchForm.jsx b/egovframe-template-simple-react-contribution/src/pages/standardCode/list/StandardCodeSearchForm.jsx new file mode 100644 index 0000000..954142c --- /dev/null +++ b/egovframe-template-simple-react-contribution/src/pages/standardCode/list/StandardCodeSearchForm.jsx @@ -0,0 +1,86 @@ +import React, {useEffect, useState} from "react"; + +function StandardCodeSearchForm({param, reloadFunction}){ + + const [searchCondition, setSearchCondition] = useState({ + pageIndex: 1, + tab: Number(param?.substring(0, 2)), + category1: param?.substring(2, 4), + category2: param?.substring(4, 6), + searchWrd: '' + }); + const [subTabsVisible, setSubTabsVisible] = useState(false); + + useEffect(() => { + if(searchCondition.tab){ + if(searchCondition.tab !== 10 && searchCondition.tab !== 20){ + setSubTabsVisible(true) + }else{ + setSubTabsVisible(false) + } + } + reloadFunction(searchCondition) + }, [searchCondition]); + + return ( + <> +
+
    +
  • +
    {setSearchCondition({...searchCondition, tab: 10})}}>설계기준
    +
  • +
  • +
    {setSearchCondition({...searchCondition, tab: 20})}}>표준시방서
    +
  • +
  • +
    {setSearchCondition({...searchCondition, tab: 40})}}>전문시방서
    +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • +
    통합 다운로드
    +
  • +
+
+ {subTabsVisible && ( +
+
+
    +
    {setSearchCondition({...searchCondition, tab: 40})}}>서울특별시
    +
    {setSearchCondition({...searchCondition, tab: 50})}}>고속도로공사
    +
    {setSearchCondition({...searchCondition, tab: 60})}}>한국농어촌공사
    +
    {setSearchCondition({...searchCondition, tab: 70})}}>철도건설공사
    +
    {setSearchCondition({...searchCondition, tab: 80})}}>LH한국토지주택공사
    +
    {setSearchCondition({...searchCondition, tab: 90})}}>K-Water
    +
+
+
+ )} + + ); +} + +export default StandardCodeSearchForm; \ No newline at end of file diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/StandardCodeController.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/StandardCodeController.java index 20c74ef..fe89702 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/StandardCodeController.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/StandardCodeController.java @@ -145,35 +145,20 @@ public class StandardCodeController extends BaseController { @ApiResponse(responseCode = "200", description = "조회 성공"), @ApiResponse(responseCode = "403", description = "인가된 사용자가 아님") }) - @PostMapping(value = "/selectStandardCodeList.do", consumes = MediaType.APPLICATION_JSON_VALUE) - public ResultVO selectStandardCodeList(@RequestBody TnDocumentInfo tnDocumentInfo, @AuthenticationPrincipal LoginVO user) + @GetMapping(value = "/standard-code-list") + public ResultVO selectStandardCodeList(TnDocumentInfo tnDocumentInfo, @AuthenticationPrincipal LoginVO user) throws Exception { ResultVO resultVO = new ResultVO(); Map resultMap = new HashMap<>(); - PaginationInfo paginationInfo = new PaginationInfo(); - paginationInfo.setCurrentPageNo(tnDocumentInfo.getPageIndex()); - paginationInfo.setRecordCountPerPage(propertyService.getInt("Globals.pageUnit")); - paginationInfo.setPageSize(propertyService.getInt("Globals.pageSize")); - resultMap.put("paginationInfo", paginationInfo); - String tab = tnDocumentInfo.getTab() != null ? tnDocumentInfo.getTab() : ""; String category1 = tnDocumentInfo.getCategory1() != null ? tnDocumentInfo.getCategory1() : ""; String category2 = tnDocumentInfo.getCategory2() != null ? tnDocumentInfo.getCategory2() : ""; String category3 = tnDocumentInfo.getCategory3() != null ? tnDocumentInfo.getCategory3() : ""; - System.out.println("@@@ tab : " + tab); - System.out.println("@@@ category1 : " + category1); - System.out.println("@@@ category2 : " + category2); - System.out.println("@@@ category3 : " + category3); - System.out.println("@@@ searchWrd : " + tnDocumentInfo.getSearchWrd()); - Integer categorySeq1 = standardCodeService.selectStandardCodeGroupSeq(tab); Integer categorySeq2 = standardCodeService.selectStandardCodeGroupSeq(tab + category1); Integer categorySeq3 = standardCodeService.selectStandardCodeGroupSeq(tab + category1 + category2); - System.out.println("@@@ categorySeq1 : " + categorySeq1); - System.out.println("@@@ categorySeq2 : " + categorySeq2); - System.out.println("@@@ categorySeq3 : " + categorySeq3); resultMap.put("category1List", standardCodeService.selectStandardCodeCategoryList(categorySeq1)); resultMap.put("category2List", standardCodeService.selectStandardCodeCategoryList(categorySeq2)); resultMap.put("category3List", standardCodeService.selectStandardCodeCategoryList(categorySeq3)); @@ -182,7 +167,7 @@ public class StandardCodeController extends BaseController { List tnDocumentCodeList = standardCodeService.selectStandardCodeList(tnDocumentInfo); resultMap.put("resultList", tnDocumentCodeList); Integer totCnt = tnDocumentCodeList.get(0).getContentcount(); - System.out.println("@@@ resultCnt : " + totCnt); + resultMap.put("resultCnt", totCnt); resultMap.put("user", user); diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/entity/TnDocumentCodeList.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/entity/TnDocumentCodeList.java index 08a324c..b081457 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/entity/TnDocumentCodeList.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/entity/TnDocumentCodeList.java @@ -9,6 +9,7 @@ import org.hibernate.annotations.DynamicUpdate; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; +import javax.persistence.Transient; @Getter @Setter @@ -37,4 +38,7 @@ public class TnDocumentCodeList { private String parentGroupSeq; @Column(name = "group_full_cd") private String groupFullCd; + + @Transient + private List<> } diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/entity/TnDocumentInfo.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/entity/TnDocumentInfo.java index e74601b..1fab805 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/entity/TnDocumentInfo.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/entity/TnDocumentInfo.java @@ -87,22 +87,6 @@ public class TnDocumentInfo { @Column(name = "old_seq") private Integer oldSeq; - - - @Schema(description = "현재페이지") - private int pageIndex = 1; - @Schema(description = "페이지갯수") - private int pageUnit = 10; - @Schema(description = "페이지사이즈") - private int pageSize = 10; - @Schema(description = "첫페이지 인덱스") - private int firstIndex = 1; - @Schema(description = "마지막페이지 인덱스") - private int lastIndex = 1; - @Schema(description = "페이지당 레코드 개수") - private int recordCountPerPage = 100; - @Schema(description = "레코드 번호") - private int rowNo = 0; @Transient private String listCode; @Transient diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/service/StandardCodeService.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/service/StandardCodeService.java index 8857d2e..5e916af 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/service/StandardCodeService.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/standardCode/service/StandardCodeService.java @@ -43,7 +43,9 @@ public class StandardCodeService extends EgovAbstractServiceImpl { return tnDocumentInfoRepository.spGetTnDocumentInfoByGroupCd(param.getDocCode()); } - public List selectStandardCodeList(TnDocumentInfo tnDocumentInfo){ return standardCodeMapper.selectStandardCodeList(tnDocumentInfo); } + public List selectStandardCodeList(TnDocumentInfo tnDocumentInfo){ + return standardCodeMapper.selectStandardCodeList(tnDocumentInfo); + } public Integer selectStandardCodeListCnt(TnDocumentInfo tnDocumentInfo) { return standardCodeMapper.selectStandardCodeListCnt(tnDocumentInfo);