import { remote } from './remote'
import { grid } from "./common";
import { genWarehouseSearchModal } from "../../../SearchModal";

export const items = [
  // form 表单
  /* ...genwarehouse({
    ...grid
  }), */
	// 仓库
	...genWarehouseSearchModal(1, true, false,null, 
			function (rowData, form) {
				if (!rowData) {
					form.setFieldsValue({
						warehouseId: '',
						warehouseCode:'',
						warehouseName:''
					})
				} else {
					form.setFieldsValue({
						warehouseId: rowData[0].warehouseId,
						warehouseCode: rowData[0].warehouseCode,
						warehouseName: rowData[0].warehouseName,
					})
				}
			},
			{ span: 8, labelCol: { span: 6 } }
		),
  {
    type: 'input',
    name: 'platName',
    label: '月台名称',
    value: '',
    ...grid
  },
  {
    type: 'input',
    name: 'platCode',
    label: '月台编码',
    value: '',
    ...grid
  },
  {
    type: 'select',
    name: 'platType',
    label: '月台类型',
    ...remote('pub_platform_plattype'),
    ...grid
  }
];

const columns = [
  {
    title: '月台编码',
    dataIndex: 'platCode',
  },
  {
    title: '月台名称',
    dataIndex: 'platName',
    scopedSlots: { customRender: 'warehouseCode' },
  },
  {
    title: '月台类型',
    dataIndex: 'platType',
  },
  {
    title: '状态',
    dataIndex: 'platStatus',
  },
  {
    title: '备注',
    dataIndex: 'remark',
  },
  {
    title: '操作',
    width: 100,
    dataIndex: 'action',
    scopedSlots: { customRender: 'action' },
  },
]

export { columns }

