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