export enum ROAD_DIRECTION {
  '上行',
  '下行'
}

export enum NAME_ROAD_DIRECTION {
  '杭州方向',
  '宁波方向'
}

export enum SEARCH_ROAD_DIRECTION {
  'gfj_tunnel_on' = '杭州方向',
  'xl_tunnel_down' = '宁波方向'
}

export enum EVENT_TYPE {
  '急加速',
  '急减速',
  '实线变道',
  '蛇形驾驶',
  '逆行',
  '拥堵',
  '可疑事件',
  '追尾',
  '停车'
}

export enum FLOW_COLOR {
  'rgba(72, 255, 0, 0.5)',
  'rgba(255, 242, 0, 0.5)',
  'rgba(255, 102, 0, 0.5)',
  'rgba(255, 102, 0, 0.5)'

}

export const enumToArray = <T>(e: T, reserve?: boolean) => {

  return Object[reserve ? 'values' : 'keys'](e).map(key => {
    return { key, text: e[key] }
  })

}