columns.js 1012 Bytes
Newer Older
TZW's avatar
TZW committed
1
import { Image } from 'antd';
wuhao's avatar
wuhao committed
2 3 4
function getcolumns(setdrawer) {
  return [
    {
TZW's avatar
TZW committed
5 6 7
      title: '设备型号',
      dataIndex: 'equipmentModelName',
      key: 'equipmentModelName',
wuhao's avatar
wuhao committed
8 9 10
      formItemProps: {
        rules: [
          {
TZW's avatar
TZW committed
11
            required: true,
wuhao's avatar
wuhao committed
12 13 14 15 16 17 18
            message: '此项为必填项',
          },
        ],
      },
    },
    {
      title: '备注',
TZW's avatar
TZW committed
19 20 21 22
      dataIndex: 'modelDescription',
      key: 'modelDescription',
      initialValue: '默认值',
      hideInForm: false,
wuhao's avatar
wuhao committed
23 24 25
      search: false,
    },
    {
TZW's avatar
TZW committed
26 27 28 29
      title: '设备图片',
      dataIndex: 'pictureUrl',
      key: 'picList',
      search: false,
wuhao's avatar
wuhao committed
30 31
      valueType: 'uploadImage',
      fieldProps: {
TZW's avatar
TZW committed
32
        limit: 1,
wuhao's avatar
wuhao committed
33 34 35 36
      },
      formItemProps: {
        rules: [
          {
TZW's avatar
TZW committed
37
            required: false,
wuhao's avatar
wuhao committed
38 39 40 41
            message: '此项为必填项',
          },
        ],
      },
TZW's avatar
TZW committed
42 43
      hideInTable: false,
      render: (text, row) => <Image width={70} src={row.pictureUrl} />,
wuhao's avatar
wuhao committed
44 45 46 47 48
    },
  ];
}

export default getcolumns;