fix 自定义路由配置
This commit is contained in:
@@ -5,6 +5,10 @@
|
|||||||
"ComputedRef": true,
|
"ComputedRef": true,
|
||||||
"DirectiveBinding": true,
|
"DirectiveBinding": true,
|
||||||
"EffectScope": true,
|
"EffectScope": true,
|
||||||
|
"ElLoading": true,
|
||||||
|
"ElMessage": true,
|
||||||
|
"ElMessageBox": true,
|
||||||
|
"ElNotification": true,
|
||||||
"ExtractDefaultPropTypes": true,
|
"ExtractDefaultPropTypes": true,
|
||||||
"ExtractPropTypes": true,
|
"ExtractPropTypes": true,
|
||||||
"ExtractPublicPropTypes": true,
|
"ExtractPublicPropTypes": true,
|
||||||
|
|||||||
@@ -26,6 +26,94 @@ import Layout from '@/layout/index.vue';
|
|||||||
|
|
||||||
// 公共路由
|
// 公共路由
|
||||||
export const constantRoutes: RouteRecordRaw[] = [
|
export const constantRoutes: RouteRecordRaw[] = [
|
||||||
|
/* ----------------------------------------自定义路由(查看)-------------------------------------------------------- */
|
||||||
|
//设备管理
|
||||||
|
{
|
||||||
|
path: '/equipmentList',
|
||||||
|
component: Layout,
|
||||||
|
name: 'Equipment',
|
||||||
|
redirect: '/equipmentList/list',
|
||||||
|
alwaysShow: true,
|
||||||
|
meta: { title: '设备管理', icon: 'equipment' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'list',
|
||||||
|
name: 'EquipmentList',
|
||||||
|
component: () => import('@/views/equipmentList/list.vue'),
|
||||||
|
meta: { title: '设备列表', icon: 'equipment' }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
//报警管理
|
||||||
|
{
|
||||||
|
path: '/warningList',
|
||||||
|
component: Layout,
|
||||||
|
name: 'Warning',
|
||||||
|
redirect: '/warningList/list',
|
||||||
|
alwaysShow: true,
|
||||||
|
meta: { title: '报警管理', icon: 'warningList' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'list',
|
||||||
|
name: 'WarningList',
|
||||||
|
component: () => import('@/views/WarningList/list.vue'),
|
||||||
|
meta: { title: '报警列表', icon: 'warningList' }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
//录像文件管理
|
||||||
|
{
|
||||||
|
path: '/fileList',
|
||||||
|
component: Layout,
|
||||||
|
name: 'File',
|
||||||
|
redirect: '/fileList/list',
|
||||||
|
meta: { title: '录像文件管理', icon: 'fileList' },
|
||||||
|
alwaysShow: true,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'list',
|
||||||
|
name: 'FileList',
|
||||||
|
component: () => import('@/views/fileList/list.vue'),
|
||||||
|
meta: { title: '录像列表', icon: 'fileList' }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
//系统设置
|
||||||
|
{
|
||||||
|
path: '/systemList',
|
||||||
|
component: Layout,
|
||||||
|
name: 'system',
|
||||||
|
redirect: '/systemList/base',
|
||||||
|
alwaysShow: true,
|
||||||
|
meta: { title: '系统设置', icon: 'systemList' },
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'base',
|
||||||
|
name: 'Base',
|
||||||
|
component: () => import('@/views/systemList/base/base.vue'),
|
||||||
|
meta: { title: '基础设置', icon: 'base' }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'password',
|
||||||
|
name: 'Password',
|
||||||
|
component: () => import('@/views/systemList/password/password.vue'),
|
||||||
|
meta: { title: '修改密码', icon: 'password' }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'role',
|
||||||
|
name: 'Role',
|
||||||
|
component: () => import('@/views/systemList/role/role.vue'),
|
||||||
|
meta: { title: '角色配置', icon: 'role' }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'user',
|
||||||
|
name: 'User',
|
||||||
|
component: () => import('@/views/systemList/user/user.vue'),
|
||||||
|
meta: { title: '用户配置', icon: 'user' }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
/* ----------------------------------------自带路由配置-------------------------------------------------------- */
|
||||||
{
|
{
|
||||||
path: '/redirect',
|
path: '/redirect',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
@@ -92,9 +180,7 @@ export const constantRoutes: RouteRecordRaw[] = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
// 动态路由,基于用户权限动态去加载
|
// 动态路由,基于用户权限动态去加载
|
||||||
export const dynamicRoutes: RouteRecordRaw[] = [
|
export const dynamicRoutes: RouteRecordRaw[] = [];
|
||||||
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建路由
|
* 创建路由
|
||||||
|
|||||||
@@ -45,6 +45,10 @@ export const usePermissionStore = defineStore('permission', () => {
|
|||||||
const setSidebarRouters = (routes: RouteRecordRaw[]): void => {
|
const setSidebarRouters = (routes: RouteRecordRaw[]): void => {
|
||||||
sidebarRouters.value = routes;
|
sidebarRouters.value = routes;
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* 生成路由
|
||||||
|
* @returns 路由数组
|
||||||
|
*/
|
||||||
const generateRoutes = async (): Promise<RouteRecordRaw[]> => {
|
const generateRoutes = async (): Promise<RouteRecordRaw[]> => {
|
||||||
const res = await getRouters();
|
const res = await getRouters();
|
||||||
const { data } = res;
|
const { data } = res;
|
||||||
|
|||||||
9
src/views/WarningList/list.vue
Normal file
9
src/views/WarningList/list.vue
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<template>
|
||||||
|
<div class="warning">
|
||||||
|
<h1>warning</h1>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts"></script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
9
src/views/equipmentList/detail.vue
Normal file
9
src/views/equipmentList/detail.vue
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<template>
|
||||||
|
<div class="detail">
|
||||||
|
<h1>detail</h1>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts"></script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
8
src/views/equipmentList/list.vue
Normal file
8
src/views/equipmentList/list.vue
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<template>
|
||||||
|
<div class="equipment">
|
||||||
|
<h1>equipment设备管理</h1>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script setup lang="ts"></script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
9
src/views/equipmentList/statistics.vue
Normal file
9
src/views/equipmentList/statistics.vue
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<template>
|
||||||
|
<div class="stat">
|
||||||
|
<h1>stat</h1>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts"></script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
9
src/views/fileList/list.vue
Normal file
9
src/views/fileList/list.vue
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<template>
|
||||||
|
<div class="file">
|
||||||
|
<h1>file</h1>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts"></script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
9
src/views/systemList/base/base.vue
Normal file
9
src/views/systemList/base/base.vue
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<template>
|
||||||
|
<div class="base">
|
||||||
|
<h1>base</h1>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts"></script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
9
src/views/systemList/password/password.vue
Normal file
9
src/views/systemList/password/password.vue
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<template>
|
||||||
|
<div class="password">
|
||||||
|
<h1>password</h1>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts"></script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
9
src/views/systemList/role/role.vue
Normal file
9
src/views/systemList/role/role.vue
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<template>
|
||||||
|
<div class="role">
|
||||||
|
<h1>role</h1>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts"></script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
9
src/views/systemList/user/user.vue
Normal file
9
src/views/systemList/user/user.vue
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<template>
|
||||||
|
<div class="user">
|
||||||
|
<h1>user</h1>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts"></script>
|
||||||
|
|
||||||
|
<style lang="less" scoped></style>
|
||||||
Reference in New Issue
Block a user