feat: 심의등록 저장 반영

main
minuk926 3 years ago
parent 5f42b45a85
commit e5de6c5462

@ -1,9 +1,9 @@
import GridModal from '../../form/Modal/GridModal'; import CmmModal from '../../form/Modal/CmmModal';
import Board from '../board/Board'; import Board from '../board/Board';
const ModalDetails = () => ( const ModalDetails = () => (
<GridModal> <>
<Board /> <Board />
</GridModal> </>
); );
export default ModalDetails; export default ModalDetails;

@ -32,6 +32,9 @@ import { useTheme } from '@mui/material/styles';
import opstBizService from '../../../apis/OpstBizService'; import opstBizService from '../../../apis/OpstBizService';
import xitCmm from '../../../commons/XitCmm'; import xitCmm from '../../../commons/XitCmm';
import CmmModal from '../../form/Modal/CmmModal';
import * as React from 'react';
import SaveParkingSimsaForm from './SaveParkingSimsaForm';
const ParkingRegister = () => { const ParkingRegister = () => {
const theme = useTheme(); const theme = useTheme();
@ -46,6 +49,7 @@ const ParkingRegister = () => {
pageSize: 100, pageSize: 100,
rows: [] rows: []
}); });
const [open, setOpen] = React.useState(false);
const columns = [ const columns = [
{ headerName: 'No', headerAlign: 'center', field: 'rowId', align: 'center', width: 70 }, { headerName: 'No', headerAlign: 'center', field: 'rowId', align: 'center', width: 70 },
@ -79,7 +83,8 @@ const ParkingRegister = () => {
} else { } else {
const selectRows = selection.map((d) => rowsStatus.rows[d - 1].rcSeq); const selectRows = selection.map((d) => rowsStatus.rows[d - 1].rcSeq);
alert(`저장할 데이타 => ${selectRows}`); setOpen(true);
// alert(` => ${selectRows}`);
} }
}; };
@ -135,13 +140,12 @@ const ParkingRegister = () => {
/> />
&nbsp;-&nbsp; &nbsp;-&nbsp;
<OutlinedInput <OutlinedInput
required
value={rcSeq2} value={rcSeq2}
onChange={(e) => setRcSeq2(e.target.value)} onChange={(e) => setRcSeq2(e.target.value)}
placeholder="접수번호(10자리)-end" placeholder="접수번호(10자리)-end"
onKeyDown={handleOnKeyDown} onKeyDown={handleOnKeyDown}
size="small" size="small"
inputProps={{ maxLength: 10 }} inputProps={{ required: true, maxLength: 10 }}
/> />
{/* <TextField fullWidth label="Last Name" defaultValue="Schorl" /> */} {/* <TextField fullWidth label="Last Name" defaultValue="Schorl" /> */}
</Grid> </Grid>
@ -173,6 +177,9 @@ const ParkingRegister = () => {
setRowsStatus={setRowsStatus} setRowsStatus={setRowsStatus}
handleSelection={handleSelection} handleSelection={handleSelection}
/> />
<CmmModal isBackdrop title="심의등록" open={open} setOpen={setOpen} callback={() => alert('~~~~')}>
<SaveParkingSimsaForm />
</CmmModal>
</MainCard> </MainCard>
); );
}; };

