comp-manage.component.ts 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. import { Component, OnInit} from '@angular/core';
  2. import { CompNavComponent } from '../comp-nav/comp-nav.component';
  3. import {DomSanitizer} from '@angular/platform-browser';
  4. import { RouterOutlet, Router } from '@angular/router';
  5. import { CommonCompModule } from '../../services/common.modules';
  6. import { MatIconRegistry, MatIconModule } from '@angular/material/icon';
  7. import { textbookServer } from '../../services/textbook';
  8. @Component({
  9. selector: 'app-comp-manage',
  10. standalone: true,
  11. imports: [CompNavComponent, RouterOutlet, CommonCompModule,MatIconModule],
  12. templateUrl: './comp-manage.component.html',
  13. styleUrls: ['./comp-manage.component.scss'],
  14. })
  15. export class CompManageComponent implements OnInit {
  16. MENU_ICON:string = `<svg width="18" height="20" viewBox="0 0 18 20" fill="none" xmlns="http://www.w3.org/2000/svg">
  17. <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)"/>
  18. <defs>
  19. <linearGradient id="paint0_linear_5_11023" x1="9" y1="-2.21282e-07" x2="25.5" y2="40" gradientUnits="userSpaceOnUse">
  20. <stop stop-color="#E04860"/>
  21. <stop offset="1" stop-color="#E99306"/>
  22. </linearGradient>
  23. </defs>
  24. </svg>
  25. `
  26. optionsMap: any = {
  27. "国家级管理员":[
  28. {
  29. name:'教材管理',
  30. id:'1',
  31. child:[
  32. {
  33. name:'申报流程',
  34. path:"/nav-admin/manage/process",
  35. id:'1-1',
  36. },
  37. {
  38. name:'全部教材',
  39. path:'/nav-admin/manage/textbook',
  40. id:'1-2',
  41. },
  42. ]
  43. },
  44. {
  45. name:'用户管理',
  46. id:'2',
  47. child:[
  48. {
  49. name:'用户列表',
  50. path:"/nav-admin/manage/user",
  51. id:'2-1',
  52. },
  53. {
  54. name:'组织管理',
  55. path:"/nav-admin/manage/role",
  56. id:'2-3',
  57. },
  58. ]
  59. },
  60. // {
  61. // name:'品牌化',
  62. // id:'3',
  63. // child:[
  64. // {
  65. // name:'登录框',
  66. // id:'3-1',
  67. // },
  68. // {
  69. // name:'消息设置',
  70. // id:'3-2',
  71. // },
  72. // ]
  73. // },
  74. // {
  75. // name:'字段管理',
  76. // id:'4',
  77. // },
  78. ],
  79. "报送联系人":[
  80. {
  81. name:'教材管理',
  82. id:'1',
  83. child:[
  84. {
  85. name:'申报流程',
  86. path:'/nav-province-contact/manage/process',
  87. id:'1-1',
  88. },
  89. {
  90. name:'全部教材',
  91. path:"/nav-province-contact/manage/textbook",
  92. id:'1-2',
  93. },
  94. ]
  95. },
  96. ],
  97. "高校联系人":[
  98. {
  99. name:'教材管理',
  100. id:'1',
  101. child:[
  102. {
  103. name:'报送合集',
  104. path:'/nav-province-school-contact/manage/collection',
  105. id:'1-1',
  106. },
  107. ]
  108. },
  109. {
  110. name:'用户管理',
  111. id:'2',
  112. child:[
  113. {
  114. name:'用户列表',
  115. id:'2-1',
  116. },
  117. {
  118. name:'用户组管理',
  119. id:'2-2',
  120. },
  121. {
  122. name:'邀请注册',
  123. id:'2-3',
  124. },
  125. ]
  126. }
  127. ],
  128. "评审专家":[
  129. {
  130. name:'报送流程',
  131. id:'1',
  132. path: '/nav-review/home/apply',
  133. },
  134. {
  135. name:'个人信息',
  136. id:'2',
  137. path: '/nav-review/profile',
  138. },
  139. ],
  140. "个人":[
  141. {
  142. name: '个人空间',
  143. id: '1',
  144. path: '/nav-author/manage/space',
  145. },
  146. {
  147. name: '回收站',
  148. id: '2',
  149. path: '/nav-author/manage/recycle',
  150. // params: {
  151. // isDeleted: true,
  152. // },
  153. },
  154. ],
  155. }
  156. active: string = localStorage.getItem('active') || '1';
  157. isCollapsed:boolean = false;
  158. constructor(
  159. public router: Router,
  160. public textbook:textbookServer,
  161. iconRegistry: MatIconRegistry,
  162. sanitizer: DomSanitizer
  163. ) {
  164. iconRegistry.addSvgIconLiteral('menu', sanitizer.bypassSecurityTrustHtml(this.MENU_ICON));
  165. }
  166. ngOnInit() {
  167. }
  168. toggleCollapsed(): void {
  169. this.isCollapsed = !this.isCollapsed;
  170. }
  171. toUrl(child: any) {
  172. let cateid = child.id;
  173. this.active = cateid;
  174. localStorage.setItem('active', cateid);
  175. console.log(child);
  176. if (child.params) {
  177. this.router.navigate([child.path, child?.params]);
  178. } else {
  179. this.router.navigate([child.path]);
  180. }
  181. }
  182. }