diff --git a/src/api/system/notice.js b/src/api/system/notice.js index 737fc16..c620e47 100644 --- a/src/api/system/notice.js +++ b/src/api/system/notice.js @@ -41,4 +41,30 @@ export function delNotice(noticeId) { url: '/system/notice/' + noticeId, method: 'delete' }) -} \ No newline at end of file +} + +// 首页顶部公告列表(带已读状态) +export function listNoticeTop() { + return request({ + url: '/system/notice/listTop', + method: 'get' + }) +} + +// 标记公告已读 +export function markNoticeRead(noticeId) { + return request({ + url: '/system/notice/markRead', + method: 'post', + params: { noticeId } + }) +} + +// 批量标记已读 +export function markNoticeReadAll(ids) { + return request({ + url: '/system/notice/markReadAll', + method: 'post', + params: { ids } + }) +} diff --git a/src/assets/icons/svg/bell.svg b/src/assets/icons/svg/bell.svg new file mode 100644 index 0000000..a7320a0 --- /dev/null +++ b/src/assets/icons/svg/bell.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/layout/components/HeaderNotice/index.vue b/src/layout/components/HeaderNotice/index.vue new file mode 100644 index 0000000..9e33528 --- /dev/null +++ b/src/layout/components/HeaderNotice/index.vue @@ -0,0 +1,237 @@ + + + + + + + diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index c5d03af..f2cffd4 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -32,6 +32,10 @@ + + + + @@ -72,6 +76,7 @@ import RuoYiDoc from '@/components/RuoYi/Doc' import useAppStore from '@/store/modules/app' import useUserStore from '@/store/modules/user' import useSettingsStore from '@/store/modules/settings' +import HeaderNotice from './HeaderNotice' const appStore = useAppStore() const userStore = useUserStore() @@ -204,11 +209,6 @@ async function toggleTheme(event) { margin-left: 8px; } - .errLog-container { - display: inline-block; - vertical-align: top; - } - .right-menu { height: 100%; line-height: 50px;