fix: 첨부파일 - 업로드 후 수정페이지에서 수정시 현파일 없어짐 버그 수정 건
parent
52cfa4a257
commit
4642e5d820
|
|
@ -67,7 +67,6 @@ function AttachFile(props) {
|
|||
|
||||
//기존 server에 upload된 file인 props.serverFiles file들을 렌더링 초기에 넣어 놓기
|
||||
useEffect(function () {
|
||||
|
||||
|
||||
if( !props.serverFiles ) {
|
||||
return;
|
||||
|
|
@ -79,7 +78,8 @@ function AttachFile(props) {
|
|||
props.serverFiles[idx].index=nNewIndex++;
|
||||
items.push( props.serverFiles[idx] );
|
||||
}
|
||||
setFileItem(items);
|
||||
setFileItem(items);
|
||||
props.setFiles(items);
|
||||
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [props.serverFiles]);
|
||||
|
|
|
|||
|
|
@ -9,11 +9,9 @@ import { FileUploader } from "react-drag-drop-files";
|
|||
*/
|
||||
function FileDragDrop({fileTypes, children, multiple, label, onDrop, handleChange, file, setFile, dropMessageStyle, name, maxSize, disabled}) {
|
||||
|
||||
const temp = 0;
|
||||
|
||||
return (
|
||||
<FileUploader
|
||||
hoverTitle="여기에 파일을 놓아주세요"
|
||||
hoverTitle=" "
|
||||
handleChange={handleChange}
|
||||
name={name}
|
||||
types={fileTypes ? fileTypes : "*"}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import CircularProgress from '@mui/material/CircularProgress';
|
||||
import Box from '@mui/material/Box';
|
||||
import { Dialog, DialogContent, makeStyles, Theme, Typography } from "@material-ui/core";
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
backDrop: {
|
||||
backdropFilter: "blur(3px)",
|
||||
backgroundColor:'rgba(0,0,30,0.4)'
|
||||
},
|
||||
}));
|
||||
|
||||
function SimpleDialog(props) {
|
||||
|
||||
const { open } = props;
|
||||
const classes = useStyles();
|
||||
|
||||
return (
|
||||
<Dialog open={open} disableEscapeKeyDown={false}
|
||||
BackdropProps={{
|
||||
classes: {
|
||||
root: classes.backDrop,
|
||||
},
|
||||
}}
|
||||
>
|
||||
<DialogContent style={{ textAlign: "center", background: 'rgba(0,0,0,0)' }}>
|
||||
<Box sx={{ display: 'flex', width: '100%', padding: '15px 15px' }}>
|
||||
<CircularProgress
|
||||
disableShrink={true}
|
||||
size={100}
|
||||
/>
|
||||
</Box>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
|
||||
SimpleDialog.propTypes = {
|
||||
open: PropTypes.bool.isRequired,
|
||||
};
|
||||
|
||||
export default function LoadingProgress({open, setOpen}) {
|
||||
|
||||
|
||||
return (
|
||||
<div>
|
||||
<SimpleDialog
|
||||
open={open}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
@ -5,6 +5,8 @@ import LinearProgress from '@mui/material/LinearProgress';
|
|||
import AttachFile from "../../../../components/file/AttachFile";
|
||||
import RichTextEditor from "../../../../components/editor/RichTextEditor";
|
||||
import AlertDialogSlide from "../../../../components/alert/AlertDialogSlide";
|
||||
import LoadingProgress from "../../../../components/progress/LoadingProgress";
|
||||
|
||||
import CODE from 'constants/code';
|
||||
|
||||
|
||||
|
|
@ -20,8 +22,7 @@ const StyledDiv = styled.div`
|
|||
.board_view2 {
|
||||
margin-bottom: 30px;
|
||||
dl.file-attach-wrapper dd {
|
||||
padding: 0px;
|
||||
|
||||
padding: 14px;
|
||||
|
||||
.file_attach {
|
||||
width: 100%;
|
||||
|
|
@ -183,12 +184,14 @@ function PopupEditor(props) {
|
|||
}
|
||||
|
||||
const requestTask = (callbackParams) => {
|
||||
setOpenLoadingProgress(true);
|
||||
EgovNet.requestFetch(callbackParams.requestUrl,
|
||||
requestOptions,
|
||||
(resp) => {
|
||||
setOpenLoadingProgress(false);
|
||||
if (Number(resp.resultCode) === Number(CODE.RCV_SUCCESS)) {
|
||||
if (modeInfo.mode === CODE.MODE_MODIFY) {
|
||||
alert("게시글이 수정 되었습니다.");
|
||||
//alert("게시글이 수정 되었습니다.");
|
||||
}
|
||||
navigate({ pathname: URL.ADMIN__CONTENTS__POP_UP });
|
||||
} else {
|
||||
|
|
@ -295,12 +298,10 @@ function PopupEditor(props) {
|
|||
|
||||
const [serverFiles, setServerFiles] = useState();
|
||||
const [files, setFiles] = useState();
|
||||
/*
|
||||
let files = null;
|
||||
const setFiles = (myFiles) => {
|
||||
files = myFiles;
|
||||
};
|
||||
*/
|
||||
|
||||
|
||||
|
||||
const [openLoadingProgress, setOpenLoadingProgress] = React.useState(false);
|
||||
|
||||
|
||||
const Location = React.memo(function Location() {
|
||||
|
|
@ -427,6 +428,7 @@ function PopupEditor(props) {
|
|||
{/* <!--// 버튼영역 --> */}
|
||||
|
||||
<AlertDialogSlide confirm={confirm} setConfirm={setConfirm} />
|
||||
<LoadingProgress open={openLoadingProgress} setOpen={setOpenLoadingProgress} />
|
||||
</StyledDiv>
|
||||
{/* <!--// 본문 --> */}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue