管理后台初始化,登录,团队管理,报价单管理 完成
This commit is contained in:
22
src/utils/tableColumns.jsx
Normal file
22
src/utils/tableColumns.jsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Tag } from 'antd';
|
||||
|
||||
export const getStatusColumn = (options = {}) => ({
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
render: (status) => {
|
||||
const color = status === '进行中' ? 'green' :
|
||||
status === '已完成' ? 'blue' :
|
||||
status === '已取消' ? 'red' : 'default';
|
||||
return <Tag color={color}>{status}</Tag>;
|
||||
},
|
||||
...options,
|
||||
});
|
||||
|
||||
export const getDateColumn = (title, dataIndex, options = {}) => ({
|
||||
title,
|
||||
dataIndex,
|
||||
key: dataIndex,
|
||||
render: (date) => new Date(date).toLocaleString(),
|
||||
...options,
|
||||
});
|
||||
Reference in New Issue
Block a user