refactor(设备管理): 提取常量并优化样式管理

将状态标签和设备类型映射提取到常量文件
将表格组件样式和空状态样式提取到样式文件
移除组件内硬编码的映射和样式,使用导入的常量
This commit is contained in:
zhang1106
2026-02-10 14:48:42 +08:00
parent b9d89bee11
commit 2c8d5c814c
3 changed files with 79 additions and 52 deletions
@@ -276,3 +276,20 @@ export const ACTION_BUTTON_CONFIG = {
// 单个删除确认消息
singleDeleteConfirmMessage: name => `确定要删除设备 "${name}" 吗?此操作不可恢复。`,
};
// 状态标签映射
export const STATUS_MAP = {
running: { text: '运行中', color: 'green' },
maintenance: { text: '维护中', color: 'orange' },
offline: { text: '离线', color: 'gray' },
fault: { text: '故障', color: 'red' },
};
// 设备类型映射
export const TYPE_MAP = {
server: '服务器',
switch: '交换机',
router: '路由器',
storage: '存储设备',
other: '其他设备',
};