From b51a3f55370a24fcb74bc7ea47e80aa801f5390e Mon Sep 17 00:00:00 2001 From: luo Date: Tue, 28 Jul 2026 16:08:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8E=BB=E6=8E=89=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E7=9A=84=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/layouts/art-header-bar/index.vue | 11 ++----- .../core/layouts/art-notification/index.vue | 14 +-------- src/config/constants/notification.ts | 5 ---- .../expiring-assets/index.vue | 28 ++++++++--------- .../task-management/bulk-purchase/index.vue | 30 +++++++++++++++++++ .../device-batch-allocation/index.vue | 5 +++- 6 files changed, 50 insertions(+), 43 deletions(-) delete mode 100644 src/config/constants/notification.ts diff --git a/src/components/core/layouts/art-header-bar/index.vue b/src/components/core/layouts/art-header-bar/index.vue index c66a28b..0f4c68c 100644 --- a/src/components/core/layouts/art-header-bar/index.vue +++ b/src/components/core/layouts/art-header-bar/index.vue @@ -194,8 +194,6 @@ import { mittBus } from '@/utils/sys' import { useMenuStore } from '@/store/modules/menu' import { useNotificationStore } from '@/store/modules/notification' - import { useAuth } from '@/composables/useAuth' - import { NOTIFICATION_PERMISSIONS } from '@/config/constants/notification' import AppConfig from '@/config' const isWindows = navigator.userAgent.includes('Windows') const { locale } = useI18n() @@ -203,7 +201,6 @@ const settingStore = useSettingStore() const userStore = useUserStore() const notificationStore = useNotificationStore() - const { hasAuth } = useAuth() const router = useRouter() const { @@ -262,12 +259,10 @@ onMounted(() => { initLanguage() - if (hasAuth(NOTIFICATION_PERMISSIONS.page)) { + void notificationStore.refreshUnreadCount().catch(() => undefined) + unreadTimer = window.setInterval(() => { void notificationStore.refreshUnreadCount().catch(() => undefined) - unreadTimer = window.setInterval(() => { - void notificationStore.refreshUnreadCount().catch(() => undefined) - }, 30_000) - } + }, 30_000) }) let unreadTimer: number | undefined diff --git a/src/components/core/layouts/art-notification/index.vue b/src/components/core/layouts/art-notification/index.vue index 1eca133..dace245 100644 --- a/src/components/core/layouts/art-notification/index.vue +++ b/src/components/core/layouts/art-notification/index.vue @@ -3,12 +3,7 @@
通知 -
@@ -62,8 +57,6 @@ import { NotificationService } from '@/api/modules' import type { NotificationCategory, NotificationItem } from '@/types/api' import { useNotificationStore } from '@/store/modules/notification' - import { useAuth } from '@/composables/useAuth' - import { NOTIFICATION_PERMISSIONS } from '@/config/constants/notification' import { navigateNotificationTarget } from '@/utils/business/notificationNavigation' import { formatDateTime } from '@/utils/business/format' @@ -72,7 +65,6 @@ const router = useRouter() const notificationStore = useNotificationStore() - const { hasAuth } = useAuth() const activeCategory = ref<'all' | NotificationCategory>('all') const visible = computed(() => props.modelValue) @@ -116,10 +108,6 @@ } const handleNotificationClick = async (item: NotificationItem) => { - if (!hasAuth(NOTIFICATION_PERMISSIONS.read)) { - ElMessage.warning('您没有标记通知已读的权限') - return - } try { const targetResponse = await NotificationService.getTarget(item.id) const readResponse = await notificationStore.markRead(item.id) diff --git a/src/config/constants/notification.ts b/src/config/constants/notification.ts deleted file mode 100644 index 56e21fc..0000000 --- a/src/config/constants/notification.ts +++ /dev/null @@ -1,5 +0,0 @@ -export const NOTIFICATION_PERMISSIONS = { - page: 'notifications:view', - read: 'notifications:read', - readAll: 'notifications:read_all' -} as const diff --git a/src/views/asset-management/expiring-assets/index.vue b/src/views/asset-management/expiring-assets/index.vue index 647d8f5..e8aa39a 100644 --- a/src/views/asset-management/expiring-assets/index.vue +++ b/src/views/asset-management/expiring-assets/index.vue @@ -33,8 +33,6 @@ :pageSize="pagination.pageSize" :total="pagination.total" :marginTop="10" - :actions="getActions" - :actionsWidth="140" @size-change="handleSizeChange" @current-change="handleCurrentChange" > @@ -50,7 +48,7 @@