export const defaultProps = {
  children: 'children',
  label: 'label'
}

export const columns = (_this) => [
  {
    prop: 'avmatCatalogName',
    label: '航材名称'
  },
  {
    prop: 'avmatCatalogCode',
    label: '航材编码'
  },
  {
    prop: 'aircaftModelName',
    label: '所属机型'
  },
  {
    prop: 'installedCount',
    label: '装机数量',
    edit: true,
    editStatus: false,
    onChange: (scope, oldRow) => {
      const { row } = scope
      if (oldRow.installedCount == row.installedCount) return
      _this.updateRow(row)
    }
  },
  {
    prop: 'installedPosition',
    label: '装机部位',
    edit: true,
    editStatus: false,
    onChange: (scope, oldRow) => {
      const { row } = scope
      if (oldRow.installedPosition == row.installedPosition) return
      _this.updateRow(row)
    }
  },
  {
    prop: 'avmatCategoriesName',
    label: '航材分类'
  },
  {
    button: true,
    label: '操作',
    width: '240px',
    group: [
      {
        name: '删除',
        type: 'text',
        round: false,
        plain: false,
        onClick: (row, index, scope) => {
          _this.remove([row])
        }
      }
    ]
  }
]

export const options = {
  stripe: true, // 斑马纹
  mutiSelect: true, // 多选框
  index: false, // 显示序号， 多选则 mutiSelect
  loading: false, // 表格动画
  initTable: true, // 是否一挂载就加载数据
  border: true,
  height: 'calc(100vh - 300px)'
}
