diff --git a/src/forge/Issues/Component/comments/editComment.jsx b/src/forge/Issues/Component/comments/editComment.jsx index 7b376b128..5ce9b6615 100644 --- a/src/forge/Issues/Component/comments/editComment.jsx +++ b/src/forge/Issues/Component/comments/editComment.jsx @@ -1,8 +1,9 @@ import React from 'react'; -import { Input, Button, message } from 'antd'; -import { getImageUrl, timeAgo } from 'educoder'; +import { Button, message } from 'antd'; +import { getImageUrl } from 'educoder'; import MDEditor from "../../../../modules/tpm/challengesnew/tpm-md-editor"; import Upload from "../../../../forge/Upload/Index"; +import Attachments from "../../../../forge/Upload/attachment"; import UploadImg from "../../../../forge/Images/upload.png"; import './list.scss'; import '../../../../forge/Order/order.scss'; @@ -20,6 +21,11 @@ function EditComment(props){ const [atWhoLoginList, setAtWhoLoginList] = useState(undefined); const [fileList, setFileList] = useState(undefined); const [attachmentClean, setAttachmentClean] = useState(true); + const [ save , setSave ] = useState(undefined); + + useState(()=>{ + setSave(props.defaultFileList); + },[props.defaultFileList]) // 评论点击函数 function addJournals(){ @@ -65,6 +71,24 @@ function EditComment(props){ }) } }; + function deleteLoad(id){ + let arr = []; + let list = save; + if(list && list.length>0 ){ + arr = list.filter(i=>i.id !== id); + } + setFileList(arr.map(i=>{return i.id})); + setSave(arr); + } + function UploadFunc(f){ + let list = []; + let arr = []; + if(save && save.length>0 ){ + arr = save.map(i=>{return i.id}); + } + list = arr && arr.length>0 ? f.concat(arr) : f ; + setFileList(list); + }; return(
- :"" +