/*
 * @Author: 陈禹琨 cyk910622@163.com
 * @Date: 2022-06-10 09:46:42
 * @LastEditors: 陈禹琨 chenyukun@prolog-int.com
 * @LastEditTime: 2023-09-13 10:49:10
 * @FilePath: /eis-3.0-fe-pc/src/views/EIS/project/qingniuEIS/ShelfBasicData/config.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

import { QN_BASEURL } from '../serviceSettings'
const baseUrl = QN_BASEURL
const config = {
  remoteUrl: {
    url: baseUrl + '/api/v1/shelvesInfoConfig/findShelvesInfoPage',
    headers: {
      'Content-Type': 'application/JSON',
    },
    method: 'post',
  },
  items: [
    {
      span: 6,
      type: 'input',
      name: 'palletNo',
      label: '货架号',
      value: '',
    },
    {
      span: 6,
      type: 'select',
      name: 'isMode',
      label: '模板货架锁定',
      value: '',
      options: [
        { value: 0, label: '否' },
        { value: 1, label: '是' },
      ],
    },

    {
      span: 6,
      type: 'select',
      name: 'isLock',
      label: '是否锁定',
      value: '',
      options: [
        { value: 0, label: '不锁定' },
        { value: 1, label: '锁定' },
      ],
    },

    {
      span: 6,
      type: 'buttonGroup',
      style: { textAlign: 'left', marginLeft: '50px' },
      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: 'palletNo',
      key: 'palletNo',
      align: 'center',
      ellipsis: true,
      title: '货架号',
    },

    {
      title: '货格数量',
      key: 'count',
      ellipsis: true,
      dataIndex: 'count',
      align: 'center',
      //   ...remote('eis_cfg_auto_carry_task_type'),
    },
    {
      title: '锁定状态',
      dataIndex: 'isLock',
      align: 'center',
      ellipsis: true,
      key: 'isLock',
      customRender(text) {
        text == 0 && (text = '不锁定')
        text == 1 && (text = '锁定')
        return text
      },
    },
    {
      title: '创建时间',
      dataIndex: 'createTime',
      align: 'center',
      key: 'createTime',
    },

    {
      title: '操作',
      key: 'operation',
      width: 180,
      scopedSlots: { customRender: 'operation' },
      //   fixed: 'right',
      align: 'center',
    },
  ],
  //   :columns="config.Model.columns"

  Model: {
    items: [
      {
        type: 'input',
        name: 'palletNo',
        label: '货架号',
        required: true,
        value: '',
      },
      {
        type: 'input',
        name: 'location',
        required: true,
        label: '位置',
        value: '',
      },
      //   angle
      {
        type: 'number',
        name: 'angle',
        label: '角度',
        value: '',
      },
      {
        type: 'input',
        name: 'reamrk',
        label: '描述',
        value: '',
      },
    ],
    columns: [
      {
        required: true,
        dataIndex: 'direction',
        title: '面',
        type: 'select',
        options: [
          { value: 'A', label: 'A' },
          { value: 'B', label: 'B' },
        ],
      },
      { dataIndex: 'layer', title: '层', type: 'number', required: true },
      { dataIndex: 'x', title: '列', type: 'number', required: true },
      {
        required: true,
        dataIndex: 'abcType',
        title: 'ABC属性',
        type: 'select',
        options: [
          { value: 'A', label: 'A' },
          { value: 'B', label: 'B' },
          { value: 'C', label: 'C' },
        ],
      },
      { dataIndex: 'volume', title: '容积', type: 'number', required: true },
    ],
  },
}
export default config
