const baseUrl = '/api/upcloud-base-wh-dev-mysql-eistest'
const config = {
  remoteUrl: {
    url: baseUrl + '/eisWhSubArea/getAll-subArea',
    headers: {
      'Content-Type': 'application/JSON',
    },
    method: 'get',
  },
  items: [
    {
      span: 8,
      type: 'input',
      name: 'subAreaNo',
      label: '子区域编号',
      value: '',
    },
    {
      span: 8,
      type: 'input',
      name: 'areaNo',
      label: '区域编号',
      value: '',
    },

    {
      span: 8,
      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: 'subAreaNo',
      key: 'subAreaNo',
      align: 'center',
      title: '子区域编号',
    },
    {
      title: '区域编号',
      dataIndex: 'areaNo',
      align: 'center',
      key: 'areaNo',
    },
    {
      title: '锚点x',
      dataIndex: 'x',
      align: 'center',
      key: 'x',
    },
    {
      title: '锚点y',
      key: 'y',
      dataIndex: 'y',
      align: 'center',
    },
    {
      title: '锚点z',
      dataIndex: 'z',
      align: 'center',
      key: 'z',
    },

    {
      title: '操作',
      key: 'operation',
      scopedSlots: { customRender: 'operation' },
      witdh: 150,
      //   fixed: 'right',
      align: 'center',
    },
  ],
  Modelitems: [
    {
      span: 24,
      type: 'input',
      name: 'subAreaNo',
      required: true,
      label: '子区域编号',
      value: '',
    },
    {
      span: 24,
      type: 'input',
      name: 'id',
      hidden: true,
      label: 'id',
      value: '',
    },

    {
      span: 24,
      type: 'searchModal',
      name: 'areaNo',
      label: '区域编号',
      required: true,
      targetClick: true,
      targetValueKey: 'areaNo',
      value: '',
      remoteUrl: '/api/upcloud-base-wh-dev-mysql-eistest/storeArea/getAll-storeArea',

      on: {
        search: () => {
          //   this.params = { name: 'hdwss' }
        },
        change: (...args) => {
          console.log(args)
        },
      },
      toolBar: {
        rowId: 'id',
        items: [
          {
            type: 'input',
            name: 'areaNo',
            label: '区域编号',
            value: '',
          },
          {
            type: 'select',
            name: 'areaType',
            label: '区域类别',
            value: '',
            options: [
              { value: 10, label: '区域' },
              { value: 20, label: '接驳口' },
            ],
          },
        ],
      },
      tableConfig: {
        rowKey: 'areaNo',
        columns: [
          {
            dataIndex: 'areaNo',
            title: '区域编号',
          },
          {
            title: '区域类别',
            dataIndex: 'areaType',
            align: 'center',
            key: 'areaType',
            customRender(text) {
              text == 10 && (text = '区域')
              text == 20 && (text = '接驳口')
              return text
            },
          },
        ],
      },
    },
    {
      span: 24,
      type: 'number',
      name: 'x',
      required: true,
      label: '锚点X',
      value: '',
    },
    {
      span: 24,
      type: 'number',
      name: 'y',
      required: true,
      label: '锚点Y',
      value: '',
    },
    {
      span: 24,
      type: 'number',
      name: 'z',
      required: true,
      label: '锚点Z',
      value: '',
    },
  ],
  details: {
    currentArea: '当前节点区域',
    nextArea: '下个节点区域',
    routeTaskState: '任务状态',
    routeExecuteState: '执行状态',
    currentLocation: '当前节点点位',
    nextLocation: '下个节点点位',
    deviceTask_id: '设备任务ID',
    deviceNo: '执行设备编号',
    arriveTime: '到位时间',
    errorMsg: '错误消息',
    updateTime: '修改时间',
  },
}
export default config
