Compare commits
No commits in common. "98d2da2e2117a528ec1fe89254b4a2f9fdeeca98" and "847d0c619d4203d186612ea4a631cee341120bcc" have entirely different histories.
98d2da2e21
...
847d0c619d
|
|
@ -1,51 +0,0 @@
|
||||||
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,7 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { styled } from '@mui/material/styles';
|
import { styled } from '@mui/material/styles';
|
||||||
import Card from '@mui/material/Card';
|
import Box from '@mui/material/Box';
|
||||||
import { CardActionArea } from '@mui/material';
|
|
||||||
import Paper from '@mui/material/Paper';
|
import Paper from '@mui/material/Paper';
|
||||||
import List from '@mui/material/List';
|
import List from '@mui/material/List';
|
||||||
import ListItem from '@mui/material/ListItem';
|
import ListItem from '@mui/material/ListItem';
|
||||||
|
|
@ -12,28 +11,15 @@ import Grid from '@mui/material/Grid';
|
||||||
import Typography from '@mui/material/Typography';
|
import Typography from '@mui/material/Typography';
|
||||||
import DeleteIcon from '@mui/icons-material/Delete';
|
import DeleteIcon from '@mui/icons-material/Delete';
|
||||||
import AddIcon from '@mui/icons-material/Add';
|
import AddIcon from '@mui/icons-material/Add';
|
||||||
import TextField from '@mui/material/TextField';
|
|
||||||
|
|
||||||
import FormDialog from '../../components/alert/FormDialog';
|
|
||||||
|
|
||||||
|
|
||||||
|
function generate(items, element) {
|
||||||
function generate(items, element, onClickListner) {
|
return items.map((value) =>
|
||||||
return items.map((value, index) =>
|
|
||||||
React.cloneElement(element, {
|
React.cloneElement(element, {
|
||||||
key: value,
|
key: value,
|
||||||
},
|
}, <ListItemText
|
||||||
<Card fullWidth sx={{ '&': { boxShadow: 'none' } }}>
|
primary={value}
|
||||||
<CardActionArea fullWidth sx={{ px: 1 }}>
|
/>),
|
||||||
<ListItemText
|
|
||||||
primary={value}
|
|
||||||
key={index}
|
|
||||||
data-index={index}
|
|
||||||
onClick={(e) => {onClickListner(e, index);}}
|
|
||||||
paragraph
|
|
||||||
/>
|
|
||||||
</CardActionArea>
|
|
||||||
</Card>),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -53,19 +39,6 @@ function ListCreateUpdateDelete(props) {
|
||||||
|
|
||||||
const [dense, setDense] = React.useState(false);
|
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 (
|
return (
|
||||||
<Paper>
|
<Paper>
|
||||||
<Typography sx={{ p: 0 }} variant="h6" component="div">
|
<Typography sx={{ p: 0 }} variant="h6" component="div">
|
||||||
|
|
@ -75,7 +48,7 @@ function ListCreateUpdateDelete(props) {
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={0} md={2} sx={{ pl: 0, '&': {backgroundColor: 'transparent' }}}>
|
<Grid item xs={0} md={2} sx={{ pl: 0, '&': {backgroundColor: 'transparent' }}}>
|
||||||
<Item sx={{ p: 0, '&': { boxShadow: 'none', backgroundColor: '#169bd5', borderRadius: '0px'} }}>
|
<Item sx={{ p: 0, '&': { boxShadow: 'none', backgroundColor: '#169bd5', borderRadius: '0px'} }}>
|
||||||
<IconButton aria-label="add" sx={{ px: 0, borderRadius: '0px', width: '100%', height: '56px'}} onClick={handleClickOpen}>
|
<IconButton aria-label="add" sx={{ px: 0, borderRadius: '0px', width: '100%', height: '56px'}}>
|
||||||
<AddIcon sx={{ px: 0, '&': {color: '#ffffff', width: '30px', height: '30px' }}} />
|
<AddIcon sx={{ px: 0, '&': {color: '#ffffff', width: '30px', height: '30px' }}} />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</Item>
|
</Item>
|
||||||
|
|
@ -99,33 +72,9 @@ function ListCreateUpdateDelete(props) {
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
</ListItem>,
|
</ListItem>,
|
||||||
onClickItem
|
|
||||||
)}
|
)}
|
||||||
</List>
|
</List>
|
||||||
</Demo>
|
</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>
|
</Paper>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,66 +0,0 @@
|
||||||
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;
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import React, { useState, useEffect } 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 { styled } from '@mui/material/styles';
|
||||||
import Box from '@mui/material/Box';
|
import Box from '@mui/material/Box';
|
||||||
|
|
@ -21,61 +21,37 @@ import DeleteIcon from '@mui/icons-material/Delete';
|
||||||
import AddIcon from '@mui/icons-material/Add';
|
import AddIcon from '@mui/icons-material/Add';
|
||||||
import AddBoxOutlinedIcon from '@mui/icons-material/AddBoxOutlined';
|
import AddBoxOutlinedIcon from '@mui/icons-material/AddBoxOutlined';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import ListCreateUpdateDelete from '../../../components/list/ListCreateUpdateDelete'
|
import ListCreateUpdateDelete from '../../../components/list/ListCreateUpdateDelete'
|
||||||
import ListLabelInputs from '../../../components/list/ListLabelInputs'
|
|
||||||
|
|
||||||
|
|
||||||
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] = useState(false);
|
const [dense, setDense] = React.useState(false);
|
||||||
const [secondary, setSecondary] = useState(false);
|
const [secondary, setSecondary] = React.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() {
|
const Location = React.memo(function Location() {
|
||||||
return (
|
return (
|
||||||
|
|
@ -112,31 +88,17 @@ function CommitteeCodeMgt(props) {
|
||||||
sx={{
|
sx={{
|
||||||
display: 'flex',
|
display: 'flex',
|
||||||
flexWrap: 'wrap',
|
flexWrap: 'wrap',
|
||||||
justifyContent: 'space-between',
|
|
||||||
'& > :not(style)': {
|
'& > :not(style)': {
|
||||||
mt: 4,
|
m: 1,
|
||||||
width: 245,
|
width: 245,
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ListCreateUpdateDelete title="중앙건설기술심의" items={depth01List} setItemIndex={setDepth01SelectedIndex}/>
|
<ListCreateUpdateDelete title="중앙건설기술심의" items={["중앙건설기술심의", "테스트2"]}/>
|
||||||
<ListCreateUpdateDelete title="총괄위원회" items={depth02List} setItemIndex={setDepth02SelectedIndex}/>
|
<ListCreateUpdateDelete title="총괄위원회" items={[]}/>
|
||||||
<ListCreateUpdateDelete title="건설기준위원회" items={depth03List} setItemIndex={setDepth03SelectedIndex}/>
|
<ListCreateUpdateDelete title="건설기준위원회" items={[]}/>
|
||||||
<ListCreateUpdateDelete title="실무위원회" items={depth04List} setItemIndex={setDepth04SelectedIndex}/>
|
<ListCreateUpdateDelete title="실무위원회" items={[]}/>
|
||||||
</Box>
|
</Box>
|
||||||
<Box
|
|
||||||
sx={{
|
|
||||||
display: 'flex',
|
|
||||||
flexWrap: 'wrap',
|
|
||||||
'& > :not(style)': {
|
|
||||||
mt: 4,
|
|
||||||
width: 245,
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<ListLabelInputs title="위원회 코드정보" items={summaryArray} />
|
|
||||||
</Box>
|
|
||||||
|
|
||||||
{/* <!--// 본문 --> */}
|
{/* <!--// 본문 --> */}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue