

// name 唯一
import { RouteRecordRaw } from "vue-router";
export const Layout = () => import("@/components/layout/layout.vue");
export const staticRouter: RouteRecordRaw[] =
    [
        {
            path: '/',
            name: 'dashboard',
            redirect: '/index',
            icon: 'icon-policeman-full',
            meta: {
                keepalive: true
            },
            component: Layout,
            children: [
                {

                    path: '/index',
                    name: 'index',
                    meta: {
                        title: '首页',
                        keepalive: true
                    },
                    component: () => import('@/views/dashboard/index.vue')
                },


            ]
        },

        {

            path: '/user',
            name: 'user',
            meta: {
                title: '用户管理',
                keepalive: true
            },
            component: Layout,
            children: [
                {
                    path: 'index',
                    name: 'user-index',
                    meta: {
                        title: '后台用户',
                        keepalive: true
                    },
                    component: () => import('@/views/user/user.vue')
                },
                {
                    path: 'weapp',
                    name: 'weapp',
                    meta: {

                        title: '小程序用户',
                        keepalive: true
                    },
                    component: () => import('@/views/user/user-weapp.vue')
                },
            ]
        },

        {

            path: '/query-',
            name: 'query-',
            meta: {
                title: '信息查询',
                keepalive: true
            },
            component: Layout,
            children: [
                {
                    path: 'public-unit',  // 这里使用相对路径而不是 '/register'
                    name: 'public-unit',
                    meta: {

                        title: '企事业单位',
                        keepalive: true
                    },
                    component: () => import('@/views/query/publicUnit.vue')
                },
                // {
                //     path: 'weapp-user',  // 这里使用相对路径而不是 '/register'
                //     name: 'weapp-user',
                //     meta: {
                //
                //         title: '微信小程序用户',
                //         keepalive: true
                //     },
                //     component: () => import('@/views/query/weappUser.vue')
                // },
            ]
        },
        {
            path: '/login',
            name: 'login',
            meta: {
                keepalive: true
            },
            component: () => import('@/views/login.vue')
        },
        {

            path: '/register-index',
            name: 'register-index',
            meta: {
            },
            component: () => import('@/views/register.vue')
        },


        {
            path: '/law',
            name: 'law',
            meta: {

            },
            component: Layout,
            children: [
                {
                    path: '/law-index',
                    name: 'law-index',
                    meta: {
                        title: '法制宣传',
                        keepalive: true
                    },
                    component: () => import('@/views/law/index.vue')
                },
            ]
        },
        {
            path: '/police',
            name: 'police',
            meta: {

            },
            component: Layout,
            children: [
                {
                    path: '/police-presence',
                    name: 'police-presence',
                    meta: {
                        title: '警保风采',
                        keepalive: true
                    },
                    component: () => import('@/views/police/index.vue')
                },
            ]
        },
        {
            path: '/warning',
            name: 'warning',
            meta: {

            },
            component: Layout,
            children: [
                {
                    path: '/early-warning',
                    name: 'early-warning',
                    meta: {
                        title: '三色预警',
                        keepalive: true
                    },
                    component: () => import('@/views/warning/index.vue')
                },
            ]
        },
    ]



