refactor: 소스 정리

main
minuk926 3 years ago
parent f00a0dd3f4
commit 4c412b0a1e

@ -93,16 +93,16 @@ const PublicBoard = () => {
const submitPublicBoard = (type, payload) => { const submitPublicBoard = (type, payload) => {
switch (type) { switch (type) {
case 'SAVE': case 'SAVE':
savePublicBoard(payload); // .then((res) => { savePublicBoard(payload).then(() => {
search(); search();
setOpen(false); setOpen(false);
// }); }); // .then((res) => {
break; break;
case 'DELETE': case 'DELETE':
deletePublicBoard(payload); // .then((res) => { deletePublicBoard(payload).then(() => {
// search(); search();
setOpen(false); setOpen(false);
// }); }); // .then((res) => {
break; break;
default: default:
} }

@ -21,12 +21,12 @@ const PublicBoardForm = (props) => {
const { create, inCode, inDept, inTitle, inHit, inName, inNalja, inFilename, inContents, setOpen, handleModalSave } = props; const { create, inCode, inDept, inTitle, inHit, inName, inNalja, inFilename, inContents, setOpen, handleModalSave } = props;
const alert = useAlert(); const alert = useAlert();
const quillRef = useRef(); const quillRef = useRef();
const [dept, setDept] = useState(inDept); const [dept, setDept] = useState(inDept || '주정차위반');
const [subject, setSubject] = useState(inTitle); const [subject, setSubject] = useState(inTitle || '');
const [contents, setContents] = useState(inContents); const [contents, setContents] = useState(inContents || '');
const [filesInfo, setFilesInfo] = useState(); const [filesInfo, setFilesInfo] = useState();
const [selectedFile, setSelectedFile] = useState(inFilename); // const [selectedFile, setSelectedFile] = useState(inFilename || ''); //
const [fileData, setFileData] = useState(); // const [fileData, setFileData] = useState();
const onList = () => { const onList = () => {
setOpen(false); setOpen(false);
@ -131,26 +131,17 @@ const PublicBoardForm = (props) => {
<TextField required label="제목" value={subject} onChange={(e) => setSubject(e.target.value)} fullWidth /> <TextField required label="제목" value={subject} onChange={(e) => setSubject(e.target.value)} fullWidth />
</Grid> </Grid>
<Grid item xs={12} sm={6}> <Grid item xs={12} sm={6}>
<Select {/* <FormControl variant="filled" sx={{ m:1, minWidth: 120 }}> */}
disabled={!create} {/* <InputLabel id="demo-simple-select-filled-label">Age</InputLabel> */}
label="업무구분" <Select disabled={!create} label="업무구분" required value={dept} onChange={(e) => setDept(e.target.value)} fullWidth>
required {/* <MenuItem value=""> */}
id="inDept" {/* <em>None</em> */}
name="inDept" {/* </MenuItem> */}
defaultValue={dept || '주정차위반'} <MenuItem value="주정차위반">주정차위반</MenuItem>
onChange={(e) => setDept(e.target.value)} <MenuItem value="장애인위반">장애인위반</MenuItem>
fullWidth <MenuItem value="기타">기타</MenuItem>
>
<MenuItem key="1" value="주정차위반">
주정차위반
</MenuItem>
<MenuItem key="2" value="장애인위반">
장애인위반
</MenuItem>
<MenuItem key="3" value="기타">
기타
</MenuItem>
</Select> </Select>
{/* </FormControl> */}
</Grid> </Grid>
<Grid item xs={12} sm={6}> <Grid item xs={12} sm={6}>
<TextField disabled label="등록일" value={inNalja} fullWidth /> <TextField disabled label="등록일" value={inNalja} fullWidth />
@ -168,7 +159,7 @@ const PublicBoardForm = (props) => {
<Grid> <Grid>
<TextField <TextField
// label="" // label=""
value={selectedFile || ''} value={selectedFile}
// inputProps={{ display: 'none' }} // inputProps={{ display: 'none' }}
fullWidth fullWidth
// InputProps={{ // InputProps={{

Loading…
Cancel
Save