뷰어 작업중 중간저장
parent
40768fa511
commit
48d76a43ef
|
|
@ -56,7 +56,10 @@ public class SecurityConfig {
|
|||
"/swagger-resources",
|
||||
"/swagger-resources/**",
|
||||
"/swagger-ui.html",
|
||||
"/swagger-ui/**"
|
||||
"/swagger-ui/**",
|
||||
|
||||
/*기준코드 조회*/
|
||||
"/standardCode/**.do"
|
||||
};
|
||||
private static final String[] ORIGINS_WHITELIST = {
|
||||
"http://localhost:3000",
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package egovframework.dbnt.kcsc.standardCode;
|
|||
import egovframework.com.cmm.ResponseCode;
|
||||
import egovframework.com.cmm.service.ResultVO;
|
||||
import egovframework.com.cmm.LoginVO;
|
||||
import egovframework.dbnt.kcsc.standardCode.service.StandardCodeService;
|
||||
import org.egovframe.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
||||
|
||||
import egovframework.dbnt.kcsc.standardCode.service.StandardCodeVO;
|
||||
|
|
@ -15,6 +16,7 @@ import lombok.RequiredArgsConstructor;
|
|||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -208,6 +210,9 @@ public class StandardCodeController {
|
|||
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
|
||||
return resultVO;
|
||||
}*/
|
||||
private final StandardCodeService standardCodeService;
|
||||
|
||||
|
||||
@Operation(
|
||||
summary = "건설기준코드 내용 조회",
|
||||
description = "건설기준코드 내용 조회",
|
||||
|
|
@ -218,39 +223,13 @@ public class StandardCodeController {
|
|||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
||||
})
|
||||
@PostMapping(value = "/viewer.do", consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResultVO selectStandardCode(@RequestBody StandardCodeVO codeVO, @AuthenticationPrincipal LoginVO user)
|
||||
public ResultVO selectStandardCode(@RequestBody StandardCodeVO param, @AuthenticationPrincipal LoginVO user)
|
||||
throws Exception {
|
||||
ResultVO resultVO = new ResultVO();
|
||||
|
||||
/*BoardMasterVO vo = new BoardMasterVO();
|
||||
vo.setBbsId(boardVO.getBbsId());
|
||||
vo.setUniqId(user.getUniqId());
|
||||
|
||||
BoardMasterVO master = bbsAttrbService.selectBBSMasterInf(vo);
|
||||
|
||||
PaginationInfo paginationInfo = new PaginationInfo();
|
||||
paginationInfo.setCurrentPageNo(boardVO.getPageIndex());
|
||||
paginationInfo.setRecordCountPerPage(propertyService.getInt("Globals.pageUnit"));
|
||||
paginationInfo.setPageSize(propertyService.getInt("Globals.pageSize"));
|
||||
|
||||
boardVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
||||
boardVO.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
boardVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
|
||||
Map<String, Object> resultMap = bbsMngService.selectBoardArticles(boardVO, vo.getBbsAttrbCode());
|
||||
|
||||
int totCnt = Integer.parseInt((String)resultMap.get("resultCnt"));
|
||||
paginationInfo.setTotalRecordCount(totCnt);
|
||||
|
||||
resultMap.put("boardVO", boardVO);
|
||||
resultMap.put("brdMstrVO", master);
|
||||
resultMap.put("paginationInfo", paginationInfo);
|
||||
resultMap.put("user", user);
|
||||
|
||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
||||
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
resultMap.put("codeTree", standardCodeService.selectStandardCodeTree());
|
||||
resultMap.put("document", standardCodeService.selectStandardCodeDocument(param));
|
||||
resultVO.setResult(resultMap);
|
||||
*/
|
||||
return resultVO;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package egovframework.dbnt.kcsc.standardCode.entity;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.DynamicInsert;
|
||||
import org.hibernate.annotations.DynamicUpdate;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@NoArgsConstructor
|
||||
@DynamicInsert
|
||||
@DynamicUpdate
|
||||
@Table(name = "tn_document_content")
|
||||
public class TnDocumentContent {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "doc_cont_seq")
|
||||
private Integer docContSeq;
|
||||
@Column(name = "doc_info_seq")
|
||||
private Integer docInfoSeq;
|
||||
@Column(name = "cont_order")
|
||||
private Integer contOrder;
|
||||
@Column(name = "onto_link_cd")
|
||||
private String ontoLinkCd;
|
||||
@Column(name = "group_title")
|
||||
private String groupTitle;
|
||||
@Column(name = "cont_type_cd")
|
||||
private String contTypeCd;
|
||||
@Column(name = "cont_level")
|
||||
private Integer contLevel;
|
||||
@Column(name = "parent_cont_seq")
|
||||
private Integer parentContSeq;
|
||||
@Column(name = "cont_label")
|
||||
private String contLabel;
|
||||
@Column(name = "table_content")
|
||||
private String tableContent;
|
||||
@Column(name = "full_content")
|
||||
private String fullContent;
|
||||
@Column(name = "cont_rev_yn")
|
||||
private String contRevYn;
|
||||
@Column(name = "cont_abolish_yn")
|
||||
private String contAbolishYn;
|
||||
@Column(name = "doc_rev_hist_seq")
|
||||
private Integer docRevHistSeq;
|
||||
@Column(name = "frst_crt_id")
|
||||
private String frstCrtId;
|
||||
@Column(name = "frst_crt_dt")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime frstCrtDt;
|
||||
@Column(name = "last_chg_id")
|
||||
private String lastChgId;
|
||||
@Column(name = "last_chg_dt")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime lastChgDt;
|
||||
@Column(name = "use_yn")
|
||||
private String useYn;
|
||||
@Column(name = "error_cd")
|
||||
private String errorCd;
|
||||
@Column(name = "old_seq")
|
||||
private Integer oldSeq;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package egovframework.dbnt.kcsc.standardCode.repository;
|
||||
|
||||
|
||||
import egovframework.dbnt.kcsc.standardCode.entity.TnDocumentContent;
|
||||
import egovframework.dbnt.kcsc.standardCode.service.StandardCodeContentInterface;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TnDocumentContentRepository extends JpaRepository<TnDocumentContent, Integer> {
|
||||
|
||||
@Query(value = "select * from get_recent_full_context_by_content(:docCode, :contentPoint)", nativeQuery = true)
|
||||
public List<StandardCodeContentInterface> getRecentFullContextByContent(String docCode, String contentPoint);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package egovframework.dbnt.kcsc.standardCode.repository;
|
||||
|
||||
import egovframework.dbnt.kcsc.standardCode.entity.TnDocumentGroup;
|
||||
import egovframework.dbnt.kcsc.standardCode.service.StandardCodeTreeInterface;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TnDocumentGroupRepository extends JpaRepository<TnDocumentGroup, Integer> {
|
||||
|
||||
@Query(value = "select * from sp_get_tn_document_code_by_tree()", nativeQuery = true)
|
||||
public List<StandardCodeTreeInterface> spGetTnDocumentCodeByTree();
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package egovframework.dbnt.kcsc.standardCode.service;
|
||||
|
||||
public interface StandardCodeContentInterface {
|
||||
String getOnto_link_cd();
|
||||
String getGroup_title();
|
||||
String getCont_type_cd();
|
||||
Integer getCont_level();
|
||||
Integer getParent_cont_seq();
|
||||
String getCont_label();
|
||||
String getError_cd();
|
||||
String getTable_content();
|
||||
String getFull_content();
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
package egovframework.dbnt.kcsc.standardCode.service;
|
||||
|
||||
import egovframework.dbnt.kcsc.standardCode.entity.TnDocumentGroup;
|
||||
import egovframework.dbnt.kcsc.standardCode.repository.TnDocumentContentRepository;
|
||||
import egovframework.dbnt.kcsc.standardCode.repository.TnDocumentGroupRepository;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class StandardCodeService {
|
||||
private final TnDocumentGroupRepository tnDocumentGroupRepository;
|
||||
private final TnDocumentContentRepository tnDocumentContentRepository;
|
||||
|
||||
public List<StandardCodeTreeInterface> selectStandardCodeTree(){
|
||||
return tnDocumentGroupRepository.spGetTnDocumentCodeByTree();
|
||||
}
|
||||
|
||||
public List<StandardCodeContentInterface> selectStandardCodeDocument(StandardCodeVO param) {
|
||||
return tnDocumentContentRepository.getRecentFullContextByContent(param.getDocCode(), param.getContentPoint());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package egovframework.dbnt.kcsc.standardCode.service;
|
||||
|
||||
public interface StandardCodeTreeInterface {
|
||||
Integer getSeq();
|
||||
Integer getDoc_level();
|
||||
Integer getParent_seq();
|
||||
String getGroup_yn();
|
||||
String getDoc_code();
|
||||
String getDoc_code_ver();
|
||||
String getDoc_code_name();
|
||||
}
|
||||
|
|
@ -6,4 +6,6 @@ import lombok.Setter;
|
|||
@Getter
|
||||
@Setter
|
||||
public class StandardCodeVO {
|
||||
private String docCode;
|
||||
private String contentPoint;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,66 +1,13 @@
|
|||
# \uc6b4\uc601\uc11c\ubc84 \ud0c0\uc785(WINDOWS, UNIX)
|
||||
spring.config.use-legacy-processing=true
|
||||
Globals.LocalIp=127.0.0.1
|
||||
Globals.DbType=postgresql
|
||||
Globals.OsType=WINDOWS
|
||||
|
||||
# Page Config
|
||||
Globals.pageUnit=10
|
||||
Globals.pageSize=10
|
||||
|
||||
# File Config
|
||||
Globals.posblAtchFileSize=5242880
|
||||
Globals.fileStorePath=./files
|
||||
Globals.addedOptions=false
|
||||
|
||||
Globals.postgresql.DriverClassName=net.sf.log4jdbc.DriverSpy
|
||||
Globals.postgresql.Url=jdbc:log4jdbc:postgresql://218.36.126.201:5432/kcsc_dev
|
||||
Globals.postgresql.UserName=postgres
|
||||
Globals.postgresql.Password=rhksflwk12!@
|
||||
|
||||
# MainPage Setting
|
||||
Globals.MainPage = /cmm/main/mainPage.do
|
||||
|
||||
# \ud30c\uc77c \ud655\uc7a5\uc790 \ud654\uc774\ud2b8\ub9ac\uc2a4\ud2b8(\ud5c8\uc6a9\ubaa9\ub85d) : \ud30c\uc77c \ud655\uc7a5\uc790\ub97c (.)\uacfc \ud568\uaed8 \uc5f0\uc774\uc5b4\uc11c \uc0ac\uc6a9\ud558\uba70 (.)\ub85c \uc2dc\uc791\ud55c\ub2e4.
|
||||
Globals.fileUpload.Extensions.Images = .gif.jpg.jpeg.png
|
||||
Globals.fileUpload.Extensions = .gif.jpg.jpeg.png.xls.xlsx
|
||||
|
||||
# Access-Control-Allow-Origin
|
||||
Globals.Allow.Origin = http://localhost:3000
|
||||
|
||||
#\uc554\ud638\ud654\uc11c\ube44\uc2a4 \uc54c\uace0\ub9ac\uc998 \ud0a4
|
||||
#\uc8fc\uc758 : \ubc18\ub4dc\uc2dc \uae30\ubcf8\uac12 "egovframe"\uc744 \ub2e4\ub978\uac83\uc73c\ub85c \ubcc0\uacbd\ud558\uc5ec \uc0ac\uc6a9\ud558\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4.
|
||||
Globals.crypto.algoritm = egovframe
|
||||
|
||||
#JWT secret key
|
||||
#\uc8fc\uc758 : \ubc18\ub4dc\uc2dc \uae30\ubcf8\uac12 "egovframe"\uc744 \ub2e4\ub978\uac83\uc73c\ub85c \ubcc0\uacbd\ud558\uc5ec \uc0ac\uc6a9\ud558\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4
|
||||
Globals.jwt.secret = egovframe
|
||||
|
||||
#server.servlet.context-path=/sht_boot_web
|
||||
server.servlet.context-path=/
|
||||
server.port = 8080
|
||||
server.servlet.session.timeout=3600
|
||||
spring.mvc.pathmatch.matching-strategy=ant_path_matcher
|
||||
|
||||
|
||||
#Logging
|
||||
#file path\uc758 default \uac12\uc740 \ud504\ub85c\uc81d\ud2b8 root \uacbd\ub85c\uc774\ubbc0\ub85c \uc6d0\ud558\uc2dc\ub294 \uacbd\ub85c\ub85c \ubcc0\uacbd\ud558\uc5ec \uc0ac\uc6a9\ud558\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4.
|
||||
logging.scan=false
|
||||
logging.root.level=DEBUG
|
||||
logging.file.name=backend
|
||||
logging.file.path=./log
|
||||
logging.rollingpolicy.maxFileSize=1MB
|
||||
logging.rollingpolicy.maxHistory=1
|
||||
|
||||
# JPA Setting Info
|
||||
spring.jpa.show-sql=true
|
||||
spring.jpa.generate-ddl=false
|
||||
spring.jpa.hibernate.naming.physical-strategy = org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
|
||||
#logging.level.org.hibernate.type.descriptor.sql= DEBUG
|
||||
#spring.jpa.properties.hibernate.diarect= org.hibernate.dialect.HSQLDialect
|
||||
#spring.jpa.properties.hibernate.format_sql= true
|
||||
#spring.jpa.properties.hibernate.show_sql= true
|
||||
#spring.jpa.properties.hibernate.use_sql_comments= true
|
||||
#spring.jpa.hibernate.id.new_generator_mappings: true
|
||||
#spring.jpa.hibernate.ddl-auto= create
|
||||
# option type: create, create-drop, update, validate, none
|
||||
|
|
@ -1,47 +1,11 @@
|
|||
spring.config.use-legacy-processing=true
|
||||
Globals.LocalIp=127.0.0.1
|
||||
|
||||
Globals.OsType=LINUX
|
||||
Globals.DbType=postgresql
|
||||
|
||||
# Page Config
|
||||
Globals.pageUnit=10
|
||||
Globals.pageSize=10
|
||||
|
||||
# File Config
|
||||
Globals.posblAtchFileSize=5242880
|
||||
Globals.fileStorePath=./files
|
||||
Globals.addedOptions=false
|
||||
|
||||
Globals.postgresql.DriverClassName=net.sf.log4jdbc.DriverSpy
|
||||
Globals.postgresql.Url=jdbc:log4jdbc:postgresql://218.36.126.201:5432/kcsc_dev
|
||||
Globals.postgresql.UserName=postgres
|
||||
Globals.postgresql.Password=rhksflwk12!@
|
||||
|
||||
# MainPage Setting
|
||||
Globals.MainPage = /cmm/main/mainPage.do
|
||||
|
||||
# \ud30c\uc77c \ud655\uc7a5\uc790 \ud654\uc774\ud2b8\ub9ac\uc2a4\ud2b8(\ud5c8\uc6a9\ubaa9\ub85d) : \ud30c\uc77c \ud655\uc7a5\uc790\ub97c (.)\uacfc \ud568\uaed8 \uc5f0\uc774\uc5b4\uc11c \uc0ac\uc6a9\ud558\uba70 (.)\ub85c \uc2dc\uc791\ud55c\ub2e4.
|
||||
Globals.fileUpload.Extensions.Images = .gif.jpg.jpeg.png
|
||||
Globals.fileUpload.Extensions = .gif.jpg.jpeg.png.xls.xlsx
|
||||
|
||||
# Access-Control-Allow-Origin
|
||||
Globals.Allow.Origin = http://localhost:3000
|
||||
|
||||
#\uc554\ud638\ud654\uc11c\ube44\uc2a4 \uc54c\uace0\ub9ac\uc998 \ud0a4
|
||||
#\uc8fc\uc758 : \ubc18\ub4dc\uc2dc \uae30\ubcf8\uac12 "egovframe"\uc744 \ub2e4\ub978\uac83\uc73c\ub85c \ubcc0\uacbd\ud558\uc5ec \uc0ac\uc6a9\ud558\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4.
|
||||
Globals.crypto.algoritm = egovframe
|
||||
|
||||
#JWT secret key
|
||||
#\uc8fc\uc758 : \ubc18\ub4dc\uc2dc \uae30\ubcf8\uac12 "egovframe"\uc744 \ub2e4\ub978\uac83\uc73c\ub85c \ubcc0\uacbd\ud558\uc5ec \uc0ac\uc6a9\ud558\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4
|
||||
Globals.jwt.secret = egovframe
|
||||
|
||||
#server.servlet.context-path=/sht_boot_web
|
||||
server.servlet.context-path=/
|
||||
server.port = 8080
|
||||
server.servlet.session.timeout=3600
|
||||
spring.mvc.pathmatch.matching-strategy=ant_path_matcher
|
||||
|
||||
|
||||
#Logging
|
||||
#file path\uc758 default \uac12\uc740 \ud504\ub85c\uc81d\ud2b8 root \uacbd\ub85c\uc774\ubbc0\ub85c \uc6d0\ud558\uc2dc\ub294 \uacbd\ub85c\ub85c \ubcc0\uacbd\ud558\uc5ec \uc0ac\uc6a9\ud558\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4.
|
||||
logging.scan=true
|
||||
|
|
|
|||
|
|
@ -32,11 +32,6 @@ Globals.posblAtchFileSize=5242880
|
|||
Globals.fileStorePath=./files
|
||||
Globals.addedOptions=false
|
||||
|
||||
Globals.postgresql.DriverClassName=net.sf.log4jdbc.DriverSpy
|
||||
Globals.postgresql.Url=jdbc:log4jdbc:postgresql://218.36.126.201:5432/kcsc_dev
|
||||
Globals.postgresql.UserName=postgres
|
||||
Globals.postgresql.Password=rhksflwk12!@
|
||||
|
||||
# MainPage Setting
|
||||
Globals.MainPage = /cmm/main/mainPage.do
|
||||
|
||||
|
|
@ -61,21 +56,12 @@ server.port = 8080
|
|||
server.servlet.session.timeout=3600
|
||||
spring.mvc.pathmatch.matching-strategy=ant_path_matcher
|
||||
|
||||
|
||||
#Logging
|
||||
#file path\uc758 default \uac12\uc740 \ud504\ub85c\uc81d\ud2b8 root \uacbd\ub85c\uc774\ubbc0\ub85c \uc6d0\ud558\uc2dc\ub294 \uacbd\ub85c\ub85c \ubcc0\uacbd\ud558\uc5ec \uc0ac\uc6a9\ud558\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4.
|
||||
logging.root.level=DEBUG
|
||||
#TRACE > DEBUG > INFO > WARN > ERROR
|
||||
logging.scan=false
|
||||
logging.root.level=ERROR
|
||||
logging.file.name=backend
|
||||
logging.file.path=./log
|
||||
logging.rollingpolicy.maxFileSize=10MB
|
||||
logging.rollingpolicy.maxHistory=30
|
||||
|
||||
# JPA Setting Info
|
||||
logging.level.org.hibernate.type.descriptor.sql: DEBUG
|
||||
spring.jpa.properties.hibernate.diarect: org.hibernate.dialect.HSQLDialect
|
||||
spring.jpa.properties.hibernate.format_sql: true
|
||||
spring.jpa.properties.hibernate.show_sql: true
|
||||
spring.jpa.properties.hibernate.use_sql_comments: true
|
||||
spring.jpa.hibernate.id.new_generator_mappings: true
|
||||
spring.jpa.hibernate.ddl-auto: create
|
||||
# option type: create, create-drop, update, validate, none
|
||||
logging.rollingpolicy.maxFileSize=1MB
|
||||
logging.rollingpolicy.maxHistory=1
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -9,8 +9,10 @@
|
|||
"react-bootstrap": "^2.9.0",
|
||||
"react-datepicker": "^4.8.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"react-icons": "^4.11.0",
|
||||
"react-router-dom": "^6.4.0",
|
||||
"react-scripts": "5.0.1",
|
||||
"styled-components": "^6.0.9",
|
||||
"web-vitals": "^2.1.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
import styled from "styled-components";
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
// 사이드바 전체를 감싸는 div
|
||||
export const SbContainer = styled.div`
|
||||
min-width: 16rem;
|
||||
width: auto;
|
||||
height: auto;
|
||||
min-height: 70vh;
|
||||
font-size: 14px;
|
||||
`
|
||||
|
||||
// SbItem에서 하위메뉴들을 묶어줄 div
|
||||
export const SbSub = styled.div`
|
||||
overflow: hidden;
|
||||
max-height: ${props => props.isOpen ? "100%" : "0"};
|
||||
`;
|
||||
|
||||
// 메뉴명을 보여줄 div
|
||||
export const SbTitle = styled.div`
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-left: ${props => 30+(props.depth * 10)}px;
|
||||
height: 32px;
|
||||
&:hover {
|
||||
background-color: #f6f6f2;
|
||||
cursor: pointer;
|
||||
border-right: solid 5px;
|
||||
}
|
||||
`;
|
||||
|
||||
// 제일 하위메뉴에서 클릭할 Link
|
||||
export const SbLink = styled(Link)`
|
||||
color: inherit;
|
||||
text-decoration: inherit;
|
||||
`;
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
import {React, useState} from 'react'
|
||||
import {SbTitle, SbSub, SbLink} from './Sb.style'
|
||||
import { FcFolder, FcOpenedFolder, FcFile } from 'react-icons/fc'
|
||||
import { AiOutlinePlusSquare, AiOutlineMinusSquare } from 'react-icons/ai'
|
||||
|
||||
|
||||
const SbItem = ({ item }) => {
|
||||
const [collapsed, setCollapsed] = useState(false);
|
||||
|
||||
function toggleCollapse() {
|
||||
setCollapsed(prevValue => !prevValue);
|
||||
}
|
||||
|
||||
if(item.childrens.length > 0){
|
||||
const icon1 = collapsed?<AiOutlinePlusSquare />:<AiOutlineMinusSquare />;
|
||||
const icon2 = collapsed?<FcOpenedFolder />:<FcFolder />;
|
||||
return (
|
||||
<div>
|
||||
<SbTitle depth={item.doc_level} onClick={toggleCollapse}>{icon1}{icon2} {(item.doc_level === 1?'':item.doc_code)+' '+item.doc_code_name}</SbTitle>
|
||||
<SbSub isOpen={collapsed}>
|
||||
{item.childrens.map((child) => (
|
||||
<SbItem item={child} />
|
||||
))}
|
||||
</SbSub>
|
||||
</div>
|
||||
)
|
||||
}else{
|
||||
const icon = <FcFile />;
|
||||
return (
|
||||
<SbTitle depth={item.doc_level}>
|
||||
<SbLink>{icon} {(item.doc_level === 1?'':item.doc_code)+' '+item.doc_code_name}</SbLink>
|
||||
</SbTitle>
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default SbItem
|
||||
|
|
@ -1,90 +1,80 @@
|
|||
import React, { useState, useEffect, useCallback } from 'react';
|
||||
import { Link, useLocation } from 'react-router-dom';
|
||||
import SbItem from './SbItem'
|
||||
import {SbContainer} from './Sb.style'
|
||||
import Row from 'react-bootstrap/Row';
|
||||
import Col from 'react-bootstrap/Col';
|
||||
import Button from 'react-bootstrap/Button';
|
||||
import * as EgovNet from 'api/egovFetch';
|
||||
import URL from 'constants/url';
|
||||
|
||||
function CodeViewer(props) {
|
||||
console.group("viewer");
|
||||
console.log("[Start] viewer ------------------------------");
|
||||
console.log("viewer [props] : ", props);
|
||||
|
||||
const docCode=props.docCode===undefined?'KDS 21 30 00':props.docCode;
|
||||
const location = useLocation();
|
||||
console.log("viewer [location] : ", location);
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const [noticeBoard, setNoticeBoard] = useState();
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const [gallaryBoard, setGallaryBoard] = useState();
|
||||
const [noticeListTag, setNoticeListTag] = useState();
|
||||
const [gallaryListTag, setGallaryListTag] = useState();
|
||||
const [codeTree, setCodeTree] = useState();
|
||||
const [docSummary, setDocSummary] = useState();
|
||||
const [docDetail, setDocDetail] = useState();
|
||||
|
||||
const retrieveList = useCallback(() => {
|
||||
console.groupCollapsed("EgovMain.retrieveList()");
|
||||
|
||||
|
||||
const retrieveListURL = '/standardCode/viewer.do';
|
||||
const requestOptions = {
|
||||
method: "POST",
|
||||
headers: {
|
||||
'Content-type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify()
|
||||
body: JSON.stringify({
|
||||
docCode: docCode
|
||||
})
|
||||
}
|
||||
|
||||
EgovNet.requestFetch(retrieveListURL,
|
||||
requestOptions,
|
||||
(resp) => {
|
||||
const menuData = resp.result.codeTree;
|
||||
// 코드 목록 트리 구성
|
||||
// https://garve32.tistory.com/52 참고
|
||||
const nest = (menuData, parent_seq = null, link = 'parent_seq') =>
|
||||
menuData.filter(item => item[link] === parent_seq)
|
||||
.map(item => ({ ...item, childrens: nest(menuData, item.seq) }));
|
||||
const tree = nest(menuData);
|
||||
let treeTag = [];
|
||||
if(tree.length>0){
|
||||
treeTag.push(
|
||||
<SbContainer>
|
||||
{tree.map((subItem, index) =>
|
||||
<SbItem item={subItem} key={index} />
|
||||
)}
|
||||
</SbContainer>
|
||||
)
|
||||
}else{
|
||||
treeTag.push(<div>검색된 결과가 없습니다.</div>); // 코드 목록 초기값
|
||||
}
|
||||
setCodeTree(treeTag);
|
||||
|
||||
setNoticeBoard(resp.result.notiList);
|
||||
setGallaryBoard(resp.result.galList);
|
||||
|
||||
let mutNotiListTag = [];
|
||||
mutNotiListTag.push(<li key="0">검색된 결과가 없습니다.</li>); // 게시판 목록 초기값
|
||||
|
||||
// 리스트 항목 구성
|
||||
resp.result.notiList.forEach(function (item, index) {
|
||||
if (index === 0) mutNotiListTag = []; // 목록 초기화
|
||||
mutNotiListTag.push(
|
||||
<li key={item.nttId}>
|
||||
<Link
|
||||
to={{pathname: URL.INFORM_NOTICE_DETAIL}}
|
||||
state={{
|
||||
nttId: item.nttId,
|
||||
bbsId: item.bbsId
|
||||
}}
|
||||
>
|
||||
{item.nttSj}
|
||||
<span>{item.frstRegisterPnttm}</span>
|
||||
</Link>
|
||||
</li>
|
||||
);
|
||||
});
|
||||
setNoticeListTag(mutNotiListTag);
|
||||
|
||||
let mutGallaryListTag = [];
|
||||
mutGallaryListTag.push(<li key="0">검색된 결과가 없습니다.</li>); // 게시판 목록 초기값
|
||||
|
||||
// 리스트 항목 구성
|
||||
resp.result.galList.forEach(function (item, index) {
|
||||
if (index === 0) mutGallaryListTag = []; // 목록 초기화
|
||||
mutGallaryListTag.push(
|
||||
<li key={index}>
|
||||
<Link
|
||||
to={{pathname: URL.INFORM_GALLERY_DETAIL}}
|
||||
state={{
|
||||
nttId: item.nttId,
|
||||
bbsId: item.bbsId
|
||||
}}
|
||||
>
|
||||
{item.nttSj}
|
||||
<span>{item.frstRegisterPnttm}</span>
|
||||
</Link>
|
||||
</li>
|
||||
);
|
||||
});
|
||||
setGallaryListTag(mutGallaryListTag);
|
||||
// 목차 구성
|
||||
let summaryTag = [];
|
||||
// 문서 전문 구성
|
||||
let detailTag = [];
|
||||
if(resp.result.document.length>0){
|
||||
resp.result.document.forEach(function (item, index){
|
||||
summaryTag.push(
|
||||
<div>{item.group_title}</div>
|
||||
)
|
||||
detailTag.push(
|
||||
<div dangerouslySetInnerHTML={ {__html: item.full_content} }></div>
|
||||
)
|
||||
})
|
||||
}else{
|
||||
summaryTag.push(<li key="0">검색된 결과가 없습니다.</li>);
|
||||
}
|
||||
setDocSummary(summaryTag);
|
||||
setDocDetail(detailTag);
|
||||
},
|
||||
function (resp) {
|
||||
console.log("err response : ", resp);
|
||||
|
|
@ -101,132 +91,17 @@ function CodeViewer(props) {
|
|||
console.groupEnd("viewer");
|
||||
|
||||
return (
|
||||
<div className="container P_MAIN">
|
||||
<div className="c_wrap">
|
||||
<div className="colbox">
|
||||
<div className="left_col">
|
||||
{/*<img src="/assets/images/img_simple_main.png" alt="단순 홈페이지 전자정부 표준프레임워크의 경량환경 내부업무에 대한 최신 정보와 기술을 제공하고 있습니다." />*/}
|
||||
<h3>건설기준코드 검색</h3>
|
||||
<Row className="justify-content-md-center">
|
||||
<Col xs={3}><Button variant="secondary">공통코드</Button></Col>
|
||||
<Col xs={3}><Button variant="secondary">지반코드</Button></Col>
|
||||
<Col xs={3}><Button variant="secondary">구조코드</Button></Col>
|
||||
<Col xs={3}><Button variant="secondary">내진코드</Button></Col>
|
||||
<Col xs={3}><Button variant="secondary">가설코드</Button></Col>
|
||||
<Col xs={3}><Button variant="secondary">교량코드</Button></Col>
|
||||
<Col xs={3}><Button variant="secondary">터널코드</Button></Col>
|
||||
<Col xs={3}><Button variant="secondary">공동구코드</Button></Col>
|
||||
<Col xs={3}><Button variant="secondary">설비코드</Button></Col>
|
||||
<Col xs={3}><Button variant="secondary">조경코드</Button></Col>
|
||||
<Col xs={3}><Button variant="secondary">건축코드</Button></Col>
|
||||
<Col xs={3}><Button variant="secondary">도로코드</Button></Col>
|
||||
<Col xs={3}><Button variant="secondary">철도코드</Button></Col>
|
||||
<Col xs={3}><Button variant="secondary">하천코드</Button></Col>
|
||||
<Col xs={3}><Button variant="secondary">댐코드</Button></Col>
|
||||
<Col xs={3}><Button variant="secondary">상수도코드</Button></Col>
|
||||
<Col xs={3}><Button variant="secondary">하수도코드</Button></Col>
|
||||
<Col xs={3}><Button variant="secondary">농업기반코드</Button></Col>
|
||||
{/*
|
||||
<Col xs={3}><Button variant="secondary"><a href="/Search/ListCodes/1010" title="공통코드">공통코드</a></Button></Col>
|
||||
<Col xs={3}><Button variant="secondary"><a href="/Search/ListCodes/101011" title="지반코드">지반코드</a></Button></Col>
|
||||
<Col xs={3}><Button variant="secondary"><a href="/Search/ListCodes/101014" title="구조코드">구조코드</a></Button></Col>
|
||||
<Col xs={3}><Button variant="secondary"><a href="/Search/ListCodes/101017" title="내진코드">내진코드</a></Button></Col>
|
||||
<Col xs={3}><Button variant="secondary"><a href="/Search/ListCodes/102021" title="가설코드">가설코드</a></Button></Col>
|
||||
<Col xs={3}><Button variant="secondary"><a href="/Search/ListCodes/102024" title="교량코드">교량코드</a></Button></Col>
|
||||
<Col xs={3}><Button variant="secondary"><a href="/Search/ListCodes/102027" title="터널코드">터널코드</a></Button></Col>
|
||||
<Col xs={3}><Button variant="secondary"><a href="/Search/ListCodes/102029" title="공동구코드">공동구코드</a></Button></Col>
|
||||
<Col xs={3}><Button variant="secondary"><a href="/Search/ListCodes/102031" title="설비코드">설비코드</a></Button></Col>
|
||||
<Col xs={3}><Button variant="secondary"><a href="/Search/ListCodes/102034" title="조경코드">조경코드</a></Button></Col>
|
||||
<Col xs={3}><Button variant="secondary"><a href="/Search/ListCodes/102041" title="건축코드">건축코드</a></Button></Col>
|
||||
<Col xs={3}><Button variant="secondary"><a href="/Search/ListCodes/102044" title="도로코드">도로코드</a></Button></Col>
|
||||
<Col xs={3}><Button variant="secondary"><a href="/Search/ListCodes/102047" title="철도코드">철도코드</a></Button></Col>
|
||||
<Col xs={3}><Button variant="secondary"><a href="/Search/ListCodes/102051" title="하천코드">하천코드</a></Button></Col>
|
||||
<Col xs={3}><Button variant="secondary"><a href="/Search/ListCodes/102054" title="댐코드">댐코드</a></Button></Col>
|
||||
<Col xs={3}><Button variant="secondary"><a href="/Search/ListCodes/102057" title="상수도코드">상수도코드</a></Button></Col>
|
||||
<Col xs={3}><Button variant="secondary"><a href="/Search/ListCodes/102061" title="하수도코드">하수도코드</a></Button></Col>
|
||||
<Col xs={3}><Button variant="secondary"><a href="/Search/ListCodes/102067" title="농업기반코드">농업기반코드</a></Button></Col>
|
||||
*/}
|
||||
<Row>
|
||||
<Col xs={3} className="border-end">
|
||||
{codeTree}
|
||||
</Col>
|
||||
<Col xs={3} className="border-end">
|
||||
{docSummary}
|
||||
</Col>
|
||||
<Col xs={6}>
|
||||
{docDetail}
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
|
||||
<div className="right_col">
|
||||
<div className="mini_board">
|
||||
<ul className="tab">
|
||||
<li><a href="#공지사항" className="on">공지사항</a></li>
|
||||
<li><a href="#갤러리">갤러리</a></li>
|
||||
</ul>
|
||||
<div className="list">
|
||||
<div className="notice">
|
||||
<h2 className="blind">공지사항</h2>
|
||||
<ul>
|
||||
{noticeListTag}
|
||||
</ul>
|
||||
<Link to={URL.INFORM_NOTICE} className="more">더보기</Link>
|
||||
</div>
|
||||
|
||||
<div className="gallary">
|
||||
<h2 className="blind">갤러리</h2>
|
||||
<ul>
|
||||
{gallaryListTag}
|
||||
</ul>
|
||||
<Link to={URL.INFORM_GALLERY} className="more">더보기</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="banner">
|
||||
<Link to={URL.SUPPORT_DOWNLOAD} className="bn1">
|
||||
<strong>자료실</strong>
|
||||
<span>다양한 자료를<br />다운로드 받으실 수 있습니다.</span>
|
||||
</Link>
|
||||
<Link to={URL.ABOUT} className="bn2">
|
||||
<strong>표준프레임워크센터</strong>
|
||||
<span>표준프레임워크센터의<br />약도 등의 정보를 제공합니다.</span>
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="banner_bot">
|
||||
<div className="b1">
|
||||
<div>
|
||||
<h2>주요사업 소개</h2>
|
||||
<p>표준프레임워크가 제공하는<br />
|
||||
주요 사업을 소개합니다.</p>
|
||||
</div>
|
||||
<Link to={URL.INTRO_WORKS}>자세히 보기</Link>
|
||||
</div>
|
||||
<div className="b2">
|
||||
<div>
|
||||
<h2>대표서비스 소개</h2>
|
||||
<p>표준프레임워크 실행환경의<br />
|
||||
서비스 그룹에서 제공하는<br />
|
||||
대표서비스입니다.</p>
|
||||
</div>
|
||||
<Link to={URL.INTRO_SERVICE}>자세히 보기</Link>
|
||||
</div>
|
||||
<div className="b3">
|
||||
<div>
|
||||
<h2>서비스 신청</h2>
|
||||
<p>표준프레임워크 경량환경<br />
|
||||
홈페이지의 다양한 서비스를<br />
|
||||
신청 하실 수 있습니다.</p>
|
||||
</div>
|
||||
<Link to={URL.SUPPORT_APPLY}>자세히 보기</Link>
|
||||
</div>
|
||||
<div className="b4">
|
||||
<div>
|
||||
<h2>일정 현황</h2>
|
||||
<p>표준프레임워크 경량환경<br />
|
||||
홈페이지의 전체적인 일정<br />
|
||||
현황을 조회하실 수 있습니다.</p>
|
||||
</div>
|
||||
<Link to={URL.INFORM}>자세히 보기</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue