export const defaultProps = {
  children: 'children',
  label: 'aircraftTypeName'
}
export const mockTableData = [
  {
    aircraftTypeName: '作战飞机',
    parentTypeName: '',
    parentTypeId: '',
    id: '1',
    numbering: '01',
    sequence: '1',
    status: 1,
    children: [
      {
        aircraftTypeName: '战斗机',
        parentTypeName: '作战飞机',
        parentTypeId: '1',
        id: '1.1',
        numbering: '01.1',
        sequence: '1.1',
        status: 0,
        children: [
          {
            aircraftTypeName: '歼20',
            parentTypeName: '战斗机',
            parentTypeId: '1.1',
            id: '1.1.1',
            numbering: '01.1.1',
            sequence: '1.1.1',
            status: 0
          },
          {
            aircraftTypeName: '歼22',
            parentTypeName: '战斗机',
            parentTypeId: '1.2',
            id: '1.1.2',
            numbering: '01.1.2',
            sequence: '1.1.2',
            status: 0
          },
          {
            aircraftTypeName: '歼23',
            parentTypeName: '战斗机',
            parentTypeId: '1.3',
            id: '1.1.3',
            numbering: '01.1.3',
            sequence: '1.1.3',
            status: 0
          }
        ]
      },
      {
        aircraftTypeName: '战略轰炸机',
        parentTypeName: '作战飞机',
        parentTypeId: '1',
        id: '1.2',
        numbering: '01.2',
        sequence: '1.2',
        status: 0
      },
      {
        aircraftTypeName: '攻击机',
        parentTypeName: '作战飞机',
        parentTypeId: '1',
        id: '1.3',
        numbering: '01.3',
        sequence: '1.3',
        status: 1
      }
    ]
  },
  {
    aircraftTypeName: '作战支援飞机',
    parentTypeName: '',
    parentTypeId: '',
    id: '2',
    numbering: '02',
    sequence: '2',
    status: 1,
    children: [
      {
        aircraftTypeName: '运输机',
        parentTypeName: '作战支援飞机',
        parentTypeId: '2',
        id: '2.1',
        numbering: '02.1',
        sequence: '2.1',
        status: 0,
        children: [
          {
            aircraftTypeName: '运20',
            parentTypeName: '运输机',
            parentTypeId: '2.1',
            id: '2.1.1',
            numbering: '02.1.1',
            sequence: '2.1.1',
            status: 0
          },
          {
            aircraftTypeName: '运22',
            parentTypeName: '运输机',
            parentTypeId: '2.2',
            id: '2.1.2',
            numbering: '02.1.2',
            sequence: '2.1.2',
            status: 0
          },
          {
            aircraftTypeName: '运23',
            parentTypeName: '运输机',
            parentTypeId: '3.3',
            id: '3.1.3',
            numbering: '03.1.3',
            sequence: '3.1.3',
            status: 0
          }
        ]
      },
      {
        aircraftTypeName: '空中加油机',
        parentTypeName: '作战支援飞机',
        parentTypeId: '2',
        id: '2.2',
        numbering: '02.2',
        sequence: '2.2',
        status: 0
      },
      {
        aircraftTypeName: '侦察机',
        parentTypeName: '作战支援飞机',
        parentTypeId: '2',
        id: '2.3',
        numbering: '02.3',
        sequence: '2.3',
        status: 1
      }
    ]
  }
]
export const tableData = [
  {
    aircraftNumber: 'L01',
    aircraftSpeciesName: '歼20',
    flyingDuration: '64'
  },
  {
    aircraftNumber: 'L11',
    aircraftSpeciesName: '歼18',
    flyingDuration: '42'
  },
  {
    aircraftNumber: 'L31',
    aircraftSpeciesName: '歼10',
    flyingDuration: '54'
  }
]
export const tableData1 = [
  {
    aircraftNumber: 'L01',
    aircraftSpeciesName: '歼20',
    flyingDuration: '64'
  },
  {
    aircraftNumber: 'L11',
    aircraftSpeciesName: '歼18',
    flyingDuration: '42'
  },
  {
    aircraftNumber: 'L31',
    aircraftSpeciesName: '歼14',
    flyingDuration: '54'
  }
]
export const tableData2 = [
  {
    aircraftNumber: 'L01',
    aircraftSpeciesName: '歼16',
    flyingDuration: '23'
  },
  {
    aircraftNumber: 'L11',
    aircraftSpeciesName: '歼17',
    flyingDuration: '42'
  },
  {
    aircraftNumber: 'L31',
    aircraftSpeciesName: '歼14',
    flyingDuration: '74'
  }
]

export const columns = (_this) => [
  {
    prop: 'aircraftNumber',
    label: '飞机编号'
  },
  {
    prop: 'aircraftSpeciesName',
    label: '所属机型'
  },
  {
    prop: 'flyingDuration',
    label: '飞行时长',
    edit: true,
    editStatus: false,
    onChange: (scope, oldRow) => {
      _this.updateRow(scope.row, scope.index, scope)
    }
  },
  {
    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)'
}
