|
|
@ -6,7 +6,7 @@ |
|
|
|
* @LastEditors: sueRimn |
|
|
|
* @LastEditors: sueRimn |
|
|
|
* @LastEditTime: 2021-02-25 11:44:34 |
|
|
|
* @LastEditTime: 2021-02-25 11:44:34 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
import { Component, OnInit, ViewChild, Inject, Input } from '@angular/core'; |
|
|
|
import { Component, OnInit, ViewChild, Inject, Input, ViewContainerRef } from '@angular/core'; |
|
|
|
import { HttpClient } from '@angular/common/http' |
|
|
|
import { HttpClient } from '@angular/common/http' |
|
|
|
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; |
|
|
|
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; |
|
|
|
import { MatPaginator } from '@angular/material/paginator'; |
|
|
|
import { MatPaginator } from '@angular/material/paginator'; |
|
|
@ -19,6 +19,7 @@ import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree' |
|
|
|
import { FlatTreeControl } from '@angular/cdk/tree'; |
|
|
|
import { FlatTreeControl } from '@angular/cdk/tree'; |
|
|
|
import { TreeService } from '../../http-interceptors/tree.service' |
|
|
|
import { TreeService } from '../../http-interceptors/tree.service' |
|
|
|
import { NzFormatEmitEvent, NzTreeComponent, NzTreeNodeOptions } from 'ng-zorro-antd/tree' |
|
|
|
import { NzFormatEmitEvent, NzTreeComponent, NzTreeNodeOptions } from 'ng-zorro-antd/tree' |
|
|
|
|
|
|
|
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; |
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
@Component({ |
|
|
|
selector: 'app-examiner-index', |
|
|
|
selector: 'app-examiner-index', |
|
|
@ -27,8 +28,8 @@ import { NzFormatEmitEvent, NzTreeComponent, NzTreeNodeOptions } from 'ng-zorro- |
|
|
|
}) |
|
|
|
}) |
|
|
|
export class ExaminerIndexComponent implements OnInit { |
|
|
|
export class ExaminerIndexComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
|
|
constructor(private router: Router, private activatedRoute: ActivatedRoute, public http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, private tree: TreeService) { } |
|
|
|
constructor(private router: Router, private activatedRoute: ActivatedRoute, public http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, private tree: TreeService, private modal: NzModalService, private viewContainerRef: ViewContainerRef) { } |
|
|
|
//displayedColumns: string[] = ['name', 'organization', 'startTime', 'overTime', 'testState', 'operation'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
ngOnInit(): void { |
|
|
|
|
|
|
|
|
|
|
@ -252,18 +253,42 @@ export class ExaminerIndexComponent implements OnInit { |
|
|
|
} |
|
|
|
} |
|
|
|
//新增考题跳转
|
|
|
|
//新增考题跳转
|
|
|
|
newExamination() { |
|
|
|
newExamination() { |
|
|
|
//this.router.navigate(['/home/createexam-index/examiner-new-one'])
|
|
|
|
|
|
|
|
const dialogRef = this.dialog.open(FinishDia, { |
|
|
|
|
|
|
|
width: '685px', |
|
|
|
// const dialogRef = this.dialog.open(FinishDia, {
|
|
|
|
data: { |
|
|
|
// width: '685px',
|
|
|
|
|
|
|
|
// data: {
|
|
|
|
|
|
|
|
// Profiles: this.Profiles,
|
|
|
|
|
|
|
|
// treedata: this.treedata,
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const modal: any = this.modal.create({ |
|
|
|
|
|
|
|
nzTitle: '新增考题', |
|
|
|
|
|
|
|
nzContent: FinishDia, |
|
|
|
|
|
|
|
nzViewContainerRef: this.viewContainerRef, |
|
|
|
|
|
|
|
nzWidth: 688, |
|
|
|
|
|
|
|
nzFooter: null, |
|
|
|
|
|
|
|
nzComponentParams: { |
|
|
|
Profiles: this.Profiles, |
|
|
|
Profiles: this.Profiles, |
|
|
|
treedata: this.treedata |
|
|
|
treedata: this.treedata, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
nzOnOk: async () => { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
const instance = modal.getContentComponent(); |
|
|
|
|
|
|
|
modal.afterOpen.subscribe(() => console.log('[afterOpen] emitted!')); |
|
|
|
|
|
|
|
// Return a result when closed
|
|
|
|
|
|
|
|
modal.afterClose.subscribe(result => console.log('[afterClose] The result is:', result)); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
js: any //辖区中队输入框
|
|
|
|
js: any //辖区中队输入框
|
|
|
|
|
|
|
|
zIndex() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -275,18 +300,20 @@ export class ExaminerIndexComponent implements OnInit { |
|
|
|
}) |
|
|
|
}) |
|
|
|
export class FinishDia { |
|
|
|
export class FinishDia { |
|
|
|
// @ViewChild('nzTreSelect', { static: false }) nzTreSelect!: NzTreeComponent;
|
|
|
|
// @ViewChild('nzTreSelect', { static: false }) nzTreSelect!: NzTreeComponent;
|
|
|
|
constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef<FinishDia>, @Inject(MAT_DIALOG_DATA) public data: any) { } |
|
|
|
constructor(private router: Router, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, private modal: NzModalRef) { } |
|
|
|
//获取登录账号的个人资料
|
|
|
|
//获取登录账号的个人资料
|
|
|
|
Profiles: any |
|
|
|
Profiles: any |
|
|
|
treedata |
|
|
|
treedata: any |
|
|
|
|
|
|
|
selectedOr |
|
|
|
nodes = [] |
|
|
|
nodes = [] |
|
|
|
|
|
|
|
expandedKeys = [] |
|
|
|
ngOnInit(): void { |
|
|
|
ngOnInit(): void { |
|
|
|
this.Profiles = this.data.Profiles |
|
|
|
this.Profiles = this.Profiles |
|
|
|
this.nodes = this.data.treedata |
|
|
|
this.nodes = [...this.treedata] |
|
|
|
|
|
|
|
this.expandedKeys = [this.treedata[0].key] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
selectedOr |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onChange($event: string[]): void { |
|
|
|
onChange($event: string[]): void { |
|
|
|
console.log($event); |
|
|
|
console.log($event); |
|
|
@ -341,8 +368,7 @@ export class FinishDia { |
|
|
|
console.log(this.selectedOr) |
|
|
|
console.log(this.selectedOr) |
|
|
|
this.http.post('/api/Papers', body).subscribe(data => { |
|
|
|
this.http.post('/api/Papers', body).subscribe(data => { |
|
|
|
this.snackBar.open('创建成功', '确定', config); |
|
|
|
this.snackBar.open('创建成功', '确定', config); |
|
|
|
this.dialogRef.close(); |
|
|
|
this.modal.triggerOk() |
|
|
|
//sessionStorage.removeItem("checkedWork")
|
|
|
|
|
|
|
|
this.tabledate = data |
|
|
|
this.tabledate = data |
|
|
|
console.log(this.tabledate) |
|
|
|
console.log(this.tabledate) |
|
|
|
sessionStorage.setItem("paperId", this.tabledate.id) |
|
|
|
sessionStorage.setItem("paperId", this.tabledate.id) |
|
|
@ -368,7 +394,7 @@ export class FinishDia { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
close() { |
|
|
|
close() { |
|
|
|
this.dialogRef.close(); |
|
|
|
// this.dialogRef.close();
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|