Compare commits
No commits in common. "f14ee3b03d3427a77b79d4f3305e3ca4251c0c81" and "2ec64ceac0f2ea2339a0ecd028cb03d24e202ceb" have entirely different histories.
f14ee3b03d
...
2ec64ceac0
|
|
@ -13,13 +13,10 @@ import * as EgovNet from 'api/egovFetch';
|
||||||
import {getLocalItem} from "utils/storage";
|
import {getLocalItem} from "utils/storage";
|
||||||
import CODE from "constants/code";
|
import CODE from "constants/code";
|
||||||
import {parseJwt} from "utils/parseJwt";
|
import {parseJwt} from "utils/parseJwt";
|
||||||
import Button from "react-bootstrap/Button";
|
|
||||||
import {InputGroup} from "react-bootstrap";
|
|
||||||
|
|
||||||
function CodeViewer(props) {
|
function CodeViewer(props) {
|
||||||
const [treeLoading, setTreeLoading] = useState(true);
|
const [treeLoading, setTreeLoading] = useState(true);
|
||||||
const [docLoading, setDocLoading] = useState(true);
|
const [docLoading, setDocLoading] = useState(true);
|
||||||
|
|
||||||
const {linkedDocCode} = useParams();
|
const {linkedDocCode} = useParams();
|
||||||
const [docCode, setDocCode] = useState(linkedDocCode !== undefined?linkedDocCode.split(':')[0]:props.docCode);
|
const [docCode, setDocCode] = useState(linkedDocCode !== undefined?linkedDocCode.split(':')[0]:props.docCode);
|
||||||
const [ymd, setYmd] = useState(linkedDocCode !== undefined?linkedDocCode.split(':')[1]:props.ymd);
|
const [ymd, setYmd] = useState(linkedDocCode !== undefined?linkedDocCode.split(':')[1]:props.ymd);
|
||||||
|
|
@ -32,8 +29,6 @@ function CodeViewer(props) {
|
||||||
const [show, setShow] = useState(false);
|
const [show, setShow] = useState(false);
|
||||||
const [bookMarkModal, setBookMarkModal] = useState();
|
const [bookMarkModal, setBookMarkModal] = useState();
|
||||||
|
|
||||||
const [colList, setColList] = useState([3,2,7]);
|
|
||||||
|
|
||||||
|
|
||||||
const sessionUser = parseJwt(getLocalItem('accessToken'));
|
const sessionUser = parseJwt(getLocalItem('accessToken'));
|
||||||
const sessionUserSe = sessionUser?.userSe;
|
const sessionUserSe = sessionUser?.userSe;
|
||||||
|
|
@ -422,13 +417,6 @@ function CodeViewer(props) {
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
function treeControl(){
|
|
||||||
if(colList[0]===3){
|
|
||||||
setColList([0,3,9]);
|
|
||||||
}else{
|
|
||||||
setColList([3,2,7]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getCodeTree();
|
getCodeTree();
|
||||||
|
|
@ -452,32 +440,22 @@ function CodeViewer(props) {
|
||||||
<Col xs={"auto"}>{docInfo}</Col>
|
<Col xs={"auto"}>{docInfo}</Col>
|
||||||
<Col>
|
<Col>
|
||||||
<input type="button" className="btn btn-sm btn-primary optionBtn" value="연혁"/>
|
<input type="button" className="btn btn-sm btn-primary optionBtn" value="연혁"/>
|
||||||
<input type="button" className="btn btn-sm btn-primary optionBtn" value="2단비교"/>
|
<input type="button" className="btn btn-sm btn-primary optionBtn" value="비교"/>
|
||||||
<input type="button" className="btn btn-sm btn-primary optionBtn" value="신구조문"/>
|
|
||||||
<input type="button" className="btn btn-sm btn-primary optionBtn" value="첨부파일"/>
|
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</Col>
|
</Col>
|
||||||
<Col xs={"auto"}>
|
<Col xs={"auto"}>{errorSelector}</Col>
|
||||||
<InputGroup>
|
|
||||||
<Form.Control type="text" size={"sm"} placeholder={"문서 내 검색"}/>
|
|
||||||
{errorSelector}
|
|
||||||
</InputGroup>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
</Row>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</Col>
|
</Col>
|
||||||
<Col xs={colList[0]} className={`border-end viewerDiv ${colList[0]===3?'':'d-none'}`}>
|
<Col xs={3} className="border-end viewerDiv">
|
||||||
{codeTree}
|
{codeTree}
|
||||||
</Col>
|
</Col>
|
||||||
<Col xs={colList[1]} className="border-end viewerDiv">
|
<Col xs={2} className="border-end viewerDiv">
|
||||||
<div>
|
|
||||||
<Button size={"sm"} variant={"outline-secondary"} onClick={treeControl}>{colList[0]===3?'트리 접기':'트리 펼치기'}</Button>
|
|
||||||
</div>
|
|
||||||
{docSummary}
|
{docSummary}
|
||||||
</Col>
|
</Col>
|
||||||
<Col xs={colList[2]} className="viewerDiv detailInfoDiv" ref={actionAppend}>
|
<Col xs={7} className="viewerDiv detailInfoDiv" ref={actionAppend}>
|
||||||
{docDetail}
|
{docDetail}
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
import React from "react";
|
|
||||||
import {SbContainer} from "./Sb.style";
|
|
||||||
import SbItem from "./SbItem";
|
|
||||||
|
|
||||||
|
|
||||||
function ViewerTree({docCode, updateDocCode}){
|
|
||||||
return (
|
|
||||||
<SbContainer>
|
|
||||||
{tree.map((subItem) =>
|
|
||||||
<SbItem item={subItem} openDocCode={docCode} updateDocCode={updateDocCode} />
|
|
||||||
)}
|
|
||||||
</SbContainer>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default ViewerTree;
|
|
||||||
Loading…
Reference in New Issue