Merge branch 'gitlink_server' of http://106.75.45.236:3000/Gitlink/forgeplus-react into feature_wiki
This commit is contained in:
commit
011aca832b
|
|
@ -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(
|
||||
<div className="grid-item-top pb10">
|
||||
|
|
@ -101,7 +125,7 @@ function EditComment(props){
|
|||
<Upload
|
||||
className="commentStyle"
|
||||
isComplete={attachmentClean}
|
||||
load={(fileList)=>{setFileList(fileList)}}
|
||||
load={UploadFunc}
|
||||
icon={
|
||||
<img
|
||||
src={UploadImg}
|
||||
|
|
@ -112,8 +136,16 @@ function EditComment(props){
|
|||
}
|
||||
size={100}
|
||||
showNotification={showNotification}
|
||||
defaultFileList={props.defaultFileList}
|
||||
// defaultFileList={props.defaultFileList}
|
||||
/>
|
||||
{props.defaultFileList && props.defaultFileList.length > 0 &&
|
||||
<Attachments
|
||||
attachments={props.defaultFileList}
|
||||
showNotification={props.showNotification}
|
||||
canDelete={true}
|
||||
deleteLoad={deleteLoad}
|
||||
></Attachments>
|
||||
}
|
||||
<p className="clearfix mt20">
|
||||
<Button
|
||||
type="primary"
|
||||
|
|
|
|||
|
|
@ -437,12 +437,15 @@ class merge extends Component {
|
|||
""
|
||||
)}
|
||||
{ data && data.issues && data.issues.length === 0 ?
|
||||
<NoneData _html="暂时还没有相关数据!"
|
||||
user_admin_or_developer={data.user_admin_or_developer}
|
||||
has_created_pull_requests={has_created_pull_requests}
|
||||
projectsId={projectsId} owner={owner}
|
||||
defaultBranch={this.props && turnbar(this.props.defaultBranch) }/>
|
||||
:""
|
||||
<div style={{border:"1px solid rgba(42, 97, 255, 0.23)",borderTop:" none",borderRadius: "0px 0px 2px 2px;"}}>
|
||||
<NoneData _html="暂时还没有相关数据!"
|
||||
user_admin_or_developer={data.user_admin_or_developer}
|
||||
has_created_pull_requests={has_created_pull_requests}
|
||||
projectsId={projectsId} owner={owner}
|
||||
defaultBranch={this.props && turnbar(this.props.defaultBranch) }/>
|
||||
</div>
|
||||
:""
|
||||
|
||||
}
|
||||
</Spin>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -163,9 +163,6 @@ ul,ol,dl{
|
|||
text-align: center;
|
||||
min-height: 320px;
|
||||
padding:40px 0px;
|
||||
border:1px solid rgba(42, 97, 255, 0.23);
|
||||
border-top: none;
|
||||
border-radius: 0px 0px 2px 2px;
|
||||
margin-bottom: 50px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
|
|
|||
Loading…
Reference in New Issue