|
|
|
@ -6,7 +6,7 @@
|
|
|
|
|
* @LastEditors: sueRimn |
|
|
|
|
* @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 { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog'; |
|
|
|
|
import { MatPaginator } from '@angular/material/paginator'; |
|
|
|
@ -19,6 +19,7 @@ import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree'
|
|
|
|
|
import { FlatTreeControl } from '@angular/cdk/tree'; |
|
|
|
|
import { TreeService } from '../../http-interceptors/tree.service' |
|
|
|
|
import { NzFormatEmitEvent, NzTreeComponent, NzTreeNodeOptions } from 'ng-zorro-antd/tree' |
|
|
|
|
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal'; |
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'app-examiner-index', |
|
|
|
@ -27,8 +28,8 @@ import { NzFormatEmitEvent, NzTreeComponent, NzTreeNodeOptions } from 'ng-zorro-
|
|
|
|
|
}) |
|
|
|
|
export class ExaminerIndexComponent implements OnInit { |
|
|
|
|
|
|
|
|
|
constructor(private router: Router, private activatedRoute: ActivatedRoute, public http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, private tree: TreeService) { } |
|
|
|
|
//displayedColumns: string[] = ['name', 'organization', 'startTime', 'overTime', 'testState', 'operation'];
|
|
|
|
|
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) { } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
|
|
|
|
|
@ -252,18 +253,42 @@ export class ExaminerIndexComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
//新增考题跳转
|
|
|
|
|
newExamination() { |
|
|
|
|
//this.router.navigate(['/home/createexam-index/examiner-new-one'])
|
|
|
|
|
const dialogRef = this.dialog.open(FinishDia, { |
|
|
|
|
width: '685px', |
|
|
|
|
data: { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// const dialogRef = this.dialog.open(FinishDia, {
|
|
|
|
|
// 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, |
|
|
|
|
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 //辖区中队输入框
|
|
|
|
|
zIndex() { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -275,18 +300,20 @@ export class ExaminerIndexComponent implements OnInit {
|
|
|
|
|
}) |
|
|
|
|
export class FinishDia { |
|
|
|
|
// @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 |
|
|
|
|
treedata |
|
|
|
|
treedata: any |
|
|
|
|
selectedOr |
|
|
|
|
nodes = [] |
|
|
|
|
|
|
|
|
|
expandedKeys = [] |
|
|
|
|
ngOnInit(): void { |
|
|
|
|
this.Profiles = this.data.Profiles |
|
|
|
|
this.nodes = this.data.treedata |
|
|
|
|
this.Profiles = this.Profiles |
|
|
|
|
this.nodes = [...this.treedata] |
|
|
|
|
this.expandedKeys = [this.treedata[0].key] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
selectedOr |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onChange($event: string[]): void { |
|
|
|
|
console.log($event); |
|
|
|
@ -341,8 +368,7 @@ export class FinishDia {
|
|
|
|
|
console.log(this.selectedOr) |
|
|
|
|
this.http.post('/api/Papers', body).subscribe(data => { |
|
|
|
|
this.snackBar.open('创建成功', '确定', config); |
|
|
|
|
this.dialogRef.close(); |
|
|
|
|
//sessionStorage.removeItem("checkedWork")
|
|
|
|
|
this.modal.triggerOk() |
|
|
|
|
this.tabledate = data |
|
|
|
|
console.log(this.tabledate) |
|
|
|
|
sessionStorage.setItem("paperId", this.tabledate.id) |
|
|
|
@ -368,7 +394,7 @@ export class FinishDia {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
close() { |
|
|
|
|
this.dialogRef.close(); |
|
|
|
|
// this.dialogRef.close();
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|