From eef6a3f48cf462dc490e906078edfce2173c9f99 Mon Sep 17 00:00:00 2001 From: "lijie.hu" Date: Tue, 19 Mar 2024 17:56:16 +0800 Subject: [PATCH] =?UTF-8?q?Add=EF=BC=9A=E5=AE=8C=E6=88=90=E8=8F=9C?= =?UTF-8?q?=E5=8D=95=E5=92=8C=E6=95=B0=E6=8D=AE=E6=A0=BC=E5=BC=8F=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../routes/data-v/menu/lj-menu.interface.ts | 19 + src/app/routes/data-v/menu/lj-menu.service.ts | 16 + .../data-v/navigation/navigation.component.ts | 683 +++++++++++++++++- 3 files changed, 688 insertions(+), 30 deletions(-) create mode 100644 src/app/routes/data-v/menu/lj-menu.interface.ts create mode 100644 src/app/routes/data-v/menu/lj-menu.service.ts diff --git a/src/app/routes/data-v/menu/lj-menu.interface.ts b/src/app/routes/data-v/menu/lj-menu.interface.ts new file mode 100644 index 0000000..5314176 --- /dev/null +++ b/src/app/routes/data-v/menu/lj-menu.interface.ts @@ -0,0 +1,19 @@ +export interface Menu { + menuCode: string; + text: string; + link?: any; + grp: boolean; + leafFlag: boolean; + rootFlag: boolean; + hideInBreadcrumbFlag: boolean; + icon?: any; + i18n: any; + srtno: number; + valiFlag: boolean; + menuType: number; + parentId?: any; + clientId: string; + children?: Menu[]; + acl?: any; + id: string; +} diff --git a/src/app/routes/data-v/menu/lj-menu.service.ts b/src/app/routes/data-v/menu/lj-menu.service.ts new file mode 100644 index 0000000..4777ece --- /dev/null +++ b/src/app/routes/data-v/menu/lj-menu.service.ts @@ -0,0 +1,16 @@ +import { HttpClient } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; + +import { Menu } from './lj-menu.interface'; + +@Injectable({ + providedIn: 'root' +}) +export class MenuService { + constructor(private http: HttpClient) {} + + getMenus(): Observable { + return this.http.get('path/to/your/api'); + } +} diff --git a/src/app/routes/data-v/navigation/navigation.component.ts b/src/app/routes/data-v/navigation/navigation.component.ts index fabcf7a..15ea360 100644 --- a/src/app/routes/data-v/navigation/navigation.component.ts +++ b/src/app/routes/data-v/navigation/navigation.component.ts @@ -6,15 +6,17 @@ import { SFSchema } from '@delon/form'; import { ModalHelper, _HttpClient } from '@delon/theme'; import { SHARED_IMPORTS } from '@shared'; +import { Menu } from '../menu/lj-menu.interface'; +import { MenuService } from '../menu/lj-menu.service'; + @Component({ selector: 'data-v-navigation', standalone: true, imports: [RouterOutlet, CommonModule, ...SHARED_IMPORTS], template: ` `, @@ -24,45 +26,666 @@ export class DataVNavigationComponent implements OnInit { private readonly http = inject(_HttpClient); private readonly modal = inject(ModalHelper); private readonly router = inject(Router); - - menuList: any = [ - { - code: '01', - text: '我的工作站', - url: '/' - }, - { - code: '02', - text: '化验总览', - url: '/data-v/s1' - }, - { - code: '03', - text: '3D', - url: '/data-v/threejs' - }, - { - text: '...' - } - ]; + menuNetDataList: Menu[] = []; imageUrl: string = 'assets/dashboard/menu_btn_l.png'; title: string = 'Label'; context: string = '2024-02-29 10:00'; + constructor(private menuService: MenuService) {} - ngOnInit(): void { } + ngOnInit(): void { + // this.menuService.getMenus().subscribe((menus: Menu[]) => { + // this.menuNetDataList = menus; + // // this.menuList; + // }); + this.menuNetDataList = [ + { + menuCode: 'Home', + text: '我的工作站', + + i18n: null, + icon: null, + grp: true, + leafFlag: false, + rootFlag: true, + hideInBreadcrumbFlag: true, + link: '/', + srtno: 0, + valiFlag: false, + menuType: 0, + parentId: null, + clientId: 'Platform_Datav', + acl: null, + id: '3a1167f1-a86c-194d-eabf-258993a337ac' + }, + { + menuCode: 'CoalFlowOverview', + text: '煤流总览', + i18n: null, + icon: null, + grp: true, + leafFlag: false, + rootFlag: true, + hideInBreadcrumbFlag: true, + link: '/data-v/s1', + srtno: 0, + valiFlag: false, + menuType: 0, + parentId: null, + clientId: 'Platform_Datav', + children: [ + { + menuCode: 'EnteringFactoryQueue', + text: '入厂排队', + i18n: null, + icon: 'anticon-appstore', + grp: true, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: null, + srtno: 0, + valiFlag: false, + menuType: 0, + parentId: '3a1167d9-814f-5a16-96ad-37595e54eeb8', + clientId: 'Platform_Datav', + children: [], + acl: null, + id: '3a1167d9-8189-ef37-f6a2-72ca8a926a10' + }, + { + menuCode: 'EntranceFactorySampling', + text: '入厂采样', + i18n: null, + icon: 'anticon-appstore', + grp: true, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: null, + srtno: 0, + valiFlag: false, + menuType: 0, + parentId: '3a1167d9-814f-5a16-96ad-37595e54eeb8', + clientId: 'Platform_Datav', + children: [], + acl: null, + id: '3a1167d9-81bd-11b0-2df2-d66b72b6c999' + }, + { + menuCode: 'GrossWeightMeasurement', + text: '毛重计量', + i18n: null, + icon: 'anticon-appstore', + grp: true, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: null, + srtno: 0, + valiFlag: false, + menuType: 0, + parentId: '3a1167d9-814f-5a16-96ad-37595e54eeb8', + clientId: 'Platform_Datav', + children: [ + { + menuCode: 'GrossWeightMeasurement.Blockbuster1', + text: '重磅1', + i18n: null, + icon: null, + grp: false, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: '', + srtno: 1, + valiFlag: false, + menuType: 0, + parentId: '3a1167dd-4307-f0bb-5bcb-4274aa1735b7', + clientId: 'Platform_Datav', + children: [], + acl: { + ability: ['GrossWeightMeasurement.Blockbuster1'] + }, + id: '3a1167f1-a7ac-59aa-9215-3fee372a4995' + }, + { + menuCode: 'GrossWeightMeasurement.Blockbuster2', + text: '重磅2', + i18n: null, + icon: null, + grp: false, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: '', + srtno: 1, + valiFlag: false, + menuType: 0, + parentId: '3a1167dd-4307-f0bb-5bcb-4274aa1735b7', + clientId: 'Platform_Datav', + children: [], + acl: { + ability: ['GrossWeightMeasurement.Blockbuster2'] + }, + id: '3a1167f1-a7f9-219d-dbb9-d81196d92574' + }, + { + menuCode: 'GrossWeightMeasurement.Blockbuster3', + text: '重磅3', + i18n: null, + icon: null, + grp: false, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: '', + srtno: 3, + valiFlag: false, + menuType: 0, + parentId: '3a1167dd-4307-f0bb-5bcb-4274aa1735b7', + clientId: 'Platform_Datav', + children: [], + acl: { + ability: ['GrossWeightMeasurement.Blockbuster3'] + }, + id: '3a1167f1-a81f-97b4-1816-e081385f5f1e' + }, + { + menuCode: 'GrossWeightMeasurement.Blockbuster4', + text: '重磅4', + i18n: null, + icon: null, + grp: false, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: '', + srtno: 4, + valiFlag: false, + menuType: 0, + parentId: '3a1167dd-4307-f0bb-5bcb-4274aa1735b7', + clientId: 'Platform_Datav', + children: [], + acl: { + ability: ['GrossWeightMeasurement.Blockbuster4'] + }, + id: '3a1167f1-a844-2035-8a00-63df140caaa6' + } + ], + acl: null, + id: '3a1167dd-4307-f0bb-5bcb-4274aa1735b7' + }, + { + menuCode: 'TransshipmentMeasurement', + text: '转运计量', + i18n: null, + icon: 'anticon-appstore', + grp: true, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: null, + srtno: 0, + valiFlag: false, + menuType: 0, + parentId: '3a1167d9-814f-5a16-96ad-37595e54eeb8', + clientId: 'Platform_Datav', + children: [ + { + menuCode: 'TransshipmentMeasurement.TransferScale', + text: '转运磅', + i18n: null, + icon: null, + grp: false, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: '', + srtno: 4, + valiFlag: false, + menuType: 0, + parentId: '3a1167f1-a86c-194d-eabf-258993a337ac', + clientId: 'Platform_Datav', + children: [], + acl: { + ability: ['TransshipmentMeasurement.TransferScale'] + }, + id: '3a1167f1-a896-a133-12d5-e9b69a5e3328' + } + ], + acl: null, + id: '3a1167f1-a86c-194d-eabf-258993a337ac' + }, + { + menuCode: 'CoalUnloadingQueue', + text: '卸煤排队', + i18n: null, + icon: 'anticon-appstore', + grp: true, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: null, + srtno: 0, + valiFlag: false, + menuType: 0, + parentId: '3a1167d9-814f-5a16-96ad-37595e54eeb8', + clientId: 'Platform_Datav', + children: [ + { + menuCode: 'CoalUnloadingQueue.CoalYard', + text: '煤场1', + i18n: null, + icon: null, + grp: false, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: '', + srtno: 1, + valiFlag: false, + menuType: 0, + parentId: '3a1167f1-a8c5-a17d-18ec-2cc6dd520571', + clientId: 'Platform_Datav', + children: [], + acl: { + ability: ['CoalUnloadingQueue.CoalYard'] + }, + id: '3a1167f1-a8ee-7fbf-82d2-f5a4638050d5' + }, + { + menuCode: 'CoalUnloadingQueue.CoalYard2', + text: '煤场2', + i18n: null, + icon: null, + grp: false, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: '', + srtno: 1, + valiFlag: false, + menuType: 0, + parentId: '3a1167f1-a8c5-a17d-18ec-2cc6dd520571', + clientId: 'Platform_Datav', + children: [], + acl: { + ability: ['CoalUnloadingQueue.CoalYard2'] + }, + id: '3a1167f1-a912-7df1-d1f5-02803f77cf6e' + }, + { + menuCode: 'CoalUnloadingQueue.CoalYard3', + text: '煤场3', + i18n: null, + icon: null, + grp: false, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: '', + srtno: 1, + valiFlag: false, + menuType: 0, + parentId: '3a1167f1-a8c5-a17d-18ec-2cc6dd520571', + clientId: 'Platform_Datav', + children: [], + acl: { + ability: ['CoalUnloadingQueue.CoalYard3'] + }, + id: '3a1167f1-a937-dced-f79c-6e556cba39d4' + }, + { + menuCode: 'CoalUnloadingQueue.CoalYard4', + text: '煤场4', + i18n: null, + icon: null, + grp: false, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: '', + srtno: 4, + valiFlag: false, + menuType: 0, + parentId: '3a1167f1-a8c5-a17d-18ec-2cc6dd520571', + clientId: 'Platform_Datav', + children: [], + acl: { + ability: ['CoalUnloadingQueue.CoalYard4'] + }, + id: '3a1167f1-a95c-80ab-eb78-47e5d9485161' + } + ], + acl: null, + id: '3a1167f1-a8c5-a17d-18ec-2cc6dd520571' + } + ], + acl: null, + id: '3a1167d9-814f-5a16-96ad-37595e54eeb8' + }, + { + menuCode: 'CoalFlowOverview', + text: '煤样总览', + i18n: null, + icon: null, + grp: true, + leafFlag: false, + rootFlag: true, + hideInBreadcrumbFlag: true, + link: '/data-v/threejs', + srtno: 0, + valiFlag: false, + menuType: 0, + parentId: null, + clientId: 'Platform_Datav', + children: [ + { + menuCode: 'EnteringFactoryQueue', + text: '入厂排队', + i18n: null, + icon: 'anticon-appstore', + grp: true, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: null, + srtno: 0, + valiFlag: false, + menuType: 0, + parentId: '3a1167d9-814f-5a16-96ad-37595e54eeb8', + clientId: 'Platform_Datav', + children: [], + acl: null, + id: '3a1167d9-8189-ef37-f6a2-72ca8a926a10' + }, + { + menuCode: 'EntranceFactorySampling', + text: '入厂采样', + i18n: null, + icon: 'anticon-appstore', + grp: true, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: null, + srtno: 0, + valiFlag: false, + menuType: 0, + parentId: '3a1167d9-814f-5a16-96ad-37595e54eeb8', + clientId: 'Platform_Datav', + children: [], + acl: null, + id: '3a1167d9-81bd-11b0-2df2-d66b72b6c999' + }, + { + menuCode: 'GrossWeightMeasurement', + text: '毛重计量', + i18n: null, + icon: 'anticon-appstore', + grp: true, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: null, + srtno: 0, + valiFlag: false, + menuType: 0, + parentId: '3a1167d9-814f-5a16-96ad-37595e54eeb8', + clientId: 'Platform_Datav', + children: [ + { + menuCode: 'GrossWeightMeasurement.Blockbuster1', + text: '重磅1', + i18n: null, + icon: null, + grp: false, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: '', + srtno: 1, + valiFlag: false, + menuType: 0, + parentId: '3a1167dd-4307-f0bb-5bcb-4274aa1735b7', + clientId: 'Platform_Datav', + children: [], + acl: { + ability: ['GrossWeightMeasurement.Blockbuster1'] + }, + id: '3a1167f1-a7ac-59aa-9215-3fee372a4995' + }, + { + menuCode: 'GrossWeightMeasurement.Blockbuster2', + text: '重磅2', + i18n: null, + icon: null, + grp: false, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: '', + srtno: 1, + valiFlag: false, + menuType: 0, + parentId: '3a1167dd-4307-f0bb-5bcb-4274aa1735b7', + clientId: 'Platform_Datav', + children: [], + acl: { + ability: ['GrossWeightMeasurement.Blockbuster2'] + }, + id: '3a1167f1-a7f9-219d-dbb9-d81196d92574' + }, + { + menuCode: 'GrossWeightMeasurement.Blockbuster3', + text: '重磅3', + i18n: null, + icon: null, + grp: false, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: '', + srtno: 3, + valiFlag: false, + menuType: 0, + parentId: '3a1167dd-4307-f0bb-5bcb-4274aa1735b7', + clientId: 'Platform_Datav', + children: [], + acl: { + ability: ['GrossWeightMeasurement.Blockbuster3'] + }, + id: '3a1167f1-a81f-97b4-1816-e081385f5f1e' + }, + { + menuCode: 'GrossWeightMeasurement.Blockbuster4', + text: '重磅4', + i18n: null, + icon: null, + grp: false, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: '', + srtno: 4, + valiFlag: false, + menuType: 0, + parentId: '3a1167dd-4307-f0bb-5bcb-4274aa1735b7', + clientId: 'Platform_Datav', + children: [], + acl: { + ability: ['GrossWeightMeasurement.Blockbuster4'] + }, + id: '3a1167f1-a844-2035-8a00-63df140caaa6' + } + ], + acl: null, + id: '3a1167dd-4307-f0bb-5bcb-4274aa1735b7' + }, + { + menuCode: 'TransshipmentMeasurement', + text: '转运计量', + i18n: null, + icon: 'anticon-appstore', + grp: true, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: null, + srtno: 0, + valiFlag: false, + menuType: 0, + parentId: '3a1167d9-814f-5a16-96ad-37595e54eeb8', + clientId: 'Platform_Datav', + children: [ + { + menuCode: 'TransshipmentMeasurement.TransferScale', + text: '转运磅', + i18n: null, + icon: null, + grp: false, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: '', + srtno: 4, + valiFlag: false, + menuType: 0, + parentId: '3a1167f1-a86c-194d-eabf-258993a337ac', + clientId: 'Platform_Datav', + children: [], + acl: { + ability: ['TransshipmentMeasurement.TransferScale'] + }, + id: '3a1167f1-a896-a133-12d5-e9b69a5e3328' + } + ], + acl: null, + id: '3a1167f1-a86c-194d-eabf-258993a337ac' + }, + { + menuCode: 'CoalUnloadingQueue', + text: '卸煤排队', + i18n: null, + icon: 'anticon-appstore', + grp: true, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: null, + srtno: 0, + valiFlag: false, + menuType: 0, + parentId: '3a1167d9-814f-5a16-96ad-37595e54eeb8', + clientId: 'Platform_Datav', + children: [ + { + menuCode: 'CoalUnloadingQueue.CoalYard', + text: '煤场1', + i18n: null, + icon: null, + grp: false, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: '', + srtno: 1, + valiFlag: false, + menuType: 0, + parentId: '3a1167f1-a8c5-a17d-18ec-2cc6dd520571', + clientId: 'Platform_Datav', + children: [], + acl: { + ability: ['CoalUnloadingQueue.CoalYard'] + }, + id: '3a1167f1-a8ee-7fbf-82d2-f5a4638050d5' + }, + { + menuCode: 'CoalUnloadingQueue.CoalYard2', + text: '煤场2', + i18n: null, + icon: null, + grp: false, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: '', + srtno: 1, + valiFlag: false, + menuType: 0, + parentId: '3a1167f1-a8c5-a17d-18ec-2cc6dd520571', + clientId: 'Platform_Datav', + children: [], + acl: { + ability: ['CoalUnloadingQueue.CoalYard2'] + }, + id: '3a1167f1-a912-7df1-d1f5-02803f77cf6e' + }, + { + menuCode: 'CoalUnloadingQueue.CoalYard3', + text: '煤场3', + i18n: null, + icon: null, + grp: false, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: '', + srtno: 1, + valiFlag: false, + menuType: 0, + parentId: '3a1167f1-a8c5-a17d-18ec-2cc6dd520571', + clientId: 'Platform_Datav', + children: [], + acl: { + ability: ['CoalUnloadingQueue.CoalYard3'] + }, + id: '3a1167f1-a937-dced-f79c-6e556cba39d4' + }, + { + menuCode: 'CoalUnloadingQueue.CoalYard4', + text: '煤场4', + i18n: null, + icon: null, + grp: false, + leafFlag: false, + rootFlag: false, + hideInBreadcrumbFlag: false, + link: '', + srtno: 4, + valiFlag: false, + menuType: 0, + parentId: '3a1167f1-a8c5-a17d-18ec-2cc6dd520571', + clientId: 'Platform_Datav', + children: [], + acl: { + ability: ['CoalUnloadingQueue.CoalYard4'] + }, + id: '3a1167f1-a95c-80ab-eb78-47e5d9485161' + } + ], + acl: null, + id: '3a1167f1-a8c5-a17d-18ec-2cc6dd520571' + } + ], + acl: null, + id: '3a1167d9-814f-5a16-96ad-37595e54eeb8' + } + ]; + } - add(): void { } + add(): void {} - menuOver(menu: any, $event: any) { } + menuOver(menu: any, $event: any) {} - isActive(menu: any) { } + isActive(menu: any) {} // 新的 navigate 方法 navigate(menu: any) { - if (menu.url) { - this.router.navigateByUrl(menu.url); + if (menu.link) { + this.router.navigateByUrl(menu.link); } // if (menu.code == '01') {