refactor: ♻️ 控制台通知公告和导航栏消息通知样式优化
This commit is contained in:
15
src/enums/MessageTypeEnum.ts
Normal file
15
src/enums/MessageTypeEnum.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/* 消息类型枚举 */
|
||||
export const enum MessageTypeEnum {
|
||||
/* 消息 */
|
||||
MESSAGE = "MESSAGE",
|
||||
/* 通知 */
|
||||
NOTICE = "NOTICE",
|
||||
/* 待办 */
|
||||
TODO = "TODO",
|
||||
}
|
||||
|
||||
export const MessageTypeLabels = {
|
||||
[MessageTypeEnum.MESSAGE]: "消息",
|
||||
[MessageTypeEnum.NOTICE]: "通知",
|
||||
[MessageTypeEnum.TODO]: "待办",
|
||||
};
|
||||
30
src/enums/NoticeTypeEnum.ts
Normal file
30
src/enums/NoticeTypeEnum.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
/* 通知类型枚举 */
|
||||
export const enum NoticeTypeEnum {
|
||||
/** 系统升级 */
|
||||
SYSTEM_UPGRADE = "SYSTEM_UPGRADE",
|
||||
/** 系统维护 */
|
||||
SYSTEM_MAINTENANCE = "SYSTEM_MAINTENANCE",
|
||||
/** 安全警告 */
|
||||
SECURITY_ALERT = "SECURITY_ALERT",
|
||||
/** 假期通知 */
|
||||
HOLIDAY_NOTICE = "HOLIDAY_NOTICE",
|
||||
/** 公司新闻 */
|
||||
COMPANY_NEWS = "COMPANY_NEWS",
|
||||
/** 其他通知 */
|
||||
OTHER = "OTHER",
|
||||
}
|
||||
|
||||
// 定义标签映射
|
||||
const NoticeTypeLabels: Record<NoticeTypeEnum, string> = {
|
||||
[NoticeTypeEnum.SYSTEM_UPGRADE]: "系统升级",
|
||||
[NoticeTypeEnum.SYSTEM_MAINTENANCE]: "系统维护",
|
||||
[NoticeTypeEnum.SECURITY_ALERT]: "安全警告",
|
||||
[NoticeTypeEnum.HOLIDAY_NOTICE]: "假期通知",
|
||||
[NoticeTypeEnum.COMPANY_NEWS]: "公司新闻",
|
||||
[NoticeTypeEnum.OTHER]: "其他通知",
|
||||
};
|
||||
|
||||
// 导出获取标签函数
|
||||
export const getNoticeLabel = (type: NoticeTypeEnum): string => {
|
||||
return NoticeTypeLabels[type] || "";
|
||||
};
|
||||
Reference in New Issue
Block a user