From 4216374c9c4a2eff3537f81d46cce568dff06f19 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 20 Mar 2026 10:37:33 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=96=B0=E5=A2=9E=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E5=85=AC=E5=91=8A=E6=B6=88=E6=81=AF=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/notice.js | 28 ++- src/assets/icons/svg/bell.svg | 1 + src/layout/components/HeaderNotice/index.vue | 237 +++++++++++++++++++ src/layout/components/Navbar.vue | 10 +- 4 files changed, 270 insertions(+), 6 deletions(-) create mode 100644 src/assets/icons/svg/bell.svg create mode 100644 src/layout/components/HeaderNotice/index.vue 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;