@ -6,7 +6,7 @@ import getYear from 'date-fns/getYear';
// material-ui // material-ui
import { GridActionsCellItem } from '@mui/x-data-grid'; import { GridActionsCellItem } from '@mui/x-data-grid';
import { Button, Divider, Fade, Grid, InputAdornment, Link, MenuItem, OutlinedInput, Select } from '@mui/material'; import { Autocomplete, Button, Divider, Fade, Grid, InputAdornment, Link, MenuItem, OutlinedInput, Select, TextField } from '@mui/material';
import DeleteIcon from '@mui/icons-material/Delete'; import DeleteIcon from '@mui/icons-material/Delete';
import MuiTooltip from '@mui/material/Tooltip'; import MuiTooltip from '@mui/material/Tooltip';
@ -30,7 +30,7 @@ import Box from '@mui/material/Box';
import Typography from '@mui/material/Typography'; import Typography from '@mui/material/Typography';
import * as React from 'react'; import * as React from 'react';
import Board from '../board/Board'; import Board from '../board/Board';
import GridModal from '../../form/Modal/GridModal'; import SubCard from '../../../ui-component/cards/SubCard';
const style = { const style = {
position: 'absolute', position: 'absolute',
@ -176,24 +176,10 @@ const ParkingReview = () => {
return ( return (
<MainCard> <MainCard>
{/*
<Button onClick={handleOpen}>open</Button>
<Modal open={open} onClose={handleClose} aria-labelledby="modal-modal-title" aria-describedby="modal-modal-description">
<Box sx={style}>
<Typography id="modal-modal-title" variant="h2" component="h2">
Text in a modal
</Typography>
{children}
<Button onClick={handleClose}>Close Modal</Button>
</Box>
</Modal>
*/}
<Grid container spacing={2} alignItems="center"> <Grid container spacing={2} alignItems="center">
<Grid item xs={12} lg={6}> <Grid item xs={12}>
<Grid container spacing={1}> <Grid container spacing={1}>
<Grid item> <Grid item xs={2}>
<MuiTooltip title="의견진술 심의 년도"> <MuiTooltip title="의견진술 심의 년도">
<Select id="reviewYear" name="reviewYear" defaultValue={year} onChange={(e) => setSelectedYear(e.target.value)}> <Select id="reviewYear" name="reviewYear" defaultValue={year} onChange={(e) => setSelectedYear(e.target.value)}>
{years.map((year, idx) => ( {years.map((year, idx) => (
@ -203,12 +189,23 @@ const ParkingReview = () => {
))} ))}
</Select> </Select>
</MuiTooltip> </MuiTooltip>
{/* <Autocomplete */}
{/* disableClearable */}
{/* value={year} */}
{/* onChange={(event, newValue) => newValue && setSelectedYear(newValue)} */}
{/* // id="controllable-states-demo" */}
{/* options={years} */}
{/* renderInput={(params) => <TextField {...params} label="의견진술심의년도" />} */}
{/* /> */}
</Grid> </Grid>
<Grid item> <Grid item>
<OutlinedInput <OutlinedInput
required
placeholder="심의차수" placeholder="심의차수"
onKeyDown={handleSearch} onKeyDown={handleSearch}
size="small" size="small"
autoComplete
autoFocus autoFocus
endAdornment={ endAdornment={
<InputAdornment position="end"> <InputAdornment position="end">

@ -0,0 +1,63 @@
import React, { useState } from 'react';
import { Checkbox, FormControlLabel, Grid, Typography, TextField } from '@mui/material';
import AdapterDateFns from '@mui/lab/AdapterDateFns';
import LocalizationProvider from '@mui/lab/LocalizationProvider';
import { DatePicker, TimePicker } from '@mui/lab';
const SaveParkingSimsaForm = () => {
const [sDate, setSdate] = useState(new Date());
const [sTime, setStime] = useState(new Date());
return (
<>
<Grid container spacing={3}>
<Grid item xs={12} sm={6}>
<TextField required id="msuTeam" name="msuTeam" label="팀" fullWidth autoComplete="given-name" />
</Grid>
<Grid item xs={12} sm={6}>
<TextField required id="msChasu" name="msChasu" label="차수" fullWidth autoComplete="family-name" />
</Grid>
<Grid item xs={12}>
<TextField required id="msSdate" name="msSdate" label="심사시작일" fullWidth autoComplete="shipping address-line1" />
<LocalizationProvider dateAdapter={AdapterDateFns}>
<DatePicker
renderInput={(props) => <TextField fullWidth {...props} helperText="" />}
label="심의시작일"
value={sDate}
inputFormat="yyyy-MM-dd"
mask="____-__-__"
onChange={(newValue) => {
setSdate(newValue);
}}
/>
</LocalizationProvider>
</Grid>
<Grid item xs={12}>
<TextField required id="msStartsi" name="msStartsi" label="심사시작시간" fullWidth autoComplete="shipping address-line2" />
<LocalizationProvider dateAdapter={AdapterDateFns}>
<TimePicker
renderInput={(props) => <TextField fullWidth {...props} helperText="" />}
label="심사시작시간"
value={sTime}
inputFormat="HH"
mask="__"
onChange={(newValue) => {
setStime(newValue);
}}
/>
</LocalizationProvider>
</Grid>
<Grid item xs={12} sm={6}>
<TextField required id="msEdate" name="msEdate" label="심사종료일" fullWidth autoComplete="shipping address-level2" />
</Grid>
<Grid item xs={12} sm={6}>
<TextField id="msCdate" name="msCdate" label="심사마감일" fullWidth />
</Grid>
<Grid item xs={12} sm={6}>
<TextField required id="msClosesi" name="msClosesi" label="심사마감시간" fullWidth autoComplete="shipping postal-code" />
</Grid>
</Grid>
</>
);
};
export default SaveParkingSimsaForm;

@ -0,0 +1,59 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import Box from '@mui/material/Box';
import Button from '@mui/material/Button';
import Typography from '@mui/material/Typography';
import Modal from '@mui/material/Modal';
import { Divider, Grid } from '@mui/material';
const style = {
position: 'absolute',
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%)',
width: 900,
bgcolor: 'background.paper',
border: '2px solid #000',
boxShadow: 24,
p: 4
};
export default function CmmModal({ isBackdrop = false, open, setOpen, title, children, callback = () => {} }) {
const handleClose = () => {
if (callback) callback();
setOpen(false);
};
return (
<div>
{/* <Button onClick={handleOpen}>Grid Modal(List)</Button> */}
<Modal
hideBackdrop={isBackdrop}
open={open}
onClose={handleClose}
aria-labelledby="modal-modal-title"
aria-describedby="modal-modal-description"
>
<Box sx={style}>
<Typography id="modal-modal-title" variant="h2" component="h2" sx={{ marginBottom: 3 }}>
{title}
</Typography>
{children}
<Grid item sx={{ marginTop: 3 }}>
<Button onClick={handleClose}>Close Modal</Button>
</Grid>
</Box>
</Modal>
</div>
);
}
CmmModal.propTypes = {
isBackdrop: PropTypes.bool,
open: PropTypes.bool,
title: PropTypes.string,
children: PropTypes.node,
setOpen: PropTypes.func,
callback: PropTypes.func
};

@ -1,44 +0,0 @@
import * as React from 'react';
import PropTypes from 'prop-types';
import Box from '@mui/material/Box';
import Button from '@mui/material/Button';
import Typography from '@mui/material/Typography';
import Modal from '@mui/material/Modal';
const style = {
position: 'absolute',
top: '50%',
left: '50%',
transform: 'translate(-50%, -50%)',
width: 900,
bgcolor: 'background.paper',
border: '2px solid #000',
boxShadow: 24,
p: 4
};
export default function GridModal({ children }) {
const [open, setOpen] = React.useState(true);
const handleOpen = () => setOpen(true);
const handleClose = () => setOpen(false);
return (
<div>
{/* <Button onClick={handleOpen}>Grid Modal(List)</Button> */}
<Modal open={open} onClose={handleClose} aria-labelledby="modal-modal-title" aria-describedby="modal-modal-description">
<Box sx={style}>
<Typography id="modal-modal-title" variant="h2" component="h2">
Text in a modal
</Typography>
{children}
<Button onClick={handleClose}>Close Modal</Button>
</Box>
</Modal>
</div>
);
}
GridModal.propTypes = {
children: PropTypes.node
};

@ -5,7 +5,7 @@ import MainCard from 'ui-component/cards/MainCard';
import SecondaryAction from 'ui-component/cards/CardSecondaryAction'; import SecondaryAction from 'ui-component/cards/CardSecondaryAction';
import NestedModal from './NestedModal'; import NestedModal from './NestedModal';
import BasicModal from './BasicModal'; import BasicModal from './BasicModal';
import GridModal from './GridModal'; import CmmModal from './CmmModal';
// ==============================|| MODAL PAGE ||============================== // // ==============================|| MODAL PAGE ||============================== //
@ -15,7 +15,6 @@ const Modal = () => (
{/* <SimpleModal /> */} {/* <SimpleModal /> */}
<BasicModal /> <BasicModal />
<NestedModal /> <NestedModal />
<GridModal />
</MainCard> </MainCard>
); );

Loading…
Cancel
Save