import { remote } from '@/views/EIS/remote/index.js'

const baseUrl = '/api/eis-lppz2-retrieval-service/api/v1/eis'
const config = {
  remoteUrl: {
    url: baseUrl + '/retrieval/twoFloor/taskGroupContainerData',
    headers: {
      'Content-Type': 'application/JSON'
    },
    method: 'post',
  },
  remoteInterfaceUrl: {
    url: baseUrl + '/retrieval/interfaceLog/interfaceLogByPData',
    headers: {
      'Content-Type': 'application/JSON'
    },
    method: 'post',
  },
  remotetransferUrl: {
    url: baseUrl + '/retrieval/carryTask/outsideData',
    headers: {
      'Content-Type': 'application/JSON'
    },
    method: 'post',
  },
  items: [{
      span: 8,
      type: 'input',
      name: 'containerNo',
      label: '托盘号',
      value: ''
    },
    {
      span: 8,
      type: 'input',
      name: 'taskGroupNo',
      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: 'stationNo',
      label: '站台号',
      value: '',
      options: [{
          label: 'D201',
          value: 'D201'
        },
        {
          label: 'D202',
          value: 'D202'
        },
        {
          label: 'D203',
          value: 'D203'
        },
        {
          label: 'D204',
          value: 'D204'
        },
        {
          label: 'D205',
          value: 'D205'
        },
        {
          label: 'D206',
          value: 'D206'
        },
        {
          label: 'D207',
          value: 'D207'
        }
      ]
    },
    {
      span: 8,
      type: 'select',
      name: 'state',
      label: '任务状态',
      value: '',
      ...remote('b_2f_task_group_container_task_state')
    },
    {
      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()
            }
          }
        }
      ]
    }
  ],
  childrenInterfaceItem:[{
      span:18,
      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: 4,
      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()
            }
          }
        }
      ]
    }],
    childrentransferItem:[{
        span:18,
        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: 4,
        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: 'id',
      key: 'id',
      align: 'center',
      ellipsis: true,
      title: '任务id'
    },
    {
      title: '站台',
      dataIndex: 'stationNo',
      align: 'center',
      key: 'stationNo'
    },
    {
      title: '任务组',
      dataIndex: 'taskGroupNo',
      ellipsis: true,
      align: 'center',
      key: 'taskGroupNo'
    },
    {
      title: '托盘号',
      key: 'containerNo',
      width:100,
      dataIndex: 'containerNo',
      ellipsis: true,
      align: 'center'
    },
    {
      title: '状态',
      dataIndex: 'taskState',
      align: 'center',
      key: 'taskState',
      customRender(text) {
        text == 1 && (text = '未开始')
        text == 2 && (text = '进行中')
        text == 3 && (text = '已完成')
        return text
      }
    },
    {
      title: '当前区域',
      dataIndex: 'currentArea',
      align: 'center',
      ellipsis: true,
      key: 'currentArea'
    },
    {
      title: '当前点位',
      dataIndex: 'currentPosition',
      align: 'center',
      ellipsis: true,
      key: 'currentPosition'
    },
    {
      title: '创建时间',
      dataIndex: 'createTime',
      align: 'center',
      ellipsis: true,
      key: 'createTime'
    },
    {
      title: '更新时间',
      dataIndex: 'updateTime',
      align: 'center',
      ellipsis: true,
      key: 'updateTime'
    },
    {
      title: '接口日志',
      key: 'operation',
      width: 150,
      scopedSlots: {
        customRender: 'operation'
      },
      fixed: 'right',
      align: 'center'
    },
    {
      title: '搬运日志',
      key: 'operation1',
      width: 150,
      scopedSlots: {
        customRender: 'operation1'
      },
      fixed: 'right',
      align: 'center'
    }
  ],
  modecolumns_interface: [{
      dataIndex: 'pinfName',
      key: 'pinfName',
      align: 'center',
      ellipsis: true,
      title: '接口名称'
    },
    {
      title: '是否成功',
      ellipsis: true,
      dataIndex: 'pfailure',
      align: 'center',
      key: 'pfailure'
    },

    {
      title: '错误消息',
      dataIndex: 'perrorMessage',
      ellipsis: true,
      align: 'center',
      key: 'perrorMessage'
    },
    {
      title: '是否发送',
      dataIndex: 'psend',
      align: 'center',
      ellipsis: true,
      key: 'psend'
    },
    {
      title: '报文',
      dataIndex: 'pdata',
      align: 'center',
      ellipsis: true,
      key: 'pdata'
    },
    {
      title: '开始时间',
      dataIndex: 'pstartTime',
      ellipsis: true,
      align: 'center',
      key: 'pstartTime'
    },
    {
      title: '结束时间',
      dataIndex: 'pcreateTime',
      ellipsis: true,
      align: 'center',
      key: 'pcreateTime'
    },
    {
      title: '业务key1',
      dataIndex: 'pbussinessKey1',
      ellipsis: true,
      align: 'center',
      key: 'pbussinessKey1'
    },
    {
      title: '业务key2',
      dataIndex: 'pbussinessKey2',
      ellipsis: true,
      align: 'center',
      key: 'pbussinessKey2'
    },
    {
      title: '业务key3',
      dataIndex: 'pbussinessKey3',
      ellipsis: true,
      align: 'center',
      key: 'pbussinessKey3'
    }
  ],
  modecolumns_transfer: [{
      dataIndex: 'taskId',
      key: 'taskId',
      align: 'center',
      ellipsis: true,
      title: '任务id'
    },
    {
      title: '容器号',
      dataIndex: 'containerNo',
      align: 'center',
      ellipsis: true,
      key: 'containerNo'
    },
    {
      title: '起始区域',
      dataIndex: 'sourceArea',
      ellipsis: true,
      align: 'center',
      key: 'sourceArea'
    },
    {
      title: '起始点位',
      dataIndex: 'sourceLocation',
      align: 'center',
      ellipsis: true,
      key: 'sourceLocation'
    },
    {
      title: '终点区域',
      dataIndex: 'targetArea',
      align: 'center',
      ellipsis: true,
      key: 'targetArea'
    },

    {
      title: '终点点位',
      dataIndex: 'targetLocation',
      ellipsis: true,
      align: 'center',
      key: 'targetLocation'
    },
    {
      title: '任务状态',
      dataIndex: 'taskState',
      ellipsis: true,
      align: 'center',
      key: 'taskState',
      customRender(text) {
        text == 1 && (text = '未开始')
        text == 2 && (text = '进行中')
        text == 3 && (text = '已完成')
        return text
      }
    },
    {
      title: '优先级',
      dataIndex: 'priority',
      ellipsis: true,
      align: 'center',
      key: 'priority'
    },
    {
      title: '业务类型',
      dataIndex: 'businessType',
      ellipsis: true,
      align: 'center',
      key: 'businessType'
    },
    {
      title: '创建时间',
      dataIndex: 'createTime',
      ellipsis: true,
      align: 'center',
      key: 'createTime'
    }
  ],

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