123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- import { Component, OnInit} from '@angular/core';
- import { CompNavComponent } from '../comp-nav/comp-nav.component';
- import {DomSanitizer} from '@angular/platform-browser';
- import { RouterOutlet, Router } from '@angular/router';
- import { CommonCompModule } from '../../services/common.modules';
- import { MatIconRegistry, MatIconModule } from '@angular/material/icon';
- import { textbookServer } from '../../services/textbook';
- @Component({
- selector: 'app-comp-manage',
- standalone: true,
- imports: [CompNavComponent, RouterOutlet, CommonCompModule,MatIconModule],
- templateUrl: './comp-manage.component.html',
- styleUrls: ['./comp-manage.component.scss'],
- })
- export class CompManageComponent implements OnInit {
- MENU_ICON:string = `<svg width="18" height="20" viewBox="0 0 18 20" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path d="M18 2H4C3.46957 2 2.96086 2.21071 2.58579 2.58579C2.21071 2.96086 2 3.46957 2 4C2 4.53043 2.21071 5.03914 2.58579 5.41421C2.96086 5.78929 3.46957 6 4 6H18V19C18 19.2652 17.8946 19.5196 17.7071 19.7071C17.5196 19.8946 17.2652 20 17 20H4C2.93913 20 1.92172 19.5786 1.17157 18.8284C0.421427 18.0783 0 17.0609 0 16V4C0 2.93913 0.421427 1.92172 1.17157 1.17157C1.92172 0.421427 2.93913 0 4 0H17C17.2652 0 17.5196 0.105357 17.7071 0.292893C17.8946 0.48043 18 0.734783 18 1V2Z" fill="url(#paint0_linear_5_11023)"/>
- <defs>
- <linearGradient id="paint0_linear_5_11023" x1="9" y1="-2.21282e-07" x2="25.5" y2="40" gradientUnits="userSpaceOnUse">
- <stop stop-color="#E04860"/>
- <stop offset="1" stop-color="#E99306"/>
- </linearGradient>
- </defs>
- </svg>
- `
- optionsMap: any = {
- "国家级管理员":[
- {
- name:'教材管理',
- id:'1',
- child:[
- {
- name:'申报流程',
- path:"/nav-admin/manage/process",
- id:'1-1',
- },
- {
- name:'全部教材',
- path:'/nav-admin/manage/textbook',
- id:'1-2',
- },
- ]
- },
- {
- name:'用户管理',
- id:'2',
- child:[
- {
- name:'用户列表',
- path:"/nav-admin/manage/user",
- id:'2-1',
- },
- {
- name:'组织管理',
- path:"/nav-admin/manage/role",
- id:'2-3',
- },
- ]
- },
- // {
- // name:'品牌化',
- // id:'3',
- // child:[
- // {
- // name:'登录框',
- // id:'3-1',
- // },
- // {
- // name:'消息设置',
- // id:'3-2',
- // },
- // ]
- // },
- // {
- // name:'字段管理',
- // id:'4',
- // },
- ],
- "报送联系人":[
- {
- name:'教材管理',
- id:'1',
- child:[
- {
- name:'申报流程',
- path:'/nav-province-contact/manage/process',
- id:'1-1',
- },
- {
- name:'全部教材',
- path:"/nav-province-contact/manage/textbook",
- id:'1-2',
- },
- ]
- },
- ],
- "高校联系人":[
- {
- name:'教材管理',
- id:'1',
- child:[
- {
- name:'报送合集',
- path:'/nav-province-school-contact/manage/collection',
- id:'1-1',
- },
- ]
- },
- {
- name:'用户管理',
- id:'2',
- child:[
- {
- name:'用户列表',
- id:'2-1',
- },
- {
- name:'用户组管理',
- id:'2-2',
- },
- {
- name:'邀请注册',
- id:'2-3',
- },
- ]
- }
- ],
- "评审专家":[
- {
- name:'报送流程',
- id:'1',
- path: '/nav-review/home/apply',
- },
- {
- name:'个人信息',
- id:'2',
- path: '/nav-review/profile',
- },
- ],
- "个人":[
- {
- name: '个人空间',
- id: '1',
- path: '/nav-author/manage/space',
- },
- {
- name: '回收站',
- id: '2',
- path: '/nav-author/manage/recycle',
- // params: {
- // isDeleted: true,
- // },
- },
- ],
- }
- active: string = localStorage.getItem('active') || '1';
- isCollapsed:boolean = false;
- constructor(
- public router: Router,
- public textbook:textbookServer,
- iconRegistry: MatIconRegistry,
- sanitizer: DomSanitizer
- ) {
- iconRegistry.addSvgIconLiteral('menu', sanitizer.bypassSecurityTrustHtml(this.MENU_ICON));
- }
- ngOnInit() {
- }
- toggleCollapsed(): void {
- this.isCollapsed = !this.isCollapsed;
- }
- toUrl(child: any) {
- let cateid = child.id;
- this.active = cateid;
- localStorage.setItem('active', cateid);
- console.log(child);
- if (child.params) {
- this.router.navigate([child.path, child?.params]);
- } else {
- this.router.navigate([child.path]);
- }
- }
- }
|