From 94a7cf1e6c2a1772f2d03897e062f0c5341c5ab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= <2897217417@qq.com> Date: Thu, 16 Sep 2021 11:46:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E7=9F=A5=E4=B8=AD=E5=BF=83=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SecuritySetting/notice/myNotice/Index.jsx | 26 ++++++++++++------- .../notice/myNotice/Index.scss | 24 ++++++++--------- 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/src/forge/SecuritySetting/notice/myNotice/Index.jsx b/src/forge/SecuritySetting/notice/myNotice/Index.jsx index 9f3d25be..e2b9b6e3 100644 --- a/src/forge/SecuritySetting/notice/myNotice/Index.jsx +++ b/src/forge/SecuritySetting/notice/myNotice/Index.jsx @@ -59,6 +59,9 @@ function MyNotice(props) { if(response.status === 200){ getMessageList(); resetUserInfo(); + //已读当前页码最后一条数据时跳转到前一页 + let totlaPage = Math.ceil((messTotalCount-1)/pageSize); + setCurrentPage(currentPage>=totlaPage? totlaPage : currentPage); } }); } @@ -117,10 +120,17 @@ function MyNotice(props) { axios.delete(`/users/${current_user.login}/messages.json`,{ data:params, }).then((response)=>{ - response.status === 200 && getMessageList(); + if(response.status === 200){ + getMessageList(); + //删除当前页码最后一条数据时跳转到前一页 + let totlaPage = Math.ceil((messTotalCount-1)/pageSize); + setCurrentPage(currentPage>=totlaPage? totlaPage : currentPage); + setSelectedNum(0); + } }); } }); + } function cancelBatchDelete(){ @@ -135,6 +145,7 @@ function MyNotice(props) { setBatchDeleteCheckAll(false); } + //跳转到消息详情页面 function turnToMess(item){ if(item.notification_url){ window.open(`${item.notification_url}`); @@ -147,7 +158,6 @@ function MyNotice(props) {
系统通知 - {/* 私信 */} @我 {(noticeType==="0" && noticeUnreadCount>0) || (noticeType==="2"&& atUnreadCount>0) ? :""} @@ -164,9 +174,8 @@ function MyNotice(props) { {messageList && messageList.length>0 &&
- {/*   */} 全选 -    已选择 {selectedNum} 项 +    已选择 {selectedNum} 项
     @@ -183,7 +192,7 @@ function MyNotice(props) {
{item.status === 1 ? : } - {item.notification_url && window.open("https://"+`${item.notification_url}`);readNotice([item.id])}} dangerouslySetInnerHTML={{__html: item.content}}> + {turnToMess(item)}} dangerouslySetInnerHTML={{__html: item.content}}>
{item.time_ago} @@ -192,16 +201,15 @@ function MyNotice(props) {
) } else if (noticeType === "2") { - console.log(item); //@我 return (
{item.sender && {window.open(`/${item.sender && item.sender.login}`);}}/>} - {item.status === 1 ? : } -
{turnToMess(item)}}> - {item.sender && " + item.sender.name+ " "+ item.content +" 中@我"}}>} +
{turnToMess(item)}}> + {item.status === 1 ? : } + {item.sender && " + item.sender.name+ " "+ item.content +" 中@我"}}>}
diff --git a/src/forge/SecuritySetting/notice/myNotice/Index.scss b/src/forge/SecuritySetting/notice/myNotice/Index.scss index 39a23b52..7f537406 100644 --- a/src/forge/SecuritySetting/notice/myNotice/Index.scss +++ b/src/forge/SecuritySetting/notice/myNotice/Index.scss @@ -16,10 +16,6 @@ position: relative; } - // #item-private{ - // margin: 0 24px 0 34px !important; - // } - li.ant-menu-item, .ant-menu-horizontal > .ant-menu-item { border-bottom: 0px; } @@ -92,15 +88,10 @@ button:active { cursor: pointer; } - & .atme-umread-redDot{ - position: relative; - top: -13px; - right: -5px; - } - & b{ font-weight: 400; text-shadow: 0.5px 0 #333; + margin: 0 6px; } & .invisable-read{ @@ -158,8 +149,15 @@ button:active { } .atme-notice-text{ margin-left: 6px; - max-width: 48rem; - word-break: break-all; + + & .atme-notice-name{ + margin: 0 0 ; + } + + & .atme-length{ + max-width: 48rem; + word-break: break-all; + } } } @@ -229,7 +227,7 @@ button:active { } -#numberSpan{ +.numberSpan{ color: #466AFF; }