100 lines
1.8 KiB
Plaintext
100 lines
1.8 KiB
Plaintext
import { h } from 'vue';
|
|
import { Avatar } from 'ant-design-vue';
|
|
import { BasicColumn } from '@/components/Table';
|
|
|
|
export const columns: BasicColumn[] = [
|
|
{
|
|
title: 'id',
|
|
dataIndex: 'id',
|
|
width: 100,
|
|
},
|
|
{
|
|
title: '编码',
|
|
dataIndex: 'no',
|
|
width: 100,
|
|
},
|
|
{
|
|
title: '名称',
|
|
dataIndex: 'name',
|
|
editComponent: 'Input',
|
|
// 默认必填校验
|
|
editRule: true,
|
|
edit: true,
|
|
width: 150,
|
|
//自定义编辑前显示内容
|
|
// editCellRender: (value) => {
|
|
// return h(
|
|
// Tag,
|
|
// {
|
|
// style: {
|
|
// marginRight: '6px',
|
|
// },
|
|
// type: 'info',
|
|
// },
|
|
// {
|
|
// default: () => value,
|
|
// }
|
|
// );
|
|
// },
|
|
},
|
|
{
|
|
title: '头像',
|
|
dataIndex: 'avatar',
|
|
width: 100,
|
|
customRender({ record }) {
|
|
return h(Avatar, {
|
|
size: 48,
|
|
src: record.avatar,
|
|
shape: 'square',
|
|
});
|
|
},
|
|
},
|
|
{
|
|
title: '地址',
|
|
dataIndex: 'address',
|
|
editComponent: 'Select',
|
|
editComponentProps: {
|
|
options: [
|
|
{
|
|
label: '广东省',
|
|
value: 1,
|
|
},
|
|
{
|
|
label: '浙江省',
|
|
value: 2,
|
|
},
|
|
],
|
|
},
|
|
edit: true,
|
|
width: 200,
|
|
ellipsis: false,
|
|
},
|
|
{
|
|
title: '开始日期',
|
|
dataIndex: 'beginTime',
|
|
edit: true,
|
|
width: 160,
|
|
editComponent: 'DatePicker',
|
|
editComponentProps: {
|
|
type: 'datetime',
|
|
format: 'YYYY-MM-DD HH:mm:ss',
|
|
},
|
|
ellipsis: false,
|
|
},
|
|
{
|
|
title: '结束日期',
|
|
dataIndex: 'endTime',
|
|
width: 160,
|
|
},
|
|
{
|
|
title: '创建时间',
|
|
dataIndex: 'date',
|
|
width: 160,
|
|
},
|
|
{
|
|
title: '停留时间',
|
|
dataIndex: 'time',
|
|
width: 80,
|
|
},
|
|
];
|