const baseUrl = '/api/service-ai-eis-business-center-eistest'
const config = function (that) {
  return {
    remoteUrl: {
      url: baseUrl + '/orderpool/getorderpool',
      headers: {
        'Content-Type': 'application/JSON',
      },
      method: 'post',
    },
    items: [
      {
        span: 8,
        type: 'input',
        name: 'name',
        label: '订单池批拣单名称',
        value: '',
      },
      {
        span: 8,
        type: 'input',
        name: 'typeNo',
        label: '出库任务单类型编号',
        value: '',
        options: [
          { label: '未开始', value: 0 },
          { label: '进行中', value: 1 },
          { label: '已暂停', value: 2 },
          { label: '已完成', value: 3 },
        ],
      },
      {
        span: 8,
        label: '创建时间',
        type: 'date',
        name: 'createTimeFrom',
        placeholder: '请输入开始日期',
        value: '',
        format: 'YYYY-MM-DD HH:mm:ss',
        showTime: true,
        style: 'padding-right:5px;',
      },
      {
        span: 8,
        label: '结束时间',
        type: 'date',
        name: 'createTimeTo',
        placeholder: '请输入结束日期',
        format: 'YYYY-MM-DD hh:mm:ss',
        value: '',
      },

      {
        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: 'id',
        key: 'id',
        align: 'center',
        // width: 150,
        ellipsis: true,
        title: 'ID',
      },
      {
        title: '订单池批拣单名称',
        dataIndex: 'name',
        ellipsis: true,
        align: 'center',
        // width: 150,
        key: 'name',
        // customRender(text) {
        //   text == 10 && (text = '区域')
        //   text == 20 && (text = '接驳口')
        //   return text
        // }
      },
      {
        title: '出库任务单类型编号',
        dataIndex: 'typeNo',
        ellipsis: true,
        align: 'center',
        // width: 150,
        key: 'typeNo',
        // customRender(text) {
        //   text == 0 && (text = '未开始')
        //   text == 1 && (text = '进行中')
        //   text == 2 && (text = '已暂停')
        //   text == 3 && (text = '已完成')
        //   return text
        // }
      },
      //   {
      //     title: '最大汇单数量',
      //     dataIndex: 'maxOrderNum',
      //     ellipsis: true,
      //     align: 'center',
      //     // width: 150,
      //     key: 'maxOrderNum'
      //     // customRender(text) {
      //     //   text == 0 && (text = '未开始')
      //     //   text == 1 && (text = '进行中')
      //     //   text == 2 && (text = '已暂停')
      //     //   text == 3 && (text = '已完成')
      //     //   return text
      //     // }
      //   },

      {
        title: '创建时间',
        dataIndex: 'createTime',
        align: 'center',
        ellipsis: true,
        // width: 150,
        key: 'createTime',
        // customRender(text) {
        //   text == 0 && (text = '不索取')
        //   text == 1 && (text = '索取')
        //   return text
        // }
      },

      {
        title: '操作',
        key: 'operation',
        width: 150,
        align: 'center',
        scopedSlots: { customRender: 'operation' },
        fixed: 'right',
        align: 'center',
      },
    ],
    Modelitems: [
      {
        span: 24,
        type: 'input',
        name: 'name',
        required: true,
        label: '订单池批拣单名称',
        value: '',
      },
      {
        span: 24,
        type: 'input',
        name: 'id',
        hidden: true,
        label: 'id',
        value: '',
      },

      {
        span: 24,
        type: 'input',
        name: 'typeNo',

        required: true,
        label: '出库任务单类型编号',
        value: '',
      },
      //   {
      //     span: 24,
      //     type: 'input',
      //     name: 'maxOrderNum',

      //     required: true,
      //     label: '最大汇单数量',
      //     value: ''
      //   }
    ],
    details: {
      currentArea: '当前节点区域',
      nextArea: '下个节点区域',
      routeTaskState: '任务状态',
      routeExecuteState: '执行状态',
      currentLocation: '当前节点点位',
      nextLocation: '下个节点点位',
      deviceTask_id: '设备任务ID',
      deviceNo: '执行设备编号',
      arriveTime: '到位时间',
      errorMsg: '错误消息',
      updateTime: '修改时间',
    },
    Modelitemsupdate1: [
      {
        span: 24,
        type: 'input',
        name: 'name',
        required: true,
        label: '订单池批拣单名称',
        value: '',
      },
      {
        span: 24,
        type: 'input',
        name: 'id',
        hidden: true,
        label: 'id',
        value: '',
      },

      {
        span: 24,
        type: 'input',
        name: 'typeNo',

        required: true,
        label: '出库任务单类型编号',
        value: '',
      },
      //   {
      //     span: 24,
      //     type: 'input',
      //     name: 'maxOrderNum',

      //     required: true,
      //     label: '最大汇单数量',
      //     value: ''
      //   }
    ],
    Modelitemsupdate: [
      {
        span: 24,
        type: 'input',
        name: 'name',
        required: true,
        label: '订单池批拣单名称',
        value: '',
      },
      {
        span: 24,
        type: 'input',
        name: 'id',
        hidden: true,
        label: 'id',
        value: '',
      },

      {
        span: 24,
        type: 'input',
        name: 'typeNo',

        required: true,
        label: '出库任务单类型编号',
        value: '',
      },
      //   {
      //     span: 24,
      //     type: 'input',
      //     name: 'maxOrderNum',

      //     required: true,
      //     label: '最大汇单数量',
      //     value: ''
      //   }
    ],
  }
}

export default config
