import { createHashHistory } from 'history'

export interface RouteItem {
  title: string,
  path: string,
  navigation:boolean,
  icon?: string,
  parent?: RouteItem,
  component: any,
  joinTab: boolean
}
export const history = createHashHistory()

const config: Array<RouteItem> = [
  {
    title: '',
    path: '/login',
    joinTab: false,
    navigation: false,
    component: require('./page/Login').default
  },
  {
    title: '场景管理',
    path: '/scene',
    joinTab: false,
    navigation: false,
    icon: require('./assets/images/icon_sys03.png'),
    component: require('./page/scene/list').SceneList
  },
  {
    title: '栅格数据',
    path: '/:sid/grid',
    navigation: true,
    joinTab: true,
    icon: require('./assets/images/icon_sys01.png'),
    component: require('./page/List/ResterList').default
  },
  {
    title: '3D模型',
    path: '/:sid/model',
    joinTab: true,
    navigation: true,
    icon: require('./assets/images/icon_sys02.png'),
    component: require('./page/List/ModelList').default
  },
  {
    title: '地形数据',
    path: '/:sid/terrain',
    navigation: true,
    joinTab: true,
    icon: require('./assets/images/icon_sys03.png'),
    component: require('./page/List/Terrain').default
  },
  {
    title: '矢量数据',
    path: '/:sid/gis',
    navigation: true,
    joinTab: true,
    icon: require('./assets/images/icon_sys03.png'),
    component: require('./page/List/GeoList').default
  }
]

config.push({
  title: '编辑样式',
  path: '/:sid/style/:id',
  navigation: false,
  joinTab: true,
  component: require('./page/StyleEdit').default,
  parent: config[2]
})

export default config
