|
@@ -1,24 +1,21 @@
|
|
|
-import { Component, OnInit} from '@angular/core';
|
|
|
+import { Component, OnInit } from '@angular/core';
|
|
|
import { CompNavComponent } from '../comp-nav/comp-nav.component';
|
|
|
-import {DomSanitizer} from '@angular/platform-browser';
|
|
|
+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';
|
|
|
import { HttpClient } from '@angular/common/http';
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
@Component({
|
|
|
selector: 'app-comp-manage',
|
|
|
standalone: true,
|
|
|
- imports: [CompNavComponent, RouterOutlet, CommonCompModule,MatIconModule],
|
|
|
+ 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">
|
|
|
+ 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">
|
|
@@ -27,119 +24,119 @@ export class CompManageComponent implements OnInit {
|
|
|
</linearGradient>
|
|
|
</defs>
|
|
|
</svg>
|
|
|
- `
|
|
|
+ `;
|
|
|
optionsMap: any = {
|
|
|
- "国家级管理员":[
|
|
|
+ 国家级管理员: [
|
|
|
{
|
|
|
- name:'教材管理',
|
|
|
- id:'1',
|
|
|
- child:[
|
|
|
+ name: '教材管理',
|
|
|
+ id: '1',
|
|
|
+ child: [
|
|
|
{
|
|
|
- name:'全部教材列表',
|
|
|
- path:'/nav-admin/manage/textbook',
|
|
|
- id:'1-1',
|
|
|
+ name: '全部教材列表',
|
|
|
+ path: '/nav-admin/manage/textbook',
|
|
|
+ id: '1-1',
|
|
|
},
|
|
|
{
|
|
|
- name:'申报流程',
|
|
|
- path:"/nav-admin/manage/process",
|
|
|
- id:'1-2',
|
|
|
+ name: '申报流程',
|
|
|
+ path: '/nav-admin/manage/process',
|
|
|
+ id: '1-2',
|
|
|
},
|
|
|
- ]
|
|
|
+ ],
|
|
|
},
|
|
|
{
|
|
|
- name:'用户管理',
|
|
|
- id:'2',
|
|
|
- child:[
|
|
|
+ name: '用户管理',
|
|
|
+ id: '2',
|
|
|
+ child: [
|
|
|
{
|
|
|
- name:'用户列表',
|
|
|
- path:"/nav-admin/manage/user",
|
|
|
- id:'2-1',
|
|
|
+ name: '用户列表',
|
|
|
+ path: '/nav-admin/manage/user',
|
|
|
+ id: '2-1',
|
|
|
},
|
|
|
{
|
|
|
- name:'申报单位管理',
|
|
|
- path:"/nav-admin/manage/role",
|
|
|
- id:'2-3',
|
|
|
+ name: '申报单位管理',
|
|
|
+ path: '/nav-admin/manage/role',
|
|
|
+ id: '2-3',
|
|
|
},
|
|
|
- ]
|
|
|
+ ],
|
|
|
},
|
|
|
],
|
|
|
- "工作联系人":[
|
|
|
+ 工作联系人: [
|
|
|
{
|
|
|
- name:'教材申报',
|
|
|
- id:'1',
|
|
|
- child:[
|
|
|
+ name: '教材申报',
|
|
|
+ id: '1',
|
|
|
+ child: [
|
|
|
{
|
|
|
- name:'全部教材列表',
|
|
|
- path:'/nav-province-contact/manage/textbook',
|
|
|
- id:'1-1',
|
|
|
+ name: '全部教材列表',
|
|
|
+ path: '/nav-province-contact/manage/textbook',
|
|
|
+ id: '1-1',
|
|
|
},
|
|
|
{
|
|
|
- name:'申报流程',
|
|
|
- path:"/nav-province-contact/manage/process",
|
|
|
- id:'1-2',
|
|
|
+ name: '申报流程',
|
|
|
+ path: '/nav-province-contact/manage/process',
|
|
|
+ id: '1-2',
|
|
|
},
|
|
|
- ]
|
|
|
+ ],
|
|
|
},
|
|
|
{
|
|
|
- name:'用户管理',
|
|
|
- id:'2',
|
|
|
- child:[
|
|
|
+ name: '用户管理',
|
|
|
+ id: '2',
|
|
|
+ child: [
|
|
|
{
|
|
|
- name:'用户列表',
|
|
|
- path:"/nav-province-contact/manage/user",
|
|
|
- id:'2-1',
|
|
|
+ name: '用户列表',
|
|
|
+ path: '/nav-province-contact/manage/user',
|
|
|
+ id: '2-1',
|
|
|
},
|
|
|
{
|
|
|
- name:'申报单位管理',
|
|
|
- path:"/nav-province-contact/manage/role",
|
|
|
- id:'2-3',
|
|
|
+ name: '申报单位管理',
|
|
|
+ path: '/nav-province-contact/manage/role',
|
|
|
+ id: '2-3',
|
|
|
},
|
|
|
- ]
|
|
|
+ ],
|
|
|
},
|
|
|
],
|
|
|
- "高校联系人":[
|
|
|
+ 高校联系人: [
|
|
|
{
|
|
|
- id:'1',
|
|
|
- name:'教材申报',
|
|
|
- child:[
|
|
|
+ id: '1',
|
|
|
+ name: '教材申报',
|
|
|
+ child: [
|
|
|
{
|
|
|
- id:'1-1',
|
|
|
- name:'全部教材',
|
|
|
- path:'/nav-province-school-contact/manage/textbook',
|
|
|
- }
|
|
|
- ]
|
|
|
+ id: '1-1',
|
|
|
+ name: '全部教材',
|
|
|
+ path: '/nav-province-school-contact/manage/textbook',
|
|
|
+ },
|
|
|
+ ],
|
|
|
},
|
|
|
{
|
|
|
- id:'2',
|
|
|
- name:'用户管理',
|
|
|
- child:[
|
|
|
+ id: '2',
|
|
|
+ name: '用户管理',
|
|
|
+ child: [
|
|
|
{
|
|
|
- id:'2-1',
|
|
|
- name:'用户列表',
|
|
|
- path:'/nav-province-school-contact/manage/user',
|
|
|
+ id: '2-1',
|
|
|
+ name: '用户列表',
|
|
|
+ path: '/nav-province-school-contact/manage/user',
|
|
|
},
|
|
|
{
|
|
|
- name:'申报单位管理',
|
|
|
- path:"/nav-province-school-contact/manage/role",
|
|
|
- id:'2-2',
|
|
|
+ name: '申报单位管理',
|
|
|
+ path: '/nav-province-school-contact/manage/role',
|
|
|
+ id: '2-2',
|
|
|
},
|
|
|
- ]
|
|
|
+ ],
|
|
|
},
|
|
|
{
|
|
|
- name:'个人空间',
|
|
|
- id:'3',
|
|
|
+ name: '个人空间',
|
|
|
+ id: '3',
|
|
|
path: '/nav-province-school-contact/manage/space',
|
|
|
},
|
|
|
{
|
|
|
- name:'回收站',
|
|
|
- id:'4',
|
|
|
+ name: '回收站',
|
|
|
+ id: '4',
|
|
|
path: '/nav-province-school-contact/manage/recycle',
|
|
|
},
|
|
|
],
|
|
|
- "评审专家":[
|
|
|
+ 评审专家: [
|
|
|
{
|
|
|
- name:'评审活动',
|
|
|
- id:'1',
|
|
|
+ name: '评审活动',
|
|
|
+ id: '1',
|
|
|
path: '/nav-review/manage/apply',
|
|
|
},
|
|
|
// {
|
|
@@ -148,7 +145,7 @@ export class CompManageComponent implements OnInit {
|
|
|
// path: '/nav-review/profile',
|
|
|
// },
|
|
|
],
|
|
|
- "教师":[
|
|
|
+ 教师: [
|
|
|
{
|
|
|
name: '个人空间',
|
|
|
id: '1',
|
|
@@ -160,29 +157,31 @@ export class CompManageComponent implements OnInit {
|
|
|
path: '/nav-author/manage/recycle',
|
|
|
},
|
|
|
],
|
|
|
- }
|
|
|
+ };
|
|
|
active: string = localStorage.getItem('active') || '1';
|
|
|
- isCollapsed:boolean = false;
|
|
|
+ isCollapsed: boolean = false;
|
|
|
|
|
|
constructor(
|
|
|
public router: Router,
|
|
|
public tbookSer: textbookServer,
|
|
|
- public textbook:textbookServer,
|
|
|
- iconRegistry: MatIconRegistry,
|
|
|
+ public textbook: textbookServer,
|
|
|
+ iconRegistry: MatIconRegistry,
|
|
|
sanitizer: DomSanitizer,
|
|
|
- private http: HttpClient,
|
|
|
-
|
|
|
+ private http: HttpClient
|
|
|
) {
|
|
|
- iconRegistry.addSvgIconLiteral('menu', sanitizer.bypassSecurityTrustHtml(this.MENU_ICON));
|
|
|
- }
|
|
|
+ iconRegistry.addSvgIconLiteral(
|
|
|
+ 'menu',
|
|
|
+ sanitizer.bypassSecurityTrustHtml(this.MENU_ICON)
|
|
|
+ );
|
|
|
+ }
|
|
|
|
|
|
ngOnInit() {
|
|
|
- console.log(this.tbookSer.profile.identity)
|
|
|
- if(localStorage.getItem('active')) return
|
|
|
- if(this.optionsMap[this.tbookSer.profile.identity][0]?.child){
|
|
|
- this.active = '1-1'
|
|
|
- }else{
|
|
|
- this.active = '1'
|
|
|
+ console.log(this.tbookSer.profile.identity);
|
|
|
+ if (localStorage.getItem('active')) return;
|
|
|
+ if (this.optionsMap[this.tbookSer.profile.identity][0]?.child) {
|
|
|
+ this.active = '1-1';
|
|
|
+ } else {
|
|
|
+ this.active = '1';
|
|
|
}
|
|
|
}
|
|
|
toggleCollapsed(): void {
|
|
@@ -211,10 +210,26 @@ export class CompManageComponent implements OnInit {
|
|
|
a.click();
|
|
|
document.body.removeChild(a);
|
|
|
window.URL.revokeObjectURL(url);
|
|
|
- })
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
- openFile(url:string){
|
|
|
- window.open(url)
|
|
|
+ openFile() {
|
|
|
+ let filePath;
|
|
|
+ switch (this.tbookSer.profile.identity) {
|
|
|
+ case '教师':
|
|
|
+ filePath = '/file/使用指南-教师.pdf';
|
|
|
+ break;
|
|
|
+ case '工作联系人':
|
|
|
+ filePath = '/file/使用指南-工作联系人.pdf';
|
|
|
+ break;
|
|
|
+ case '高校联系人':
|
|
|
+ filePath = '/file/使用指南-高校联系人.pdf';
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ filePath = '/file/公共使用指南.pdf';
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ console.log(filePath);
|
|
|
+ window.open(filePath);
|
|
|
}
|
|
|
}
|