Compare commits
4 Commits
3ff1ce7481
...
98d2da2e21
| Author | SHA1 | Date |
|---|---|---|
|
|
98d2da2e21 | |
|
|
c524e2b7d9 | |
|
|
847d0c619d | |
|
|
163d0ecd4f |
|
|
@ -0,0 +1,51 @@
|
|||
import * as React from 'react';
|
||||
import Button from '@mui/material/Button';
|
||||
|
||||
import Dialog from '@mui/material/Dialog';
|
||||
import DialogActions from '@mui/material/DialogActions';
|
||||
import DialogContent from '@mui/material/DialogContent';
|
||||
import DialogContentText from '@mui/material/DialogContentText';
|
||||
import DialogTitle from '@mui/material/DialogTitle';
|
||||
|
||||
export default function FormDialog( {open, setOpen, title, contentText, children} ) {
|
||||
|
||||
const handleClickOpen = () => {
|
||||
setOpen(true);
|
||||
};
|
||||
|
||||
const handleClose = () => {
|
||||
setOpen(false);
|
||||
};
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<Dialog
|
||||
open={open}
|
||||
onClose={handleClose}
|
||||
PaperProps={{
|
||||
component: 'form',
|
||||
onSubmit: (event) => {
|
||||
event.preventDefault();
|
||||
const formData = new FormData(event.currentTarget);
|
||||
const formJson = Object.fromEntries(formData.entries());
|
||||
const email = formJson.email;
|
||||
console.log(email);
|
||||
handleClose();
|
||||
},
|
||||
}}
|
||||
>
|
||||
<DialogTitle>{title}</DialogTitle>
|
||||
<DialogContent>
|
||||
<DialogContentText>
|
||||
{contentText}
|
||||
</DialogContentText>
|
||||
{children}
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={handleClose}>취소</Button>
|
||||
<Button type="submit">저장</Button>
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
import React from 'react';
|
||||
import { styled } from '@mui/material/styles';
|
||||
import Box from '@mui/material/Box';
|
||||
import Card from '@mui/material/Card';
|
||||
import { CardActionArea } from '@mui/material';
|
||||
import Paper from '@mui/material/Paper';
|
||||
import List from '@mui/material/List';
|
||||
import ListItem from '@mui/material/ListItem';
|
||||
|
|
@ -11,15 +12,28 @@ 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';
|
||||
import TextField from '@mui/material/TextField';
|
||||
|
||||
import FormDialog from '../../components/alert/FormDialog';
|
||||
|
||||
|
||||
function generate(items, element) {
|
||||
return items.map((value) =>
|
||||
|
||||
function generate(items, element, onClickListner) {
|
||||
return items.map((value, index) =>
|
||||
React.cloneElement(element, {
|
||||
key: value,
|
||||
}, <ListItemText
|
||||
},
|
||||
<Card fullWidth sx={{ '&': { boxShadow: 'none' } }}>
|
||||
<CardActionArea fullWidth sx={{ px: 1 }}>
|
||||
<ListItemText
|
||||
primary={value}
|
||||
/>),
|
||||
key={index}
|
||||
data-index={index}
|
||||
onClick={(e) => {onClickListner(e, index);}}
|
||||
paragraph
|
||||
/>
|
||||
</CardActionArea>
|
||||
</Card>),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -39,6 +53,19 @@ function ListCreateUpdateDelete(props) {
|
|||
|
||||
const [dense, setDense] = React.useState(false);
|
||||
|
||||
const [open, setOpen] = React.useState(false);
|
||||
|
||||
const handleClickOpen = () => {
|
||||
setOpen(true);
|
||||
};
|
||||
|
||||
const handleClose = () => {
|
||||
setOpen(false);
|
||||
};
|
||||
|
||||
const onClickItem = (e, index) => {
|
||||
props.setItemIndex(index);
|
||||
};
|
||||
return (
|
||||
<Paper>
|
||||
<Typography sx={{ p: 0 }} variant="h6" component="div">
|
||||
|
|
@ -48,7 +75,7 @@ function ListCreateUpdateDelete(props) {
|
|||
</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'}}>
|
||||
<IconButton aria-label="add" sx={{ px: 0, borderRadius: '0px', width: '100%', height: '56px'}} onClick={handleClickOpen}>
|
||||
<AddIcon sx={{ px: 0, '&': {color: '#ffffff', width: '30px', height: '30px' }}} />
|
||||
</IconButton>
|
||||
</Item>
|
||||
|
|
@ -72,9 +99,33 @@ function ListCreateUpdateDelete(props) {
|
|||
}
|
||||
>
|
||||
</ListItem>,
|
||||
onClickItem
|
||||
)}
|
||||
</List>
|
||||
</Demo>
|
||||
<FormDialog open={open} setOpen={setOpen} title="위원회 코드 등록" contentText="위원회 코드 항목을 입력해주세요." >
|
||||
<TextField
|
||||
autoFocus
|
||||
required
|
||||
margin="dense"
|
||||
id="insert-org-nm"
|
||||
name="insert-org-nm"
|
||||
label="명칭"
|
||||
type="text"
|
||||
fullWidth
|
||||
variant="standard"
|
||||
/>
|
||||
<TextField
|
||||
required
|
||||
margin="dense"
|
||||
id="insert-org-desc"
|
||||
name="insert-org-desc"
|
||||
label="위원회 설명"
|
||||
type="text"
|
||||
fullWidth
|
||||
variant="standard"
|
||||
/>
|
||||
</FormDialog>
|
||||
</Paper>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,66 @@
|
|||
import React, { useState, useEffect } from 'react';
|
||||
import { styled } from '@mui/material/styles';
|
||||
import Paper from '@mui/material/Paper';
|
||||
import List from '@mui/material/List';
|
||||
import ListItem from '@mui/material/ListItem';
|
||||
import Grid from '@mui/material/Grid';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import TextField from '@mui/material/TextField';
|
||||
|
||||
|
||||
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 ListLabelInputs(props) {
|
||||
|
||||
const [dense, setDense] = useState(false);
|
||||
|
||||
const [items, setItems] = useState(false);
|
||||
|
||||
useEffect(function () {
|
||||
setItems(props.items);
|
||||
console.log( props.items );
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [props]);
|
||||
|
||||
useEffect(function () {
|
||||
console.log( items );
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
|
||||
}, [items]);
|
||||
|
||||
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={10} >
|
||||
<Item sx={{ px: 0, '&': { boxShadow: 'none', color: '#ffffff', fontWeight: '600', fontSize: '18px', backgroundColor: 'transparent', lineHeight: '40px' }}}>{props.title}</Item>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Typography>
|
||||
<Demo>
|
||||
<List dense={dense}>
|
||||
{
|
||||
items &&
|
||||
Object.entries(items).map(([key, value], index) => (
|
||||
<ListItem key={index}>
|
||||
<TextField id="standard-basic" label={key} variant="standard" value={value ? value : ""} inputProps={{ readOnly: true, }} />
|
||||
</ListItem>
|
||||
))
|
||||
}
|
||||
</List>
|
||||
</Demo>
|
||||
</Paper>
|
||||
);
|
||||
}
|
||||
|
||||
export default ListLabelInputs;
|
||||
|
|
@ -29,25 +29,21 @@
|
|||
text-align: left;
|
||||
}
|
||||
.code_list .head >span:nth-child(5),.code_list .result .List_Codes >div:nth-child(5){
|
||||
width: 7%;
|
||||
width: 15%;
|
||||
}
|
||||
.code_list .head >span:nth-child(6),.code_list .result .List_Codes >div:nth-child(6){
|
||||
width: 7%;
|
||||
width: 15%;
|
||||
}
|
||||
.code_list .head > span:nth-child(7),.code_list .result .List_Codes >div:nth-child(7){
|
||||
width: 7%;
|
||||
}
|
||||
.code_list .head >span:nth-child(8),.code_list .result .List_Codes >div:nth-child(8){
|
||||
width: 8%;
|
||||
}
|
||||
.code_list .result .List_Codes >div:nth-child(1),
|
||||
.code_list .result .List_Codes >div:nth-child(2),
|
||||
.code_list .result .List_Codes >div:nth-child(3),
|
||||
.code_list .result .List_Codes >div:nth-child(4),
|
||||
.code_list .result .List_Codes >div:nth-child(5),
|
||||
.code_list .result .List_Codes >div:nth-child(6),
|
||||
.code_list .result .List_Codes >div:nth-child(7),
|
||||
.code_list .result .List_Codes >div:nth-child(8){
|
||||
.code_list .result .List_Codes >div:nth-child(7){
|
||||
font-size: 14px;
|
||||
}
|
||||
.codelistcontent{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import React from 'react';
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { styled } from '@mui/material/styles';
|
||||
import Box from '@mui/material/Box';
|
||||
|
|
@ -21,37 +21,61 @@ 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 ListLabelInputs from '../../../components/list/ListLabelInputs'
|
||||
|
||||
|
||||
import URL from 'constants/url';
|
||||
|
||||
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) {
|
||||
|
||||
const [dense, setDense] = React.useState(false);
|
||||
const [secondary, setSecondary] = React.useState(false);
|
||||
const [dense, setDense] = useState(false);
|
||||
const [secondary, setSecondary] = useState(false);
|
||||
|
||||
const [depth01List, setDepth01List] = useState(["중앙건설기술심의", "테스트2"]);
|
||||
const [depth02List, setDepth02List] = useState(["123", "테스트2"]);
|
||||
const [depth03List, setDepth03List] = useState(["다람쥐", "쳇바퀴"]);
|
||||
const [depth04List, setDepth04List] = useState(["임시 텍스트", "text"]);
|
||||
const [summaryArray, setSummaryArray] = useState({});
|
||||
|
||||
const [depth01SelectedIndex, setDepth01SelectedIndex] = React.useState();
|
||||
const [depth02SelectedIndex, setDepth02SelectedIndex] = React.useState();
|
||||
const [depth03SelectedIndex, setDepth03SelectedIndex] = React.useState();
|
||||
const [depth04SelectedIndex, setDepth04SelectedIndex] = React.useState();
|
||||
|
||||
useEffect(function () {
|
||||
setSummaryArray(
|
||||
{
|
||||
"중앙건설기술심의" : depth01List[depth01SelectedIndex],
|
||||
"총괄위원회" : depth02List[depth02SelectedIndex],
|
||||
"건설기준위원회" : depth03List[depth03SelectedIndex],
|
||||
"실무위원회" : depth04List[depth04SelectedIndex],
|
||||
}
|
||||
);
|
||||
console.log(`${depth01List[depth01SelectedIndex]}[${depth01SelectedIndex}]`);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [
|
||||
depth01List,
|
||||
depth02List,
|
||||
depth03List,
|
||||
depth04List,
|
||||
depth01SelectedIndex,
|
||||
depth02SelectedIndex,
|
||||
depth03SelectedIndex,
|
||||
depth04SelectedIndex]);
|
||||
|
||||
useEffect(function () {
|
||||
console.log( summaryArray );
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [summaryArray]);
|
||||
|
||||
|
||||
|
||||
const Location = React.memo(function Location() {
|
||||
return (
|
||||
|
|
@ -88,17 +112,31 @@ function CommitteeCodeMgt(props) {
|
|||
sx={{
|
||||
display: 'flex',
|
||||
flexWrap: 'wrap',
|
||||
justifyContent: 'space-between',
|
||||
'& > :not(style)': {
|
||||
m: 1,
|
||||
mt: 4,
|
||||
width: 245,
|
||||
},
|
||||
}}
|
||||
>
|
||||
<ListCreateUpdateDelete title="중앙건설기술심의" items={["중앙건설기술심의", "테스트2"]}/>
|
||||
<ListCreateUpdateDelete title="총괄위원회" items={[]}/>
|
||||
<ListCreateUpdateDelete title="건설기준위원회" items={[]}/>
|
||||
<ListCreateUpdateDelete title="실무위원회" items={[]}/>
|
||||
<ListCreateUpdateDelete title="중앙건설기술심의" items={depth01List} setItemIndex={setDepth01SelectedIndex}/>
|
||||
<ListCreateUpdateDelete title="총괄위원회" items={depth02List} setItemIndex={setDepth02SelectedIndex}/>
|
||||
<ListCreateUpdateDelete title="건설기준위원회" items={depth03List} setItemIndex={setDepth03SelectedIndex}/>
|
||||
<ListCreateUpdateDelete title="실무위원회" items={depth04List} setItemIndex={setDepth04SelectedIndex}/>
|
||||
</Box>
|
||||
<Box
|
||||
sx={{
|
||||
display: 'flex',
|
||||
flexWrap: 'wrap',
|
||||
'& > :not(style)': {
|
||||
mt: 4,
|
||||
width: 245,
|
||||
},
|
||||
}}
|
||||
>
|
||||
<ListLabelInputs title="위원회 코드정보" items={summaryArray} />
|
||||
</Box>
|
||||
|
||||
{/* <!--// 본문 --> */}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -5,47 +5,16 @@ import * as EgovNet from 'api/egovFetch';
|
|||
import URL from 'constants/url';
|
||||
import {StandardCodeListModal, StandardCodeListModalTable} from './StandardCodeListModal'
|
||||
import {AiFillFileMarkdown, AiFillStar} from "react-icons/ai";
|
||||
import StandardCodeSearchForm from "./StandardCodeSearchForm";
|
||||
|
||||
function StandardCodeList(props) {
|
||||
function StandardCodeList({}) {
|
||||
const {listCode} = useParams();
|
||||
const [show, setShow] = useState(false);
|
||||
const [groupSeq, setgroupSeq] = useState();
|
||||
|
||||
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 [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 [groupSeq, setGroupSeq] = useState();
|
||||
|
||||
/* 탭 */
|
||||
const [activeTab, setActiveTab] = useState(10);
|
||||
const [subTabsVisible, setSubTabsVisible] = useState(false);
|
||||
|
||||
const [show, setShow] = useState(false);
|
||||
function close() {
|
||||
setShow(false);
|
||||
}
|
||||
|
|
@ -89,74 +58,33 @@ function StandardCodeList(props) {
|
|||
)
|
||||
}
|
||||
|
||||
setgroupSeq(<StandardCodeListModalTable head={head} content={body}/>);
|
||||
setGroupSeq(<StandardCodeListModalTable head={head} content={body}/>);
|
||||
}
|
||||
)
|
||||
setShow(true);
|
||||
|
||||
}
|
||||
|
||||
|
||||
const handleTabClick = (tabName) => {
|
||||
setActiveTab(tabName);
|
||||
|
||||
const updatedCondition = {
|
||||
...searchCondition,
|
||||
tab: tabName,
|
||||
category1: '',
|
||||
category2: '',
|
||||
category3: '',
|
||||
searchWrd: '',
|
||||
};
|
||||
|
||||
setSearchCondition(updatedCondition);
|
||||
retrieveList(updatedCondition);
|
||||
|
||||
if ([40, 50, 60, 70, 80, 90].includes(tabName)) {
|
||||
setSubTabsVisible(true);
|
||||
} else {
|
||||
setSubTabsVisible(false);
|
||||
}
|
||||
};
|
||||
|
||||
const retrieveList = useCallback((searchCondition) => {
|
||||
console.groupCollapsed("StandardCodeList.retrieveList()");
|
||||
|
||||
const retrieveListURL = '/standardCode/selectStandardCodeList.do';
|
||||
const requestOptions = {
|
||||
method: "POST",
|
||||
if(searchCondition?.tab){
|
||||
EgovNet.requestFetch('/standardCode/standard-code-list'+EgovNet.convParams(searchCondition),
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
'Content-type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(searchCondition)
|
||||
}
|
||||
|
||||
EgovNet.requestFetch(retrieveListURL,
|
||||
requestOptions,
|
||||
},
|
||||
(resp) => {
|
||||
setMasterBoard(resp.result.tnDocumentInfo);
|
||||
/*검색을 위한 리스트 state에 저장*/
|
||||
setlistData(resp.result.resultList);
|
||||
setCategory1List(resp.result.category1List);
|
||||
setCategory2List(resp.result.category2List);
|
||||
setCategory3List(resp.result.category3List);
|
||||
setListData(resp.result.resultList);
|
||||
setResultCnt(resp.result.resultCnt);
|
||||
// 리스트 항목 구성
|
||||
},
|
||||
function (resp) {
|
||||
console.log("err response : ", resp);
|
||||
}
|
||||
);
|
||||
console.groupEnd("StandardCodeList.retrieveList()");
|
||||
}
|
||||
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
retrieveList(searchCondition);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
console.log("------------------------------StandardCodeList [End]");
|
||||
console.groupEnd("StandardCodeList");
|
||||
return (
|
||||
<div className="StandardCodeList container">
|
||||
<div className="c_wrap codelistcontent">
|
||||
|
|
@ -172,112 +100,10 @@ function StandardCodeList(props) {
|
|||
<div className="top_tit">
|
||||
<h2 className="tit_1">건설기준코드 검색</h2>
|
||||
</div>
|
||||
<div className="condition">
|
||||
<ul>
|
||||
<li className="third_1 L">
|
||||
<div className={`tab ${activeTab === 10 ? 'active' : ''}`} onClick={() => handleTabClick(10)}>설계기준</div>
|
||||
</li>
|
||||
<li className="third_1 L">
|
||||
<div className={`tab ${activeTab === 20 ? 'active' : ''}`} onClick={() => handleTabClick(20)}>표준시방서</div>
|
||||
</li>
|
||||
<li className="third_1 L">
|
||||
<div className={`tab ${[40, 50, 60, 70, 80, 90].includes(activeTab) ? 'active' : ''}`} onClick={() => handleTabClick(40)}>전문시방서</div>
|
||||
</li>
|
||||
<li className="third_1 L">
|
||||
<label className="f_select" htmlFor="sel1">
|
||||
<select id="sel1" title="조건" value={searchCondition.category1} ref={category1Ref}
|
||||
onChange={e => {
|
||||
const updatedCondition = {
|
||||
...searchCondition,
|
||||
category1: e.target.value,
|
||||
category2: '',
|
||||
category3: '',
|
||||
searchWrd: wrdRef.current.value,
|
||||
tab: activeTab
|
||||
};
|
||||
|
||||
setSearchCondition(updatedCondition);
|
||||
retrieveList(updatedCondition);
|
||||
}}
|
||||
>
|
||||
<option value="">전체</option>
|
||||
{category1List.map(category => (
|
||||
<option key={category.groupSeq} value={category.groupFullCd.substring(2, 4)}>{category.groupNm}</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
</li>
|
||||
<li className="third_1 L">
|
||||
<label className="f_select w_306" htmlFor="sel1">
|
||||
<select id="sel2" title="조건" value={searchCondition.category2} ref={category2Ref}
|
||||
onChange={e => {
|
||||
const updatedCondition = {
|
||||
...searchCondition,
|
||||
category1: category1Ref.current.value,
|
||||
category2: category2Ref.current.value,
|
||||
category3: '',
|
||||
searchWrd: wrdRef.current.value,
|
||||
tab: activeTab
|
||||
};
|
||||
|
||||
setSearchCondition(updatedCondition);
|
||||
retrieveList(updatedCondition);
|
||||
}}
|
||||
>
|
||||
<option value="">전체</option>
|
||||
{category2List.map(category => (
|
||||
<option key={category.groupSeq} value={category.groupFullCd.substring(4, 6)}>{category.groupNm}</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
</li>
|
||||
<li className="third_1 L">
|
||||
<label className="f_select w_306" htmlFor="sel1">
|
||||
<select id="sel3" title="조건" value={searchCondition.category3} ref={category3Ref}
|
||||
onChange={e => {
|
||||
const updatedCondition = {
|
||||
...searchCondition,
|
||||
category1: category1Ref.current.value,
|
||||
category2: category2Ref.current.value,
|
||||
category3: category3Ref.current.value,
|
||||
searchWrd: wrdRef.current.value,
|
||||
tab: activeTab
|
||||
};
|
||||
|
||||
setSearchCondition(updatedCondition);
|
||||
retrieveList(updatedCondition);
|
||||
}}
|
||||
>
|
||||
<option value="">전체</option>
|
||||
{category3List.map(category => (
|
||||
<option key={category.groupSeq} value={category.groupFullCd.substring(6, 8)}>{category.groupNm}</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
</li>
|
||||
<li className="third_1 L">
|
||||
<div className={`tab`}>통합 다운로드</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{/* <!--// 검색조건 --> */}
|
||||
{subTabsVisible && (
|
||||
<div className="right_col">
|
||||
<div className="mini_board">
|
||||
<ul>
|
||||
<div className={`tab ${activeTab === 40 ? 'active' : ''}`} onClick={() => handleTabClick(40)}>서울특별시</div>
|
||||
<div className={`tab ${activeTab === 50 ? 'active' : ''}`} onClick={() => handleTabClick(50)}>고속도로공사</div>
|
||||
<div className={`tab ${activeTab === 60 ? 'active' : ''}`} onClick={() => handleTabClick(60)}>한국농어촌공사</div>
|
||||
<div className={`tab ${activeTab === 70 ? 'active' : ''}`} onClick={() => handleTabClick(70)}>철도건설공사</div>
|
||||
<div className={`tab ${activeTab === 80 ? 'active' : ''}`} onClick={() => handleTabClick(80)}>LH한국토지주택공사</div>
|
||||
<div className={`tab ${activeTab === 90 ? 'active' : ''}`} onClick={() => handleTabClick(90)}>K-Water</div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<StandardCodeSearchForm param={listCode} reloadFunction={retrieveList}/>
|
||||
<div><span>전체 {resultCnt} 건</span></div>
|
||||
{/* <!-- 게시판목록 --> */}
|
||||
<div className="board_list BRD002 code_list">
|
||||
<div className="board_list code_list">
|
||||
<div className="head">
|
||||
<span>대분류</span>
|
||||
<span>중분류</span>
|
||||
|
|
@ -285,12 +111,9 @@ function StandardCodeList(props) {
|
|||
<span>코드명</span>
|
||||
<span>개정이력</span>
|
||||
<span>보기</span>
|
||||
<span>다운로드</span>
|
||||
<span>즐겨찾기</span>
|
||||
</div>
|
||||
<div className="result">
|
||||
|
||||
{/*검색기능 filterData가 없는경우 모든 데이터 출력*/}
|
||||
{listData.filter(item => {
|
||||
if (item.groupNm.includes(filterData)) {
|
||||
return item
|
||||
|
|
@ -305,24 +128,13 @@ function StandardCodeList(props) {
|
|||
<div className="groupNm">{item.groupNm}</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="viewer">{item.docFileGrpId == null ? null :
|
||||
<a href={"https://www.kcsc.re.kr/file/DownloadGrp/" + item.docFileGrpId}><AiFillFileMarkdown/></a>}</div>
|
||||
<div className="star"><AiFillStar/></div>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
{/* <!--// 게시판목록 --> */}
|
||||
|
||||
|
||||
{/* <!-- Paging --> */}
|
||||
|
||||
{/* <!--/ Paging --> */}
|
||||
<StandardCodeListModal size={"lg"} show={show} content={groupSeq} onClose={close} title={"개정이력"}/>
|
||||
|
||||
|
||||
{/* <!--// 본문 --> */}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,86 @@
|
|||
import React, {useEffect, useState} from "react";
|
||||
|
||||
function StandardCodeSearchForm({param, reloadFunction}){
|
||||
|
||||
const [searchCondition, setSearchCondition] = useState({
|
||||
pageIndex: 1,
|
||||
tab: Number(param?.substring(0, 2)),
|
||||
category1: param?.substring(2, 4),
|
||||
category2: param?.substring(4, 6),
|
||||
searchWrd: ''
|
||||
});
|
||||
const [subTabsVisible, setSubTabsVisible] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if(searchCondition.tab){
|
||||
if(searchCondition.tab !== 10 && searchCondition.tab !== 20){
|
||||
setSubTabsVisible(true)
|
||||
}else{
|
||||
setSubTabsVisible(false)
|
||||
}
|
||||
}
|
||||
reloadFunction(searchCondition)
|
||||
}, [searchCondition]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="condition">
|
||||
<ul>
|
||||
<li className="third_1 L">
|
||||
<div className={`tab ${searchCondition.tab === 10 ? 'active' : ''}`}
|
||||
onClick={() => {setSearchCondition({...searchCondition, tab: 10})}}>설계기준</div>
|
||||
</li>
|
||||
<li className="third_1 L">
|
||||
<div className={`tab ${searchCondition.tab === 20 ? 'active' : ''}`}
|
||||
onClick={() => {setSearchCondition({...searchCondition, tab: 20})}}>표준시방서</div>
|
||||
</li>
|
||||
<li className="third_1 L">
|
||||
<div className={`tab ${[40, 50, 60, 70, 80, 90].includes(searchCondition.tab) ? 'active' : ''}`}
|
||||
onClick={() => {setSearchCondition({...searchCondition, tab: 40})}}>전문시방서</div>
|
||||
</li>
|
||||
<li className="third_1 L">
|
||||
<label className="f_select" htmlFor="sel1">
|
||||
<select id="sel1" title="조건" value={searchCondition.category1}>
|
||||
<option value="">전체</option>
|
||||
|
||||
</select>
|
||||
</label>
|
||||
</li>
|
||||
<li className="third_1 L">
|
||||
<label className="f_select w_306" htmlFor="sel1">
|
||||
<select id="sel2" title="조건" value={searchCondition.category2}>
|
||||
<option value="">전체</option>
|
||||
</select>
|
||||
</label>
|
||||
</li>
|
||||
<li className="third_1 L">
|
||||
<label className="f_select w_306" htmlFor="sel1">
|
||||
<select id="sel3" title="조건" value={searchCondition.category3} >
|
||||
<option value="">전체</option>
|
||||
</select>
|
||||
</label>
|
||||
</li>
|
||||
<li className="third_1 L">
|
||||
<div className={`tab`}>통합 다운로드</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{subTabsVisible && (
|
||||
<div className="right_col">
|
||||
<div className="mini_board">
|
||||
<ul>
|
||||
<div className={`tab ${searchCondition.tab === 40 ? 'active' : ''}`} onClick={() => {setSearchCondition({...searchCondition, tab: 40})}}>서울특별시</div>
|
||||
<div className={`tab ${searchCondition.tab === 50 ? 'active' : ''}`} onClick={() => {setSearchCondition({...searchCondition, tab: 50})}}>고속도로공사</div>
|
||||
<div className={`tab ${searchCondition.tab === 60 ? 'active' : ''}`} onClick={() => {setSearchCondition({...searchCondition, tab: 60})}}>한국농어촌공사</div>
|
||||
<div className={`tab ${searchCondition.tab === 70 ? 'active' : ''}`} onClick={() => {setSearchCondition({...searchCondition, tab: 70})}}>철도건설공사</div>
|
||||
<div className={`tab ${searchCondition.tab === 80 ? 'active' : ''}`} onClick={() => {setSearchCondition({...searchCondition, tab: 80})}}>LH한국토지주택공사</div>
|
||||
<div className={`tab ${searchCondition.tab === 90 ? 'active' : ''}`} onClick={() => {setSearchCondition({...searchCondition, tab: 90})}}>K-Water</div>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default StandardCodeSearchForm;
|
||||
|
|
@ -145,35 +145,20 @@ public class StandardCodeController extends BaseController {
|
|||
@ApiResponse(responseCode = "200", description = "조회 성공"),
|
||||
@ApiResponse(responseCode = "403", description = "인가된 사용자가 아님")
|
||||
})
|
||||
@PostMapping(value = "/selectStandardCodeList.do", consumes = MediaType.APPLICATION_JSON_VALUE)
|
||||
public ResultVO selectStandardCodeList(@RequestBody TnDocumentInfo tnDocumentInfo, @AuthenticationPrincipal LoginVO user)
|
||||
@GetMapping(value = "/standard-code-list")
|
||||
public ResultVO selectStandardCodeList(TnDocumentInfo tnDocumentInfo, @AuthenticationPrincipal LoginVO user)
|
||||
throws Exception {
|
||||
ResultVO resultVO = new ResultVO();
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
|
||||
PaginationInfo paginationInfo = new PaginationInfo();
|
||||
paginationInfo.setCurrentPageNo(tnDocumentInfo.getPageIndex());
|
||||
paginationInfo.setRecordCountPerPage(propertyService.getInt("Globals.pageUnit"));
|
||||
paginationInfo.setPageSize(propertyService.getInt("Globals.pageSize"));
|
||||
resultMap.put("paginationInfo", paginationInfo);
|
||||
|
||||
String tab = tnDocumentInfo.getTab() != null ? tnDocumentInfo.getTab() : "";
|
||||
String category1 = tnDocumentInfo.getCategory1() != null ? tnDocumentInfo.getCategory1() : "";
|
||||
String category2 = tnDocumentInfo.getCategory2() != null ? tnDocumentInfo.getCategory2() : "";
|
||||
String category3 = tnDocumentInfo.getCategory3() != null ? tnDocumentInfo.getCategory3() : "";
|
||||
|
||||
System.out.println("@@@ tab : " + tab);
|
||||
System.out.println("@@@ category1 : " + category1);
|
||||
System.out.println("@@@ category2 : " + category2);
|
||||
System.out.println("@@@ category3 : " + category3);
|
||||
System.out.println("@@@ searchWrd : " + tnDocumentInfo.getSearchWrd());
|
||||
|
||||
Integer categorySeq1 = standardCodeService.selectStandardCodeGroupSeq(tab);
|
||||
Integer categorySeq2 = standardCodeService.selectStandardCodeGroupSeq(tab + category1);
|
||||
Integer categorySeq3 = standardCodeService.selectStandardCodeGroupSeq(tab + category1 + category2);
|
||||
System.out.println("@@@ categorySeq1 : " + categorySeq1);
|
||||
System.out.println("@@@ categorySeq2 : " + categorySeq2);
|
||||
System.out.println("@@@ categorySeq3 : " + categorySeq3);
|
||||
resultMap.put("category1List", standardCodeService.selectStandardCodeCategoryList(categorySeq1));
|
||||
resultMap.put("category2List", standardCodeService.selectStandardCodeCategoryList(categorySeq2));
|
||||
resultMap.put("category3List", standardCodeService.selectStandardCodeCategoryList(categorySeq3));
|
||||
|
|
@ -182,7 +167,7 @@ public class StandardCodeController extends BaseController {
|
|||
List<TnDocumentCodeList> tnDocumentCodeList = standardCodeService.selectStandardCodeList(tnDocumentInfo);
|
||||
resultMap.put("resultList", tnDocumentCodeList);
|
||||
Integer totCnt = tnDocumentCodeList.get(0).getContentcount();
|
||||
System.out.println("@@@ resultCnt : " + totCnt);
|
||||
|
||||
resultMap.put("resultCnt", totCnt);
|
||||
resultMap.put("user", user);
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import org.hibernate.annotations.DynamicUpdate;
|
|||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Transient;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
|
|
@ -37,4 +38,5 @@ public class TnDocumentCodeList {
|
|||
private String parentGroupSeq;
|
||||
@Column(name = "group_full_cd")
|
||||
private String groupFullCd;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -87,22 +87,6 @@ public class TnDocumentInfo {
|
|||
@Column(name = "old_seq")
|
||||
private Integer oldSeq;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "현재페이지")
|
||||
private int pageIndex = 1;
|
||||
@Schema(description = "페이지갯수")
|
||||
private int pageUnit = 10;
|
||||
@Schema(description = "페이지사이즈")
|
||||
private int pageSize = 10;
|
||||
@Schema(description = "첫페이지 인덱스")
|
||||
private int firstIndex = 1;
|
||||
@Schema(description = "마지막페이지 인덱스")
|
||||
private int lastIndex = 1;
|
||||
@Schema(description = "페이지당 레코드 개수")
|
||||
private int recordCountPerPage = 100;
|
||||
@Schema(description = "레코드 번호")
|
||||
private int rowNo = 0;
|
||||
@Transient
|
||||
private String listCode;
|
||||
@Transient
|
||||
|
|
|
|||
|
|
@ -43,7 +43,9 @@ public class StandardCodeService extends EgovAbstractServiceImpl {
|
|||
return tnDocumentInfoRepository.spGetTnDocumentInfoByGroupCd(param.getDocCode());
|
||||
}
|
||||
|
||||
public List<TnDocumentCodeList> selectStandardCodeList(TnDocumentInfo tnDocumentInfo){ return standardCodeMapper.selectStandardCodeList(tnDocumentInfo); }
|
||||
public List<TnDocumentCodeList> selectStandardCodeList(TnDocumentInfo tnDocumentInfo){
|
||||
return standardCodeMapper.selectStandardCodeList(tnDocumentInfo);
|
||||
}
|
||||
|
||||
public Integer selectStandardCodeListCnt(TnDocumentInfo tnDocumentInfo) {
|
||||
return standardCodeMapper.selectStandardCodeListCnt(tnDocumentInfo);
|
||||
|
|
|
|||
Loading…
Reference in New Issue