const baseUrl = '/api/upcloud-base-wh-dev-mysql-eistest'
const config = {
  remoteUrl: {
    url: baseUrl + '/deviceInfo/get-deviceInfo-page',
    headers: {
      'Content-Type': 'application/JSON',
    },
    method: 'get',
  },
  items: [
    {
      span: 8,
      type: 'input',
      name: 'deviceNo',
      label: '设备编号',
      value: '',
    },

    {
      span: 8,
      type: 'select',
      name: 'deviceType',
      label: '设备类型',
      value: '',
      options: [
        { label: '四向车', value: 1 },
        { label: '堆垛机', value: 2 },
        { label: 'AGV', value: 3 },
        { label: '提升机', value: 4 },
        { label: '多穿车', value: 5 },
        { label: '托盘输送线', value: 6 },
        { label: '料箱输送线', value: 7 },
      ],
    },

    {
      span: 24,
      type: 'buttonGroup',
      style: { textAlign: 'right' },
      options: [
        {
          value: '查询',
          icon: 'search',
          btnType: 'primary',
          style: 'margin-right:10px',
          htmlType: 'submit',
        },
        {
          value: '重置',
          icon: 'redo',
          style: 'margin-right:50px',
          on: {
            click: (event, form) => {
              console.log(form)
              form.resetFields()
            },
          },
        },
      ],
    },
  ],
  columns: [
    {
      dataIndex: 'deviceNo',
      key: 'deviceNo',
      align: 'center',
      title: '设备编号',
    },
    {
      title: '设备类型',
      dataIndex: 'deviceType',
      align: 'center',
      key: 'deviceType',
      customRender(text) {
        text == 1 && (text = '四向车')
        text == 2 && (text = '堆垛机')
        text == 3 && (text = 'AGV')
        text == 4 && (text = '提升机')
        text == 5 && (text = '多穿车')
        text == 6 && (text = '托盘输送线')
        text == 7 && (text = '料箱输送线')
        return text
      },
    },
    {
      title: '设备描述',
      dataIndex: 'deviceDescription',
      align: 'center',
      key: 'deviceDescription',
      //   customRender(text) {
      //     text == 1 && (text = '出库口')
      //     text == 2 && (text = '钢平台拣选')
      //     text == 3 && (text = '在线拣选')
      //     return text
      //   }
    },
    {
      title: '注册时间',
      key: 'createTime',
      dataIndex: 'createTime',
      align: 'center',
    },

    {
      title: '操作',
      key: 'operation',
      scopedSlots: { customRender: 'operation' },
      //   fixed: 'right',
      align: 'center',
    },
  ],
  Modelitems: [
    {
      span: 24,
      type: 'input',
      name: 'deviceNo',
      required: true,
      label: '设备编号',
      value: '',
    },
    {
      span: 24,
      type: 'input',
      name: 'id',
      hidden: true,
      label: 'id',
      value: '',
    },

    {
      span: 24,
      type: 'select',
      required: true,
      name: 'deviceType',
      label: '设备类型',
      value: '',
      options: [
        { label: '四向车', value: 1 },
        { label: '堆垛机', value: 2 },
        { label: 'AGV', value: 3 },
        { label: '提升机', value: 4 },
        { label: '多穿车', value: 5 },
        { label: '托盘输送线', value: 6 },
        { label: '料箱输送线', value: 7 },
      ],
    },
    {
      span: 24,
      type: 'input',
      required: true,
      name: 'deviceDescription',
      label: '设备描述',
      value: '',
    },
  ],
  details: {
    currentArea: '当前节点区域',
    nextArea: '下个节点区域',
    routeTaskState: '任务状态',
    routeExecuteState: '执行状态',
    currentLocation: '当前节点点位',
    nextLocation: '下个节点点位',
    deviceTask_id: '设备任务ID',
    deviceNo: '执行设备编号',
    arriveTime: '到位时间',
    errorMsg: '错误消息',
    updateTime: '修改时间',
  },
}
export default config
