import { remote } from '@/views/EIS/remote/index.js'
const baseUrl = '/api/upcloud-base-wh-dev-mysql-eistest'
// const baseUrl = '/wrb2'
const config = {
  remoteUrl: {
    url: baseUrl + '/eisStoreAreaDirectionService/area/page',
    headers: {
      'Content-Type': 'application/JSON',
    },
    method: 'post',
  },
  items: [
    {
      span: 8,
      type: 'input',
      name: 'sourceAreaNo',
      label: '起点区域',
      value: '',
    },
    {
      span: 8,
      type: 'input',
      name: 'targetAreaNo',
      label: '终点区域',
      value: '',
    },
    {
      span: 8,
      type: 'select',
      name: 'deviceSystem',
      label: '下游WCS系统',
      value: '',
      options: [
        { label: 'GCS', value: 'GCS' },
        { label: 'MCS', value: 'MCS' },
        { label: 'RCS', value: 'RCS' },
        { label: 'SPS', value: 'SPS' },
        { label: '华瑞德MCS', value: 'HRD_MCS' },
      ],
    },
    {
      span: 8,
      type: 'select',
      name: 'isLock',
      label: '是否锁定',
      value: '',
      options: [
        { label: '是', value: 1 },
        { label: '否', value: 0 },
      ],
    },
  ],
  columns: [
    {
      title: 'id',
      dataIndex: 'id',
      hidden: true,
    },
    {
      dataIndex: 'sourceAreaNo',
      key: 'sourceAreaNo',
      align: 'center',
      ellipsis: true,
      title: '起点区域',
    },
    {
      title: '终点区域',
      dataIndex: 'targetAreaNo',
      align: 'center',
      ellipsis: true,
      key: 'targetAreaNo',
    },
    {
      title: '下游WCS系统',
      dataIndex: 'deviceSystem',
      ellipsis: true,
      align: 'center',
      key: 'deviceSystem',
    },
    {
      title: '参数类型字段',
      dataIndex: 'deviceStyle',
      ellipsis: true,
      align: 'center',
      key: 'deviceStyle',
    },
    {
      title: '区域间距离',
      dataIndex: 'distance',
      ellipsis: true,
      align: 'center',
      key: 'distance',
    },
    {
      title: '路线权重',
      dataIndex: 'routePower',
      ellipsis: true,
      align: 'center',
      key: 'routePower',
    },
    {
      title: '高度限制',
      dataIndex: 'maxHeight',
      ellipsis: true,
      align: 'center',
      key: 'maxHeight',
    },
    {
      title: '重量限制',
      dataIndex: 'maxWeight',
      align: 'center',
      ellipsis: true,
      key: 'maxWeight',
    },
    {
      title: '提升机编号',
      dataIndex: 'extend1',
      align: 'center',
      ellipsis: false,
      key: 'extend1',
    },

    {
      title: '是否避让',
      dataIndex: 'isAvoid',
      align: 'center',
      key: 'isAvoid',
      customRender(text) {
        text == 0 && (text = '否')
        text == 1 && (text = '是')
        return text
      },
    },
    {
      title: '是否锁定',
      dataIndex: 'isLock',
      align: 'center',
      key: 'isLock',
      customRender(text) {
        text == 0 && (text = '否')
        text == 1 && (text = '是')
        return text
      },
    },
    {
      title: '创建时间',
      dataIndex: 'createTime',
      align: 'center',
      ellipsis: true,
      key: 'createTime',
    },
    {
      title: '更新时间',
      dataIndex: 'updateTime',
      ellipsis: true,
      align: 'center',
      key: 'updateTime',
    },
    {
      title: '备注',
      dataIndex: 'remark',
      ellipsis: true,
      align: 'center',
      key: 'remark',
    },
    {
      title: '操作',
      dataIndex: 'operator',
      key: 'operator',
      width: 140,
      scopedSlots: { customRender: 'operator' },
    },
  ],
  model: {
    remoteUrl: {
      url: baseUrl + '/eisWhArea/getAll-storeArea',
      headers: {
        'Content-Type': 'application/JSON',
      },
      method: 'get',
    },
    items: [
      {
        span: 8,
        type: 'input',
        name: 'areaNo',
        label: '区域编号',
        value: '',
      },
      {
        span: 8,
        type: 'select',
        name: 'areaType',
        label: '区域类别',
        value: '',
        options: [
          { label: '区域', value: 10 },
          { label: '接驳口', value: 20 },
        ],
      },

      {
        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: 'areaNo',
        key: 'areaNo',
        align: 'center',
        title: '区域编号',
      },
      {
        title: '区域类别',
        dataIndex: 'areaType',
        align: 'center',
        key: 'areaType',
        customRender(text) {
          text == 10 && (text = '区域')
          text == 20 && (text = '接驳口')

          return text
        },
      },
    ],
    itemsInfo: [
      {
        span: 24,
        type: 'input',
        name: 'deviceSystem',
        required: true,
        label: '下游WCS系统',
        value: '',
      },
      {
        span: 24,
        type: 'input',
        name: 'entranceDirection',
        required: true,
        label: '入口方向',
        value: '',
        options: [
          { label: '区域', value: 10 },
          { label: '接驳口', value: 20 },
        ],
      },
      {
        span: 24,
        type: 'input',
        required: true,
        name: 'deviceStyle',
        label: '参数类型字段',
        value: '',
      },
      {
        span: 24,
        type: 'input',
        name: 'distance',
        required: true,
        label: '区域间距离',
        value: '',
      },
      {
        span: 24,
        type: 'input',
        required: true,
        name: 'routePower',
        label: '路线权重',
        value: '',
      },
      {
        span: 24,
        type: 'input',
        name: 'maxHeight',
        required: true,
        label: '高度限制',
        value: '',
      },
      {
        span: 24,
        type: 'input',
        required: true,
        name: 'maxWeight',
        label: '重量限制',
        value: '',
      },
      {
        span: 24,
        type: 'input',
        name: 'extend1',
        required: true,
        label: '提升机编号',
        value: '',
      },
      {
        span: 24,
        type: 'radio',
        name: 'isAvoid',
        required: true,
        label: '是否避让',
        value: 1,
        options: [
          { label: '是', value: 1 },
          { label: '否', value: 0 },
        ],
      },
      {
        span: 24,
        type: 'radio',
        name: 'isLock',
        required: true,
        label: '锁定',
        value: 1,
        options: [
          { label: '是', value: 1 },
          { label: '否', value: 0 },
        ],
      },
      {
        span: 24,
        type: 'input',
        name: 'remark',
        label: '备注',
        value: '',
      },
      {
        span: 24,
        type: 'input',
        name: 'directionNo',
        label: '方向分组',
        value: '',
      },
      {
        span: 24,
        type: 'input',
        name: 'priority',
        label: '优先级',
        value: '',
      },
    ],
  },
}
export default config
