const baseUrl = '/api/upcloud-base-wh-dev-mysql-eistest'

const config = {
  remoteUrl: {
    url: baseUrl + '/eisLocator/goods/page',
    headers: {
      'Content-Type': 'application/JSON',
    },
    method: 'post',
  },
  items: [
    {
      span: 8,
      type: 'input',
      name: 'locationNo',
      label: '货位编号',
      value: '',
    },
    {
      span: 8,
      type: 'input',
      name: 'groupNo',
      label: '货位组编号',
      value: '',
    },
    {
      span: 8,
      type: 'input',
      name: 'areaNo',
      label: '区域',
      value: '',
    },

    {
      span: 8,
      type: 'input',
      name: 'limitHeight',
      label: '限高',
      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: 'locationNo',
      key: 'locationNo',
      align: 'center',
      ellipsis: true,
      title: '货位编号',
    },
    {
      title: '货位组编号',
      dataIndex: 'groupNo',
      ellipsis: true,
      scopedSlots: { customRender: 'groupNo' },
      align: 'center',
      key: 'groupNo',
    },
    {
      title: '区域编号',
      dataIndex: 'areaNo',
      ellipsis: true,
      align: 'center',
      key: 'areaNo',
      customRender(text) {
        text == 1 && (text = '出库口')
        text == 2 && (text = '在线拣选')
        return text
      },
    },
    {
      title: '位置类型',
      ellipsis: true,
      key: 'locationType',
      dataIndex: 'locationType',
      align: 'center',
      customRender(text) {
        text == 1 && (text = '存储位')
        text == 2 && (text = '工作位')
        text == 3 && (text = '输送线点位')
        return text
      },
    },
    {
      title: '位置锁',
      dataIndex: 'locationLock',
      align: 'center',
      ellipsis: true,
      key: 'locationLock',
      customRender(text) {
        text == 0 && (text = '否')
        text == 1 && (text = '是')
        return text
      },
    },
    {
      title: '货位组锁',
      dataIndex: 'isLock',
      ellipsis: true,
      align: 'center',
      key: 'isLock',
      customRender(text) {
        text == 0 && (text = '否')
        text == 1 && (text = '是')
        return text
      },
    },
    {
      title: '货位组深位锁',
      dataIndex: 'ascentLockState',
      align: 'center',
      ellipsis: true,
      key: 'ascentLockState',
      customRender(text) {
        text == 0 && (text = '否')
        text == 1 && (text = '是')
        return text
      },
    },
    {
      title: '设备锁',
      dataIndex: 'equipmentLock',
      align: 'center',
      ellipsis: true,
      key: 'equipmentLock',
      customRender(text) {
        text == 0 && (text = '否')
        text == 1 && (text = '是')
        return text
      },
    },
    {
      title: '货位组位置索引',
      dataIndex: 'locationIndex',
      align: 'center',
      key: 'locationIndex',
    },
    {
      title: '货位深度',
      dataIndex: 'depth',
      align: 'center',
      key: 'depth',
    },
    // {
    //   title: '限高',
    //   dataIndex: 'limitHeight',
    //   align: 'center',
    //   key: 'limitHeight'
    // },

    {
      title: '移位数',
      dataIndex: 'deptNum',
      align: 'center',
      key: 'deptNum',
    },
    {
      title: '是否入库货位',
      dataIndex: 'isInBoundLocation',
      align: 'center',
      key: 'isInBoundLocation',
      customRender(text) {
        text == 0 && (text = '否')
        text == 1 && (text = '是')
        return text
      },
    },

    {
      title: '操作',
      key: 'operation',
      width: 150,
      scopedSlots: { customRender: 'operation' },
      align: 'center',
    },
  ],
  Modelitems: [
    {
      span: 24,
      type: 'input',
      name: 'locationNo',
      disabled: true,
      required: true,
      label: '点位编号',
      value: '',
    },
    {
      span: 24,
      type: 'input',
      name: 'id',
      hidden: true,
      label: 'id',
      value: '',
    },
    {
      span: 24,
      type: 'input',
      name: 'wmsLocationNo',
      label: 'WMS点位编号',
      value: '',
    },
    // {
    //   span: 24,
    //   type: 'select',
    //   name: 'locationType',
    //   required: true,
    //   label: '位置类型',
    //   value: '',
    //   options: [
    //     { label: '存储位', value: 1 },
    //     { label: '工作位', value: 2 },
    //     { label: '输送线点位', value: 3 }
    //   ]
    // },

    {
      span: 24,
      type: 'select',
      required: true,
      name: 'locationLock',
      label: '位置锁',
      value: '',
      options: [
        { label: '否', value: 0 },
        { label: '是', value: 1 },
      ],
    },
    // {
    //   span: 24,
    //   type: 'input',
    //   name: 'deviceNo',
    //   required: true,
    //   label: '设备类型',
    //   value: ''
    // }
    // {
    //   span: 24,
    //   type: 'input',
    //   required: true,
    //   name: 'limitHeight',
    //   label: '限高',
    //   value: ''
    // },

    // {
    //   span: 24,
    //   type: 'input',
    //   required: true,
    //   name: 'limitWeight',
    //   label: '限重',
    //   value: ''
    // }
  ],

  details: {
    currentArea: '当前节点区域',
    nextArea: '下个节点区域',
    routeTaskState: '任务状态',
    routeExecuteState: '执行状态',
    currentLocation: '当前节点点位',
    nextLocation: '下个节点点位',
    deviceTask_id: '设备任务ID',
    deviceNo: '执行设备编号',
    arriveTime: '到位时间',
    errorMsg: '错误消息',
    updateTime: '修改时间',
  },

  ModelitemsLock: [
    {
      span: 24,
      type: 'radio',
      name: 'isLock',
      options: [
        { label: '否', value: 0 },
        { label: '是', value: 1 },
      ],
      required: true,
      label: '货位组锁',
      value: '',
    },
    {
      span: 24,
      type: 'radio',
      name: 'ascentLockState',
      required: true,
      options: [
        { label: '否', value: 0 },
        { label: '是', value: 1 },
      ],
      label: '货位组深位锁',
      value: '',
    },
    {
      span: 24,
      type: 'input',
      name: 'locatorGroupId',
      hidden: true,
      label: 'locatorGroupId',
      value: '',
    },
  ],
  Modelitemsadjust: [
    {
      span: 24,
      type: 'input',
      name: 'groupNo',
      disabled: true,
      required: true,
      label: '货位组编号',
      value: '',
    },
    {
      span: 24,
      type: 'input',
      name: 'id',
      disabled: true,
      hidden: true,
      label: 'id',
      value: '',
    },
    {
      span: 24,
      type: 'select',
      name: 'entrance',
      disabled: true,
      label: '入口类型',
      options: [
        { label: '仅入口1', value: 1 },
        { label: '仅入口2', value: 2 },
        { label: '入口1+入口2', value: 3 },
      ],
      value: '',
    },
    {
      span: 24,
      type: 'input',
      name: 'inOutNum',
      disabled: true,
      required: true,
      label: '出入口数量',
      value: '',
      //   options: [
      //     { label: '存储位', value: 1 },
      //     { label: '工作位', value: 2 },
      //     { label: '输送线点位', value: 3 }
      //   ]
    },

    {
      span: 24,
      type: 'select',
      required: true,
      disabled: true,
      name: 'isLock',
      label: '是否锁定',
      value: 0,
      options: [
        { label: '否', value: 0 },
        { label: '是', value: 1 },
      ],
    },
    {
      span: 24,
      type: 'select',
      disabled: true,
      name: 'ascentLockState',
      label: '货位组升位锁',
      value: 0,
      options: [
        { label: '否', value: 0 },
        { label: '是', value: 1 },
      ],
    },
    {
      span: 24,
      type: 'select',
      disabled: true,
      name: 'readyOutLock',
      label: '待出库锁',
      value: 0,
      options: [
        { label: '否', value: 0 },
        { label: '是', value: 1 },
      ],
    },
    {
      span: 24,
      type: 'select',
      name: 'equipmentLock',
      label: '设备锁',
      disabled: true,
      options: [
        { label: '否', value: 0 },
        { label: '是', value: 1 },
      ],
      value: '',
    },
    {
      span: 24,
      type: 'input',
      disabled: true,
      name: 'x',
      label: 'X轴',
      value: '',
    },
    {
      span: 24,
      type: 'input',
      name: 'y',
      disabled: true,
      label: 'Y轴',
      value: '',
    },
    {
      span: 24,
      type: 'input',
      name: 'locationNum',
      disabled: true,
      label: '货位数量',
      value: '',
    },
    {
      span: 24,
      type: 'input',
      disabled: true,
      name: 'subAreaNo',
      label: '子区域编号',
      value: '',
    },
    {
      span: 24,
      type: 'input',
      name: 'belongArea',
      disabled: true,
      label: '所属区域',
      value: '',
    },
  ],
}
export default config
