2024-04-06 13:25:13 +08:00
|
|
|
// Hooks
|
|
|
|
import { datasetsBeforeEnter } from 'new-dashboard/router/hooks/check-navigation';
|
|
|
|
import store from '../../store';
|
|
|
|
|
|
|
|
// Lazy Pages
|
|
|
|
const Data = () => import('new-dashboard/pages/Data/Data');
|
|
|
|
const Datasets = () => import('new-dashboard/pages/Data/Datasets');
|
|
|
|
const Subscriptions = () => import('new-dashboard/pages/Data/Subscriptions');
|
|
|
|
const Catalog = () => import('new-dashboard/pages/Data/Catalog');
|
|
|
|
const CatalogDataset = () => import('new-dashboard/pages/Data/CatalogDataset');
|
|
|
|
const CatalogDatasetData = () => import('new-dashboard/pages/Data/CatalogDatasetData');
|
|
|
|
const CatalogDatasetSummary = () => import('new-dashboard/pages/Data/CatalogDatasetSummary');
|
|
|
|
|
|
|
|
const routes = [
|
|
|
|
{
|
|
|
|
path: '/datasets/:filter?',
|
|
|
|
component: Data,
|
|
|
|
meta: {
|
2024-04-09 20:20:34 +08:00
|
|
|
title: () => '数据 | 快点'
|
2024-04-06 13:25:13 +08:00
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'spatial-data-catalog',
|
|
|
|
name: 'spatial-data-catalog',
|
|
|
|
component: Catalog,
|
|
|
|
meta: {
|
2024-04-09 20:20:34 +08:00
|
|
|
title: () => '空间数据目录 | 快点'
|
2024-04-06 13:25:13 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '',
|
|
|
|
component: Datasets,
|
|
|
|
name: 'datasets',
|
|
|
|
props: (route) => ({ datasetId: route.query.id, createVis: /^true$/i.test(route.query.create) }),
|
|
|
|
meta: {
|
2024-04-09 20:20:34 +08:00
|
|
|
title: () => '数据 | 快点'
|
2024-04-06 13:25:13 +08:00
|
|
|
},
|
|
|
|
beforeEnter: datasetsBeforeEnter
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/datasets/spatial-data-catalog/:type/:datasetId',
|
|
|
|
component: CatalogDataset,
|
|
|
|
meta: {
|
2024-04-09 20:20:34 +08:00
|
|
|
title: () => '空间数据目录 | 快点'
|
2024-04-06 13:25:13 +08:00
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'data',
|
|
|
|
name: 'catalog-dataset-data',
|
|
|
|
component: CatalogDatasetData,
|
|
|
|
meta: {
|
2024-04-09 20:20:34 +08:00
|
|
|
title: () => '空间数据目录 | 快点'
|
2024-04-06 13:25:13 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '',
|
|
|
|
name: 'catalog-dataset-summary',
|
|
|
|
component: CatalogDatasetSummary,
|
|
|
|
meta: {
|
2024-04-09 20:20:34 +08:00
|
|
|
title: () => '空间数据目录 | 快点'
|
2024-04-06 13:25:13 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
if (store.state.user.do_enabled) {
|
|
|
|
routes[0].children.unshift({
|
|
|
|
path: 'subscriptions',
|
|
|
|
name: 'subscriptions',
|
|
|
|
component: Subscriptions,
|
|
|
|
meta: {
|
2024-04-09 20:20:34 +08:00
|
|
|
title: () => '订阅 | 快点'
|
2024-04-06 13:25:13 +08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
export default routes;
|