diff --git a/openhis-ui-vue3/src/components/NoticePopup/index.vue b/openhis-ui-vue3/src/components/NoticePopup/index.vue index effd4cbc..d00f1740 100644 --- a/openhis-ui-vue3/src/components/NoticePopup/index.vue +++ b/openhis-ui-vue3/src/components/NoticePopup/index.vue @@ -241,7 +241,9 @@ const loadNotices = async () => { try { const res = await getUserNotices() if (res.code === 200) { - noticeList.value = res.data || [] + noticeList.value = (res.data || []).sort((a, b) => { + return new Date(b.createTime) - new Date(a.createTime) + }) // 设置第一个未读公告为激活状态,如果没有未读则设置第一个 const firstUnread = noticeList.value.find(n => !n.isRead) if (firstUnread) { @@ -359,7 +361,8 @@ defineExpose({ } .notice-list { - width: 380px; + width: 25%; + min-width: 200px; border-right: 1px solid #e4e7ed; background: #fafafa; @@ -368,6 +371,7 @@ defineExpose({ cursor: pointer; border-bottom: 1px solid #e4e7ed; transition: all 0.3s; + position: relative; &:hover { background: #f0f2f5;