Commit 78a6f92f by Ooh-Ao

เส้นทาง

parent 52b52d78
...@@ -9,10 +9,12 @@ import { ProjectProductManagementComponent } from './project-management/project- ...@@ -9,10 +9,12 @@ import { ProjectProductManagementComponent } from './project-management/project-
import { HomeAdminComponent } from './home-admin/home-admin.component'; import { HomeAdminComponent } from './home-admin/home-admin.component';
import { TransectionProductManagementComponent } from './transection-product-management/transection-product-management.component'; import { TransectionProductManagementComponent } from './transection-product-management/transection-product-management.component';
import { HistoryProductComponent } from './history-product/history-product.component'; import { HistoryProductComponent } from './history-product/history-product.component';
import { AdminRoutingModule } from './admin.routing';
@NgModule({ @NgModule({
imports: [ imports: [
CommonModule CommonModule,
AdminRoutingModule
], ],
declarations: [AdminComponent, UserManagementComponent, ProjectManagementComponent, ProductManagementComponent, ProjectEmployeeManagementComponent, ProjectProductManagementComponent, HomeAdminComponent, TransectionProductManagementComponent, HistoryProductComponent] declarations: [AdminComponent, UserManagementComponent, ProjectManagementComponent, ProductManagementComponent, ProjectEmployeeManagementComponent, ProjectProductManagementComponent, HomeAdminComponent, TransectionProductManagementComponent, HistoryProductComponent]
}) })
......
import { Routes, RouterModule } from '@angular/router';
import { HomeAdminComponent } from './home-admin/home-admin.component';
import { UserManagementComponent } from './user-management/user-management.component';
import { NgModule } from '@angular/core';
const routes: Routes = [
{
path: "admin",
children: [
{ path: "home", component: HomeAdminComponent },
{ path: "user-management", component: UserManagementComponent },
]
}
];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class AdminRoutingModule { }
...@@ -72,9 +72,16 @@ export class SidebarComponent { ...@@ -72,9 +72,16 @@ export class SidebarComponent {
} }
ngOnInit() { ngOnInit() {
this.menuitemsSubscribe$ = this.navServices.items.subscribe((items) => { if(true){
this.menuitemsSubscribe$ = this.navServices.itemsAdmin.subscribe((items) => {
this.menuItems = items; this.menuItems = items;
}); });
}else{
this.menuitemsSubscribe$ = this.navServices.itemsEmp.subscribe((items) => {
this.menuItems = items;
});
}
this.ParentActive(); this.ParentActive();
this.router.events.subscribe((event) => { this.router.events.subscribe((event) => {
......
...@@ -68,5 +68,9 @@ export const content: Routes = [ ...@@ -68,5 +68,9 @@ export const content: Routes = [
path: '', path: '',
loadChildren: () => import('../../components/icons/icons.module').then(m => m.IconsModule) loadChildren: () => import('../../components/icons/icons.module').then(m => m.IconsModule)
}, },
{
path: '',
loadChildren: () => import('../../admin/admin.module').then(m => m.AdminModule)
},
]; ];
...@@ -92,7 +92,7 @@ export class NavService implements OnDestroy { ...@@ -92,7 +92,7 @@ export class NavService implements OnDestroy {
title: 'Dashboards', title: 'Dashboards',
icon: 'home-8-line', icon: 'home-8-line',
type: 'sub', type: 'sub',
selected : false, selected: false,
active: false, active: false,
children: [ children: [
{ path: '/dashboard/sales', title: 'Sales', type: 'link' }, { path: '/dashboard/sales', title: 'Sales', type: 'link' },
...@@ -117,7 +117,7 @@ export class NavService implements OnDestroy { ...@@ -117,7 +117,7 @@ export class NavService implements OnDestroy {
badgeClass: 'badge badge-sm bg-secondary badge-hide', badgeClass: 'badge badge-sm bg-secondary badge-hide',
badgeValue: 'new', badgeValue: 'new',
path: '/widgets', path: '/widgets',
selected : false, selected: false,
type: 'link', type: 'link',
}, },
//component //component
...@@ -127,7 +127,7 @@ export class NavService implements OnDestroy { ...@@ -127,7 +127,7 @@ export class NavService implements OnDestroy {
icon: 'inbox-line', icon: 'inbox-line',
type: 'sub', type: 'sub',
Menusub: true, Menusub: true,
selected : false, selected: false,
active: false, active: false,
children: [ children: [
{ path: '/components/accordion', title: 'Accordion', type: 'link' }, { path: '/components/accordion', title: 'Accordion', type: 'link' },
...@@ -153,7 +153,7 @@ export class NavService implements OnDestroy { ...@@ -153,7 +153,7 @@ export class NavService implements OnDestroy {
icon: 'cpu-line', icon: 'cpu-line',
type: 'sub', type: 'sub',
Menusub: true, Menusub: true,
selected : false, selected: false,
active: false, active: false,
children: [ children: [
{ path: '/elements/nav-bar', title: 'Navbar', type: 'link' }, { path: '/elements/nav-bar', title: 'Navbar', type: 'link' },
...@@ -172,7 +172,7 @@ export class NavService implements OnDestroy { ...@@ -172,7 +172,7 @@ export class NavService implements OnDestroy {
icon: 'file-text-line', icon: 'file-text-line',
type: 'sub', type: 'sub',
Menusub: true, Menusub: true,
selected : false, selected: false,
active: false, active: false,
children: [ children: [
{ {
...@@ -235,7 +235,7 @@ export class NavService implements OnDestroy { ...@@ -235,7 +235,7 @@ export class NavService implements OnDestroy {
type: 'sub', type: 'sub',
Menusub: true, Menusub: true,
active: false, active: false,
selected : false, selected: false,
children: [ children: [
{ path: '/advanced/rangeslider', title: 'Rangeslider', type: 'link' }, { path: '/advanced/rangeslider', title: 'Rangeslider', type: 'link' },
{ path: '/advanced/calender', title: 'Calender', type: 'link' }, { path: '/advanced/calender', title: 'Calender', type: 'link' },
...@@ -258,7 +258,7 @@ export class NavService implements OnDestroy { ...@@ -258,7 +258,7 @@ export class NavService implements OnDestroy {
title: 'File Manager', title: 'File Manager',
icon: 'database', icon: 'database',
type: 'sub', type: 'sub',
selected : false, selected: false,
Menusub: true, Menusub: true,
active: false, active: false,
children: [ children: [
...@@ -287,7 +287,7 @@ export class NavService implements OnDestroy { ...@@ -287,7 +287,7 @@ export class NavService implements OnDestroy {
icon: 'file-list-3-line', icon: 'file-list-3-line',
type: 'sub', type: 'sub',
Menusub: true, Menusub: true,
selected : false, selected: false,
active: false, active: false,
children: [ children: [
{ path: '/basicui/dropdown', title: 'Dropdown', type: 'link' }, { path: '/basicui/dropdown', title: 'Dropdown', type: 'link' },
...@@ -302,7 +302,7 @@ export class NavService implements OnDestroy { ...@@ -302,7 +302,7 @@ export class NavService implements OnDestroy {
title: 'Tables', title: 'Tables',
icon: 'database', icon: 'database',
type: 'sub', type: 'sub',
selected : false, selected: false,
Menusub: true, Menusub: true,
active: false, active: false,
children: [ children: [
...@@ -323,7 +323,7 @@ export class NavService implements OnDestroy { ...@@ -323,7 +323,7 @@ export class NavService implements OnDestroy {
title: 'NestedMenu', title: 'NestedMenu',
icon: 'node-tree', icon: 'node-tree',
type: 'sub', type: 'sub',
selected : false, selected: false,
Menusub: false, Menusub: false,
active: false, active: false,
children: [ children: [
...@@ -337,7 +337,7 @@ export class NavService implements OnDestroy { ...@@ -337,7 +337,7 @@ export class NavService implements OnDestroy {
title: 'Nested2', title: 'Nested2',
icon: 'database', icon: 'database',
type: 'sub', type: 'sub',
selected : false, selected: false,
active: false, active: false,
children: [ children: [
{ {
...@@ -362,7 +362,7 @@ export class NavService implements OnDestroy { ...@@ -362,7 +362,7 @@ export class NavService implements OnDestroy {
title: 'Maps', title: 'Maps',
icon: 'map-pin-user-line', icon: 'map-pin-user-line',
type: 'sub', type: 'sub',
selected : false, selected: false,
Menusub: true, Menusub: true,
active: false, active: false,
children: [ children: [
...@@ -373,7 +373,7 @@ export class NavService implements OnDestroy { ...@@ -373,7 +373,7 @@ export class NavService implements OnDestroy {
title: 'Charts', title: 'Charts',
icon: 'pie-chart-2-line', icon: 'pie-chart-2-line',
type: 'sub', type: 'sub',
selected : false, selected: false,
Menusub: true, Menusub: true,
active: false, active: false,
children: [ children: [
...@@ -387,14 +387,14 @@ export class NavService implements OnDestroy { ...@@ -387,14 +387,14 @@ export class NavService implements OnDestroy {
title: 'Pages', title: 'Pages',
icon: 'book-open-line', icon: 'book-open-line',
type: 'sub', type: 'sub',
selected : false, selected: false,
Menusub: true, Menusub: true,
active: false, active: false,
children: [ children: [
{ {
title: 'Profile', title: 'Profile',
type: 'sub', type: 'sub',
selected : false, selected: false,
Menusub: true, Menusub: true,
active: false, active: false,
children: [ children: [
...@@ -409,7 +409,7 @@ export class NavService implements OnDestroy { ...@@ -409,7 +409,7 @@ export class NavService implements OnDestroy {
{ {
title: 'Invoice', title: 'Invoice',
type: 'sub', type: 'sub',
selected : false, selected: false,
Menusub: true, Menusub: true,
active: false, active: false,
children: [ children: [
...@@ -428,7 +428,7 @@ export class NavService implements OnDestroy { ...@@ -428,7 +428,7 @@ export class NavService implements OnDestroy {
{ {
title: 'Blog', title: 'Blog',
type: 'sub', type: 'sub',
selected : false, selected: false,
Menusub: true, Menusub: true,
active: false, active: false,
children: [ children: [
...@@ -440,7 +440,7 @@ export class NavService implements OnDestroy { ...@@ -440,7 +440,7 @@ export class NavService implements OnDestroy {
{ {
title: 'Mail', title: 'Mail',
type: 'sub', type: 'sub',
selected : false, selected: false,
Menusub: true, Menusub: true,
active: false, active: false,
children: [ children: [
...@@ -456,7 +456,7 @@ export class NavService implements OnDestroy { ...@@ -456,7 +456,7 @@ export class NavService implements OnDestroy {
{ {
title: 'Ecommerce', title: 'Ecommerce',
type: 'sub', type: 'sub',
selected : false, selected: false,
Menusub: true, Menusub: true,
active: false, active: false,
children: [ children: [
...@@ -514,7 +514,7 @@ export class NavService implements OnDestroy { ...@@ -514,7 +514,7 @@ export class NavService implements OnDestroy {
{ {
title: 'Icons', title: 'Icons',
icon: 'camera-lens-line', icon: 'camera-lens-line',
type: 'sub',selected : false, type: 'sub', selected: false,
Menusub: true, Menusub: true,
active: false, active: false,
children: [ children: [
...@@ -525,13 +525,13 @@ export class NavService implements OnDestroy { ...@@ -525,13 +525,13 @@ export class NavService implements OnDestroy {
{ {
title: 'Authentication', title: 'Authentication',
icon: 'error-warning-line', icon: 'error-warning-line',
type: 'sub',selected : false, type: 'sub', selected: false,
Menusub: true, Menusub: true,
active: false, active: false,
children: [ children: [
{ {
title: 'Sign In', title: 'Sign In',
type: 'sub',selected : false, type: 'sub', selected: false,
Menusub: true, Menusub: true,
active: false, active: false,
children: [ children: [
...@@ -542,7 +542,7 @@ export class NavService implements OnDestroy { ...@@ -542,7 +542,7 @@ export class NavService implements OnDestroy {
}, },
{ {
title: 'Sign Up', title: 'Sign Up',
type: 'sub',selected : false, type: 'sub', selected: false,
Menusub: true, Menusub: true,
active: false, active: false,
children: [ children: [
...@@ -553,7 +553,7 @@ export class NavService implements OnDestroy { ...@@ -553,7 +553,7 @@ export class NavService implements OnDestroy {
}, },
{ {
title: 'Create Password', title: 'Create Password',
type: 'sub',selected : false, type: 'sub', selected: false,
Menusub: true, Menusub: true,
active: false, active: false,
children: [ children: [
...@@ -564,7 +564,7 @@ export class NavService implements OnDestroy { ...@@ -564,7 +564,7 @@ export class NavService implements OnDestroy {
}, },
{ {
title: 'Reset Password', title: 'Reset Password',
type: 'sub',selected : false, type: 'sub', selected: false,
Menusub: true, Menusub: true,
active: false, active: false,
children: [ children: [
...@@ -575,7 +575,7 @@ export class NavService implements OnDestroy { ...@@ -575,7 +575,7 @@ export class NavService implements OnDestroy {
}, },
{ {
title: 'Forgot Password', title: 'Forgot Password',
type: 'sub',selected : false, type: 'sub', selected: false,
Menusub: true, Menusub: true,
active: false, active: false,
children: [ children: [
...@@ -586,7 +586,7 @@ export class NavService implements OnDestroy { ...@@ -586,7 +586,7 @@ export class NavService implements OnDestroy {
}, },
{ {
title: 'Lock Screen', title: 'Lock Screen',
type: 'sub',selected : false, type: 'sub', selected: false,
Menusub: true, Menusub: true,
active: false, active: false,
children: [ children: [
...@@ -597,7 +597,7 @@ export class NavService implements OnDestroy { ...@@ -597,7 +597,7 @@ export class NavService implements OnDestroy {
}, },
{ {
title: 'Two-step-verification', title: 'Two-step-verification',
type: 'sub',selected : false, type: 'sub', selected: false,
Menusub: true, Menusub: true,
active: false, active: false,
children: [ children: [
...@@ -635,7 +635,7 @@ export class NavService implements OnDestroy { ...@@ -635,7 +635,7 @@ export class NavService implements OnDestroy {
}, },
{ {
title: 'Error Pages', title: 'Error Pages',
type: 'sub',selected : false, type: 'sub', selected: false,
Menusub: true, Menusub: true,
active: false, active: false,
children: [ children: [
...@@ -656,4 +656,23 @@ export class NavService implements OnDestroy { ...@@ -656,4 +656,23 @@ export class NavService implements OnDestroy {
]; ];
// Array // Array
items = new BehaviorSubject<Menu[]>(this.MENUITEMS); items = new BehaviorSubject<Menu[]>(this.MENUITEMS);
itemsAdmin = new BehaviorSubject<Menu[]>([{ headTitle: 'Admin' },
{ path: '/dashboard/stocks', title: 'หน้าแรก', type: 'link' },
{
title: 'การจัดการ',
type: 'sub',
selected: false,
Menusub: true,
active: false,
children: [
{ path: '/mail/chat', title: 'การจัดการสมาชิก', type: 'link' },
{ path: '/mail/mail', title: 'การจัดการอุปกรณ์', type: 'link' },
{
path: '/mail/mail-settings',
title: 'การจัดการอุปกรณ์',
type: 'link',
},
],
},]);
itemsEmp = new BehaviorSubject<Menu[]>(this.MENUITEMS);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment