import { BasicColumn, FormSchema } from '@jdlinker/ui';
import { Badge, Space } from 'ant-design-vue';
import dayjs from 'dayjs';
export const statusMap = {
online: ,
offline: ,
notActive: ,
};
//列表数据
export const columns: BasicColumn[] = [
{
title: '设备编号',
align: 'center',
dataIndex: 'id',
},
{
title: '设备名称',
align: 'center',
dataIndex: 'name',
},
{
title: '产品名称',
align: 'center',
dataIndex: 'productName',
},
{
title: '注册时间',
align: 'center',
dataIndex: 'registryTime',
customRender: ({ text }) => {
return {text ? dayjs(text).format('YYYY-MM-DD HH:mm:ss') : ''};
},
},
{
title: '状态',
align: 'center',
dataIndex: 'state',
customRender: ({ record }) => {
return {statusMap[record.state.value]};
},
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: '设备名称',
field: 'name',
component: 'JInput',
},
{
label: '产品名称',
field: 'productId',
component: 'JDictSelectTag',
componentProps: {
dictCode: 'linker_device_product,name,id',
placeholder: '请选择产品名称',
},
},
];