export function fullScreen(isFullScreen) {
    if (!isFullScreen) {
      // 退出全屏
      if (document.exitFullScreen) {
        document.exitFullScreen();
      } else if (document.mozCancelFullScreen) {
        document.mozCancelFullScreen();
      } else if (document.webkitExitFullscreen) {
        document.webkitExitFullscreen();
      } else if (document.msExitFullscreen) {
        document.msExitFullscreen();
      }
    } else {
      // 全屏
      var el = document.documentElement;
      var rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullscreen;
      if (typeof rfs != "undefined" && rfs) {
        rfs.call(el);
      }
    }
  }


  /**
 * @description: 全屏函数
 * @param {object} that - 当前实例
 * @param { String } fullScreenNode - 节点
 * @param { Boolean } isFullScreen - 当前状态
 */
export function eleFullScreen(videoDom, isFullScreen) {
    videoDom = videoDom || document.documentElement
    if (!videoDom) {
      throw new Error(`请配置 fullScreenNode 属性`)
    }
    // debugger

    if (isFullScreen) {
      if (videoDom.requestFullscreen) {
        console.log(videoDom)
        videoDom.requestFullscreen()
      } else if (videoDom.webkitRequestFullScreen) {
        videoDom.webkitRequestFullScreen()
      } else if (videoDom.mozRequestFullScreen) {
        videoDom.mozRequestFullScreen()
      } else {
        videoDom.msRequestFullscreen()
      }
    } else {
      if (document.exitFullscreen) {
        document.exitFullscreen()
      } else if (document.mozCancelFullScreen) {
        document.mozCancelFullScreen()
      } else if (document.msExitFullscreen) {
        document.msExiFullscreen()
      } else if (document.webkitCancelFullScreen) {
        document.webkitCancelFullScreen()
      }
    }
  }
  
  // 检查全屏状态
  export function checkFull() {
    var isFull =
      document.mozFullScreen ||
      document.fullScreen ||
      document.webkitIsFullScreen ||
      document.webkitRequestFullScreen ||
      document.mozRequestFullScreen ||
      document.msFullscreenEnabled
    if (isFull === undefined) {
      isFull = false
    }
    return isFull
  }
  export function queryFormItems(self) {
    let _this = self
    return [
  
      {
        type: 'input',
        name: 'customercode',
        label: '',
        value: '',
        span: 24,

      },
      {
        type: 'input',
        name: 'customername',
        label: '',
        value: '',
        span: 24,

      },
      {
        type: 'input',
        name: 'lineCode',
        label: '',
        value: '',
        span: 24,

      },
    ]
  }
  export const columns = [
    // {
    //   title: '序号',
    //   dataIndex: 'index',
    //   key: 'index',
    //   scopedSlots: { customRender: 'index' },
    // },
    {
      title: '监管码标识',
      dataIndex: 'tag',
      key: 'tag',
    },
    {
      title: '拼箱号',
      dataIndex: 'lclNo',
      key: 'box_no',
    },
    {
      title: '商品名称',
      key: 'name',
      dataIndex: 'itemName',
    },
    {
      title: '商品编号',
      key: 'code',
      dataIndex: 'itemCode',
    },
    {
      title: '规则',
      key: 'type',
      dataIndex: 'type',
    },
    {
      title: '批号',
      key: 'some',
      dataIndex: 'batchNum',
    },
    // {
    //   title: '生产日期',
    //   key: 'created_at',
    //   width: '200px',
    //   dataIndex: 'productionDate',
    // },
    // {
    //   title: '有效期至',
    //   key: 'time_end',
    //   width: '200px',
  
    //   dataIndex: 'expiredDate',
    // },
    {
      title: '计划数量',
      key: 'plan_num',
      dataIndex: 'qty',
    },
    {
      title: '实际数量',
      key: 'realy_num',
      dataIndex: 'checkQty',
    },
    {
      title: '已扫描数量',
      key: 'scan_num',
      dataIndex: 'scan_num',
    },
    {
      title: '处理方式',
      key: 'handle',
      dataIndex: 'handle',
    },
    {
      title: '冲红原因',
      key: 'reason',
      dataIndex: 'reason',
    },
    {
      title: '货位',
      key: 'add',
      dataIndex: 'add',
    },
    {
      title: '状态',
      key: 'status',
    },
     {
      title: '操作',
      key: 'operate',
      align: 'center',
      fixed: 'right',
      width: '175px',
      scopedSlots: { customRender: 'action' }
    }
  ]
  export const printcolumns = [
    {
      title: '序号',
      dataIndex: 'index',
      key: 'index',
      scopedSlots: { customRender: 'index' },
    },
    {
      title: '商品编码',
      key: 'name',
      width: '100px',
      dataIndex: 'itemCode',
    },
    {
      title: '数量',
      dataIndex: 'qty',
      width: '100px',
      key: 'qty',
    }
  ]