我的通知

This commit is contained in:
谢思 2021-09-15 16:52:34 +08:00
parent dcbba90c18
commit 4bb1b8d538
2 changed files with 10 additions and 9 deletions

View File

@ -142,6 +142,10 @@ function MyNotice(props) {
setBatchDeleteCheckAll(false); setBatchDeleteCheckAll(false);
} }
function turnToPersonalCenter(){
window.open(`/${current_user && current_user.login}`);
}
return ( return (
<div className="notice01"> <div className="notice01">
<div className="sshHead"> <div className="sshHead">
@ -183,7 +187,7 @@ function MyNotice(props) {
<div className="mynotice-cont stretch-style"> <div className="mynotice-cont stretch-style">
{item.status === 1 ? <Badge color="#FA2020" /> : <span className="system-notice-blank"></span>} {item.status === 1 ? <Badge color="#FA2020" /> : <span className="system-notice-blank"></span>}
<i className={"iconfont "+noticeSourceType[item.source]}></i> <i className={"iconfont "+noticeSourceType[item.source]}></i>
<span className={item.notification_url?"sysNotice-length highlightSpan":"sysNotice-length"} onClick={() => {item.notification_url && window.open("https://"+`${item.notification_url}`)}} dangerouslySetInnerHTML={{__html: item.content}}></span> <span className={item.notification_url?"sysNotice-length highlightSpan":"sysNotice-length"} onClick={() => {item.notification_url && window.open("https://"+`${item.notification_url}`);readNotice([item.id])}} dangerouslySetInnerHTML={{__html: item.content}}></span>
</div> </div>
<div className="mynotice-cont vertical-center-style float-left-little"> <div className="mynotice-cont vertical-center-style float-left-little">
<span className={item.status === 1?"timeSpan":""}>{item.time_ago}</span> <span className={item.status === 1?"timeSpan":""}>{item.time_ago}</span>
@ -199,11 +203,11 @@ function MyNotice(props) {
<div className="mynotice-cont vertical-center-style"> <div className="mynotice-cont vertical-center-style">
{/* <input type="checkbox" className={isBatchDelete ? 'atme-checkbox' : 'invisible'} onChange={onChange} /> */} {/* <input type="checkbox" className={isBatchDelete ? 'atme-checkbox' : 'invisible'} onChange={onChange} /> */}
<Checkbox value={item.id} className={isBatchDelete ? 'visible-checkbox' : 'invisible-checkbox'} onChange={onChange} checked={item.checkedBatch}></Checkbox> <Checkbox value={item.id} className={isBatchDelete ? 'visible-checkbox' : 'invisible-checkbox'} onChange={onChange} checked={item.checkedBatch}></Checkbox>
{item.sender && <img src={`https://testforgeplus.trustie.net//${item.sender.image_url}`} className="currentImg" />} {item.sender && <img src={`https://testforgeplus.trustie.net//${item.sender.image_url}`} className="currentImg" onClick={turnToPersonalCenter}/>}
<div className="atme-notice-text"> <div className="atme-notice-text">
<div className="at-badge">{item.status === 1 ? <Badge color="#FA2020" /> : <span className="system-notice-blank"></span>}</div> <div className="at-badge">{item.status === 1 ? <Badge color="#FA2020" /> : <span className="system-notice-blank"></span>}</div>
{item.sender && <div className="atme-sender-name boldSpan">{item.sender.name}</div>} {/* {item.sender && <div className="atme-sender-name boldSpan">{item.sender.name}</div>} */}
<div className={item.notification_url?"highlightSpan atme-cont":"atme-cont"} onClick={() => {item.notification_url && window.open("https://"+`${item.notification_url}`)}} dangerouslySetInnerHTML={{__html: item.content+" 中@我"}}></div> {item.sender && <div className={item.notification_url?"highlightSpan atme-cont":"atme-cont"} onClick={() => {item.notification_url && window.open("https://"+`${item.notification_url}`);readNotice([item.id])}} dangerouslySetInnerHTML={{__html: "<b onClick = {turnToPersonalCenter}>" + item.sender.name +"</b>&nbsp;&nbsp;&nbsp;" + item.content +" 中@我"}}></div>}
</div> </div>
</div> </div>
<div className="mynotice-cont vertical-center-style"> <div className="mynotice-cont vertical-center-style">

View File

@ -155,12 +155,9 @@ button:active {
position:absolute; position:absolute;
} }
& .atme-sender-name{
padding: 0 4px;
}
& .atme-cont{ & .atme-cont{
max-width: 42rem; max-width: 48rem;
margin-left: 12px;
} }
} }
} }