import { tableColumn } from '../components/ColumnSet/index.vue'
export default function useTableColumns() {
  const tableColumns = ref<tableColumn[]>([])
  let filterColumnProps: string[] = []
  const filteredColumns = computed(() =>
    tableColumns.value.filter(({ columnProp }) =>
      filterColumnProps.includes(columnProp)
    )
  )
  const getTableColumns = () => {
    tableColumns.value = [
      {
        columnName: '航班号',
        columnProp: 'flightNO',
        groupTitle: '航班相关',
      },
    ]
  }
  const columnChecked = checkedColumnProps => {
    filterColumnProps = checkedColumnProps
  }
  onMounted(() => {
    getTableColumns()
  })
  
  return {
    tableColumns,
    columnChecked,
    filteredColumns
  }
}
