링크 기능 작업중.

cks
강석 최 2023-10-19 14:53:40 +09:00
parent f73efb133c
commit 4e58a20acf
2 changed files with 9 additions and 1 deletions

View File

@ -307,4 +307,6 @@
.calendar_info ul li span {position: absolute; right: 15px; top: 15px; color: #808080; font-size: 16px; font-weight: 300;}
.viewerDiv{height: calc(100vh - 180px); overflow-y: auto;}
.openDoc{background-color: bisque;}
.openDoc{background-color: bisque;}
.docLink{background-color: aquamarine}
.docLink:hover{cursor: pointer}

View File

@ -83,6 +83,7 @@ function CodeViewer(props) {
// 문서 전문 구성
let detailTag = [];
if(resp.result.document.length>0){
const reg = /([A-Z]{3,5}(\s[0-9]{2}){3,4})/g
resp.result.document.forEach(function (item, index){
const isTitle = item.full_content.includes(item.group_title);
if(isTitle){
@ -96,6 +97,11 @@ function CodeViewer(props) {
</VwDiv>
)
}
if(reg.test(item.full_content)){
const docCode = item.full_content.match(reg)[0]
const fullContent = item.full_content.split(docCode);
item.full_content = fullContent[0]+'<key class="docLink">'+docCode+'</key>'+fullContent[1];
}
detailTag.push(
<VwDiv depth={item.cont_level} isTitle={isTitle} id={item.cont_type_cd} dangerouslySetInnerHTML={ {__html: item.full_content} }></VwDiv>
)