github.com/easysoft/zendata@v0.0.0-20240513203326-705bd5a7fd67/ui/src/router/index.js (about)

     1  import Vue from "vue";
     2  import VueRouter from "vue-router";
     3  
     4  import MainLayout from "../layout/MainLayout";
     5  import ColLayout from "../layout/ColLayout";
     6  import BlankLayout from "../layout/BlankLayout";
     7  import BuildinLayout from "../views/data/buildin/Layout";
     8  
     9  Vue.use(VueRouter);
    10  
    11  const routes = [
    12      {
    13          path:"/",
    14          name: "",
    15          component: MainLayout,
    16          redirect: '/data/mine/list',
    17          children: [
    18              {
    19                  path:"mock",
    20                  name: "mock",
    21                  component: ColLayout,
    22                  children: [
    23                      {
    24                          path: 'index',
    25                          name: 'mock-index',
    26                          component: () => import('../views/mock/Index'),
    27                          meta: { title: 'menu.data.mock' }
    28                      },
    29                  ]
    30              },
    31              {
    32                  path:"data",
    33                  name: "data",
    34                  component: ColLayout,
    35                  children: [
    36                      {
    37                          path: 'mine',
    38                          name: 'mine',
    39                          component: BlankLayout,
    40                          children: [
    41                              {
    42                                  path: 'list',
    43                                  name: 'mine-list',
    44                                  component: () => import('../views/data/mine/List'),
    45                                  meta: { title: 'menu.data.list' }
    46                              },
    47                              {
    48                                  path: 'edit/:id',
    49                                  name: 'mine-edit',
    50                                  component: () => import('../views/data/mine/Edit'),
    51                                  meta: { title: 'menu.data.edit' }
    52                              },
    53                          ],
    54                      },
    55                      {
    56                          path: 'buildin',
    57                          name: 'buildin',
    58                          component: BuildinLayout,
    59                          children: [
    60                              {
    61                                  path: 'ranges',
    62                                  name: 'ranges',
    63                                  component: BlankLayout,
    64                                  children: [
    65                                      {
    66                                          path: 'list/:id?',
    67                                          name: 'ranges-list',
    68                                          component: () => import('../views/data/buildin/ranges/List'),
    69                                          meta: { title: 'menu.ranges.list' }
    70                                      },
    71                                      {
    72                                          path: 'edit/:id',
    73                                          name: 'ranges-edit',
    74                                          component: () => import('../views/data/buildin/ranges/Edit'),
    75                                          meta: { title: 'menu.ranges.edit' }
    76                                      },
    77                                  ],
    78                              },
    79                              {
    80                                  path: 'instances',
    81                                  name: 'instances',
    82                                  component: BlankLayout,
    83                                  children: [
    84                                      {
    85                                          path: 'list/:id?',
    86                                          name: 'instances-list',
    87                                          component: () => import('../views/data/buildin/instances/List'),
    88                                          meta: { title: 'menu.instances.list' }
    89                                      },
    90                                      {
    91                                          path: 'edit/:id',
    92                                          name: 'instances-edit',
    93                                          component: () => import('../views/data/buildin/instances/Edit'),
    94                                          meta: { title: 'menu.instances.edit' }
    95                                      },
    96                                  ],
    97                              },
    98                              {
    99                                  path: 'excel',
   100                                  name: 'excel',
   101                                  component: BlankLayout,
   102                                  children: [
   103                                      {
   104                                          path: 'list/:id?',
   105                                          name: 'excel-list',
   106                                          component: () => import('../views/data/buildin/excel/List'),
   107                                          meta: { title: 'menu.excel.list' }
   108                                      },
   109                                      {
   110                                          path: 'edit/:id',
   111                                          name: 'excel-edit',
   112                                          component: () => import('../views/data/buildin/excel/Edit'),
   113                                          meta: { title: 'menu.excel.edit' }
   114                                      },
   115                                  ],
   116                              },
   117                              {
   118                                  path: 'config',
   119                                  name: 'config',
   120                                  component: BlankLayout,
   121                                  children: [
   122                                      {
   123                                          path: 'list/:id?',
   124                                          name: 'config-list',
   125                                          component: () => import('../views/data/buildin/config/List'),
   126                                          meta: { title: 'menu.config.list' }
   127                                      },
   128                                      {
   129                                          path: 'edit/:id',
   130                                          name: 'config-edit',
   131                                          component: () => import('../views/data/buildin/config/Edit'),
   132                                          meta: { title: 'menu.config.edit' }
   133                                      },
   134                                  ],
   135                              },
   136                              {
   137                                  path: 'text',
   138                                  name: 'text',
   139                                  component: BlankLayout,
   140                                  children: [
   141                                      {
   142                                          path: 'list/:id?',
   143                                          name: 'text-list',
   144                                          component: () => import('../views/data/buildin/text/List'),
   145                                          meta: { title: 'menu.text.list' }
   146                                      },
   147                                      {
   148                                          path: 'edit/:id',
   149                                          name: 'text-edit',
   150                                          component: () => import('../views/data/buildin/text/Edit'),
   151                                          meta: { title: 'menu.text.edit' }
   152                                      },
   153                                  ],
   154                              },
   155                          ],
   156                      }
   157                  ]
   158              }
   159          ]
   160      },
   161  ]
   162  
   163  const router =  new VueRouter({
   164      mode: 'hash',
   165      routes
   166  })
   167  export default router;