From b340709b00a4d5a65e42be44e32664342e6d4606 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Wed, 29 Mar 2023 11:21:09 +0800 Subject: [PATCH] =?UTF-8?q?=20issue=E5=93=81=E8=AE=BA=E5=8C=BA=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E9=99=84=E4=BB=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Issues/Component/comments/editComment.jsx | 40 +++++++++++++++++-- src/forge/Merge/merge.js | 15 ++++--- src/forge/css/index.scss | 3 -- 3 files changed, 45 insertions(+), 13 deletions(-) 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(
- :"" +