feat: '진행현황 관리' 페이지에서 등록 또는 수정 시 '기준코드' 목록 불러오는 API연동 - front-end

thkim
thkim 2024-06-13 17:16:06 +09:00
parent baff901cee
commit 6be91489cf
3 changed files with 51 additions and 172 deletions

View File

@ -30,6 +30,9 @@ const useStyles = makeStyles(() => ({
}));
const StyledDiv = styled.div`
margin-bottom: 100px;
.f_select.w_250 {
@media only screen and (max-width: 768px) {
width: 100%;
@ -48,6 +51,13 @@ const StyledDiv = styled.div`
margin: 0px;
}
}
.right_col {
position: absolute;
right: 0px;
top: 0px;
text-align: right;
}
`;

View File

@ -9,174 +9,11 @@ import Paper from '@mui/material/Paper';
import ListSubheader from '@mui/material/ListSubheader';
import * as EgovNet from 'api/egovFetch';
import ReferenceCodePopupDialogCotentsHeader from './ReferenceCodePopupDialogCotentsHeader';
import ReferenceCodePopupDialogCotentsListItem from './ReferenceCodePopupDialogCotentsListItem';
const data = [
{
codeTitle: "KDS 10 00 00",
codeName: '설계기준',
depth: 1,
children: [
{
codeTitle: "KDS 10 10 00",
codeName: '공통편',
depth: 2,
children: [
{
codeTitle: "KDS 10 10 00",
codeName: '공통편',
depth: 3,
children: [
{
codeTitle: "KDS 10 00 00",
codeName: '공통 설계기준',
depth: 4,
children: [
]
},
{
codeTitle: "KDS 10 20 00",
codeName: '지반 설계 기준',
depth: 4,
children: [
]
},
{
codeTitle: "KDS 12 00 00",
codeName: '건설측량 설계기준',
depth: 4,
children: [
]
},
{
codeTitle: "KDS 14 00 00",
codeName: '구조 설계기준',
depth: 4,
children: [
]
},
{
codeTitle: "KDS 17 00 00",
codeName: '내진 설계기준',
depth: 4,
children: [
]
},
]
},
{
codeTitle: "KDS 10 20 00",
codeName: '시설물편',
depth: 3,
children: [
{
codeTitle: "TEST 17 00 00",
codeName: 'test',
depth: 4,
children: [
]
},
{
codeTitle: "TEST 17 00 00",
codeName: 'test',
depth: 4,
children: [
]
},
{
codeTitle: "TEST 17 00 00",
codeName: 'test',
depth: 4,
children: [
]
},
{
codeTitle: "TEST 17 00 00",
codeName: 'test',
depth: 4,
children: [
]
},
{
codeTitle: "TEST 17 00 00",
codeName: 'test',
depth: 4,
children: [
]
},
{
codeTitle: "TEST 17 00 00",
codeName: 'test',
depth: 4,
children: [
]
},
{
codeTitle: "TEST 17 00 00",
codeName: 'test',
depth: 4,
children: [
]
},
{
codeTitle: "TEST 17 00 00",
codeName: 'test',
depth: 4,
children: [
]
},
{
codeTitle: "TEST 17 00 00",
codeName: 'test',
depth: 4,
children: [
]
},
{
codeTitle: "TEST 17 00 00",
codeName: 'test',
depth: 4,
children: [
]
},
{
codeTitle: "TEST 17 00 00",
codeName: 'test',
depth: 4,
children: [
]
},
{
codeTitle: "TEST 17 00 00",
codeName: 'test',
depth: 4,
children: [
]
},
]
},
]
},
{
codeTitle: "KDS 10 20 00",
codeName: '시설물편',
depth: 2,
children: [
]
},
]
},
{ codeTitle: "KCS 20 00 00", codeName: '표준시방서', depth: 1, },
{ codeTitle: "SMCS 40 00 00", codeName: '서울시 전문시방서', depth: 1, },
{ codeTitle: "EXCS 50 00 00", codeName: '고속도로공사 전문시방서', depth: 1, },
{ codeTitle: "KRCCS 60 00 00", codeName: '농업생산기반시설 전문시방서', depth: 1, },
];
const FireNav = styled(List)({
'& .MuiListItemButton-root': {
paddingLeft: 0,
@ -194,12 +31,37 @@ const FireNav = styled(List)({
export default function ReferenceCodePopupDialogCotents() {
const [selectedValue, setSelectedValue] = React.useState('a');
const [StandardCodeList, setSelectedValue] = React.useState(null);
const [standardCodeList, setStandardCodeList] = React.useState(null);
const handleChange = (event) => {
setSelectedValue(event.target.value);
};
React.useEffect(function () {
getStandardCodeList();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const requestOptions = {
method: "GET",
headers: {
'Content-type': 'application/json'
}
}
const getStandardCodeList = () => {
EgovNet.requestFetch(`/admin/committee/progress-status/standard-code-api/list`,
requestOptions,
function (resp) {
console.log('%o', resp);
setStandardCodeList(resp.result.items);
}
);
}
return (
@ -260,7 +122,7 @@ export default function ReferenceCodePopupDialogCotents() {
}
>
<ReferenceCodePopupDialogCotentsListItem
data={data}
data={standardCodeList}
/>
</List>

View File

@ -59,10 +59,10 @@ const ItemComponent = (props) => {
}}
>
<Item
sx={{paddingLeft: `${Number(Number(item.depth)-1) * 20}px`,}}
sx={{paddingLeft: `${Number(Number(item.docLevel)-1) * 20}px`,}}
>
{
item.children && item.children.length > 0
item.children && 0 < item.children.length
?
<span>
{
@ -76,11 +76,17 @@ const ItemComponent = (props) => {
:
<span> <InsertDriveFileOutlinedIcon sx={{ color: '#777777', height: '30px;'}} /> </span>
}
&nbsp;{item.codeTitle}
&nbsp;{item.groupTitle}
</Item>
<Item>{item.codeName}</Item>
<Item>{item.groupNm}</Item>
<Item sx={{textAlign: 'center'}}>
<button type="button" class="btn btn_blue_h31 px-1">선택</button>
{
item.children && 0 < item.children.length
?
<span>-</span>
:
<button type="button" class="btn btn_blue_h31 px-1">선택</button>
}
</Item>
</Box>
</ListItemButton>
@ -88,6 +94,7 @@ const ItemComponent = (props) => {
{
item.children &&
item.children.map(function(item, index) {
console.log('thkim 2024-03-21 11:29 %o', item);
return (
<ItemComponent item={item} index={index} openSelf={open} />
);