diff --git a/locales/en.yaml b/locales/en.yaml index 64a27092a..31bf130f2 100644 --- a/locales/en.yaml +++ b/locales/en.yaml @@ -19,6 +19,8 @@ buttons: pureBackTop: BackTop pureOpenText: Open pureCloseText: Close + pureWatchMore: Watch More + pureMarkAsRead: Mark As Read search: pureTotal: Total pureHistory: History diff --git a/locales/zh-CN.yaml b/locales/zh-CN.yaml index 83bb3df51..dc55db717 100644 --- a/locales/zh-CN.yaml +++ b/locales/zh-CN.yaml @@ -19,6 +19,8 @@ buttons: pureBackTop: 回到顶部 pureOpenText: 开 pureCloseText: 关 + pureWatchMore: 查看更多 + pureMarkAsRead: 标为已读 search: pureTotal: 共 pureHistory: 搜索历史 diff --git a/src/layout/components/lay-notice/components/NoticeItem.vue b/src/layout/components/lay-notice/components/NoticeItem.vue index 4608e6f77..b3ea18d08 100644 --- a/src/layout/components/lay-notice/components/NoticeItem.vue +++ b/src/layout/components/lay-notice/components/NoticeItem.vue @@ -8,6 +8,10 @@ defineProps({ noticeItem: { type: Object as PropType, default: () => {} + }, + isLast: { + type: Boolean, + default: false } }); @@ -49,7 +53,11 @@ function hoverDescription(event, description) { diff --git a/src/layout/components/lay-notice/index.vue b/src/layout/components/lay-notice/index.vue index b1f4d5ffc..e31dad803 100644 --- a/src/layout/components/lay-notice/index.vue +++ b/src/layout/components/lay-notice/index.vue @@ -3,9 +3,12 @@ import { useI18n } from "vue-i18n"; import { ref, computed } from "vue"; import { noticesData } from "./data"; import NoticeList from "./components/NoticeList.vue"; + import BellIcon from "~icons/lucide/bell"; +import ArrowRightIcon from "~icons/ri/arrow-right-s-line"; const { t } = useI18n(); +const dropdownRef = ref(); const notices = ref(noticesData); const activeKey = ref(noticesData[0]?.key); @@ -13,10 +16,30 @@ const getLabel = computed( () => item => t(item.name) + (item.list.length > 0 ? `(${item.list.length})` : "") ); + +const currentNoticeHasData = computed(() => { + const currentNotice = notices.value.find( + item => item.key === activeKey.value + ); + return currentNotice && currentNotice.list.length > 0; +}); + +const onWatchMore = () => { + dropdownRef.value.handleClose(); +}; + +const onMarkAsRead = () => { + const currentNotice = notices.value.find( + item => item.key === activeKey.value + ); + if (currentNotice) { + currentNotice.list = []; + } +};