parent
c5c3dd3850
commit
7d45bc37a8
|
|
@ -81,7 +81,3 @@ button {cursor: pointer;}
|
|||
.mt40 {margin-top: 40px !important;}
|
||||
.ml10 {margin-left: 10px !important;}
|
||||
.pb10 {padding-bottom: 10px !important;}
|
||||
|
||||
|
||||
.detailInfoDiv > div > p { display: inline; }
|
||||
.detailInfoDiv > div > input {margin-right: 5px;}
|
||||
|
|
|
|||
|
|
@ -331,4 +331,8 @@
|
|||
color: forestgreen;
|
||||
}
|
||||
.bookmark:hover{cursor: pointer}
|
||||
.errorText{color:white; background-color: red; font-size: x-small; vertical-align: bottom; padding: 0 10px;}
|
||||
.errorText{color:white; background-color: red; font-size: x-small; vertical-align: bottom; padding: 0 10px;}
|
||||
|
||||
/*기준코드 뷰어*/
|
||||
.titleCheckBox ~ p {display: inline}
|
||||
.detailInfoDiv > div > input {margin-right: 5px;}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
import {React, useCallback, useEffect, useState} from "react";
|
||||
import Modal from "react-bootstrap/Modal";
|
||||
import * as EgovNet from "../../api/egovFetch";
|
||||
import {VwDiv} from "./Sb.style";
|
||||
import {VwDiv} from "./Vw.style";
|
||||
|
||||
const BookmarkModal = ({docCode, docPart}) => {
|
||||
const [modalTitle, setModalTitle] = useState();
|
||||
|
|
|
|||
|
|
@ -26,14 +26,4 @@ export const SbTitle = styled.div`
|
|||
cursor: pointer;
|
||||
border-right: solid 5px;
|
||||
}
|
||||
`;
|
||||
|
||||
export const VwDiv = styled.div`
|
||||
padding-left: ${props => (props.depth * 10)}px;
|
||||
color: ${props => (props.isTitle?'darkcyan':'black')};
|
||||
padding-top: ${props => (props.isTitle?'10':'')}px;
|
||||
`;
|
||||
|
||||
export const VwPtag = styled.p`
|
||||
cursor: ${props => (props.isTitle?'pointer':'')};
|
||||
`;
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
import styled from "styled-components";
|
||||
|
||||
export const VwDiv = styled.div`
|
||||
padding-left: ${props => (props.depth * 10)}px;
|
||||
color: ${props => (props.isTitle?'darkcyan':'black')};
|
||||
padding-top: ${props => (props.isTitle?'10':'')}px;
|
||||
`;
|
||||
|
||||
export const VwPtag = styled.p`
|
||||
cursor: ${props => (props.isTitle?'pointer':'')};
|
||||
`;
|
||||
|
|
@ -3,11 +3,13 @@ import { useLocation, useParams } from 'react-router-dom';
|
|||
import SbItem from './SbItem'
|
||||
import Loading from '../../components/Loading'
|
||||
import BookmarkModal from './BookmarkModal';
|
||||
import {SbContainer, VwDiv, VwPtag} from './Sb.style'
|
||||
import {SbContainer} from './Sb.style'
|
||||
import {VwDiv, VwPtag} from './Vw.style'
|
||||
import Row from 'react-bootstrap/Row';
|
||||
import Col from 'react-bootstrap/Col';
|
||||
import Modal from 'react-bootstrap/Modal';
|
||||
import * as EgovNet from 'api/egovFetch';
|
||||
import {getSessionItem} from "../../utils/storage";
|
||||
|
||||
function CodeViewer(props) {
|
||||
const [treeLoading, setTreeLoading] = useState(true);
|
||||
|
|
@ -22,6 +24,10 @@ function CodeViewer(props) {
|
|||
const [show, setShow] = useState(false);
|
||||
const [bookMarkModal, setBookMarkModal] = useState();
|
||||
|
||||
|
||||
const sessionUser = getSessionItem('loginUser');
|
||||
const sessionUserSe = sessionUser?.userSe;
|
||||
|
||||
const handleClose = () => setShow(false);
|
||||
const handleShow = () => setShow(true);
|
||||
|
||||
|
|
@ -144,35 +150,37 @@ function CodeViewer(props) {
|
|||
item.full_content = "<br>"+item.full_content;
|
||||
}
|
||||
}
|
||||
if(docLinkReg.test(item.full_content)){
|
||||
const docCodeAry = item.full_content.match(docLinkReg);
|
||||
const docCodeMap = new Map();
|
||||
for(let i=0; i<docCodeAry.length; i++) {
|
||||
const docCode = docCodeAry[i];
|
||||
docCodeMap.set(docCode, '<a class="docLink" href="/standardCode/viewer/' + docCode + '" target="_blank">' + docCode + '</a>')
|
||||
}
|
||||
docCodeMap.forEach((docCodeLink, docCode)=>{
|
||||
item.full_content = item.full_content.replaceAll(docCode, docCodeLink);
|
||||
})
|
||||
if(docPartReg.test(item.full_content)){
|
||||
const docPartAry = item.full_content.match(docPartReg);
|
||||
const docPartMap = new Map();
|
||||
for(let i=0; i<docPartAry.length; i++) {
|
||||
const docPart = docPartAry[i];
|
||||
const docCodeMatch = item.full_content.substring(item.full_content.indexOf(docPart)-30).match(docLinkReg);
|
||||
let docCode = null;
|
||||
if (docCodeMatch){
|
||||
docCode = docCodeMatch[0];
|
||||
}
|
||||
//const docCode = item.full_content.substring(item.full_content.indexOf(docPart)-30).match(docLinkReg)[0];
|
||||
docPartMap.set(docPart, docPart +
|
||||
'<key class="bookmark" data-doccode="'+docCode+'" data-docpart="'+docPart.replace('(', '').replace(')', '')+'">'+
|
||||
'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M2 4a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v11.5a.5.5 0 0 1-.777.416L7 13.101l-4.223 2.815A.5.5 0 0 1 2 15.5V4z"></path><path d="M4.268 1A2 2 0 0 1 6 0h6a2 2 0 0 1 2 2v11.5a.5.5 0 0 1-.777.416L13 13.768V2a1 1 0 0 0-1-1H4.268z"></path></svg>'+
|
||||
'</key>');
|
||||
if(!item.full_content.includes("<table")){
|
||||
if(docLinkReg.test(item.full_content)){
|
||||
const docCodeAry = item.full_content.match(docLinkReg);
|
||||
const docCodeMap = new Map();
|
||||
for(let i=0; i<docCodeAry.length; i++) {
|
||||
const docCode = docCodeAry[i];
|
||||
docCodeMap.set(docCode, '<a class="docLink" href="/standardCode/viewer/' + docCode + '" target="_blank">' + docCode + '</a>')
|
||||
}
|
||||
docPartMap.forEach((docPartLink, docPart)=>{
|
||||
item.full_content = item.full_content.replaceAll(docPart, docPartLink);
|
||||
docCodeMap.forEach((docCodeLink, docCode)=>{
|
||||
item.full_content = item.full_content.replaceAll(docCode, docCodeLink);
|
||||
})
|
||||
if(docPartReg.test(item.full_content)){
|
||||
const docPartAry = item.full_content.match(docPartReg);
|
||||
const docPartMap = new Map();
|
||||
for(let i=0; i<docPartAry.length; i++) {
|
||||
const docPart = docPartAry[i];
|
||||
const docCodeMatch = item.full_content.substring(item.full_content.indexOf(docPart)-30).match(docLinkReg);
|
||||
let docCode = null;
|
||||
if (docCodeMatch){
|
||||
docCode = docCodeMatch[0];
|
||||
}
|
||||
//const docCode = item.full_content.substring(item.full_content.indexOf(docPart)-30).match(docLinkReg)[0];
|
||||
docPartMap.set(docPart, docPart +
|
||||
'<key class="bookmark" data-doccode="'+docCode+'" data-docpart="'+docPart.replace('(', '').replace(')', '')+'">'+
|
||||
'<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M2 4a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v11.5a.5.5 0 0 1-.777.416L7 13.101l-4.223 2.815A.5.5 0 0 1 2 15.5V4z"></path><path d="M4.268 1A2 2 0 0 1 6 0h6a2 2 0 0 1 2 2v11.5a.5.5 0 0 1-.777.416L13 13.768V2a1 1 0 0 0-1-1H4.268z"></path></svg>'+
|
||||
'</key>');
|
||||
}
|
||||
docPartMap.forEach((docPartLink, docPart)=>{
|
||||
item.full_content = item.full_content.replaceAll(docPart, docPartLink);
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
if(item.full_content.includes("<table")){
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import * as EgovNet from "../../api/egovFetch";
|
|||
import React, {useEffect, useState} from "react";
|
||||
import SbItem from "./SbItem";
|
||||
import {Col, Row} from "react-bootstrap";
|
||||
import {VwDiv, VwPtag} from "./Sb.style";
|
||||
import {VwDiv, VwPtag} from "./Vw.style";
|
||||
|
||||
/*최상위 컴포넌트*/
|
||||
export function Maincontent({docCode}) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue