diff --git a/egovframe-template-simple-react-contribution/src/css/page.css b/egovframe-template-simple-react-contribution/src/css/page.css index a10a60b..7359c1a 100644 --- a/egovframe-template-simple-react-contribution/src/css/page.css +++ b/egovframe-template-simple-react-contribution/src/css/page.css @@ -308,5 +308,13 @@ .viewerDiv{height: calc(100vh - 180px); overflow-y: auto;} .openDoc{background-color: bisque;} - .docLink{background-color: aquamarine} - .docLink:hover{cursor: pointer} \ No newline at end of file + .docLink{ + color: black; + background-color: palegreen + } + .docLink:hover{cursor: pointer} + .docPart{ + color: forestgreen; + } + .docPart:hover{cursor: pointer} + .errorText{color:red; font-size: x-small; vertical-align: bottom; padding-right: 10px;} \ No newline at end of file diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/Sb.style.js b/egovframe-template-simple-react-contribution/src/pages/standardCode/Sb.style.js index 582e6cc..4f19d4b 100644 --- a/egovframe-template-simple-react-contribution/src/pages/standardCode/Sb.style.js +++ b/egovframe-template-simple-react-contribution/src/pages/standardCode/Sb.style.js @@ -30,8 +30,6 @@ export const SbTitle = styled.div` `; export const VwDiv = styled.div` - display: flex; - align-items: center; padding-left: ${props => (props.depth * 10)}px; color: ${props => (props.isTitle?'darkcyan':'black')}; padding-top: ${props => (props.isTitle?'10':'')}px; diff --git a/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer.js b/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer.js index b4f2eb7..0b009af 100644 --- a/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer.js +++ b/egovframe-template-simple-react-contribution/src/pages/standardCode/viewer.js @@ -84,7 +84,8 @@ function CodeViewer(props) { // 문서 전문 구성 let detailTag = []; if(resp.result.document.length>0){ - const reg = /([A-Z]{3,5}(\s[0-9]{2}){3,4})/g + const docLinkReg = /([A-Z]{3,5}(\s[0-9]{2}){3,4})/g + const docPartReg = /\((?:표|그림|부록)?\s*([A-Z]\.)?(?!\d\))\d+(\.\d+)*(\s?\(\d\))?(-\d+)?(?:\s*[A-Z])?\)/g // /(\((?:표|그림|부록)?\s*([A-Z]\.)?\d+(\.\d+)*(\s?\(\d\))?(-\d+)?(?:\s*[A-Z])?\))/g resp.result.document.forEach(function (item, index){ const isTitle = item.full_content.includes(item.group_title); if(isTitle){ @@ -98,16 +99,36 @@ function CodeViewer(props) { ) } - if(reg.test(item.full_content)){ - const docCodeAry = item.full_content.match(reg); - const docCodeLink = []; + if(docLinkReg.test(item.full_content)){ + const docCodeAry = item.full_content.match(docLinkReg); + const docCodeMap = new Map(); for(let i=0; i' + docCode + '') - } - for(let i=0; i' + docCode + '') } + 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'+ + ''+ + ''); + } + docPartMap.forEach((docPartLink, docPart)=>{ + item.full_content = item.full_content.replaceAll(docPart, docPartLink); + }) + } + } + if(item.full_content.includes(""; } detailTag.push( @@ -145,10 +166,10 @@ function CodeViewer(props) { {codeTree} - + {docSummary} - + {docDetail} @@ -156,8 +177,8 @@ function CodeViewer(props) { } CodeViewer.defaultProps = { - docCode: 'KDS 21 45 00', - docName: '가설교량 및 노면복공 설계기준' + docCode: 'KDS 24 14 30', + docName: '강교 설계기준(허용응력설계법)' } export default CodeViewer;