export const defaultProps = {
  children: 'children',
  label: 'aircraftTypeName'
}
export const mockTableData = [
  {
    aircraftTypeName: '全部',
    parentTypeName: '',
    parentTypeId: '1',
    id: '1.1',
    numbering: '01.1',
    sequence: '1.1',
    status: 0,
    children: [
      {
        aircraftTypeName: '歼-20 TZ_001',
        parentTypeName: '全部',
        parentTypeId: '',
        id: '1',
        numbering: '01',
        sequence: '1',
        status: 1
      },
      {
        aircraftTypeName: '歼-20 TZ_002',
        parentTypeName: '全部',
        parentTypeId: '',
        id: '2',
        numbering: '02',
        sequence: '2',
        status: 1
      },
      {
        aircraftTypeName: '歼-20 TZ_003',
        parentTypeName: '全部',
        parentTypeId: '',
        id: '3',
        numbering: '03',
        sequence: '3',
        status: 1
      },
      {
        aircraftTypeName: '歼-20 TZ_004',
        parentTypeName: '全部',
        parentTypeId: '',
        id: '4',
        numbering: '04',
        sequence: '4',
        status: 1
      },
      {
        aircraftTypeName: '歼-20 TZ_005',
        parentTypeName: '全部',
        parentTypeId: '',
        id: '5',
        numbering: '05',
        sequence: '5',
        status: 1
      },
      {
        aircraftTypeName: '歼-20 TZ_006',
        parentTypeName: '全部',
        parentTypeId: '',
        id: '6',
        numbering: '06',
        sequence: '4',
        status: 1
      },
      {
        aircraftTypeName: '歼-20 TZ_007',
        parentTypeName: '全部',
        parentTypeId: '',
        id: '7',
        numbering: '07',
        sequence: '7',
        status: 1
      }
    ]
  }
]

export const tableData = [
  {
    sparePartsCoding: '201',
    sparePartsName: '后轮',
    meteringUnit: '个',
    aircraft: '001',
    sparePartsCoding: '轰炸机',
    carryQuantity: '10',
    unitPrice: '100',
    amount: '1000',
    updateTime: '2022-10-12'
  },
  {
    sparePartsCoding: '201',
    sparePartsName: '后轮',
    meteringUnit: '个',
    aircraft: '001',
    sparePartsCoding: 'J20',
    carryQuantity: '1',
    unitPrice: '99',
    amount: '99',
    updateTime: '2022-10-12'
  }
]

export const dialogTreeObj = {
  title: '所属分类',
  activityheight: '500px',
  searchIcon: false,
  configure: defaultProps
}

export const treeObj = {
  title: '所属飞机',
  activityheight: '275px',
  searchIcon: false,
  configure: defaultProps
}

export const dialogColumns = (_this) => [
  {
    prop: 'sparePartsName',
    label: '航材名称'
  },
  {
    prop: 'sparePartsCoding',
    label: '航材编号'
  },

  {
    button: true,
    label: '操作',
    width: '240px',
    group: [
      {
        name: '选择',
        type: 'text',
        round: false,
        plain: false,
        onClick: (row, index, scope) => {
          _this.select(row)
        }
      }
    ]
  }
]

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

export const dialogMenuTreeData = [
  {
    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
      },
      {
        aircraftTypeName: '滤芯',
        parentTypeName: '作战飞机',
        parentTypeId: '1',
        id: '1.2',
        numbering: '01.2',
        sequence: '1.2',
        status: 0
      }
    ]
  },
  {
    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
      },
      {
        aircraftTypeName: '燃料',
        parentTypeName: '消耗品',
        parentTypeId: '2',
        id: '2.2',
        numbering: '02.2',
        sequence: '2.2',
        status: 0
      }
    ]
  },
  {
    aircraftTypeName: '修理航材',
    parentTypeName: '',
    parentTypeId: '',
    id: '3',
    numbering: '03',
    sequence: '3',
    status: 1,
    children: [
      {
        aircraftTypeName: '发动机',
        parentTypeName: '消耗品',
        parentTypeId: '3',
        id: '3.1',
        numbering: '03.1',
        sequence: '3.1',
        status: 0
      },
      {
        aircraftTypeName: '航电系统',
        parentTypeName: '消耗品',
        parentTypeId: '3',
        id: '3.2',
        numbering: '03.2',
        sequence: '3.2',
        status: 0
      }
    ]
  }
]

export const dialogTableData = [
  {
    sparePartsCoding: '201',
    sparePartsName: '后轮',
    meteringUnit: '个',
    aircraft: 'J20',
    carryQuantity: '',
    unitPrice: '2000',
    amount: '50000',
    updateTime: ''
  },
  {
    sparePartsCoding: '203',
    sparePartsName: '前轮',
    meteringUnit: '个',
    aircraft: 'J20',
    carryQuantity: '',
    unitPrice: '2000',
    amount: '50000',
    updateTime: ''
  },
  {
    sparePartsCoding: '204',
    sparePartsName: '支架',
    meteringUnit: '个',
    aircraft: 'J20',
    carryQuantity: '',
    unitPrice: '2000',
    amount: '50000',
    updateTime: ''
  },
  {
    sparePartsCoding: '208',
    sparePartsName: '灯泡',
    meteringUnit: '个',
    aircraft: 'J20',
    carryQuantity: '',
    unitPrice: '2000',
    amount: '50000',
    updateTime: ''
  },
  {
    sparePartsCoding: '345',
    sparePartsName: '射灯',
    meteringUnit: '个',
    aircraft: 'J20',
    carryQuantity: '',
    unitPrice: '2000',
    amount: '50000',
    updateTime: ''
  }
]

export const addModeOptions = [
  {
    value: '1',
    label: '追加'
  },
  {
    value: '2',
    label: '覆盖'
  }
]
