From 609a01dc8a1f882673caafb705c9a2789b4e12e9 Mon Sep 17 00:00:00 2001
From: hongawen <83944980@qq.com>
Date: Sat, 13 Jun 2026 14:59:31 +0800
Subject: [PATCH] =?UTF-8?q?refactor(projects):=20=E6=B6=88=E6=81=AF?=
=?UTF-8?q?=E6=8F=90=E7=A4=BA=E5=A2=9E=E5=8A=A0=E7=AD=89=E7=BA=A7=E5=8C=BA?=
=?UTF-8?q?=E5=88=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/constants/dict.ts | 9 ++
.../components/notification-bell.vue | 132 +++++++++++++++---
.../global-menu/modules/horizontal-menu.vue | 2 +-
.../modules/horizontal-mix-menu.vue | 5 +-
.../modules/reversed-horizontal-mix-menu.vue | 4 +-
.../global-menu/modules/vertical-menu.vue | 2 +-
.../global-menu/modules/vertical-mix-menu.vue | 2 +-
src/service/api/dict.ts | 12 +-
src/service/api/notify-message.ts | 7 +-
src/store/modules/dict/index.ts | 13 +-
src/typings/api/dict.d.ts | 4 +
src/typings/api/notify-message.d.ts | 2 +
src/utils/datetime.ts | 7 +
13 files changed, 167 insertions(+), 34 deletions(-)
diff --git a/src/constants/dict.ts b/src/constants/dict.ts
index 5afc803..139b594 100644
--- a/src/constants/dict.ts
+++ b/src/constants/dict.ts
@@ -119,3 +119,12 @@ export const RDMS_WORKLOG_DIFFICULTY_DICT_CODE = 'rdms_task_item_worklog_difficu
* 来源口径:`overtime-application-design.md` 明确时长下拉字典为 rdms_overtime_duration
*/
export const RDMS_OVERTIME_DURATION_DICT_CODE = 'rdms_overtime_duration';
+
+/**
+ * 站内信消息等级字典编码
+ *
+ * 对应业务字段:站内信 NotifyMessage.level(1=普通 2=提醒 3=警告 4=严重,数字越大越紧急)
+ * 来源口径:`2026-06-13-站内信消息等级-前端对接.html` 明确等级字典为 notify_message_level,
+ * 显示名与颜色(hex)均走字典,前端按 level 取色不硬编码。
+ */
+export const NOTIFY_MESSAGE_LEVEL_DICT_CODE = 'notify_message_level';
diff --git a/src/layouts/modules/global-header/components/notification-bell.vue b/src/layouts/modules/global-header/components/notification-bell.vue
index d4ce467..0d9bb3d 100644
--- a/src/layouts/modules/global-header/components/notification-bell.vue
+++ b/src/layouts/modules/global-header/components/notification-bell.vue
@@ -1,18 +1,22 @@
-
+
-
+
+
-
+
-
+
-
+
-
+
-
+
& {
colorType?: string | null;
color_type?: string | null;
+ css_class?: string | null;
};
type DictDataPageResponse = Omit, 'list'> & {
@@ -28,6 +29,7 @@ type DictDataPageResponse = Omit, 'list'>
type FrontendDictDataResponse = Omit & {
colorType?: string | null;
color_type?: string | null;
+ css_class?: string | null;
};
type FrontendDictCacheResponse = Record;
@@ -37,20 +39,22 @@ function normalizeColorType(value?: string | null) {
}
function normalizeDictData(data: DictDataResponse): Api.Dict.DictData {
- const { color_type: colorTypeFromSnakeCase, ...rest } = data;
+ const { color_type: colorTypeFromSnakeCase, css_class: cssClassFromSnakeCase, ...rest } = data;
return {
...rest,
- colorType: normalizeColorType(data.colorType ?? colorTypeFromSnakeCase)
+ colorType: normalizeColorType(data.colorType ?? colorTypeFromSnakeCase),
+ cssClass: normalizeColorType(data.cssClass ?? cssClassFromSnakeCase)
};
}
function normalizeFrontendDictData(data: FrontendDictDataResponse): Api.Dict.FrontendDictData {
- const { color_type: colorTypeFromSnakeCase, ...rest } = data;
+ const { color_type: colorTypeFromSnakeCase, css_class: cssClassFromSnakeCase, ...rest } = data;
return {
...rest,
- colorType: normalizeColorType(data.colorType ?? colorTypeFromSnakeCase)
+ colorType: normalizeColorType(data.colorType ?? colorTypeFromSnakeCase),
+ cssClass: normalizeColorType(data.cssClass ?? cssClassFromSnakeCase)
};
}
diff --git a/src/service/api/notify-message.ts b/src/service/api/notify-message.ts
index 8a67b96..c4ff376 100644
--- a/src/service/api/notify-message.ts
+++ b/src/service/api/notify-message.ts
@@ -4,8 +4,10 @@ import { type ServiceRequestResult, mapServiceResult, normalizeStringId, safeJso
const NOTIFY_MESSAGE_PREFIX = `${SYSTEM_SERVICE_PREFIX}/notify-message`;
-type NotifyMessageResponse = Omit & {
+type NotifyMessageResponse = Omit & {
id: string | number;
+ /** 后端老消息可能不带 level,按可空接收,normalize 时回落普通(1) */
+ level?: number | null;
};
type MyNotifyMessagePageResponse = Omit, 'list'> & {
@@ -15,7 +17,8 @@ type MyNotifyMessagePageResponse = Omit