const baseUrl = '/api/upcloud-base-wh-control-mysql-eistest'

const config = {
  remoteUrl: {
    url: baseUrl + '/dispatchswitch/get-dispatchswitch',
    headers: {
      'Content-Type': 'application/JSON',
    },
    method: 'post',
  },
  items: [
    {
      span: 8,
      type: 'input',
      name: 'switchName',
      label: '开关名称',
      value: '',
    },
    {
      span: 8,
      type: 'input',
      name: 'switchCode',
      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: 'switchName',
      key: 'switchName',
      align: 'center',
      ellipsis: true,
      title: '开关名称',
    },
    {
      title: '开关代码',
      dataIndex: 'switchCode',
      align: 'center',
      ellipsis: true,
      key: 'switchCode',
    },
    {
      title: '开关描述',
      dataIndex: 'comment',
      align: 'center',
      key: 'comment',
    },
    {
      title: '开关',
      key: 'switchValue',
      scopedSlots: { customRender: 'switchValue' },
      align: 'center',
    },
  ],
  Modelitems: [
    {
      span: 24,
      type: 'input',
      name: 'switchName',
      required: true,
      label: '开关名称',
      value: '',
    },
    {
      span: 24,
      type: 'input',
      name: 'id',
      hidden: true,
      label: 'id',
      value: '',
    },
    {
      span: 24,
      type: 'input',
      name: 'switchCode',
      required: true,
      label: '开关代码',
      value: '',
    },
    {
      span: 24,
      type: 'textarea',
      name: 'comment',
      required: true,
      label: '开关描述',
      value: '',
    },
  ],
  details: {
    currentArea: '当前节点区域',
    nextArea: '下个节点区域',
    routeTaskState: '任务状态',
    routeExecuteState: '执行状态',
    currentLocation: '当前节点点位',
    nextLocation: '下个节点点位',
    deviceTask_id: '设备任务ID',
    deviceNo: '执行设备编号',
    arriveTime: '到位时间',
    errorMsg: '错误消息',
    updateTime: '修改时间',
  },
}
export default config
