const baseUrl = '/api/service-ai-eis-route-center-eistest'
const config = {
  remoteUrl: {
    url: baseUrl + '/sxcaracross/get-sxcaracross-page',
    headers: {
      'Content-Type': 'application/JSON',
    },
    method: 'post',
  },
  items: [
    {
      span: 8,
      type: 'input',
      name: 'carNo',
      label: '小车编号',
      value: '',
    },
    {
      span: 8,
      type: 'input',
      name: 'hoistNo',
      label: '提升机编号',
      value: '',
    },
    {
      span: 24,
      type: 'buttonGroup',
      style: { textAlign: 'right' },
      options: [
        {
          value: '查询',
          icon: 'search',
          btnType: 'primary',
          style: 'margin-right:10px',
          htmlType: 'submit',
        },
        {
          value: '重置',
          icon: 'redo',
          on: {
            click: (event, form) => {
              console.log(form)
              form.resetFields()
            },
          },
        },
      ],
    },
  ],
  modelcolumns: [
    {
      dataIndex: 'taskId',
      key: 'taskId',
      align: 'center',
      ellipsis: true,
      title: '任务ID',
    },
    {
      title: '层',
      dataIndex: 'floor',
      align: 'center',
      ellipsis: true,
      key: 'floor',
    },
    {
      title: '任务类型',
      ellipsis: true,
      dataIndex: 'taskType',
      align: 'center',
      key: 'taskType',
      customRender(text, record) {
        if (record.systype == 'GCS') {
          text == 1 && (text = '进入提升机接驳口')
          text == 2 && (text = '进入提升机')
          text == 3 && (text = '出提升机')
        } else {
          text == 1 && (text = '提升机到远程')
          text == 2 && (text = '提升机到目标层')
          text == 3 && (text = '提升机解锁')
        }

        return text
      },
    },

    {
      title: '设备类型',
      dataIndex: 'systype',
      ellipsis: true,
      align: 'center',
      key: 'systype',
    },
    {
      title: '提升机编号',
      dataIndex: 'hoistId',
      align: 'center',
      ellipsis: true,
      key: 'hoistId',
    },
    {
      title: '返回错误消息',
      dataIndex: 'sendErrMsg',
      align: 'center',
      ellipsis: true,
      key: 'sendErrMsg',
    },

    {
      title: '发送状态',
      dataIndex: 'sendStatus',
      ellipsis: true,
      align: 'center',
      key: 'sendStatus',
      customRender(text) {
        text == 1 && (text = '成功')
        text == 2 && (text = '失败')
        return text
      },
    },
    {
      title: '任务状态',
      dataIndex: 'taskStatus',
      ellipsis: true,
      align: 'center',
      key: 'taskStatus',
      customRender(text) {
        text == 1 && (text = '已发送')
        text == 2 && (text = '开始')
        text == 3 && (text = '完成')
        text == 4 && (text = '故障')
        return text
      },
    },
    {
      title: '发送次数',
      dataIndex: 'sendCount',
      ellipsis: true,
      align: 'center',
      key: 'sendCount',
    },
    {
      title: '创建时间',
      dataIndex: 'createTime',
      ellipsis: true,
      align: 'center',
      key: 'createTime',
    },
    {
      title: '任务开始时间',
      dataIndex: 'startTime',
      ellipsis: true,
      align: 'center',
      key: 'startTime',
    },
    {
      title: '任务完成时间',
      dataIndex: 'finishTime',
      ellipsis: true,
      align: 'center',
      key: 'finishTime',
    },
  ],
  columns: [
    {
      title: 'id',
      dataIndex: 'id',
      hidden: true,
    },
    {
      dataIndex: 'sourceLayer',
      key: 'sourceLayer',
      align: 'center',
      title: '源层',
    },
    {
      title: '源区域',
      dataIndex: 'sourceArea',
      align: 'center',
      key: 'sourceArea',
    },
    {
      title: '目标层',
      dataIndex: 'tarLayer',
      align: 'center',
      key: 'tarLayer',
    },
    {
      title: '目标区域',
      dataIndex: 'tarArea',
      align: 'center',
      key: 'tarArea',
    },
    {
      title: '小车编号',
      dataIndex: 'carNo',
      align: 'center',
      key: 'carNo',
    },
    {
      title: '提升机编号',
      dataIndex: 'hoistNo',
      align: 'center',
      key: 'hoistNo',
    },
    {
      title: '跨层状态',
      dataIndex: 'acrossStatus',
      align: 'center',
      key: 'acrossStatus',
      customRender(text) {
        text == 0 && (text = '已创建')
        text == 1 && (text = '提升机去往源层')
        text == 2 && (text = '提升机到达源层')
        text == 3 && (text = '小车去往源层接驳口')
        text == 4 && (text = '小车到达源层接驳口')
        text == 5 && (text = '小车去往提升机')
        text == 6 && (text = '小车到达提升机')
        text == 7 && (text = '提升机去往目标层')
        text == 8 && (text = '提升机到达目标层')
        text == 9 && (text = '小车去往目标层接驳口')
        text == 10 && (text = '小车到达目标层接驳口')
        text == 11 && (text = '回告提升机解锁完成')
        return text
      },
    },

    {
      title: '创建时间',
      dataIndex: 'createTime',
      align: 'center',
      key: 'createTime',
    },
    {
      title: '异常状态',
      dataIndex: 'abnormalState',
      align: 'center',
      key: 'abnormalState',
      customRender(text) {
        text == 0 && (text = '否')
        text == 1 && (text = '是')
        return text
      },
    },
    {
      title: '操作',
      key: 'operation',
      scopedSlots: { customRender: 'operation' },
      fixed: 'right',
      width: 150,
      align: 'center',
    },
  ],
}
export default config
