import { remote } from '@/views/EIS/remote/index.js'
// console.log(remote, '======================')
// const base = '/api/service-ai-eis-business-center-eistest'
const base = '/api/eis-lppz2-maintain-service'

//  eis-lppz2-maintain-service
// import { remote } from '../../../remote/index'

const config = function (that) {
  return {
    remoteUrl: {
      url: base + '/api/v1/eis/maintain/queryMaintainTasks',
      headers: {
        'Content-Type': 'application/JSON',
      },
      method: 'post',
    },
    items: [
      {
        span: 8,
        type: 'input',
        name: 'deviceCompany',
        label: '设备厂商',
        value: '',
      },
      {
        span: 8,
        type: 'input',
        name: 'equipmentNo',
        label: '设备编号',
        value: '',
      },
      {
        span: 8,
        type: 'input',
        name: 'deviceType',
        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: 'id',
        key: 'id',
        hidden: true,
        align: 'center',
        width: 150,
        ellipsis: true,
        title: 'id',
      },
      {
        title: '设备厂商',
        dataIndex: 'deviceCompany',
        ellipsis: true,
        align: 'center',
        width: 150,
        key: 'deviceCompany',
        // customRender(text) {
        //   text == 10 && (text = '区域')
        //   text == 20 && (text = '接驳口')
        //   return text
        // }
      },

      {
        title: '设备类型',
        key: 'deviceType',
        width: 150,
        ellipsis: true,
        dataIndex: 'deviceType',
        align: 'center',
        // ...remote('eis_container_task_status'),
        // customRender(text) {
        //   text == 0 && (text = '未开始')
        //   text == 1 && (text = '进行中')
        //   text == 2 && (text = '已完成')
        //   text == 3 && (text = '已暂停')
        //   text == 4 && (text = '已取消')
        //   return text
        // }
      },

      {
        title: '设备编号',
        key: 'equipmentNo',
        width: 150,
        ellipsis: true,
        dataIndex: 'equipmentNo',
        align: 'center',
      },
      {
        title: '保养内容',
        dataIndex: 'maintainContent',
        align: 'center',
        width: 350,
        ellipsis: true,
        key: 'maintainContent',
      },
      //   {
      //     title: '任务完成时间',
      //     width: 150,
      //     dataIndex: 'finishTime',
      //     align: 'center',
      //     key: 'finishTime',
      //   },
      {
        title: '钉钉开始推送消息',
        dataIndex: 'dingNotice',
        width: 150,
        // scopedSlots: { customRender: 'detailSize' },
        align: 'center',
        key: 'dingNotice',
      },
      {
        title: '最后一次保养日期',
        key: 'lastMaintainDate',
        width: 150,
        ellipsis: true,
        dataIndex: 'lastMaintainDate',
        align: 'center',
      },
      {
        title: '保养周期',
        key: 'maintainCycle',
        width: 150,
        ellipsis: true,
        dataIndex: 'maintainCycle',
        align: 'center',
      },
      {
        title: '下次保养日期',
        key: 'nextMaintainDate',
        width: 150,
        ellipsis: true,
        dataIndex: 'nextMaintainDate',
        align: 'center',
      },
      {
        title: '下次保养通知日期',
        key: 'noticeMaintainDate',
        width: 150,
        ellipsis: true,
        dataIndex: 'noticeMaintainDate',
        align: 'center',
      },

      {
        title: '操作',
        key: 'operation',
        scopedSlots: { customRender: 'operation' },
        // fixed: 'right',
        width: 150,
        align: 'center',
      },
    ],
  }
}

export default config
