diff --git a/web/.gitignore b/web/.gitignore index 18a53b5..f30c2ed 100644 --- a/web/.gitignore +++ b/web/.gitignore @@ -1,5 +1,6 @@ .DS_Store node_modules +.pnpm-store /screenshots /dist dist.zip diff --git a/web/src/layout/components/Header/index.vue b/web/src/layout/components/Header/index.vue index 8fd072a..44acc82 100644 --- a/web/src/layout/components/Header/index.vue +++ b/web/src/layout/components/Header/index.vue @@ -196,7 +196,7 @@ ref, computed, unref, - watch, + // watch, // 随右上角弹窗推送暂时注释 h, onMounted, } from 'vue'; @@ -206,12 +206,12 @@ NDialogProvider, useDialog, useMessage, - NAvatar, - NTag, + // NAvatar, // 随右上角弹窗推送暂时注释 + // NTag, + // useNotification, + // NotificationReactive, + // NButton, NIcon, - useNotification, - NotificationReactive, - NButton, NText, } from 'naive-ui'; import { TABS_ROUTES } from '@/store/mutation-types'; @@ -223,7 +223,7 @@ import { NotificationsOutline as NotificationsIcon } from '@vicons/ionicons5'; import SystemMessage from './SystemMessage.vue'; import { notificationStoreWidthOut } from '@/store/modules/notification'; - import { getIcon } from '@/enums/systemMessageEnum'; + // import { getIcon } from '@/enums/systemMessageEnum'; // 随右上角弹窗推送暂时注释 import { availableLocales, useI18nStore } from '@/store/modules/i18n'; import Search from './Search.vue'; @@ -392,10 +392,10 @@ click: () => window.open('https://github.com/bufanyun/hotgo'), }, }, - { - icon: 'BellOutlined', - tips: '我的消息', - }, + // { + // icon: 'BellOutlined', + // tips: '我的消息', + // }, { icon: 'LockOutlined', tips: '锁屏', @@ -470,88 +470,90 @@ openDrawer(); } - const notification = useNotification(); - const getMessages = computed(() => { - return notificationStore.newMessage; - }); - const nRef = ref(null); + // 通知铃铛已暂时隐藏,暂停右上角实时弹窗推送;后续恢复时取消注释(连同下方 import) + // const notification = useNotification(); + // const getMessages = computed(() => { + // return notificationStore.newMessage; + // }); + // const nRef = ref(null); // 监听新消息,推送通知 - watch( - getMessages, - (newVal, _oldVal) => { - if (newVal === null || newVal === undefined) { - return; - } + // watch( + // getMessages, + // (newVal, _oldVal) => { + // if (newVal === null || newVal === undefined) { + // return; + // } - nRef.value = notification.create({ - title: newVal.title, - description: - newVal.tagTitle === '' || newVal.tagTitle === undefined - ? undefined - : () => - h( - NTag, - { - style: { - marginRight: '6px', - }, - type: newVal.tagProps?.type, - bordered: false, - }, - { - default: () => newVal.tagTitle, - } - ), + // nRef.value = notification.create({ + // title: newVal.title, + // description: + // newVal.tagTitle === '' || newVal.tagTitle === undefined + // ? undefined + // : () => + // h( + // NTag, + // { + // style: { + // marginRight: '6px', + // }, + // type: newVal.tagProps?.type, + // bordered: false, + // }, + // { + // default: () => newVal.tagTitle, + // } + // ), - content: () => - newVal.content === '' || newVal.content === undefined - ? undefined - : h('div', { innerHTML: '
' + newVal.content + '
' }), - meta: newVal.createdAt, - avatar: () => - newVal.senderAvatar !== '' || newVal.senderAvatar === undefined - ? h(NAvatar, { - size: 'small', - round: true, - src: newVal.senderAvatar, - }) - : h(NIcon, null, { default: () => h(getIcon(newVal)) }), - action: () => - h( - NButton, - { - text: true, - type: 'info', - onClick: () => { - (nRef.value as NotificationReactive).destroy(); - router.push({ - name: 'home_message', - query: { - type: newVal.type, - }, - }); - }, - }, - { - default: () => '查看详情', - } - ), - onClose: () => { - nRef.value = null; - }, - }); - }, - { immediate: true, deep: true } - ); + // content: () => + // newVal.content === '' || newVal.content === undefined + // ? undefined + // : h('div', { innerHTML: '
' + newVal.content + '
' }), + // meta: newVal.createdAt, + // avatar: () => + // newVal.senderAvatar !== '' || newVal.senderAvatar === undefined + // ? h(NAvatar, { + // size: 'small', + // round: true, + // src: newVal.senderAvatar, + // }) + // : h(NIcon, null, { default: () => h(getIcon(newVal)) }), + // action: () => + // h( + // NButton, + // { + // text: true, + // type: 'info', + // onClick: () => { + // (nRef.value as NotificationReactive).destroy(); + // router.push({ + // name: 'home_message', + // query: { + // type: newVal.type, + // }, + // }); + // }, + // }, + // { + // default: () => '查看详情', + // } + // ), + // onClose: () => { + // nRef.value = null; + // }, + // }); + // }, + // { immediate: true, deep: true } + // ); const updateMenu = () => { emit('update:collapsed', !props.collapsed); }; onMounted(() => { - if (notificationStore.getUnreadCount() === 0) { - notificationStore.pullMessages(); - } + // 通知铃铛已暂时隐藏,暂停首屏未读拉取;后续恢复铃铛时取消注释 + // if (notificationStore.getUnreadCount() === 0) { + // notificationStore.pullMessages(); + // } }); return { ...toRefs(state),