diff --git a/src/apis/system/index.ts b/src/apis/system/index.ts index 27d9408..bbf216d 100644 --- a/src/apis/system/index.ts +++ b/src/apis/system/index.ts @@ -8,3 +8,4 @@ export * from './file' export * from './storage' export * from './option' export * from './user-center' +export * from './message' diff --git a/src/apis/system/message.ts b/src/apis/system/message.ts new file mode 100644 index 0000000..85bce64 --- /dev/null +++ b/src/apis/system/message.ts @@ -0,0 +1,19 @@ +import type * as System from './type' +import http from '@/utils/http' + +const BASE_URL = '/system/message' + +/** @desc 查询消息列表 */ +export function listMessage(query: System.MessagePageQuery) { + return http.get>(`${BASE_URL}`, query) +} + +/** @desc 删除消息 */ +export function deleteMessage(ids: string | Array) { + return http.del(`${BASE_URL}/${ids}`) +} + +/** @desc 标记已读 */ +export function readMessage(ids: string | Array) { + return http.patch(`${BASE_URL}/read`, ids) +} diff --git a/src/apis/system/type.ts b/src/apis/system/type.ts index 68e3f3c..395a9d9 100644 --- a/src/apis/system/type.ts +++ b/src/apis/system/type.ts @@ -297,3 +297,25 @@ export interface BindSocialAccountRes { source: string description: string } + +/** 系统消息类型 */ +export interface MessageResp { + id: string + title: string + content: string + type: number + isRead: boolean + readTime: string + createUserString: string + createTime: string +} + +export interface MessageQuery { + title?: string + type?: number + isRead?: boolean + sort: Array +} + +export interface MessagePageQuery extends MessageQuery, PageQuery { +} diff --git a/src/apis/system/user-center.ts b/src/apis/system/user-center.ts index 22a65e7..a80e084 100644 --- a/src/apis/system/user-center.ts +++ b/src/apis/system/user-center.ts @@ -1,5 +1,5 @@ +import type * as System from './type' import http from '@/utils/http' -import type * as System from '@/apis/system/type' const BASE_URL = '/system/user' diff --git a/src/router/index.ts b/src/router/index.ts index 4f813fb..931d223 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -63,6 +63,12 @@ export const constantRoutes: RouteRecordRaw[] = [ name: 'SettingProfile', component: () => import('@/views/setting/profile/index.vue'), meta: { title: '个人中心', showInTabs: false } + }, + { + path: '/setting/message', + name: 'SettingMessage', + component: () => import('@/views/setting/message/index.vue'), + meta: { title: '消息中心', showInTabs: false } } ] } diff --git a/src/views/setting/message/index.vue b/src/views/setting/message/index.vue new file mode 100644 index 0000000..eb19d45 --- /dev/null +++ b/src/views/setting/message/index.vue @@ -0,0 +1,140 @@ + + + + + diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue index 09e044a..a912cf3 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -94,7 +94,7 @@ const columns: TableInstanceColumns[] = [ }, { title: '标签', dataIndex: 'label', slotName: 'label', width: 100, align: 'center' }, { title: '值', dataIndex: 'value', width: 100, align: 'center', ellipsis: true, tooltip: true }, - { title: '状态', slotName: 'status', width: 90, align: 'center' }, + { title: '状态', slotName: 'status', width: 80, align: 'center' }, { title: '排序', dataIndex: 'sort', diff --git a/src/views/system/dict/tree/index.vue b/src/views/system/dict/tree/index.vue index 88775f0..e1d6aa5 100644 --- a/src/views/system/dict/tree/index.vue +++ b/src/views/system/dict/tree/index.vue @@ -13,9 +13,9 @@ -
{{ node.name }}({{ node.code }})
+
{{ node.name }} ({{ node.code }})
-
{{ node.name }}({{ node.code }})
+
{{ node.name }} ({{ node.code }})