配餐项目前端文件
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

135 lines
2.7 KiB

2 years ago
import { NgModule } from "@angular/core";
import { Routes, RouterModule } from "@angular/router";
import {
DishComponent,
FoodComponent,
HomeComponent,
IngredientFormComponent,
IngredientListComponent,
IngredientReleaseComponent,
IngredientReviewComponent,
LoginComponent,
2 years ago
OrganizationListComponent,
OrganizationFormComponent,
UserManageComponent,
StandardListComponent,
StandardFormComponent,
StandardSettingComponent,
2 years ago
} from "./pages";
import { AppLayoutComponent } from "./components";
2 years ago
import { authGuard } from "./services/auth.guard";
2 years ago
const routes: Routes = [
{ path: "login", component: LoginComponent },
{
path: "",
component: AppLayoutComponent,
2 years ago
canActivate: [authGuard],
2 years ago
children: [
{ path: "", pathMatch: "full", redirectTo: "home" },
{ path: "home", component: HomeComponent },
2 years ago
{ path: "food", component: FoodComponent, title: "食材管理" },
{ path: "dish", component: DishComponent, title: "菜品管理" },
{
path: "standard",
children: [
{
path: "",
pathMatch: "full",
redirectTo: "list",
},
{
path: "list",
component: StandardListComponent,
},
{
path: "form/:id",
component: StandardFormComponent,
},
{
path: "setting/:id",
component: StandardSettingComponent,
},
],
},
2 years ago
{
path: "ingredient",
2 years ago
title: "食谱管理",
2 years ago
children: [
{
path: "",
pathMatch: "full",
redirectTo: "item",
},
{
path: "item",
2 years ago
title: "食谱库",
2 years ago
children: [
{
path: "",
pathMatch: "full",
redirectTo: "list",
},
{
path: "list",
component: IngredientListComponent,
},
{
path: "form/:id",
component: IngredientFormComponent,
},
],
},
{
path: "review",
2 years ago
title: "食谱审核",
2 years ago
component: IngredientReviewComponent,
},
{
path: "release",
2 years ago
title: "食谱发布计划",
2 years ago
component: IngredientReleaseComponent,
},
],
},
2 years ago
{
path: "organization",
title: "单位管理",
children: [
{
path: "",
pathMatch: "full",
redirectTo: "list",
},
{
path: "list",
component: OrganizationListComponent,
},
{
path: "form/:id",
component: OrganizationFormComponent,
},
],
},
{
path: "system",
title: "系统设置",
children: [
{
path: "user",
title: "用户管理",
component: UserManageComponent,
},
],
},
2 years ago
],
},
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule],
})
export class AppRoutingModule {}