forked from Gitlink/forgeplus-react
细节修改
This commit is contained in:
parent
ad76d0210b
commit
f768e0e9db
|
@ -5,9 +5,10 @@ import { CopyToClipboard } from 'react-copy-to-clipboard';
|
|||
|
||||
function Copy({ children , value }){
|
||||
const [ title , setTitle ] = useState("点击复制链接");
|
||||
|
||||
let host = window.location.hostname === "localhost" ? "testforgeplus.trustie.net" : window.location.hostname;
|
||||
let protocol = window.location.protocol;
|
||||
return(
|
||||
<CopyToClipboard text={value}
|
||||
<CopyToClipboard text={`${protocol}//${host}${value}`}
|
||||
onCopy={() => setTitle("复制成功")}>
|
||||
<Tooltip
|
||||
placement="bottom"
|
||||
|
|
|
@ -3,12 +3,12 @@ import { getImageUrl } from 'educoder';
|
|||
import issue from '../Img/issue.png';
|
||||
import { Link } from "react-router-dom";
|
||||
import Copy from '../Component/copy';
|
||||
import { Tooltip } from 'antd';
|
||||
|
||||
|
||||
// issue列表显示
|
||||
function Datas({checkbox ,item , projectsId,owner}){
|
||||
let host = window.location.hostname === "localhost" ? "testforgeplus.trustie.net" : window.location.hostname;
|
||||
let protocol = window.location.protocol;
|
||||
|
||||
function statusTag(name){
|
||||
switch (name) {
|
||||
case "低":
|
||||
|
@ -22,6 +22,11 @@ function Datas({checkbox ,item , projectsId,owner}){
|
|||
}
|
||||
}
|
||||
|
||||
function renderName(list){
|
||||
let l = list.map(i=>{return i.name});
|
||||
return l.join(",");
|
||||
}
|
||||
|
||||
return(
|
||||
<div>
|
||||
<div className="issuedetail">
|
||||
|
@ -29,7 +34,7 @@ function Datas({checkbox ,item , projectsId,owner}){
|
|||
<div className="ilog">
|
||||
<span className={statusTag(item.priority_name)}>{item.priority_name}</span>
|
||||
{ item.project_issues_index &&
|
||||
<Copy value={`${protocol}//${host}/${owner}/${projectsId}/issues/${item.project_issues_index}`}><span className="number">#{item.project_issues_index}</span></Copy>
|
||||
<Copy value={`/${owner}/${projectsId}/issues/${item.project_issues_index}`}><span className="number">#{item.project_issues_index}</span></Copy>
|
||||
}
|
||||
</div>
|
||||
<div style={{marginTop:"-2px"}}>
|
||||
|
@ -58,20 +63,23 @@ function Datas({checkbox ,item , projectsId,owner}){
|
|||
<div className="issuecondition">
|
||||
{
|
||||
item.assigners && item.assigners.length > 0 ?
|
||||
<div className={item.assigners.length > 1 ?"principal hovers":"principal"}>
|
||||
{
|
||||
item.assigners.map((i,k)=>{
|
||||
return(
|
||||
k<5 && <Link to={`/${i.login}`} style={{right:`${(item.assigners.length-k-1)*(22-7)}px`,zIndex:k+1}}><img src={getImageUrl(i.image_url)} alt="" /></Link>
|
||||
)
|
||||
})
|
||||
}
|
||||
{/* <span>...</span> */}
|
||||
</div>
|
||||
<Tooltip title={renderName(item.assigners)} placement="bottomRight">
|
||||
<div className={item.assigners.length > 1 ?"principal hovers":"principal"}>
|
||||
{
|
||||
item.assigners.map((i,k)=>{
|
||||
return(
|
||||
k<5 && <Link to={`/${i.login}`} style={{right:`${(item.assigners.length-k-1)*(22-7)}px`,zIndex:k+1}}><img src={getImageUrl(i.image_url)} alt="" /></Link>
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
</Tooltip>
|
||||
:""
|
||||
}
|
||||
<div>{item.status_name}</div>
|
||||
<div className="commentnum"><i className="iconfont icon-a-xiaoxi1 mr5 font-15"></i>{item.comment_journals_count}</div>
|
||||
<div className="commentnum">
|
||||
<Link to={`/${owner}/${projectsId}/issues/${item.project_issues_index}#commentList`}><i className="iconfont icon-a-xiaoxi1 mr5 font-15"></i>{item.comment_journals_count}</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
|
|
@ -342,7 +342,7 @@ function Details(props){
|
|||
<div className="detailtitle">
|
||||
<div className="ilog">
|
||||
{details.priority && <span className={statusTag(details.priority.name)}>{ details.priority.name }</span> }
|
||||
<Copy value={`${host}/${owner}/${projectsId}/issues/${index}`}><span className="number">#{details.project_issues_index}</span></Copy>
|
||||
<Copy value={`/${owner}/${projectsId}/issues/${index}`}><span className="number">#{details.project_issues_index}</span></Copy>
|
||||
</div>
|
||||
<div>
|
||||
<p className="name">{details.subject}</p>
|
||||
|
@ -378,7 +378,9 @@ function Details(props){
|
|||
: ""
|
||||
}
|
||||
</div>
|
||||
<CommentList {...props} issueInfo={details} reload = {commentReload} reloadComment = {()=>{setCommentReload(Math.random())}}/>
|
||||
<div id="commentList">
|
||||
<CommentList {...props} issueInfo={details} reload = {commentReload} reloadComment = {()=>{setCommentReload(Math.random())}}/>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</LongWidth>
|
||||
|
|
Loading…
Reference in New Issue