Compare commits
No commits in common. "90973d65d13b5e4eac3c18939946eff2c965895b" and "5d87831386a314466bd8802f22d62e53d4f4b186" have entirely different histories.
90973d65d1
...
5d87831386
|
|
@ -7,7 +7,6 @@
|
||||||
"@emotion/styled": "^11.11.0",
|
"@emotion/styled": "^11.11.0",
|
||||||
"@material-ui/core": "^4.12.4",
|
"@material-ui/core": "^4.12.4",
|
||||||
"@material-ui/icons": "^4.11.3",
|
"@material-ui/icons": "^4.11.3",
|
||||||
"@mui/icons-material": "^5.15.6",
|
|
||||||
"@mui/material": "^5.14.19",
|
"@mui/material": "^5.14.19",
|
||||||
"@mui/styles": "^5.15.3",
|
"@mui/styles": "^5.15.3",
|
||||||
"bootstrap": "^5.3.2",
|
"bootstrap": "^5.3.2",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import React, {useState} from 'react';
|
import React from 'react';
|
||||||
import { Link, NavLink, useNavigate } from 'react-router-dom';
|
import { Link, NavLink, useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
import * as EgovNet from 'api/egovFetch';
|
import * as EgovNet from 'api/egovFetch';
|
||||||
|
|
@ -13,7 +13,6 @@ function EgovHeader({ loginUser, onChangeLogin }) {
|
||||||
console.group("EgovHeader");
|
console.group("EgovHeader");
|
||||||
console.log("[Start] EgovHeader ------------------------------");
|
console.log("[Start] EgovHeader ------------------------------");
|
||||||
|
|
||||||
const [menuDiv, setMenuDiv] = useState(false);
|
|
||||||
const accessToken = getLocalItem('accessToken');
|
const accessToken = getLocalItem('accessToken');
|
||||||
const userInfo = parseJwt(accessToken);
|
const userInfo = parseJwt(accessToken);
|
||||||
const sessionUserId = userInfo?.id;
|
const sessionUserId = userInfo?.id;
|
||||||
|
|
@ -57,15 +56,9 @@ function EgovHeader({ loginUser, onChangeLogin }) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function allMenuControl(){
|
|
||||||
setMenuDiv(!menuDiv);
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log("------------------------------EgovHeader [End]");
|
console.log("------------------------------EgovHeader [End]");
|
||||||
console.groupEnd("EgovHeader");
|
console.groupEnd("EgovHeader");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
// <!-- header -->
|
// <!-- header -->
|
||||||
<div className="header">
|
<div className="header">
|
||||||
|
|
@ -78,8 +71,7 @@ function EgovHeader({ loginUser, onChangeLogin }) {
|
||||||
<div className="gnb">
|
<div className="gnb">
|
||||||
<h2 className="blind">주메뉴</h2>
|
<h2 className="blind">주메뉴</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li><NavLink to={URL.STANDARD_CODE_INFO} className={({ isActive }) => (isActive ? "cur" : "")}>건설기준코드</NavLink></li>
|
<li><NavLink to={URL.ABOUT} className={({ isActive }) => (isActive ? "cur" : "")}>사이트소개</NavLink></li>
|
||||||
{/*<li><NavLink to={URL.ABOUT} className={({ isActive }) => (isActive ? "cur" : "")}>사이트소개</NavLink></li>*/}
|
|
||||||
<li><NavLink to={URL.INTRO} className={({ isActive }) => (isActive ? "cur" : "")}>정보마당</NavLink></li>
|
<li><NavLink to={URL.INTRO} className={({ isActive }) => (isActive ? "cur" : "")}>정보마당</NavLink></li>
|
||||||
<li><NavLink to={URL.SUPPORT} className={({ isActive }) => (isActive ? "cur" : "")}>고객지원</NavLink></li>
|
<li><NavLink to={URL.SUPPORT} className={({ isActive }) => (isActive ? "cur" : "")}>고객지원</NavLink></li>
|
||||||
<li><NavLink to={URL.INFORM} className={({ isActive }) => (isActive ? "cur" : "")}>알림마당</NavLink></li>
|
<li><NavLink to={URL.INFORM} className={({ isActive }) => (isActive ? "cur" : "")}>알림마당</NavLink></li>
|
||||||
|
|
@ -106,24 +98,17 @@ function EgovHeader({ loginUser, onChangeLogin }) {
|
||||||
{/* <!--// PC web에서 보여지는 영역 --> */}
|
{/* <!--// PC web에서 보여지는 영역 --> */}
|
||||||
|
|
||||||
{/* <!-- right area --> */}
|
{/* <!-- right area --> */}
|
||||||
<div className="right_a" onClick={allMenuControl}>
|
<div className="right_a">
|
||||||
<button type="button" className="btn btnAllMenu" title="전체메뉴 닫힘">전체메뉴</button>
|
<button type="button" className="btn btnAllMenu" title="전체메뉴 닫힘">전체메뉴</button>
|
||||||
<button type="button" className="btn mobile btnAllMenuM" title="전체메뉴 닫힘">전체메뉴</button>
|
<button type="button" className="btn mobile btnAllMenuM" title="전체메뉴 닫힘">전체메뉴</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* <!-- All menu : web --> */}
|
{/* <!-- All menu : web --> */}
|
||||||
<div className={`all_menu WEB ${menuDiv?"open":"closed"}`}>
|
<div className="all_menu WEB closed">
|
||||||
<h2 className="blind">전체메뉴</h2>
|
<h2 className="blind">전체메뉴</h2>
|
||||||
<div className="inner">
|
<div className="inner">
|
||||||
<div className="col">
|
<div className="col">
|
||||||
<h3>건설기준코드</h3>
|
|
||||||
<ul>
|
|
||||||
<li><NavLink to={URL.STANDARD_CODE_INFO} onClick={allMenuControl} className={({ isActive }) => (isActive ? "cur" : "")}>건설기준코드 안내</NavLink></li>
|
|
||||||
<li><NavLink to={URL.STANDARD_CODE_LIST} onClick={allMenuControl} className={({ isActive }) => (isActive ? "cur" : "")}>건설기준코드 검색</NavLink></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
{/*<div className="col">
|
|
||||||
<h3>사이트소개</h3>
|
<h3>사이트소개</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li><NavLink to={URL.ABOUT_SITE} className={({ isActive }) => (isActive ? "cur" : "")}>소개</NavLink></li>
|
<li><NavLink to={URL.ABOUT_SITE} className={({ isActive }) => (isActive ? "cur" : "")}>소개</NavLink></li>
|
||||||
|
|
@ -131,8 +116,7 @@ function EgovHeader({ loginUser, onChangeLogin }) {
|
||||||
<li><NavLink to={URL.ABOUT_ORGANIZATION} className={({ isActive }) => (isActive ? "cur" : "")}>조직소개</NavLink></li>
|
<li><NavLink to={URL.ABOUT_ORGANIZATION} className={({ isActive }) => (isActive ? "cur" : "")}>조직소개</NavLink></li>
|
||||||
<li><NavLink to={URL.ABOUT_LOCATION} className={({ isActive }) => (isActive ? "cur" : "")}>찾아오시는 길</NavLink></li>
|
<li><NavLink to={URL.ABOUT_LOCATION} className={({ isActive }) => (isActive ? "cur" : "")}>찾아오시는 길</NavLink></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>*/}
|
</div>
|
||||||
|
|
||||||
<div className="col">
|
<div className="col">
|
||||||
<h3>정보마당</h3>
|
<h3>정보마당</h3>
|
||||||
<ul>
|
<ul>
|
||||||
|
|
|
||||||
|
|
@ -1,82 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import { styled } from '@mui/material/styles';
|
|
||||||
import Box from '@mui/material/Box';
|
|
||||||
import Paper from '@mui/material/Paper';
|
|
||||||
import List from '@mui/material/List';
|
|
||||||
import ListItem from '@mui/material/ListItem';
|
|
||||||
import EditIcon from '@mui/icons-material/Edit';
|
|
||||||
import ListItemText from '@mui/material/ListItemText';
|
|
||||||
import IconButton from '@mui/material/IconButton';
|
|
||||||
import Grid from '@mui/material/Grid';
|
|
||||||
import Typography from '@mui/material/Typography';
|
|
||||||
import DeleteIcon from '@mui/icons-material/Delete';
|
|
||||||
import AddIcon from '@mui/icons-material/Add';
|
|
||||||
|
|
||||||
|
|
||||||
function generate(items, element) {
|
|
||||||
return items.map((value) =>
|
|
||||||
React.cloneElement(element, {
|
|
||||||
key: value,
|
|
||||||
}, <ListItemText
|
|
||||||
primary={value}
|
|
||||||
/>),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const Demo = styled('div')(({ theme }) => ({
|
|
||||||
backgroundColor: theme.palette.background.paper,
|
|
||||||
}));
|
|
||||||
|
|
||||||
const Item = styled(Paper)(({ theme }) => ({
|
|
||||||
backgroundColor: theme.palette.mode === 'dark' ? '#1A2027' : '#fff',
|
|
||||||
...theme.typography.body2,
|
|
||||||
padding: theme.spacing(1),
|
|
||||||
textAlign: 'center',
|
|
||||||
color: theme.palette.text.secondary,
|
|
||||||
}));
|
|
||||||
|
|
||||||
function ListCreateUpdateDelete(props) {
|
|
||||||
|
|
||||||
const [dense, setDense] = React.useState(false);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Paper>
|
|
||||||
<Typography sx={{ p: 0 }} variant="h6" component="div">
|
|
||||||
<Grid container spacing={0} columns={10} sx={{ '&': { backgroundColor: '#333333', height: '56px'}}}>
|
|
||||||
<Grid item xs={6} md={8} >
|
|
||||||
<Item sx={{ px: 0, '&': { boxShadow: 'none', color: '#ffffff', fontWeight: '600', fontSize: '18px', backgroundColor: 'transparent', lineHeight: '40px' }}}>{props.title}</Item>
|
|
||||||
</Grid>
|
|
||||||
<Grid item xs={0} md={2} sx={{ pl: 0, '&': {backgroundColor: 'transparent' }}}>
|
|
||||||
<Item sx={{ p: 0, '&': { boxShadow: 'none', backgroundColor: '#169bd5', borderRadius: '0px'} }}>
|
|
||||||
<IconButton aria-label="add" sx={{ px: 0, borderRadius: '0px', width: '100%', height: '56px'}}>
|
|
||||||
<AddIcon sx={{ px: 0, '&': {color: '#ffffff', width: '30px', height: '30px' }}} />
|
|
||||||
</IconButton>
|
|
||||||
</Item>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</Typography>
|
|
||||||
<Demo>
|
|
||||||
<List dense={dense}>
|
|
||||||
{generate(
|
|
||||||
props.items,
|
|
||||||
<ListItem
|
|
||||||
secondaryAction={
|
|
||||||
<div>
|
|
||||||
<IconButton sx={{ mx: 0 }} edge="start" aria-label="edit">
|
|
||||||
<EditIcon />
|
|
||||||
</IconButton>
|
|
||||||
<IconButton edge="end" aria-label="delete">
|
|
||||||
<DeleteIcon />
|
|
||||||
</IconButton>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
</ListItem>,
|
|
||||||
)}
|
|
||||||
</List>
|
|
||||||
</Demo>
|
|
||||||
</Paper>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default ListCreateUpdateDelete;
|
|
||||||
|
|
@ -121,9 +121,7 @@ const URL = {
|
||||||
ADMIN__LOGS__FILE_DOWNLOAD_STATUS : "/admin/logs/file-download-status", // 위원회 관리/파일 다운현황
|
ADMIN__LOGS__FILE_DOWNLOAD_STATUS : "/admin/logs/file-download-status", // 위원회 관리/파일 다운현황
|
||||||
|
|
||||||
//기준코드
|
//기준코드
|
||||||
STANDARD_CODE_INFO : "/standardCode/info",
|
STANDARD_CODE_LIST : "/standardCode/list/:listCode", //건설기준코드/리스트
|
||||||
STANDARD_CODE_LIST : "/standardCode/list", //건설기준코드/리스트
|
|
||||||
STANDARD_CODE_LIST_LINK : "/standardCode/list/:listCode", //건설기준코드/리스트
|
|
||||||
STANDARD_CODE_DETAIL : "/standardCode/detail", //건설기준코드/리스트
|
STANDARD_CODE_DETAIL : "/standardCode/detail", //건설기준코드/리스트
|
||||||
STANDARD_CODE_VIEWER : "/standardCode/viewer", //건설기준코드/뷰어
|
STANDARD_CODE_VIEWER : "/standardCode/viewer", //건설기준코드/뷰어
|
||||||
STANDARD_CODE_VIEWER_LINK : "/standardCode/viewer/:linkedDocCode", //건설기준코드/뷰어/새 창 링크
|
STANDARD_CODE_VIEWER_LINK : "/standardCode/viewer/:linkedDocCode", //건설기준코드/뷰어/새 창 링크
|
||||||
|
|
|
||||||
|
|
@ -187,7 +187,7 @@
|
||||||
|
|
||||||
|
|
||||||
/* Condition */
|
/* Condition */
|
||||||
.condition {padding: 10px; border: 1px solid #dde2e5; border-radius: 10px; text-align: center;} /* changed by lim padding: 26px;*/
|
.condition {padding: 10px; border: 1px solid #dde2e5; border-radius: 10px; font-size: 0; text-align: center;} /* changed by lim padding: 26px;*/
|
||||||
.condition > ul,
|
.condition > ul,
|
||||||
.condition > ul li {display: inline-block; vertical-align: top;}
|
.condition > ul li {display: inline-block; vertical-align: top;}
|
||||||
.condition > ul li + li {margin-left: 20px;}
|
.condition > ul li + li {margin-left: 20px;}
|
||||||
|
|
@ -246,7 +246,7 @@ select::-ms-expand {display:none;}
|
||||||
/* 건설기준코드list 설계기준 표준시방서 전문시방서 통합 다운로드 탭 */
|
/* 건설기준코드list 설계기준 표준시방서 전문시방서 통합 다운로드 탭 */
|
||||||
.right_col {display: flex; justify-content: space-between; align-items: center;}
|
.right_col {display: flex; justify-content: space-between; align-items: center;}
|
||||||
.mini_board ul {display: flex; list-style: none; padding: 0; margin: 0;}
|
.mini_board ul {display: flex; list-style: none; padding: 0; margin: 0;}
|
||||||
.tab {padding: 5px 10px; margin-right: 10px; cursor: pointer; border: 1px solid #ccc; border-radius: 5px; transition: background-color 0.3s;}
|
.tab {padding: 10px; margin-right: 10px; cursor: pointer; border: 1px solid #ccc; border-radius: 5px; transition: background-color 0.3s;}
|
||||||
.tab:hover {background-color: #f0f0f0;}
|
.tab:hover {background-color: #f0f0f0;}
|
||||||
.active {background-color: #007bff; color: #fff;}
|
.active {background-color: #007bff; color: #fff;}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -245,7 +245,6 @@ function Schedules(props) {
|
||||||
{/* <!-- 검색조건 --> */}
|
{/* <!-- 검색조건 --> */}
|
||||||
<div className="condition">
|
<div className="condition">
|
||||||
<ul>
|
<ul>
|
||||||
{false &&
|
|
||||||
<li>
|
<li>
|
||||||
<label className="f_select" htmlFor="sel1">
|
<label className="f_select" htmlFor="sel1">
|
||||||
<select name="schdulSe" id="sel1" title="조건"
|
<select name="schdulSe" id="sel1" title="조건"
|
||||||
|
|
@ -262,8 +261,6 @@ function Schedules(props) {
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
}
|
|
||||||
|
|
||||||
<li className="half L">
|
<li className="half L">
|
||||||
<button className="prev"
|
<button className="prev"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|
|
||||||
|
|
@ -1,58 +1,13 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { styled } from '@mui/material/styles';
|
|
||||||
import Box from '@mui/material/Box';
|
|
||||||
import Paper from '@mui/material/Paper';
|
|
||||||
import List from '@mui/material/List';
|
|
||||||
import ListItem from '@mui/material/ListItem';
|
|
||||||
import EditIcon from '@mui/icons-material/Edit';
|
|
||||||
import ListItemAvatar from '@mui/material/ListItemAvatar';
|
|
||||||
import ListItemIcon from '@mui/material/ListItemIcon';
|
|
||||||
import ListItemText from '@mui/material/ListItemText';
|
|
||||||
import Avatar from '@mui/material/Avatar';
|
|
||||||
import IconButton from '@mui/material/IconButton';
|
|
||||||
import FormGroup from '@mui/material/FormGroup';
|
|
||||||
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
||||||
import Checkbox from '@mui/material/Checkbox';
|
|
||||||
import Grid from '@mui/material/Grid';
|
|
||||||
import Typography from '@mui/material/Typography';
|
|
||||||
import FolderIcon from '@mui/icons-material/Folder';
|
|
||||||
import DeleteIcon from '@mui/icons-material/Delete';
|
|
||||||
import AddIcon from '@mui/icons-material/Add';
|
|
||||||
import AddBoxOutlinedIcon from '@mui/icons-material/AddBoxOutlined';
|
|
||||||
|
|
||||||
import ListCreateUpdateDelete from '../../../components/list/ListCreateUpdateDelete'
|
|
||||||
|
|
||||||
import URL from 'constants/url';
|
import URL from 'constants/url';
|
||||||
|
|
||||||
import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin';
|
import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin';
|
||||||
|
|
||||||
|
|
||||||
function generate(element) {
|
|
||||||
return [0, 1, 2].map((value) =>
|
|
||||||
React.cloneElement(element, {
|
|
||||||
key: value,
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const Demo = styled('div')(({ theme }) => ({
|
|
||||||
backgroundColor: theme.palette.background.paper,
|
|
||||||
}));
|
|
||||||
|
|
||||||
const Item = styled(Paper)(({ theme }) => ({
|
|
||||||
backgroundColor: theme.palette.mode === 'dark' ? '#1A2027' : '#fff',
|
|
||||||
...theme.typography.body2,
|
|
||||||
padding: theme.spacing(1),
|
|
||||||
textAlign: 'center',
|
|
||||||
color: theme.palette.text.secondary,
|
|
||||||
}));
|
|
||||||
|
|
||||||
function CommitteeCodeMgt(props) {
|
function CommitteeCodeMgt(props) {
|
||||||
|
|
||||||
const [dense, setDense] = React.useState(false);
|
|
||||||
const [secondary, setSecondary] = React.useState(false);
|
|
||||||
|
|
||||||
const Location = React.memo(function Location() {
|
const Location = React.memo(function Location() {
|
||||||
return (
|
return (
|
||||||
<div className="location">
|
<div className="location">
|
||||||
|
|
@ -84,21 +39,7 @@ function CommitteeCodeMgt(props) {
|
||||||
<h1 className="tit_1">위원회 코드 관리</h1>
|
<h1 className="tit_1">위원회 코드 관리</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Box
|
여기에 구현해주세요.
|
||||||
sx={{
|
|
||||||
display: 'flex',
|
|
||||||
flexWrap: 'wrap',
|
|
||||||
'& > :not(style)': {
|
|
||||||
m: 1,
|
|
||||||
width: 245,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<ListCreateUpdateDelete title="중앙건설기술심의" items={["중앙건설기술심의", "테스트2"]}/>
|
|
||||||
<ListCreateUpdateDelete title="총괄위원회" items={[]}/>
|
|
||||||
<ListCreateUpdateDelete title="건설기준위원회" items={[]}/>
|
|
||||||
<ListCreateUpdateDelete title="실무위원회" items={[]}/>
|
|
||||||
</Box>
|
|
||||||
{/* <!--// 본문 --> */}
|
{/* <!--// 본문 --> */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,180 +1,30 @@
|
||||||
import React, {useState, useEffect, useCallback, useRef, PureComponent} from 'react';
|
import React from 'react';
|
||||||
import { Link, useLocation } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
|
|
||||||
import {BarChart, Bar, Rectangle, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer} from 'recharts';
|
|
||||||
|
|
||||||
import Switch from '@mui/material/Switch';
|
|
||||||
|
|
||||||
import * as EgovNet from 'api/egovFetch';
|
|
||||||
import URL from 'constants/url';
|
import URL from 'constants/url';
|
||||||
|
|
||||||
import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin';
|
import { default as EgovLeftNav } from 'components/leftmenu/EgovLeftNavAdmin';
|
||||||
|
|
||||||
import { itemIdxByPage } from 'utils/calc';
|
|
||||||
import EgovPaging from 'components/EgovPaging';
|
|
||||||
|
|
||||||
|
|
||||||
function ApiKeys(props) {
|
function ApiKeys(props) {
|
||||||
// console.group("EgovAdminPrivacyList");
|
|
||||||
// console.log("[Start] EgovAdminPrivacyList ------------------------------");
|
|
||||||
// console.log("EgovAdminPrivacyList [props] : ", props);
|
|
||||||
const location = useLocation();
|
|
||||||
// console.log("EgovAdminPrivacyList [location] : ", location);
|
|
||||||
|
|
||||||
// eslint-disable-next-line no-unused-vars
|
const Location = React.memo(function Location() {
|
||||||
const [searchCondition, setSearchCondition] = useState(location.state?.searchCondition || { pageIndex: 1, searchCnd: '0', searchWrd: '' });
|
|
||||||
const [paginationInfo, setPaginationInfo] = useState({});
|
|
||||||
const [chartData, setChartData] = useState([]);
|
|
||||||
const [user_id, setuser_id] = useState([]);
|
|
||||||
|
|
||||||
const [listTag, setListTag] = useState([]);
|
|
||||||
// const label = { inputProps: { 'aria-label': '사용여부' } };
|
|
||||||
|
|
||||||
const retrieveList = useCallback((srchCnd) => {
|
|
||||||
// console.groupCollapsed("EgovAdminUsageList.retrieveList()");
|
|
||||||
const retrieveListURL = '/admin/standards/apikey';
|
|
||||||
|
|
||||||
const requestOptions = {
|
|
||||||
method: "POST",
|
|
||||||
headers: {
|
|
||||||
'Content-type': 'application/json',
|
|
||||||
},
|
|
||||||
body: JSON.stringify(srchCnd)
|
|
||||||
}
|
|
||||||
|
|
||||||
EgovNet.requestFetch(
|
|
||||||
retrieveListURL,
|
|
||||||
requestOptions,
|
|
||||||
(resp) => {
|
|
||||||
setPaginationInfo(resp.result.paginationInfo);
|
|
||||||
|
|
||||||
let mutListTag = [];
|
|
||||||
listTag.push(<p className="no_data" key="0">데이터가 없습니다.</p>); // 게시판 목록 초기값
|
|
||||||
|
|
||||||
const resultCnt = parseInt(resp.result.resultCnt);
|
|
||||||
const currentPageNo = resp.result.paginationInfo.pageIndex;
|
|
||||||
const pageSize = resp.result.paginationInfo.rowCnt;
|
|
||||||
|
|
||||||
const startIndex = (currentPageNo - 1) * pageSize;
|
|
||||||
const endIndex = Math.min(startIndex + pageSize, resultCnt);
|
|
||||||
|
|
||||||
// 리스트 항목 구성
|
|
||||||
for (let index = startIndex; index < endIndex; index++) {
|
|
||||||
const listIdx = itemIdxByPage(resultCnt, currentPageNo, 0, index); // pageSize 로 넣으면 listIdx값이 2배씩 줄어서 0으로 수정
|
|
||||||
const item = resp.result.resultList[index];
|
|
||||||
|
|
||||||
mutListTag.push(
|
|
||||||
<div key={listIdx} className="list_item">
|
|
||||||
<div>{item.userId}</div>
|
|
||||||
<div style={{ cursor: 'pointer' }} onClick={() => handleApiKeyChart(item)}>{item.apiKey}</div>
|
|
||||||
<div>{item.startDt} ~ {item.endDt}</div>
|
|
||||||
<div>{item.idntyYn === 'Y' ? <Switch defaultChecked onChange={() => handleSwitchToggle(item)} /> : <Switch onChange={() => handleSwitchToggle(item)} />}</div>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
setListTag(mutListTag);
|
|
||||||
},
|
|
||||||
function (resp) {
|
|
||||||
console.log("err response : ", resp);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
// console.groupEnd("EgovAdminPrivacyList.retrieveList()");
|
|
||||||
},[listTag]);
|
|
||||||
|
|
||||||
const CustomTooltip = ({ active, payload, label }) => {
|
|
||||||
if (active && payload && payload.length) {
|
|
||||||
return (
|
return (
|
||||||
<div className="custom-tooltip">
|
<div className="location">
|
||||||
<p className="intro">API 요청 [{user_id}]</p>
|
<ul>
|
||||||
<p className="label">{`${label} : ${payload[0].value}`}회</p>
|
<li><Link to={URL.MAIN} className="home">Home</Link></li>
|
||||||
|
<li><Link to={URL.ADMIN}>건설기준 관리</Link></li>
|
||||||
|
<li>API KEY 관리</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
);
|
)
|
||||||
}
|
});
|
||||||
return null;
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleSwitchToggle = async (item) => {
|
|
||||||
try {
|
|
||||||
const updateApiEndpoint = '/admin/standards/apiupdate';
|
|
||||||
const requestOptions = {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
body: JSON.stringify(item),
|
|
||||||
};
|
|
||||||
|
|
||||||
const response = await EgovNet.requestFetch(updateApiEndpoint, requestOptions);
|
|
||||||
const data = await response.json();
|
|
||||||
|
|
||||||
if (response.ok) {
|
|
||||||
console.log('Data updated successfully:', data);
|
|
||||||
return { success: true, data };
|
|
||||||
} else {
|
|
||||||
console.error('Failed to update data:', data);
|
|
||||||
return { success: false, error: data };
|
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error during data update:', error);
|
|
||||||
return { success: false, error };
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleApiKeyChart = (item) => {
|
|
||||||
try {
|
|
||||||
const updateApiEndpoint = '/admin/standards/apiDailyChart';
|
|
||||||
const requestOptions = {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
body: JSON.stringify(item),
|
|
||||||
};
|
|
||||||
|
|
||||||
EgovNet.requestFetch(
|
|
||||||
updateApiEndpoint,
|
|
||||||
requestOptions,
|
|
||||||
(resp) => {
|
|
||||||
let chartDataArray = resp.result.resultList.map((item, index) => ({
|
|
||||||
logdt: item[0], // Assuming logCnt is the x-axis data
|
|
||||||
"API 요청수": item[1], // Assuming menuTitle is the y-axis data
|
|
||||||
}));
|
|
||||||
setChartData(chartDataArray);
|
|
||||||
// item.userId 값 넣기
|
|
||||||
console.log(`User ID: ${item.userId}`);
|
|
||||||
setuser_id(item.userId);
|
|
||||||
},
|
|
||||||
function (resp) {
|
|
||||||
console.log("err response : ", resp);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Error during data update:', error);
|
|
||||||
return { success: false, error };
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
retrieveList(searchCondition);
|
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
// console.log("------------------------------EgovAdminPrivacyList [End]");
|
|
||||||
// console.groupEnd("EgovAdminPrivacyList");
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container">
|
<div className="container">
|
||||||
<div className="c_wrap">
|
<div className="c_wrap">
|
||||||
{/* <!-- Location --> */}
|
{/* <!-- Location --> */}
|
||||||
<div className="location">
|
<Location />
|
||||||
<ul>
|
|
||||||
<li><Link to={URL.MAIN} className="home">Home</Link></li>
|
|
||||||
<li><Link to={URL.ADMIN} >사이트관리</Link></li>
|
|
||||||
<li>건설기준 관리</li>
|
|
||||||
<li>API KEY 관리</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
{/* <!--// Location --> */}
|
{/* <!--// Location --> */}
|
||||||
|
|
||||||
<div className="layout">
|
<div className="layout">
|
||||||
|
|
@ -185,50 +35,12 @@ function ApiKeys(props) {
|
||||||
<div className="contents " id="contents">
|
<div className="contents " id="contents">
|
||||||
{/* <!-- 본문 --> */}
|
{/* <!-- 본문 --> */}
|
||||||
<div className="top_tit">
|
<div className="top_tit">
|
||||||
<h1 className="tit_1">API KEY 관리</h1>
|
<h1 className="tit_1">건설기준 관리</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* <!-- 목록 --> */}
|
<h2 className="tit_2">API KEY 관리</h2>
|
||||||
<div className="board_list BRD012">
|
|
||||||
<div className="head">
|
|
||||||
<span>사용자</span>
|
|
||||||
<span>발급키</span>
|
|
||||||
<span>승인기간</span>
|
|
||||||
<span>승인여부</span>
|
|
||||||
</div>
|
|
||||||
<div className="result">
|
|
||||||
{listTag}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{/* <!--// 목록 -->*/}
|
|
||||||
|
|
||||||
<div className="board_bot mt-1">
|
여기에 구현해주세요.
|
||||||
{/* <!-- Paging --> */}
|
|
||||||
<EgovPaging pagination={paginationInfo} moveToPage={passedPage => {
|
|
||||||
retrieveList({ ...searchCondition, pageIndex: passedPage }) //, searchCnd: cndRef.current.value, searchWrd: wrdRef.current.value
|
|
||||||
}} />
|
|
||||||
{/* <!--/ Paging --> */}
|
|
||||||
</div>
|
|
||||||
<div className="pt-2">
|
|
||||||
<ResponsiveContainer width="100%" height={477}>
|
|
||||||
<BarChart data={chartData} layout="vertical"
|
|
||||||
height={477}
|
|
||||||
margin={{
|
|
||||||
top: 0,
|
|
||||||
right: 0,
|
|
||||||
left: 20,
|
|
||||||
bottom: 0,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<CartesianGrid strokeDasharray="3 3" />
|
|
||||||
<XAxis type="number" />
|
|
||||||
<YAxis type="category" dataKey="logdt" tick={{ fontSize: 10, whiteSpace: 'nowrap' }} />
|
|
||||||
<Tooltip content={<CustomTooltip/>} />
|
|
||||||
<Legend />
|
|
||||||
<Bar dataKey="API 요청수" fill="#87CEFA" activeBar={<Rectangle fill="gold" stroke="purple" />} />
|
|
||||||
</BarChart>
|
|
||||||
</ResponsiveContainer>
|
|
||||||
</div>
|
|
||||||
{/* <!--// 본문 --> */}
|
{/* <!--// 본문 --> */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import {React, useCallback, useEffect, useState} from "react";
|
import {React, useCallback, useEffect, useState} from "react";
|
||||||
import Modal from "react-bootstrap/Modal";
|
import Modal from "react-bootstrap/Modal";
|
||||||
import * as EgovNet from "../../../api/egovFetch";
|
import * as EgovNet from "../../api/egovFetch";
|
||||||
import {VwDiv} from "./Vw.style";
|
import {VwDiv} from "./Vw.style";
|
||||||
import Col from "react-bootstrap/Col";
|
import Col from "react-bootstrap/Col";
|
||||||
import Row from "react-bootstrap/Row";
|
import Row from "react-bootstrap/Row";
|
||||||
|
|
@ -8,52 +8,13 @@ import {AiFillFileMarkdown, AiFillStar} from "react-icons/ai";
|
||||||
|
|
||||||
function StandardCodeList(props) {
|
function StandardCodeList(props) {
|
||||||
const {listCode} = useParams();
|
const {listCode} = useParams();
|
||||||
const [show, setShow] = useState(false);
|
const [show, setshow] = useState(false);
|
||||||
const [groupSeq, setgroupSeq] = useState();
|
const [groupseq, setgroupseq] = useState();
|
||||||
|
|
||||||
console.group("StandardCodeList");
|
function showhandling(e) {
|
||||||
console.log("[Start] StandardCodeList ------------------------------");
|
|
||||||
console.log("StandardCodeList [props] : ", props);
|
|
||||||
console.log("listcode----------------------------" + listCode);
|
|
||||||
|
|
||||||
const location = useLocation();
|
|
||||||
console.log("StandardCodeList [location] : ", location);
|
|
||||||
|
|
||||||
const category1Ref = useRef();
|
|
||||||
const category2Ref = useRef();
|
|
||||||
const category3Ref = useRef();
|
|
||||||
const wrdRef = useRef();
|
|
||||||
|
|
||||||
// eslint-disable-next-line no-unused-vars
|
|
||||||
const [searchCondition, setSearchCondition] = useState(location.state?.searchCondition || {
|
|
||||||
pageIndex: 1,
|
|
||||||
tab: listCode?.substring(0, 2),
|
|
||||||
category1: listCode?.substring(2, 4),
|
|
||||||
category2: listCode?.substring(4, 6),
|
|
||||||
searchWrd: ''
|
|
||||||
});// 기존 조회에서 접근 했을 시 || 신규로 접근 했을 시
|
|
||||||
const [masterBoard, setMasterBoard] = useState({});
|
|
||||||
|
|
||||||
/* 검색기능 추가 변수*/
|
|
||||||
const [listData, setlistData] = useState([]);
|
|
||||||
const [filterData, setFilterData] = useState('');
|
|
||||||
const [category1List, setCategory1List] = useState([]);
|
|
||||||
const [category2List, setCategory2List] = useState([]);
|
|
||||||
const [category3List, setCategory3List] = useState([]);
|
|
||||||
const [resultCnt, setResultCnt] = useState(0);
|
|
||||||
|
|
||||||
/* 탭 */
|
|
||||||
const [activeTab, setActiveTab] = useState(10);
|
|
||||||
const [subTabsVisible, setSubTabsVisible] = useState(false);
|
|
||||||
|
|
||||||
function close() {
|
|
||||||
setShow(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
function showHandling(e) {
|
|
||||||
const param = e.currentTarget.dataset;
|
const param = e.currentTarget.dataset;
|
||||||
const groupSeq = param.groupSeq;
|
const groupseq = param.groupseq;
|
||||||
console.log(groupSeq);
|
console.log(groupseq);
|
||||||
EgovNet.requestFetch(
|
EgovNet.requestFetch(
|
||||||
'/standardCode/codeListModal.do',
|
'/standardCode/codeListModal.do',
|
||||||
{
|
{
|
||||||
|
|
@ -62,7 +23,7 @@ function StandardCodeList(props) {
|
||||||
'Content-type': 'application/json'
|
'Content-type': 'application/json'
|
||||||
},
|
},
|
||||||
body: JSON.stringify(
|
body: JSON.stringify(
|
||||||
groupSeq
|
groupseq
|
||||||
)
|
)
|
||||||
}, (resp) => {
|
}, (resp) => {
|
||||||
console.log(resp + "------------------------resp")
|
console.log(resp + "------------------------resp")
|
||||||
|
|
@ -89,13 +50,51 @@ function StandardCodeList(props) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
setgroupSeq(<StandardCodeListModalTable head={head} content={body}/>);
|
setgroupseq(<StandardCodeListModalTable head={head} content={body}/>);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
setShow(true);
|
setshow(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function close() {
|
||||||
|
setshow(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.group("StandardCodeList");
|
||||||
|
console.log("[Start] StandardCodeList ------------------------------");
|
||||||
|
console.log("StandardCodeList [props] : ", props);
|
||||||
|
console.log("listcode----------------------------" + listCode);
|
||||||
|
|
||||||
|
const location = useLocation();
|
||||||
|
console.log("StandardCodeList [location] : ", location);
|
||||||
|
|
||||||
|
const category1Ref = useRef();
|
||||||
|
const category2Ref = useRef();
|
||||||
|
const category3Ref = useRef();
|
||||||
|
const wrdRef = useRef();
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
|
const [searchCondition, setSearchCondition] = useState(location.state?.searchCondition || {
|
||||||
|
pageIndex: 1,
|
||||||
|
tab: listCode.substring(0, 2),
|
||||||
|
category1: listCode.substring(2, 4),
|
||||||
|
category2: listCode.substring(4, 6),
|
||||||
|
searchWrd: ''
|
||||||
|
});// 기존 조회에서 접근 했을 시 || 신규로 접근 했을 시
|
||||||
|
const [masterBoard, setMasterBoard] = useState({});
|
||||||
|
|
||||||
|
/* 검색기능 추가 변수*/
|
||||||
|
const [listdata, setlistdata] = useState([]);
|
||||||
|
const [filterData, setfilterData] = useState('');
|
||||||
|
const [category1List, setCategory1List] = useState([]);
|
||||||
|
const [category2List, setCategory2List] = useState([]);
|
||||||
|
const [category3List, setCategory3List] = useState([]);
|
||||||
|
const [resultCnt, setResultCnt] = useState(0);
|
||||||
|
|
||||||
|
/* 탭 */
|
||||||
|
const [activeTab, setActiveTab] = useState(10);
|
||||||
|
const [subTabsVisible, setSubTabsVisible] = useState(false);
|
||||||
|
|
||||||
const handleTabClick = (tabName) => {
|
const handleTabClick = (tabName) => {
|
||||||
setActiveTab(tabName);
|
setActiveTab(tabName);
|
||||||
|
|
@ -136,7 +135,7 @@ function StandardCodeList(props) {
|
||||||
(resp) => {
|
(resp) => {
|
||||||
setMasterBoard(resp.result.tnDocumentInfo);
|
setMasterBoard(resp.result.tnDocumentInfo);
|
||||||
/*검색을 위한 리스트 state에 저장*/
|
/*검색을 위한 리스트 state에 저장*/
|
||||||
setlistData(resp.result.resultList);
|
setlistdata(resp.result.resultList);
|
||||||
setCategory1List(resp.result.category1List);
|
setCategory1List(resp.result.category1List);
|
||||||
setCategory2List(resp.result.category2List);
|
setCategory2List(resp.result.category2List);
|
||||||
setCategory3List(resp.result.category3List);
|
setCategory3List(resp.result.category3List);
|
||||||
|
|
@ -160,31 +159,49 @@ function StandardCodeList(props) {
|
||||||
return (
|
return (
|
||||||
<div className="StandardCodeList container">
|
<div className="StandardCodeList container">
|
||||||
<div className="c_wrap codelistcontent">
|
<div className="c_wrap codelistcontent">
|
||||||
|
{/* <!-- Location --> */}
|
||||||
<div className="location">
|
<div className="location">
|
||||||
<ul>
|
<ul>
|
||||||
<li><Link to={URL.MAIN} className="home">Home</Link></li>
|
<li><Link to={URL.MAIN} className="home">Home</Link></li>
|
||||||
<li><Link to='#'>건설기준코드</Link></li>
|
<li><Link to='#'>건설기준코드</Link></li>
|
||||||
<li><Link to={URL.STANDARD_CODE_LIST}>건설기준코드 검색</Link></li>
|
<li>{masterBoard && masterBoard.bbsNm}</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
{/* <!--// Location --> */}
|
||||||
|
|
||||||
<div className="layout">
|
<div className="layout">
|
||||||
|
{/* <!-- Navigation --> */}
|
||||||
|
|
||||||
|
{/* <!--// Navigation --> */}
|
||||||
|
|
||||||
<div className="contents NOTICE_LIST listtablediv">
|
<div className="contents NOTICE_LIST listtablediv">
|
||||||
|
{/* <!-- 본문 --> */}
|
||||||
|
|
||||||
<div className="top_tit">
|
<div className="top_tit">
|
||||||
<h2 className="tit_1">건설기준코드 검색</h2>
|
<h2 className="tit_1">건설기준코드</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<h2 className="tit_2">설계기준, 표준시방서 내용을 열람할 수 있습니다.</h2>
|
||||||
|
|
||||||
|
{/* <!-- 검색조건 --> */}
|
||||||
<div className="condition">
|
<div className="condition">
|
||||||
<ul>
|
<ul>
|
||||||
<li className="third_1 L">
|
<li className="third_2 R">
|
||||||
<div className={`tab ${activeTab === 10 ? 'active' : ''}`} onClick={() => handleTabClick(10)}>설계기준</div>
|
<span className="f_search w_200">
|
||||||
</li>
|
<input type="text" name="" defaultValue={searchCondition.searchWrd} placeholder="코드명" ref={wrdRef}
|
||||||
<li className="third_1 L">
|
onChange={e => {
|
||||||
<div className={`tab ${activeTab === 20 ? 'active' : ''}`} onClick={() => handleTabClick(20)}>표준시방서</div>
|
setfilterData(e.target.value);
|
||||||
</li>
|
}}
|
||||||
<li className="third_1 L">
|
/>
|
||||||
<div className={`tab ${[40, 50, 60, 70, 80, 90].includes(activeTab) ? 'active' : ''}`} onClick={() => handleTabClick(40)}>전문시방서</div>
|
<button type="button"
|
||||||
|
onClick={() => {
|
||||||
|
retrieveList({...searchCondition, pageIndex: 1, category1: category1Ref.current.value, searchWrd: wrdRef.current.value, tab: activeTab});
|
||||||
|
}}>조회</button>
|
||||||
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li className="third_1 L">
|
<li className="third_1 L">
|
||||||
<label className="f_select" htmlFor="sel1">
|
<label className="f_select" htmlFor="sel1">
|
||||||
|
<span>{searchCondition.category1}</span>
|
||||||
<select id="sel1" title="조건" value={searchCondition.category1} ref={category1Ref}
|
<select id="sel1" title="조건" value={searchCondition.category1} ref={category1Ref}
|
||||||
onChange={e => {
|
onChange={e => {
|
||||||
const updatedCondition = {
|
const updatedCondition = {
|
||||||
|
|
@ -255,12 +272,19 @@ function StandardCodeList(props) {
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
</li>
|
</li>
|
||||||
<li className="third_1 L">
|
|
||||||
<div className={`tab`}>통합 다운로드</div>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{/* <!--// 검색조건 --> */}
|
{/* <!--// 검색조건 --> */}
|
||||||
|
<div className="right_col">
|
||||||
|
<div className="mini_board">
|
||||||
|
<ul>
|
||||||
|
<div className={`tab ${activeTab === 10 ? 'active' : ''}`} onClick={() => handleTabClick(10)}>설계기준</div>
|
||||||
|
<div className={`tab ${activeTab === 20 ? 'active' : ''}`} onClick={() => handleTabClick(20)}>표준시방서</div>
|
||||||
|
<div className={`tab ${[40, 50, 60, 70, 80, 90].includes(activeTab) ? 'active' : ''}`} onClick={() => handleTabClick(40)}>전문시방서</div>
|
||||||
|
<div className={`tab`}>통합 다운로드</div>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{subTabsVisible && (
|
{subTabsVisible && (
|
||||||
<div className="right_col">
|
<div className="right_col">
|
||||||
<div className="mini_board">
|
<div className="mini_board">
|
||||||
|
|
@ -291,7 +315,7 @@ function StandardCodeList(props) {
|
||||||
<div className="result">
|
<div className="result">
|
||||||
|
|
||||||
{/*검색기능 filterData가 없는경우 모든 데이터 출력*/}
|
{/*검색기능 filterData가 없는경우 모든 데이터 출력*/}
|
||||||
{listData.filter(item => {
|
{listdata.filter(item => {
|
||||||
if (item.groupNm.includes(filterData)) {
|
if (item.groupNm.includes(filterData)) {
|
||||||
return item
|
return item
|
||||||
}
|
}
|
||||||
|
|
@ -303,7 +327,7 @@ function StandardCodeList(props) {
|
||||||
<div className="middleCategory">{item.middleCategory}</div>
|
<div className="middleCategory">{item.middleCategory}</div>
|
||||||
<div className="kcscCd">{item.kcscCd}</div>
|
<div className="kcscCd">{item.kcscCd}</div>
|
||||||
<div className="groupNm">{item.groupNm}</div>
|
<div className="groupNm">{item.groupNm}</div>
|
||||||
<div className="Revisionhistory"><a className="vieweratag" onClick={showHandling} data-groupSeq={item.groupSeq}>개정이력</a></div>
|
<div className="Revisionhistory"><a className="vieweratag" onClick={showhandling} data-groupseq={item.groupSeq}>개정이력</a></div>
|
||||||
<div className="fille">{item.contentcount > 0 ? <a className="vieweratag" href={"/standardCode/viewer/" + item.kcscCd}>내용보기</a> : null}</div>
|
<div className="fille">{item.contentcount > 0 ? <a className="vieweratag" href={"/standardCode/viewer/" + item.kcscCd}>내용보기</a> : null}</div>
|
||||||
<div className="viewer">{item.docFileGrpId == null ? null :
|
<div className="viewer">{item.docFileGrpId == null ? null :
|
||||||
<a href={"https://www.kcsc.re.kr/file/DownloadGrp/" + item.docFileGrpId}><AiFillFileMarkdown/></a>}</div>
|
<a href={"https://www.kcsc.re.kr/file/DownloadGrp/" + item.docFileGrpId}><AiFillFileMarkdown/></a>}</div>
|
||||||
|
|
@ -319,7 +343,7 @@ function StandardCodeList(props) {
|
||||||
{/* <!-- Paging --> */}
|
{/* <!-- Paging --> */}
|
||||||
|
|
||||||
{/* <!--/ Paging --> */}
|
{/* <!--/ Paging --> */}
|
||||||
<StandardCodeListModal size={"lg"} show={show} content={groupSeq} onClose={close} title={"개정이력"}/>
|
<StandardCodeListModal size={"lg"} show={show} content={groupseq} onClose={close} title={"개정이력"}/>
|
||||||
|
|
||||||
|
|
||||||
{/* <!--// 본문 --> */}
|
{/* <!--// 본문 --> */}
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import React, { useState, useEffect, useCallback } from 'react';
|
import React, { useState, useEffect, useCallback } from 'react';
|
||||||
import { useLocation, useParams } from 'react-router-dom';
|
import { useLocation, useParams } from 'react-router-dom';
|
||||||
import SbItem from './SbItem'
|
import SbItem from './SbItem'
|
||||||
import Loading from '../../../components/Loading'
|
import Loading from '../../components/Loading'
|
||||||
import BookmarkModal from './BookmarkModal';
|
import BookmarkModal from './BookmarkModal';
|
||||||
import {SbContainer} from './Sb.style'
|
import {SbContainer} from './Sb.style'
|
||||||
import {VwDiv, VwPtag} from './Vw.style'
|
import {VwDiv, VwPtag} from './Vw.style'
|
||||||
|
|
@ -10,9 +10,9 @@ import Row from 'react-bootstrap/Row';
|
||||||
import Col from 'react-bootstrap/Col';
|
import Col from 'react-bootstrap/Col';
|
||||||
import Modal from 'react-bootstrap/Modal';
|
import Modal from 'react-bootstrap/Modal';
|
||||||
import * as EgovNet from 'api/egovFetch';
|
import * as EgovNet from 'api/egovFetch';
|
||||||
import {getLocalItem} from "../../../utils/storage";
|
import {getLocalItem} from "../../utils/storage";
|
||||||
import CODE from "../../../constants/code";
|
import CODE from "../../constants/code";
|
||||||
import {parseJwt} from "../../../utils/parseJwt";
|
import {parseJwt} from "../../utils/parseJwt";
|
||||||
|
|
||||||
function CodeViewer(props) {
|
function CodeViewer(props) {
|
||||||
const [treeLoading, setTreeLoading] = useState(true);
|
const [treeLoading, setTreeLoading] = useState(true);
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import * as EgovNet from "../../../api/egovFetch";
|
import * as EgovNet from "../../api/egovFetch";
|
||||||
import React, {useEffect, useState} from "react";
|
import React, {useEffect, useState} from "react";
|
||||||
import SbItem from "./SbItem";
|
import SbItem from "./SbItem";
|
||||||
import {Col, Row} from "react-bootstrap";
|
import {Col, Row} from "react-bootstrap";
|
||||||
|
|
@ -110,11 +110,11 @@ import AdminLogsFileDownloadStatus from 'pages/admin/logs/FileDownloadStatus';
|
||||||
|
|
||||||
|
|
||||||
//건설기준코드
|
//건설기준코드
|
||||||
import CodeViewer from 'pages/standardCode/viewer/viewer';
|
import CodeViewer from 'pages/standardCode/viewer';
|
||||||
|
|
||||||
import * as EgovNet from 'api/egovFetch'; // jwt토큰 위조 검사 때문에 추가
|
import * as EgovNet from 'api/egovFetch'; // jwt토큰 위조 검사 때문에 추가
|
||||||
import initPage from 'js/ui';
|
import initPage from 'js/ui';
|
||||||
import StandardCodeList from "../pages/standardCode/list/StandardCodeList";
|
import StandardCodeList from "../pages/standardCode/StandardCodeList";
|
||||||
|
|
||||||
const RootRoutes = () => {
|
const RootRoutes = () => {
|
||||||
//useLocation객체를 이용하여 정규표현식을 사용한 /admin/~ 으로 시작하는 경로와 비교에 사용(아래 1줄) */}
|
//useLocation객체를 이용하여 정규표현식을 사용한 /admin/~ 으로 시작하는 경로와 비교에 사용(아래 1줄) */}
|
||||||
|
|
@ -329,7 +329,6 @@ const SecondRoutes = () => {
|
||||||
|
|
||||||
{/*기준코드리스트*/}
|
{/*기준코드리스트*/}
|
||||||
<Route path={URL.STANDARD_CODE_LIST} element={<StandardCodeList />} />
|
<Route path={URL.STANDARD_CODE_LIST} element={<StandardCodeList />} />
|
||||||
<Route path={URL.STANDARD_CODE_LIST_LINK} element={<StandardCodeList />} />
|
|
||||||
|
|
||||||
</Routes>
|
</Routes>
|
||||||
<EgovFooter />
|
<EgovFooter />
|
||||||
|
|
|
||||||
|
|
@ -1072,13 +1072,6 @@
|
||||||
dependencies:
|
dependencies:
|
||||||
regenerator-runtime "^0.14.0"
|
regenerator-runtime "^0.14.0"
|
||||||
|
|
||||||
"@babel/runtime@^7.23.8":
|
|
||||||
version "7.23.9"
|
|
||||||
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.9.tgz#47791a15e4603bb5f905bc0753801cf21d6345f7"
|
|
||||||
integrity sha512-0CX6F+BI2s9dkUqr08KFrAIZgNFj75rdBU/DjCyYLIaV/quFjkk6T+EJ2LkZHyZTbEV4L5p97mNkUsHl2wLFAw==
|
|
||||||
dependencies:
|
|
||||||
regenerator-runtime "^0.14.0"
|
|
||||||
|
|
||||||
"@babel/template@^7.18.10", "@babel/template@^7.20.7", "@babel/template@^7.3.3":
|
"@babel/template@^7.18.10", "@babel/template@^7.20.7", "@babel/template@^7.3.3":
|
||||||
version "7.20.7"
|
version "7.20.7"
|
||||||
resolved "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz"
|
resolved "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz"
|
||||||
|
|
@ -1811,13 +1804,6 @@
|
||||||
resolved "https://registry.yarnpkg.com/@mui/core-downloads-tracker/-/core-downloads-tracker-5.15.3.tgz#40fc854d7cf5505a182a4e121149dfe21cd277ef"
|
resolved "https://registry.yarnpkg.com/@mui/core-downloads-tracker/-/core-downloads-tracker-5.15.3.tgz#40fc854d7cf5505a182a4e121149dfe21cd277ef"
|
||||||
integrity sha512-sWeihiVyxdJjpLkp8SHkTy9kt2M/o11M60G1MzwljGL2BXdM3Ktzqv5QaQHdi00y7Y1ulvtI3GOSxP2xU8mQJw==
|
integrity sha512-sWeihiVyxdJjpLkp8SHkTy9kt2M/o11M60G1MzwljGL2BXdM3Ktzqv5QaQHdi00y7Y1ulvtI3GOSxP2xU8mQJw==
|
||||||
|
|
||||||
"@mui/icons-material@^5.15.6":
|
|
||||||
version "5.15.6"
|
|
||||||
resolved "https://registry.yarnpkg.com/@mui/icons-material/-/icons-material-5.15.6.tgz#6958232bef48972fcbafd5f69e6079a9be5951f1"
|
|
||||||
integrity sha512-GnkxMtlhs+8ieHLmCytg00ew0vMOiXGFCw8Ra9nxMsBjBqnrOI5gmXqUm+sGggeEU/HG8HyeqC1MX/IxOBJHzA==
|
|
||||||
dependencies:
|
|
||||||
"@babel/runtime" "^7.23.8"
|
|
||||||
|
|
||||||
"@mui/material@^5.14.19":
|
"@mui/material@^5.14.19":
|
||||||
version "5.15.3"
|
version "5.15.3"
|
||||||
resolved "https://registry.yarnpkg.com/@mui/material/-/material-5.15.3.tgz#b77f1ac1275e5bf13b735e8224bdd301aab918c4"
|
resolved "https://registry.yarnpkg.com/@mui/material/-/material-5.15.3.tgz#b77f1ac1275e5bf13b735e8224bdd301aab918c4"
|
||||||
|
|
|
||||||
|
|
@ -1,108 +0,0 @@
|
||||||
package com.dbnt.kcscbackend.admin.standards;
|
|
||||||
|
|
||||||
import com.dbnt.kcscbackend.admin.standards.entity.TnApiKey;
|
|
||||||
import com.dbnt.kcscbackend.admin.standards.service.AdminApiService;
|
|
||||||
import com.dbnt.kcscbackend.auth.entity.LoginVO;
|
|
||||||
import com.dbnt.kcscbackend.config.common.BaseController;
|
|
||||||
import com.dbnt.kcscbackend.config.common.ResponseCode;
|
|
||||||
import com.dbnt.kcscbackend.config.common.ResultVO;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.security.core.annotation.AuthenticationPrincipal;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@RequestMapping("/admin/standards")
|
|
||||||
@Tag(name="AdminStandardsController", description = "사이트관리 건설기준관리 메뉴 컨트롤러")
|
|
||||||
public class AdminStandardsController extends BaseController {
|
|
||||||
|
|
||||||
private final AdminApiService adminApiService;
|
|
||||||
|
|
||||||
@Operation(
|
|
||||||
summary = "건설기준관리 - API 관리",
|
|
||||||
description = "API 관리",
|
|
||||||
tags = {"AdminStandardsController"}
|
|
||||||
)
|
|
||||||
@ApiResponses(value = {
|
|
||||||
@ApiResponse(responseCode = "200", description = "조회 성공"),
|
|
||||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
|
||||||
})
|
|
||||||
@RequestMapping(method = RequestMethod.POST, value = "/apikey", consumes = MediaType.APPLICATION_JSON_VALUE)
|
|
||||||
public ResultVO selectApiList(@RequestBody TnApiKey tnApiKey, @AuthenticationPrincipal LoginVO user)
|
|
||||||
throws Exception {
|
|
||||||
|
|
||||||
ResultVO resultVO = new ResultVO();
|
|
||||||
tnApiKey.setQueryInfo();
|
|
||||||
Map<String, Object> resultMap = adminApiService.selectApiList();
|
|
||||||
int totCnt = Integer.parseInt((String)resultMap.get("resultCnt"));
|
|
||||||
tnApiKey.setContentCnt(totCnt);
|
|
||||||
tnApiKey.setPaginationInfo();
|
|
||||||
resultMap.put("paginationInfo", tnApiKey);
|
|
||||||
|
|
||||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
|
||||||
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
|
|
||||||
resultVO.setResult(resultMap);
|
|
||||||
return resultVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(
|
|
||||||
summary = "API key 관리",
|
|
||||||
description = "API key 승인여부 수정",
|
|
||||||
tags = {"AdminStandardsController"}
|
|
||||||
)
|
|
||||||
@ApiResponses(value = {
|
|
||||||
@ApiResponse(responseCode = "200", description = "수정 성공"),
|
|
||||||
@ApiResponse(responseCode = "303", description = "만료된 토큰"),
|
|
||||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
|
||||||
})
|
|
||||||
@RequestMapping(method = RequestMethod.POST, value = "/apiupdate", consumes = MediaType.APPLICATION_JSON_VALUE)
|
|
||||||
public ResultVO modifyApi(@RequestBody TnApiKey tnApiKey, @AuthenticationPrincipal LoginVO user) throws Exception{
|
|
||||||
ResultVO resultVO = new ResultVO();
|
|
||||||
|
|
||||||
TnApiKey existingApiKey = adminApiService.getApiKeyById(tnApiKey.getUserId());
|
|
||||||
if (existingApiKey != null) {
|
|
||||||
existingApiKey.setIdntyYn(existingApiKey.getIdntyYn().equals("Y") ? "N" : "Y");
|
|
||||||
adminApiService.modifyApi(existingApiKey);
|
|
||||||
|
|
||||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
|
||||||
} else {
|
|
||||||
resultVO.setResultCode(ResponseCode.SAVE_ERROR.getCode()); // 존재하지 않는 user_id에 대한 처리
|
|
||||||
}
|
|
||||||
return resultVO;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(
|
|
||||||
summary = "API key Chart",
|
|
||||||
description = "API key 클릭시 차트",
|
|
||||||
tags = {"AdminStandardsController"}
|
|
||||||
)
|
|
||||||
@ApiResponses(value = {
|
|
||||||
@ApiResponse(responseCode = "200", description = "수정 성공"),
|
|
||||||
@ApiResponse(responseCode = "303", description = "만료된 토큰"),
|
|
||||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
|
||||||
})
|
|
||||||
@RequestMapping(method = RequestMethod.POST, value = "/apiDailyChart", consumes = MediaType.APPLICATION_JSON_VALUE)
|
|
||||||
public ResultVO ApiChart(@RequestBody Map<String, String> dateRange, @AuthenticationPrincipal LoginVO user) throws Exception{
|
|
||||||
ResultVO resultVO = new ResultVO();
|
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
|
||||||
|
|
||||||
String UserId = dateRange.get("userId");
|
|
||||||
|
|
||||||
resultMap.put("resultList", adminApiService.selectApiDailyCount(UserId));
|
|
||||||
resultVO.setResultCode(ResponseCode.SUCCESS.getCode());
|
|
||||||
resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage());
|
|
||||||
resultVO.setResult(resultMap);
|
|
||||||
return resultVO;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
package com.dbnt.kcscbackend.admin.standards.entity;
|
|
||||||
|
|
||||||
import com.dbnt.kcscbackend.config.common.BoardParams;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.Setter;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
import org.hibernate.annotations.DynamicInsert;
|
|
||||||
import org.hibernate.annotations.DynamicUpdate;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import javax.persistence.*;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@Entity
|
|
||||||
@NoArgsConstructor
|
|
||||||
@DynamicInsert
|
|
||||||
@DynamicUpdate
|
|
||||||
@Table(name = "tn_api_key")
|
|
||||||
public class TnApiKey extends BoardParams {
|
|
||||||
@Id
|
|
||||||
@Column(name = "user_id")
|
|
||||||
private String userId;
|
|
||||||
|
|
||||||
@Column(name = "api_key")
|
|
||||||
private String apiKey;
|
|
||||||
|
|
||||||
@Column(name = "idnty_yn")
|
|
||||||
private String idntyYn;
|
|
||||||
|
|
||||||
@Column(name = "start_dt")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
|
||||||
private LocalDate startDt;
|
|
||||||
|
|
||||||
@Column(name = "end_dt")
|
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
|
||||||
private LocalDate endDt;
|
|
||||||
}
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
package com.dbnt.kcscbackend.admin.standards.repository;
|
|
||||||
|
|
||||||
import com.dbnt.kcscbackend.admin.standards.entity.TnApiKey;
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
|
||||||
import org.springframework.data.jpa.repository.Query;
|
|
||||||
import org.springframework.data.repository.query.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface ApiKeyRepository extends JpaRepository<TnApiKey, String> {
|
|
||||||
List<TnApiKey> findAllByOrderByEndDtDesc();
|
|
||||||
|
|
||||||
@Query(value = "SELECT TO_CHAR(access_dt, 'YYYY-MM-DD') as log_dt, count(1) as log_cnt "
|
|
||||||
+ "FROM th_api_log "
|
|
||||||
+ "WHERE access_id = :UserId "
|
|
||||||
+ "GROUP BY TO_CHAR(access_dt, 'YYYY-MM-DD') "
|
|
||||||
+ "ORDER BY log_dt asc", nativeQuery = true)
|
|
||||||
List<Object[]> selectCountApiDaily(@Param("UserId") String UserId);
|
|
||||||
}
|
|
||||||
|
|
@ -1,47 +0,0 @@
|
||||||
package com.dbnt.kcscbackend.admin.standards.service;
|
|
||||||
|
|
||||||
import com.dbnt.kcscbackend.admin.standards.entity.TnApiKey;
|
|
||||||
import com.dbnt.kcscbackend.admin.standards.repository.ApiKeyRepository;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class AdminApiService extends EgovAbstractServiceImpl {
|
|
||||||
private final ApiKeyRepository apiKeyRepository;
|
|
||||||
|
|
||||||
public Map<String, Object> selectApiList() {
|
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
|
||||||
|
|
||||||
long totalRecordCount = apiKeyRepository.count(); // 전체 레코드 수 가져오기
|
|
||||||
List<TnApiKey> apiList = apiKeyRepository.findAllByOrderByEndDtDesc(); // 개인 정보 로그 리스트 가져오기
|
|
||||||
|
|
||||||
resultMap.put("resultCnt", String.valueOf(totalRecordCount)); // 개수를 resultMap에 추가
|
|
||||||
resultMap.put("resultList", apiList); // 결과를 resultMap에 추가
|
|
||||||
|
|
||||||
return resultMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
public TnApiKey getApiKeyById(String userId) { return apiKeyRepository.findById(userId).orElse(null); }
|
|
||||||
|
|
||||||
@Transactional
|
|
||||||
public String modifyApi(TnApiKey tnApiKey) {
|
|
||||||
try {
|
|
||||||
apiKeyRepository.save(tnApiKey);
|
|
||||||
return "API key updated successfully";
|
|
||||||
} catch (Exception e) {
|
|
||||||
return "Failed to update API key";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Object[]> selectApiDailyCount(String UserId) {
|
|
||||||
return apiKeyRepository.selectCountApiDaily(UserId);
|
|
||||||
} // 일자별 API 요청횟수
|
|
||||||
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue