(authStore.userInfo?.user?.tenantId || '0
+
{
+export const useNoticeStore = defineStore(SetupStoreId.Notice, () => {
const state = reactive({
notices: [] as NoticeItem[]
});
@@ -21,6 +22,10 @@ export const useNoticeStore = defineStore('notice', () => {
state.notices.splice(state.notices.indexOf(notice), 1);
};
+ const readNotice = (notice: NoticeItem) => {
+ state.notices[state.notices.indexOf(notice)].read = true;
+ };
+
// 实现全部已读
const readAll = () => {
state.notices.forEach((item: any) => {
@@ -31,10 +36,12 @@ export const useNoticeStore = defineStore('notice', () => {
const clearNotice = () => {
state.notices = [];
};
+
return {
state,
addNotice,
removeNotice,
+ readNotice,
readAll,
clearNotice
};
diff --git a/src/typings/components.d.ts b/src/typings/components.d.ts
index 6ae162ed..f735fc70 100644
--- a/src/typings/components.d.ts
+++ b/src/typings/components.d.ts
@@ -62,6 +62,7 @@ declare module 'vue' {
NA: typeof import('naive-ui')['NA']
NAlert: typeof import('naive-ui')['NAlert']
NAvatar: typeof import('naive-ui')['NAvatar']
+ NBadge: typeof import('naive-ui')['NBadge']
NBreadcrumb: typeof import('naive-ui')['NBreadcrumb']
NBreadcrumbItem: typeof import('naive-ui')['NBreadcrumbItem']
NButton: typeof import('naive-ui')['NButton']
@@ -81,6 +82,7 @@ declare module 'vue' {
NDrawerContent: typeof import('naive-ui')['NDrawerContent']
NDropdown: typeof import('naive-ui')['NDropdown']
NDynamicInput: typeof import('naive-ui')['NDynamicInput']
+ NEllipsis: typeof import('naive-ui')['NEllipsis']
NEmpty: typeof import('naive-ui')['NEmpty']
NForm: typeof import('naive-ui')['NForm']
NFormItem: typeof import('naive-ui')['NFormItem']