import { remote } from '@/views/EIS/remote/index.js'
const baseUrl = '/api/service-ai-eis-route-center-eistest'
const config = {
  remoteUrl: {
    url: baseUrl + '/eispathexecutionrecord/container/location',
    headers: {
      'Content-Type': 'application/JSON',
    },
    method: 'post',
  },
  items: [
    {
      span: 8,
      type: 'input',
      name: 'containerNo',
      label: '托盘号',
      value: '',
    },
    {
      span: 8,
      type: 'input',
      name: 'palletNo',
      label: '载具编号',
      value: '',
    },
    {
      span: 8,
      type: 'row',
      label: '日期',
      list: [
        {
          type: 'date',
          name: 'startTime',
          placeholder: '请输入开始日期',
          value: '',
          format: 'YYYY-MM-DD HH:mm:ss',
          style: 'padding-right:5px;',
        },
        {
          type: 'date',
          name: 'endTime',
          placeholder: '请输入结束日期',
          format: 'YYYY-MM-DD HH:mm:ss',
          value: '',
        },
      ],
    },
    // {
    //   span: 8,
    //   type: 'select',
    //   name: 'taskType',
    //   label: '任务类型',
    //   value: '',
    //   options: [
    //     { label: '无任务', value: 0 },
    //     { label: '入库', value: 10 },
    //     { label: '出库', value: 20 },
    //     { label: '内部位移', value: 30 },
    //     { label: '移动', value: 40 }
    //   ]
    // },

    {
      span: 8,
      type: 'select',
      name: 'taskType',
      label: '任务类型',
      value: '',
      ...remote('eis_route_container_loc_task_type'),
    },
    {
      span: 8,
      type: 'select',
      name: 'taskState',
      label: '任务状态',
      value: '',
      ...remote('eis_route_container_loc_task_state'),
    },
    {
      span: 8,
      type: 'input',
      name: 'sourceArea',
      label: '起点区域',
      value: '',
    },
    {
      span: 8,
      type: 'input',
      name: 'targetArea',
      label: '终点区域',
      value: '',
    },
    {
      span: 8,
      type: 'buttonGroup',
      style: { textAlign: 'left' },
      options: [
        {
          value: '查询',
          icon: 'search',
          btnType: 'primary',
          style: 'margin-right:10px',
          htmlType: 'submit',
        },
        {
          value: '重置',
          icon: 'redo',
          on: {
            click: (event, form) => {
              console.log(form)
              form.resetFields()
            },
          },
        },
      ],
    },
  ],
  columns: [
    {
      dataIndex: 'containerNo',
      key: 'containerNo',
      align: 'center',
      title: '托盘号',
    },
    {
      title: '载具号',
      dataIndex: 'palletNo',
      align: 'center',
      key: 'palletNo',
    },
    {
      title: '任务号',
      ellipsis: true,
      dataIndex: 'taskNo',
      align: 'center',
      key: 'taskNo',
    },
    {
      title: '任务类型',
      key: 'taskState',
      dataIndex: 'taskState',
      align: 'center',
      ...remote('eis_route_container_loc_task_type'),
    },
    {
      title: '起点区域',
      dataIndex: 'sourceArea',
      align: 'center',
      key: 'sourceArea',
    },
    {
      title: '起点货位',
      dataIndex: 'sourceLocation',
      align: 'center',
      key: 'sourceLocation',
    },
    {
      title: '终点区域',
      dataIndex: 'targetArea',
      align: 'center',
      key: 'targetArea',
    },
    {
      title: '创建时间',
      dataIndex: 'createTime',
      ellipsis: true,
      align: 'center',
      key: 'createTime',
    },

    {
      title: '操作',
      key: 'operation',
      width: 150,
      scopedSlots: { customRender: 'operation' },
      fixed: 'right',
      align: 'center',
    },
  ],
  modelcolumns: [
    {
      dataIndex: 'containerNo',
      key: 'containerNo',
      align: 'center',
      ellipsis: true,
      title: '容器号',
    },
    {
      title: '任务序号',
      dataIndex: 'taskIndex',
      align: 'center',
      ellipsis: true,
      key: 'taskIndex',
    },
    {
      title: '当前点位',
      ellipsis: true,
      dataIndex: 'currentLocation',
      align: 'center',
      key: 'currentLocation',
    },

    {
      title: '下一个点位区域',
      dataIndex: 'nextArea',
      ellipsis: true,
      align: 'center',
      key: 'nextArea',
    },
    {
      title: '下一个点位',
      dataIndex: 'nextLocation',
      align: 'center',
      ellipsis: true,
      key: 'nextLocation',
    },
    {
      title: '设备任务ID',
      dataIndex: 'deviceTaskId',
      align: 'center',
      ellipsis: true,
      key: 'deviceTaskId',
    },

    {
      title: '执行设备编号',
      dataIndex: 'deviceNo',
      ellipsis: true,
      align: 'center',
      key: 'deviceNo',
    },
    {
      title: '创建时间',
      dataIndex: 'createTime',
      ellipsis: true,
      align: 'center',
      key: 'createTime',
    },
    {
      title: '发送指令时间',
      dataIndex: 'sendTime',
      ellipsis: true,
      align: 'center',
      key: 'sendTime',
    },
    {
      title: '开始时间',
      dataIndex: 'moveTime',
      ellipsis: true,
      align: 'center',
      key: 'moveTime',
    },
    {
      title: '到位时间',
      dataIndex: 'arriveTime',
      ellipsis: true,
      align: 'center',
      key: 'arriveTime',
    },
  ],
  details: {
    currentArea: '当前节点区域',
    nextArea: '下个节点区域',
    routeTaskState: '任务状态',
    routeExecuteState: '执行状态',
    currentLocation: '当前节点点位',
    nextLocation: '下个节点点位',
    deviceTask_id: '设备任务ID',
    deviceNo: '执行设备编号',
    arriveTime: '到位时间',
    errorMsg: '错误消息',
    updateTime: '修改时间',
  },
}
export default config
