加入后台管理模块。

This commit is contained in:
2023-03-23 18:39:15 +08:00
parent a03da1bba9
commit cca2f449ac
15 changed files with 626 additions and 82 deletions

View File

@@ -23,18 +23,64 @@ const routes = [
hidden: true,
component: async () => await import( "@/views/Login.vue" ),
},
{
path: "/public",
name: "Public",
hidden: true,
component: async () => await import( "@/views/Public.vue" ),
},
// 桌面霸屏
{
path: "/desktop_archievement",
name: "DesktopArchievement",
hidden: true,
component: async () => await import( "@/views/DesktopArchievement.vue" ),
},
// 工作台
{
path:"/console",
name:"Console",
meta: {
title: "总览",
icon: "house",
},
component: ()=> import("../layout/Index.vue"),
children:[
{
path:"/desktop",
name:"Desktop",
meta: {
title:"工作台",
icon: "house",
},
component: ()=> import("../views/Desktop.vue"),
},
],
},
//数据管理
{
path:"/data",
name:"Data",
meta:{
title:"数据管理",
icon: "document",
},
component: ()=> import("../layout/Index.vue"),
children:[
{
path:"/staff_data",
name:"StaffDataManagement",
meta: {
title:"坐席管理",
icon: "user",
},
component: ()=> import("../views/StaffManagement.vue"),
},
{
path:"/archievement_data",
name:"ArchievementDataManagement",
meta: {
title:"数据管理",
icon: "document",
},
component: ()=> import("../views/DataManagement.vue"),
},
],
},
];
const router = createRouter(
@@ -50,4 +96,25 @@ const router = createRouter(
// });
export { router };
// 工具函数
function hasOnlyChild( children )
{
if ( !children )
{
return false;
}
const routes = children.filter((item)=>
{
return !item.hidden;
});
if ( routes.length === 1)
{
return true;
}
return false;
}
export { router, hasOnlyChild };