fix: 게시판관리 반영
parent
843f0adc85
commit
3c71453d52
@ -0,0 +1,164 @@
|
||||
import { useMemo, useRef, useState } from 'react';
|
||||
|
||||
import { useAlert } from 'react-alert';
|
||||
// material-ui
|
||||
import { Button, Divider, Grid, TextField } from '@mui/material';
|
||||
|
||||
// berry ui
|
||||
import ReactQuill from 'react-quill';
|
||||
import 'react-quill/dist/quill.snow.css';
|
||||
|
||||
// project imports
|
||||
import { Delete, List, Save } from '@mui/icons-material';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
const ModifyBoardForm = (props) => {
|
||||
// eslint-disable-next-line react/prop-types
|
||||
const { setOpen, handleModalSave, rowData = {}, owner = false, handleNewBoard } = props;
|
||||
console.log(`~~~~~~${owner}`);
|
||||
const alert = useAlert();
|
||||
const quillRef = useRef();
|
||||
const [subject, setSubject] = useState(rowData.ciTitle);
|
||||
const [contents, setContents] = useState(rowData.ciContents);
|
||||
const [pass, setPass] = useState(rowData.ciPass);
|
||||
|
||||
const onList = () => {
|
||||
setOpen(false);
|
||||
};
|
||||
const onSave = () => {
|
||||
// TODO : validation check 추가
|
||||
const saveData = {
|
||||
ciCode: rowData.ciCode,
|
||||
ciTitle: subject,
|
||||
ciContents: contents,
|
||||
ciPass: pass
|
||||
};
|
||||
|
||||
handleModalSave('SAVE', saveData);
|
||||
};
|
||||
|
||||
const onRemove = () => {
|
||||
handleModalSave('DELETE', rowData.ciCode);
|
||||
};
|
||||
|
||||
const onResponse = (e) => {
|
||||
// 댓글 달기 : 대댓글인 경우 ciRef, ciStep 값 존재
|
||||
handleNewBoard(e, rowData.ciCode, rowData.ciRef ?? rowData.ciCode);
|
||||
};
|
||||
|
||||
const modules = useMemo(
|
||||
() => ({
|
||||
toolbar: {
|
||||
container: [
|
||||
['bold', 'italic', 'underline', 'strike', 'blockquote'],
|
||||
[{ size: ['small', false, 'large', 'huge'] }, { color: [] }],
|
||||
[{ list: 'ordered' }, { list: 'bullet' }, { indent: '-1' }, { indent: '+1' }, { align: [] }]
|
||||
// ['image', 'video']
|
||||
]
|
||||
}
|
||||
}),
|
||||
[]
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Grid mt={1}>
|
||||
<Grid container spacing={1} item xs={12} mb={1}>
|
||||
<Grid item sm={3}>
|
||||
<TextField size="small" disabled label="작성자" value={rowData.ciName} fullWidth />
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<TextField size="small" disabled label="등록일" value={rowData.ciNalja} fullWidth />
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<TextField size="small" disabled label="글번호" value={rowData.ciCode} fullWidth />
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<TextField size="small" disabled label="조회수" value={rowData.ciHit} fullWidth />
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={1} item xs={12} mt={2}>
|
||||
<Grid item sm={12}>
|
||||
<TextField
|
||||
disabled={!owner}
|
||||
size="small"
|
||||
required
|
||||
label="제목"
|
||||
value={subject}
|
||||
onChange={(e) => setSubject(e.target.value)}
|
||||
fullWidth
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={1} item xs={12} mt={2}>
|
||||
<Grid item xs={12}>
|
||||
<ReactQuill
|
||||
ref={(element) => {
|
||||
if (element !== null) {
|
||||
quillRef.current = element;
|
||||
}
|
||||
}}
|
||||
readOnly={!owner}
|
||||
value={contents}
|
||||
onChange={setContents}
|
||||
modules={modules}
|
||||
theme="snow"
|
||||
placeholder="내용을 입력해주세요."
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={1} item xs={12} mt={2}>
|
||||
<Grid item sm={12}>
|
||||
<TextField
|
||||
disabled={!owner}
|
||||
size="small"
|
||||
type="password"
|
||||
required
|
||||
label="비밀번호"
|
||||
value={pass}
|
||||
onChange={(e) => setPass(e.target.value)}
|
||||
fullWidth
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={1} item xs={12} mt={1}>
|
||||
<Grid item xs={12}>
|
||||
<Divider />
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item container spacing={0.5} xs={12} mt={1}>
|
||||
<Grid item>
|
||||
<Button variant="contained" size="small" startIcon={<List />} onClick={onList}>
|
||||
목록
|
||||
</Button>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<Button disabled={owner} variant="contained" size="small" startIcon={<List />} onClick={onResponse}>
|
||||
답변하기
|
||||
</Button>
|
||||
</Grid>
|
||||
<Grid item style={{ marginLeft: 'auto' }}>
|
||||
<Button disabled={!owner} variant="contained" size="small" startIcon={<Save />} onClick={onSave}>
|
||||
저장
|
||||
</Button>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<Button disabled={!owner} variant="contained" size="small" startIcon={<Delete />} onClick={onRemove}>
|
||||
삭제
|
||||
</Button>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
ModifyBoardForm.propTypes = {
|
||||
rowData: PropTypes.object.isRequired,
|
||||
handleModalSave: PropTypes.func.isRequired,
|
||||
handleNewBoard: PropTypes.func.isRequired,
|
||||
setOpen: PropTypes.func.isRequired,
|
||||
owner: PropTypes.bool.isRequired
|
||||
};
|
||||
|
||||
export default ModifyBoardForm;
|
@ -0,0 +1,136 @@
|
||||
import { useMemo, useRef, useState } from 'react';
|
||||
|
||||
import { useAlert } from 'react-alert';
|
||||
// material-ui
|
||||
import { Button, Divider, Grid, TextField } from '@mui/material';
|
||||
|
||||
// assets
|
||||
|
||||
// berry ui
|
||||
import ReactQuill from 'react-quill';
|
||||
import 'react-quill/dist/quill.snow.css';
|
||||
|
||||
// project imports
|
||||
import { List, Save } from '@mui/icons-material';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
const BoardForm = (props) => {
|
||||
// eslint-disable-next-line react/prop-types
|
||||
const { setOpen, handleModalSave, rowData = {} } = props;
|
||||
const alert = useAlert();
|
||||
const quillRef = useRef();
|
||||
const [subject, setSubject] = useState('');
|
||||
const [contents, setContents] = useState('');
|
||||
const [pass, setPass] = useState();
|
||||
|
||||
const onList = () => {
|
||||
setOpen(false);
|
||||
};
|
||||
const onSave = () => {
|
||||
// TODO : validation check 추가
|
||||
const saveData = {
|
||||
ciRef: rowData.ciRef,
|
||||
ciStep: rowData.ciStep,
|
||||
ciRevel: rowData.ciRevel,
|
||||
ciTitle: subject,
|
||||
ciContents: contents,
|
||||
ciPass: pass
|
||||
};
|
||||
|
||||
handleModalSave('SAVE', saveData);
|
||||
};
|
||||
|
||||
const modules = useMemo(
|
||||
() => ({
|
||||
toolbar: {
|
||||
container: [
|
||||
['bold', 'italic', 'underline', 'strike', 'blockquote'],
|
||||
[{ size: ['small', false, 'large', 'huge'] }, { color: [] }],
|
||||
[{ list: 'ordered' }, { list: 'bullet' }, { indent: '-1' }, { indent: '+1' }, { align: [] }]
|
||||
// ['image', 'video']
|
||||
]
|
||||
}
|
||||
}),
|
||||
[]
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Grid mt={1}>
|
||||
<Grid container spacing={1} item xs={12} mb={1}>
|
||||
<Grid item sm={3}>
|
||||
<TextField size="small" disabled label="작성자" value={rowData.ciName} fullWidth />
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<TextField size="small" disabled label="등록일" value={rowData.ciNalja} fullWidth />
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<TextField size="small" disabled label="글번호" value={rowData.ciCode} fullWidth />
|
||||
</Grid>
|
||||
<Grid item sm={3}>
|
||||
<TextField size="small" disabled label="조회수" value={rowData.ciHit} fullWidth />
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={1} item xs={12} mt={2}>
|
||||
<Grid item sm={12}>
|
||||
<TextField size="small" required label="제목" value={subject} onChange={(e) => setSubject(e.target.value)} fullWidth />
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={1} item xs={12} mt={2}>
|
||||
<Grid item xs={12}>
|
||||
<ReactQuill
|
||||
ref={(element) => {
|
||||
if (element !== null) {
|
||||
quillRef.current = element;
|
||||
}
|
||||
}}
|
||||
value={contents}
|
||||
onChange={setContents}
|
||||
modules={modules}
|
||||
theme="snow"
|
||||
placeholder="내용을 입력해주세요."
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={1} item xs={12} mt={2}>
|
||||
<Grid item sm={12}>
|
||||
<TextField
|
||||
size="small"
|
||||
type="password"
|
||||
required
|
||||
label="비밀번호"
|
||||
value={pass}
|
||||
onChange={(e) => setPass(e.target.value)}
|
||||
fullWidth
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={1} item xs={12} mt={1}>
|
||||
<Grid item xs={12}>
|
||||
<Divider />
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item container spacing={0.5} xs={12} mt={1}>
|
||||
<Grid item>
|
||||
<Button variant="contained" size="small" startIcon={<List />} onClick={onList}>
|
||||
목록
|
||||
</Button>
|
||||
</Grid>
|
||||
<Grid item style={{ marginLeft: 'auto' }}>
|
||||
<Button variant="contained" size="small" startIcon={<Save />} onClick={onSave}>
|
||||
저장
|
||||
</Button>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
BoardForm.propTypes = {
|
||||
rowData: PropTypes.object.isRequired,
|
||||
handleModalSave: PropTypes.func.isRequired,
|
||||
setOpen: PropTypes.func.isRequired
|
||||
};
|
||||
|
||||
export default BoardForm;
|
@ -1,152 +0,0 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
// material-ui
|
||||
import { Button, Divider, Grid, InputAdornment, MenuItem, OutlinedInput, Select } from '@mui/material';
|
||||
|
||||
// assets
|
||||
import { IconSearch } from '@tabler/icons';
|
||||
|
||||
// berry ui
|
||||
import MainCard from 'ui-component/cards/MainCard';
|
||||
|
||||
// project imports
|
||||
import MuiDataGrid from 'views/cmm/MuiDataGrid';
|
||||
import { findUsers } from 'apis/user';
|
||||
import CmmModal from '../../cmm/CmmModal';
|
||||
import UserManagerForm from './UserManagerForm';
|
||||
import { removePublicBoard, savePublicBoard } from 'apis/public';
|
||||
|
||||
const UserManager = () => {
|
||||
const [category, setCategory] = useState('ciTitle');
|
||||
const [searchTxt, setSearchTxt] = useState('');
|
||||
|
||||
const [totalCount, setTotalCount] = useState(0);
|
||||
const [rowsState, setRowsState] = useState({
|
||||
page: 0,
|
||||
pageSize: 20,
|
||||
rows: []
|
||||
// loading: false
|
||||
});
|
||||
|
||||
// 등록 버튼 state
|
||||
const [open, setOpen] = useState(false);
|
||||
const [selectedRow, setSelectedRow] = useState({});
|
||||
const [create, setCreate] = useState(false);
|
||||
const [title, setTitle] = useState();
|
||||
|
||||
const columns = [
|
||||
{ headerName: '게시판코드', field: 'ciCode' },
|
||||
{ headerName: '글번호', field: 'ciContentno' },
|
||||
{ headerName: '제목', field: 'ciTitle', editable: true },
|
||||
{ headerName: '사용자ID', field: 'ciId' },
|
||||
{ headerName: '사용자 비번', field: 'ciPwd' }
|
||||
];
|
||||
const handleSearch = async (event) => {
|
||||
if (event.type === 'keydown' && event.key === 'Enter') {
|
||||
const newString = event?.target.value;
|
||||
setSearchTxt(newString);
|
||||
}
|
||||
};
|
||||
|
||||
const search = () => {
|
||||
const params = {
|
||||
page: rowsState.page,
|
||||
size: rowsState.pageSize
|
||||
};
|
||||
|
||||
findUsers(params).then((response) => {
|
||||
if (response && response.data) {
|
||||
setTotalCount(response.count);
|
||||
setRowsState((prevState) => ({ ...prevState, rows: response.data }));
|
||||
}
|
||||
});
|
||||
};
|
||||
useEffect(() => {
|
||||
search();
|
||||
}, [rowsState.page, rowsState.pageSize, category, searchTxt]); // rowsState.page, rowsState.pageSize, rowsState.rows]);
|
||||
|
||||
// model창
|
||||
const submitPublicBoard = (type, payload) => {
|
||||
switch (type) {
|
||||
case 'SAVE':
|
||||
savePublicBoard(payload).then(() => {
|
||||
search();
|
||||
setOpen(false);
|
||||
}); // .then((res) => {
|
||||
break;
|
||||
case 'DELETE':
|
||||
removePublicBoard(payload).then(() => {
|
||||
search();
|
||||
setOpen(false);
|
||||
}); // .then((res) => {
|
||||
break;
|
||||
default:
|
||||
}
|
||||
};
|
||||
|
||||
// 공지사항 버튼 이벤트
|
||||
const handleCreate = () => {
|
||||
setSelectedRow({});
|
||||
setTitle('공지사항 등록');
|
||||
setCreate(true);
|
||||
setOpen(true);
|
||||
};
|
||||
|
||||
return (
|
||||
<MainCard>
|
||||
<Grid container spacing={2} alignItems="center">
|
||||
<Grid item xs={12} lg={6}>
|
||||
<Grid container spacing={1}>
|
||||
<Grid item>
|
||||
<Select id="category" name="reviewYear" defaultValue="ciTitle" onChange={(e) => setCategory(e.target.value)}>
|
||||
<MenuItem key="1" value="ciTitle">
|
||||
이름
|
||||
</MenuItem>
|
||||
<MenuItem key="2" value="ciName">
|
||||
아이디
|
||||
</MenuItem>
|
||||
</Select>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<OutlinedInput
|
||||
placeholder="Search"
|
||||
onKeyDown={handleSearch}
|
||||
size="small"
|
||||
autoFocus
|
||||
endAdornment={
|
||||
<InputAdornment position="end">
|
||||
<IconSearch stroke={1.5} size="1rem" />
|
||||
</InputAdornment>
|
||||
}
|
||||
/>
|
||||
{/* <IconSearch stroke={1.5} size="1rem" /> */}
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<Button variant="contained" size="small" onClick={handleCreate}>
|
||||
평가 등록
|
||||
</Button>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Divider />
|
||||
</Grid>
|
||||
<Grid item xs={12}>
|
||||
<Divider />
|
||||
</Grid>
|
||||
<MuiDataGrid
|
||||
columns={columns}
|
||||
rowsState={rowsState}
|
||||
totalCount={totalCount}
|
||||
setRowsState={setRowsState}
|
||||
// handleCellClick={handleOnCellClick}
|
||||
/>
|
||||
<CmmModal isBackdrop title={title} open={open} setOpen={setOpen}>
|
||||
<UserManagerForm create={create} setOpen={setOpen} handleModalSave={submitPublicBoard} {...selectedRow} />
|
||||
</CmmModal>
|
||||
</MainCard>
|
||||
);
|
||||
};
|
||||
|
||||
export default UserManager;
|
@ -1,226 +0,0 @@
|
||||
import { useMemo, useRef, useState } from 'react';
|
||||
|
||||
import { useAlert } from 'react-alert';
|
||||
// material-ui
|
||||
import { Button, FormControl, Grid, MenuItem, Select, TextField } from '@mui/material';
|
||||
|
||||
// assets
|
||||
|
||||
// berry ui
|
||||
import ReactQuill from 'react-quill';
|
||||
import 'react-quill/dist/quill.snow.css';
|
||||
|
||||
// project imports
|
||||
import InputLabel from 'ui-component/extended/Form/InputLabel';
|
||||
|
||||
import { Delete, List, Save } from '@mui/icons-material';
|
||||
import { fileDownload } from '../../../apis/common';
|
||||
import FileForm from 'views/cmm/FileForm';
|
||||
|
||||
const PublicBoardForm = (props) => {
|
||||
// eslint-disable-next-line react/prop-types
|
||||
const { create, inCode, inDept, inTitle, inHit, inName, inNalja, inFilename, inContents, setOpen, handleModalSave } = props;
|
||||
const alert = useAlert();
|
||||
const quillRef = useRef();
|
||||
const [dept, setDept] = useState(inDept || '주정차위반');
|
||||
const [subject, setSubject] = useState(inTitle || '');
|
||||
const [contents, setContents] = useState(inContents || '');
|
||||
const [filesInfo, setFilesInfo] = useState();
|
||||
const [selectedFile, setSelectedFile] = useState(inFilename || ''); // 파일
|
||||
// const [fileData, setFileData] = useState();
|
||||
|
||||
const onList = () => {
|
||||
setOpen(false);
|
||||
};
|
||||
const onSave = () => {
|
||||
// TODO : validation check 추가
|
||||
const formData = new FormData();
|
||||
formData.append('inCode', inCode ?? '');
|
||||
formData.append('inTitle', subject);
|
||||
formData.append('inDept', dept);
|
||||
formData.append('inContents', contents);
|
||||
formData.append('inFilename', selectedFile ?? '');
|
||||
|
||||
if (filesInfo && filesInfo.length > 0) {
|
||||
// eslint-disable-next-line no-plusplus
|
||||
for (let i = 0; i < filesInfo.length; i++) formData.append('files', filesInfo[i]);
|
||||
}
|
||||
handleModalSave('SAVE', formData);
|
||||
};
|
||||
|
||||
const onRemove = () => {
|
||||
handleModalSave('DELETE', inCode);
|
||||
};
|
||||
|
||||
const imageHandler = () => {
|
||||
const input = document.createElement('input');
|
||||
input.setAttribute('type', 'file');
|
||||
input.setAttribute('accept', 'image/*');
|
||||
input.click();
|
||||
|
||||
input.onchange = async () => {
|
||||
if (input.files) {
|
||||
const file = input.files[0];
|
||||
const formData = new FormData();
|
||||
formData.append('image', file);
|
||||
|
||||
console.log(formData);
|
||||
|
||||
// 파일이 input 태그에 담기면 실행 될 함수
|
||||
input.onchange = async () => {
|
||||
const file = input.files;
|
||||
if (file !== null) {
|
||||
formData.append('image', file[0]);
|
||||
|
||||
try {
|
||||
// 서저 저장
|
||||
// const res = await axios.get('/');
|
||||
//
|
||||
const url = '/Users/minuk/Pictures/test.png';
|
||||
|
||||
// 이미지 태그 생성
|
||||
const range = quillRef.current?.getEditor().getSelection()?.index;
|
||||
if (range !== null && range !== undefined) {
|
||||
const quill = quillRef.current?.getEditor();
|
||||
|
||||
quill?.setSelection(range, 1);
|
||||
|
||||
quill?.clipboard.dangerouslyPasteHTML(range, `<img src=${url} alt="이미지 태그가 삽입됩니다." />`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
const modules = useMemo(
|
||||
() => ({
|
||||
toolbar: {
|
||||
container: [
|
||||
['bold', 'italic', 'underline', 'strike', 'blockquote'],
|
||||
[{ size: ['small', false, 'large', 'huge'] }, { color: [] }],
|
||||
[{ list: 'ordered' }, { list: 'bullet' }, { indent: '-1' }, { indent: '+1' }, { align: [] }]
|
||||
// ['image', 'video']
|
||||
],
|
||||
handlers: {
|
||||
image: imageHandler
|
||||
}
|
||||
}
|
||||
}),
|
||||
[]
|
||||
);
|
||||
|
||||
const onChangeFile = (file) => {
|
||||
setSelectedFile(file.name);
|
||||
setFilesInfo([file]);
|
||||
};
|
||||
|
||||
// const onChangeFile = (e) => {
|
||||
// setSelectedFile(e.target.files[0].name);
|
||||
// setFilesInfo(e.target.files);
|
||||
// };
|
||||
|
||||
const handleFileDownload = () => {
|
||||
if (!inFilename) {
|
||||
alert.show('등록된 파일이 없습니다.');
|
||||
return;
|
||||
}
|
||||
fileDownload(inCode, inFilename, alert).then(() => {});
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Grid mt={2}>
|
||||
<Grid container spacing={1} item xs={12} mb={1}>
|
||||
<Grid item xs={12} sm={6}>
|
||||
<TextField size="small" required label="제목" value={subject} onChange={(e) => setSubject(e.target.value)} fullWidth />
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={3}>
|
||||
<FormControl fullWidth>
|
||||
<InputLabel required>진술유형</InputLabel>
|
||||
<Select
|
||||
size="small"
|
||||
disabled={!create}
|
||||
label="업무구분"
|
||||
required
|
||||
value={dept}
|
||||
onChange={(e) => setDept(e.target.value)}
|
||||
fullWidth
|
||||
>
|
||||
<MenuItem value="주정차위반">주정차위반</MenuItem>
|
||||
<MenuItem value="장애인위반">장애인위반</MenuItem>
|
||||
<MenuItem value="기타">기타</MenuItem>
|
||||
</Select>
|
||||
</FormControl>
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={3}>
|
||||
<TextField size="small" disabled label="작성자" value={inName} fullWidth />
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={1} item xs={12} mb={1}>
|
||||
<Grid item xs={12} sm={3}>
|
||||
<TextField size="small" disabled label="등록일" value={inNalja} fullWidth />
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={3}>
|
||||
<TextField size="small" disabled label="번호" value={inCode} fullWidth />
|
||||
</Grid>
|
||||
<Grid item xs={12} sm={3}>
|
||||
<TextField size="small" disabled label="조회수" value={inHit} fullWidth />
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={1} item xs={12} mb={1}>
|
||||
<Grid item xs={12}>
|
||||
<ReactQuill
|
||||
ref={(element) => {
|
||||
if (element !== null) {
|
||||
quillRef.current = element;
|
||||
}
|
||||
}}
|
||||
value={contents}
|
||||
onChange={setContents}
|
||||
modules={modules}
|
||||
theme="snow"
|
||||
placeholder="내용을 입력해주세요."
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container spacing={1} item xs={12} mb={1}>
|
||||
<Grid item sm={6}>
|
||||
<FileForm
|
||||
isDownload={inFilename}
|
||||
labelName="첨부파일"
|
||||
savedFilename={inFilename}
|
||||
selectedFile={selectedFile}
|
||||
handleChangeFile={onChangeFile}
|
||||
handleFileDownload={handleFileDownload}
|
||||
alert={alert}
|
||||
/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid item container spacing={0.5} xs={12}>
|
||||
<Grid item>
|
||||
<Button variant="contained" size="small" startIcon={<List />} onClick={onList}>
|
||||
목록
|
||||
</Button>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<Button variant="contained" size="small" startIcon={<Save />} onClick={onSave}>
|
||||
저장
|
||||
</Button>
|
||||
</Grid>
|
||||
{!create && (
|
||||
<Grid item>
|
||||
<Button variant="contained" size="small" startIcon={<Delete />} onClick={onDelete}>
|
||||
삭제
|
||||
</Button>
|
||||
</Grid>
|
||||
)}
|
||||
</Grid>
|
||||
</>
|
||||
);
|
||||
};
|
||||
export default PublicBoardForm;
|
Loading…
Reference in New Issue