columns.js 1 KB
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
      dataIndex: 'modelDescription',
      key: 'modelDescription',
      initialValue: '默认值',
TZW's avatar
TZW committed
22
      width: 250,
TZW's avatar
TZW committed
23
      hideInForm: false,
wuhao's avatar
wuhao committed
24 25 26
      search: false,
    },
    {
TZW's avatar
TZW committed
27
      title: '图片',
TZW's avatar
TZW committed
28 29 30
      dataIndex: 'pictureUrl',
      key: 'picList',
      search: false,
wuhao's avatar
wuhao committed
31 32
      valueType: 'uploadImage',
      fieldProps: {
TZW's avatar
TZW committed
33
        limit: 1,
wuhao's avatar
wuhao committed
34 35 36 37
      },
      formItemProps: {
        rules: [
          {
TZW's avatar
TZW committed
38
            required: false,
wuhao's avatar
wuhao committed
39 40 41 42
            message: '此项为必填项',
          },
        ],
      },
TZW's avatar
TZW committed
43 44
      hideInTable: false,
      render: (text, row) => <Image width={70} src={row.pictureUrl} />,
wuhao's avatar
wuhao committed
45 46 47 48 49
    },
  ];
}

export default getcolumns;