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
@@ -406,6 +406,50 @@ export const exportModalStyles = {
},
};
// 空状态样式
export const emptyStateStyle = {
textAlign: 'center',
padding: '60px 20px',
fontSize: '15px',
};
// 空状态图标样式
export const emptyStateIconStyle = {
fontSize: '48px',
marginBottom: '16px',
};
// 表格容器样式
export const tableContainerStyle = {
borderRadius: borderRadius.medium,
overflow: 'hidden',
};
// ResizableTitle 组件样式
export const resizableTitleStyles = {
container: {
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
width: '100%',
},
text: {
flex: 1,
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
},
resizeHandle: {
width: '8px',
height: '20px',
backgroundColor: '#e0e0e0',
borderRadius: '4px',
cursor: 'col-resize',
marginLeft: '8px',
flexShrink: 0,
},
};
// CSS-in-JS 样式字符串生成函数
export const generateGlobalStyles = tokens => `
.device-modal .ant-modal-close {