From c962738e79c7749cf0bd2a5b7509a0f4774bd74d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=84=9D=20=EC=B5=9C?= Date: Mon, 23 Oct 2023 15:57:14 +0900 Subject: [PATCH] =?UTF-8?q?=EC=98=A4=EB=A5=98=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=ED=91=9C=ED=98=84.=20=EA=B8=B0=EC=A4=80=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EB=A7=81=ED=81=AC=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95.?= =?UTF-8?q?=20=EB=AC=B8=EB=8B=A8=20=EC=B1=85=EA=B0=88=ED=94=BC=20=EC=82=BD?= =?UTF-8?q?=EC=9E=85.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/css/page.css | 12 ++++- .../src/pages/standardCode/Sb.style.js | 2 - .../src/pages/standardCode/viewer.js | 45 ++++++++++++++----- 3 files changed, 43 insertions(+), 16 deletions(-) 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;