const baseUrl = '/api/service-ai-eis-route-center-eistest'
import { remote } from '@/views/EIS/remote/index.js'
const config = {
  remoteUrl: {
    url: baseUrl + '/carryinterfacetaskhis/get-carry-list',
    headers: {
      'Content-Type': 'application/JSON',
    },
    method: 'post',
  },
  items: [
    // {
    //     type: 'searchModal',
    //     name: 'project',
    //     labelCol: { span: 6 },
    //     label: '服务名称',
    //     value: '',
    //     toolBar: {
    //       span: 8,
    //       labelCol: { span: 9 },
    //       items: [
    //         {
    //           type: 'input',
    //           name: 'serviceCode',
    //           label: '服务名称',
    //           value: ''
    //         },
    //         {
    //           type: 'input',
    //           name: 'serviceName',
    //           label: '服务中文名',
    //           value: ''
    //         },
    //         {
    //           type: 'select',
    //           name: 'category',
    //           label: '服务类型',
    //           value: '',
    //           remoteUrl: '/api/service-authorization/microServiceType/search',
    //           options: [{ label: '全部分类', value: '' }],
    //           replaceFields: {
    //             label: 'name',
    //             value: 'name'
    //           }
    //         }
    //       ]
    //     },
    //     targetValueKey: 'serviceCode',
    //     rowKey: 'id',
    //     remoteUrl: '/api/service-authorization/microService/getMicroservices?category=1',
    //     tableConfig: {
    //       rowSelectType: 1,
    //       columns: [
    //         {
    //           title: 'ID',
    //           dataIndex: 'id',
    //           hidden: true
    //         },
    //         {
    //           title: '服务名称',
    //           dataIndex: 'serviceCode',
    //           ellipsis: true,
    //           width: 160
    //         },
    //         {
    //           title: '服务中文名称',
    //           dataIndex: 'serviceName',
    //           ellipsis: true,
    //           width: 250
    //         },

    //         {
    //           title: '类型',
    //           dataIndex: 'typeName',
    //           ellipsis: true,
    //           width: 120
    //         }
    //       ]
    //     }
    //   },
    {
      span: 8,
      type: 'input',
      name: 'id',
      label: '任务ID',
      value: '',
    },
    {
      span: 8,
      type: 'input',
      name: 'containerNo',
      label: '容器号',
      value: '',
    },
    // {
    //   span: 8,
    //   type: 'select',
    //   name: 'taskType',
    //   label: '任务类型',
    //   value: '',
    // //   eis_route_carry_task_type
    //   options: [
    //     { label: '入库', value: 1 },
    //     { label: '出库', value: 2 },
    //     { label: '移位', value: 3 }
    //   ]
    // },
    {
      span: 8,
      type: 'select',
      name: 'taskType',
      label: '任务类型',
      value: '',
      ...remote('eis_route_carry_task_type'),
    },

    // {
    //   span: 8,
    //   type: 'select',
    //   name: 'type',
    //   label: '站台类型',
    //   value: '',
    //   options: [
    //     { label: '出库口', value: 1 },
    //     { label: '钢平台拣选', value: 2 },
    //     { label: '在线拣选', value: 3 }
    //   ]
    // },

    {
      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',
      ellipsis: true,
      title: '任务ID',
    },
    {
      title: '容器号',
      dataIndex: 'containerNo',
      align: 'center',
      ellipsis: true,
      key: 'containerNo',
    },
    {
      title: '任务类型',
      dataIndex: 'taskType',
      align: 'center',
      key: 'taskType',
      ...remote('eis_route_carry_task_type'),
    },
    {
      title: '起始区域',
      key: 'startRegion',
      dataIndex: 'startRegion',
      align: 'center',
      // customRender(text) {
      //   text == 0 && (text = '否')
      //   text == 1 && (text = '是')
      //   return text
      // },
    },
    {
      title: '起始货位',
      dataIndex: 'startLocation',
      align: 'center',
      key: 'startLocation',
      customRender(text) {
        text == 0 && (text = '不索取')
        text == 1 && (text = '索取')
        return text
      },
    },
    {
      title: '终点区域',
      dataIndex: 'endRegion',
      align: 'center',
      key: 'endRegion',
      ellipsis: true,
    },
    {
      title: '终点货位',
      dataIndex: 'endLocation',
      align: 'center',
      key: 'endLocation',
      ellipsis: true,
    },
    {
      title: '是否变更任务',
      dataIndex: 'isChangeTask',
      hidden: true,
      align: 'center',
      key: 'isChangeTask',
      customRender(text) {
        text == 0 && (text = '否')
        text == 1 && (text = '是')
        return text
      },
    },
    {
      title: '是否取消任务',
      dataIndex: 'cleanTaskStatus',
      align: 'center',
      hidden: true,
      key: 'cleanTaskStatus',
      customRender(text) {
        text == 0 && (text = '否')
        text == 1 && (text = '是')
        return text
      },
    },
    {
      title: '任务状态',
      dataIndex: 'taskStatus',
      align: 'center',
      key: 'taskStatus',
      ...remote('eis_route_carry_task_status'),
    },
    {
      title: '优先级',
      dataIndex: 'priority',
      align: 'center',
      key: 'priority',
      hidden: true,
    },
    {
      title: '高度',
      dataIndex: 'height',
      hidden: true,
      align: 'center',
      key: 'height',
    },
    {
      title: '重量',
      dataIndex: 'weight',
      hidden: true,
      align: 'center',
      key: 'weight',
    },

    {
      title: '业务属性',
      dataIndex: 'businessProperty',
      hidden: true,
      ellipsis: true,
      align: 'center',
      key: 'businessProperty',
    },
    {
      title: '任务描述',
      dataIndex: 'taskRemark',
      align: 'center',
      ellipsis: true,
      key: 'taskRemark',
    },
    {
      title: '创建时间',
      dataIndex: 'createTime',
      ellipsis: true,
      align: 'center',
      key: 'createTime',
    },

    {
      title: '操作',
      key: 'operation',
      scopedSlots: { customRender: 'operation' },
      // fixed: 'right',
      align: 'center',
    },
  ],
  Modelitems: [
    {
      span: 24,
      type: 'input',
      name: 'stationNo',
      required: true,
      label: '站台编号',
      value: '',
    },
    {
      span: 24,
      type: 'input',
      name: 'id',
      hidden: true,
      label: 'id',
      value: '',
    },
    {
      span: 24,
      type: 'input',
      hidden: true,
      name: 'createTime',
      label: 'createTime',
      value: '',
    },
    {
      span: 24,
      type: 'input',
      name: 'areaNo',
      required: true,
      label: '站台区域',
      value: '',
    },

    {
      span: 24,
      type: 'select',
      required: true,
      name: 'type',
      label: '站台类型',
      value: 1,
      options: [
        { label: '出库口', value: 1 },
        { label: '钢平台拣选', value: 2 },
        { label: '在线拣选', value: 3 },
      ],
    },
    {
      span: 24,
      type: 'radio',
      required: true,
      name: 'isLock',
      label: '是否锁定',
      value: 0,
      options: [
        {
          value: 0,
          label: '开启',
        },
        {
          value: 1,
          label: '关闭',
        },
      ],
    },
    {
      span: 24,
      type: 'radio',
      name: 'claim',
      required: true,
      label: '是否索取',
      value: 1,
      options: [
        {
          value: 0,
          label: '不索取',
        },
        {
          value: 1,
          label: '索取',
        },
      ],
    },
    {
      span: 24,
      type: 'input',
      name: 'taskRemark',
      required: false,
      label: '任务描述',
      value: '',
    },
  ],
  details: {
    currentArea: '当前节点区域',
    nextArea: '下个节点区域',
    routeTaskState: '任务状态',
    routeExecuteState: '执行状态',
    currentLocation: '当前节点点位',
    nextLocation: '下个节点点位',
    deviceTask_id: '设备任务ID',
    deviceNo: '执行设备编号',
    arriveTime: '到位时间',
    errorMsg: '错误消息',
    updateTime: '修改时间',
  },
}
export default config
