뷰어 작업중.
parent
48d76a43ef
commit
c36d8a69ba
|
|
@ -77,7 +77,7 @@ const URL = {
|
||||||
|
|
||||||
//기준코드
|
//기준코드
|
||||||
STANDARD_CODE_LIST : "/standardCode/list", //건설기준코드/리스트
|
STANDARD_CODE_LIST : "/standardCode/list", //건설기준코드/리스트
|
||||||
STANDARD_CODE_VIEWER : "/standardCode/viewer", //건설기준코드/뷰어
|
STANDARD_CODE_VIEWER : "/standardCode/viewer/:docCode", //건설기준코드/뷰어
|
||||||
}
|
}
|
||||||
|
|
||||||
export default URL;
|
export default URL;
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
import {React, useState} from 'react'
|
import {React, useState} from 'react'
|
||||||
|
import { useNavigate } from 'react-router-dom';
|
||||||
import {SbTitle, SbSub, SbLink} from './Sb.style'
|
import {SbTitle, SbSub, SbLink} from './Sb.style'
|
||||||
import { FcFolder, FcOpenedFolder, FcFile } from 'react-icons/fc'
|
import { FcFolder, FcOpenedFolder, FcFile } from 'react-icons/fc'
|
||||||
import { AiOutlinePlusSquare, AiOutlineMinusSquare } from 'react-icons/ai'
|
import { AiOutlinePlusSquare, AiOutlineMinusSquare } from 'react-icons/ai'
|
||||||
|
|
||||||
|
|
||||||
const SbItem = ({ item }) => {
|
const SbItem = ({ item }) => {
|
||||||
const [collapsed, setCollapsed] = useState(false);
|
const [collapsed, setCollapsed] = useState(false);
|
||||||
|
const navigate = useNavigate();
|
||||||
function toggleCollapse() {
|
function toggleCollapse() {
|
||||||
setCollapsed(prevValue => !prevValue);
|
setCollapsed(prevValue => !prevValue);
|
||||||
}
|
}
|
||||||
|
|
@ -28,7 +28,14 @@ const SbItem = ({ item }) => {
|
||||||
const icon = <FcFile />;
|
const icon = <FcFile />;
|
||||||
return (
|
return (
|
||||||
<SbTitle depth={item.doc_level}>
|
<SbTitle depth={item.doc_level}>
|
||||||
<SbLink>{icon} {(item.doc_level === 1?'':item.doc_code)+' '+item.doc_code_name}</SbLink>
|
{/*<a onClick={()=>{
|
||||||
|
navigate('/standardCode/viewer', {
|
||||||
|
state:{
|
||||||
|
docCode: item.doc_code
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}}>{icon} {(item.doc_level === 1?'':item.doc_code)+' '+item.doc_code_name}</a>*/}
|
||||||
|
<SbLink to={"/standardCode/viewer/"+item.doc_code}>{icon} {(item.doc_level === 1?'':item.doc_code)+' '+item.doc_code_name}</SbLink>
|
||||||
</SbTitle>
|
</SbTitle>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { useState, useEffect, useCallback } from 'react';
|
import React, { useState, useEffect, useCallback } from 'react';
|
||||||
import { Link, useLocation } from 'react-router-dom';
|
import { useLocation, useParams } from 'react-router-dom';
|
||||||
import SbItem from './SbItem'
|
import SbItem from './SbItem'
|
||||||
import {SbContainer} from './Sb.style'
|
import {SbContainer} from './Sb.style'
|
||||||
import Row from 'react-bootstrap/Row';
|
import Row from 'react-bootstrap/Row';
|
||||||
|
|
@ -7,21 +7,22 @@ import Col from 'react-bootstrap/Col';
|
||||||
import * as EgovNet from 'api/egovFetch';
|
import * as EgovNet from 'api/egovFetch';
|
||||||
|
|
||||||
function CodeViewer(props) {
|
function CodeViewer(props) {
|
||||||
console.group("viewer");
|
|
||||||
console.log("[Start] viewer ------------------------------");
|
|
||||||
console.log("viewer [props] : ", props);
|
|
||||||
const docCode=props.docCode===undefined?'KDS 21 30 00':props.docCode;
|
|
||||||
const location = useLocation();
|
|
||||||
console.log("viewer [location] : ", location);
|
|
||||||
|
|
||||||
|
const [{docCode}, setDocCode] = useState(useParams());
|
||||||
const [codeTree, setCodeTree] = useState();
|
const [codeTree, setCodeTree] = useState();
|
||||||
const [docSummary, setDocSummary] = useState();
|
const [docSummary, setDocSummary] = useState();
|
||||||
const [docDetail, setDocDetail] = useState();
|
const [docDetail, setDocDetail] = useState();
|
||||||
|
|
||||||
|
console.group("viewer");
|
||||||
|
console.log("[Start] viewer ------------------------------");
|
||||||
|
console.log("viewer [props] : ", props);
|
||||||
|
const location = useLocation();
|
||||||
|
console.log("viewer [location] : ", location);
|
||||||
|
console.log("viewer [docCode] : ", docCode);
|
||||||
|
|
||||||
|
|
||||||
const retrieveList = useCallback(() => {
|
const retrieveList = useCallback(() => {
|
||||||
console.groupCollapsed("EgovMain.retrieveList()");
|
console.groupCollapsed("EgovMain.retrieveList()");
|
||||||
|
|
||||||
|
|
||||||
const retrieveListURL = '/standardCode/viewer.do';
|
const retrieveListURL = '/standardCode/viewer.do';
|
||||||
const requestOptions = {
|
const requestOptions = {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
|
|
@ -83,13 +84,13 @@ function CodeViewer(props) {
|
||||||
console.groupEnd("EgovMain.retrieveList()");
|
console.groupEnd("EgovMain.retrieveList()");
|
||||||
},[]);
|
},[]);
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
retrieveList();
|
retrieveList();
|
||||||
}, [retrieveList]);
|
}, [retrieveList]);
|
||||||
|
|
||||||
console.log("------------------------------viewer [End]");
|
console.log("------------------------------viewer [End]");
|
||||||
console.groupEnd("viewer");
|
console.groupEnd("viewer");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Row>
|
<Row>
|
||||||
<Col xs={3} className="border-end">
|
<Col xs={3} className="border-end">
|
||||||
|
|
@ -105,4 +106,5 @@ function CodeViewer(props) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export default CodeViewer;
|
export default CodeViewer;
|
||||||
|
|
|
||||||
|
|
@ -226,7 +226,7 @@ const SecondRoutes = () => {
|
||||||
<Route path={URL.ADMIN_MANAGER} element={<EgovAdminPasswordUpdate />} />
|
<Route path={URL.ADMIN_MANAGER} element={<EgovAdminPasswordUpdate />} />
|
||||||
|
|
||||||
{/*기준코드*/}
|
{/*기준코드*/}
|
||||||
<Route path={URL.STANDARD_CODE_VIEWER} element={<CodeViewer />} />
|
<Route path={URL.STANDARD_CODE_VIEWER} element={<CodeViewer mode={CODE.MODE_READ} />} />
|
||||||
|
|
||||||
</Routes>
|
</Routes>
|
||||||
<EgovFooter />
|
<EgovFooter />
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue