13562321995 3 years ago
parent
commit
e0c875bc5d
  1. 35
      src/app/app.component.spec.ts
  2. 2
      src/app/app.module.ts
  3. 2
      src/app/examiner/examiner-index/examiner-index.component.html
  4. 60
      src/app/examiner/examiner-index/examiner-index.component.ts
  5. 10
      src/app/examiner/examiner-index/finishDia.html
  6. 1
      src/app/examiner/examiner-index/finishDia.scss
  7. 6
      src/app/examiner/examiner.module.ts
  8. 4
      src/styles.scss

35
src/app/app.component.spec.ts

@ -1,35 +0,0 @@
import { TestBed, async } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule
],
declarations: [
AppComponent
],
}).compileComponents();
}));
it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
});
it(`should have as title 'anxin119'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('anxin119');
});
it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('.content span').textContent).toContain('anxin119 app is running!');
});
});

2
src/app/app.module.ts

@ -29,6 +29,7 @@ import { registerLocaleData } from '@angular/common';
import zh from '@angular/common/locales/zh';
import { ExaminerModule } from './examiner/examiner.module';
import { StudentModule} from './student/student.module'
import { NzModalModule } from 'ng-zorro-antd/modal';
registerLocaleData(zh);
@NgModule({
@ -48,6 +49,7 @@ registerLocaleData(zh);
HttpClientModule,
ExaminerModule,
StudentModule,
NzModalModule
],
providers: [httpInterceptorProviders, CacheTokenService,TreeService,ComponentServiceService],
bootstrap: [AppComponent]

2
src/app/examiner/examiner-index/examiner-index.component.html

@ -12,7 +12,7 @@
<div class="queryField ordiv">
<label style="margin-right: 10px;font-size: 15px;">消防救援站:</label>
<nz-tree-select [nzDropdownClassName]="'maxHeightTreeSelect'" style="width: 250px" [(ngModel)]="js"
[nzNodes]="nodes" nzPlaceHolder="请选择" [nzExpandedIcon]="multiExpandedIconTpl" [nzExpandedKeys]="expandedKeys">
[nzNodes]="nodes" nzPlaceHolder="请选择" [nzExpandedIcon]="multiExpandedIconTpl" [nzExpandedKeys]="expandedKeys" (click)="zIndex()">
</nz-tree-select>
<ng-template #multiExpandedIconTpl let-node let-origin="origin">
<ng-container *ngIf="node.children.length == 0; else elseTemplate">

60
src/app/examiner/examiner-index/examiner-index.component.ts

@ -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();
}
}

10
src/app/examiner/examiner-index/finishDia.html

@ -13,9 +13,9 @@
</div>
<div class="diaone">
<div style="margin-bottom: 5px;"><label>请选择考核队站:</label></div>
<nz-tree-select [nzDropdownClassName]="'maxHeightTreeSelect'" style="width: 287px" [(ngModel)]="selectedOr"
<nz-tree-select [nzDropdownClassName]="'maxHeightTreeSelect'" style="width: 286px" [(ngModel)]="selectedOr"
[nzNodes]="nodes" (ngModelChange)="onChange($event)" [nzMultiple]="true" nzPlaceHolder="请选择"
[nzExpandedIcon]="multiExpandedIconTpl">
[nzExpandedIcon]="multiExpandedIconTpl" [nzExpandedKeys]="expandedKeys">
</nz-tree-select>
<ng-template #multiExpandedIconTpl let-node let-origin="origin">
<ng-container *ngIf="node.children.length == 0; else elseTemplate">
@ -44,10 +44,10 @@
</div>
<div mat-dialog-actions>
<div mat-dialog-actions style="display: flex;justify-content: center;margin-top: 12px;">
<button mat-button (click)="onNoClick()"
style="background-color: #07CDCF;margin-left: 200px;color: #fff;">确定</button>
style="background-color: #07CDCF;color: #fff;margin-right: 3px;">确定</button>
<button mat-button type="button" (click)="close()"
style=" background-color: #FF8678;margin-left: 25px;color: #fff;">取消</button>
style=" background-color: #FF8678;color: #fff;margin-left: 3px;">取消</button>
</div>
</div>

1
src/app/examiner/examiner-index/finishDia.scss

@ -1,7 +1,6 @@
.box {
display: flex;
flex-direction: column;
margin-left: 10px;
box-sizing: border-box;
padding: 16px;
input {

6
src/app/examiner/examiner.module.ts

@ -112,9 +112,11 @@ import { NzTreeSelectModule } from 'ng-zorro-antd/tree-select';
NavigationModule,
NzTreeModule,
NzDatePickerModule,
NzTreeSelectModule
NzTreeSelectModule,
],
providers: [{ provide: MatPaginatorIntl, useValue: myPaginator() }],
exports: [PlanLevel]
exports: [PlanLevel],
entryComponents:[FinishDia]
})
export class ExaminerModule { }

4
src/styles.scss

@ -3,7 +3,7 @@
@import "./assets/css/ngZorroTree.css";
/* 引入组件样式 */
@import "~ng-zorro-antd/tree-select/style/index.min.css";
@import "~ng-zorro-antd/modal/style/index.min.css";
/* 引入组件样式 */
@import "./assets/css/time.scss";
@ -193,9 +193,11 @@ table td.mat-footer-cell:last-of-type {
.maxHeightTreeSelect {
max-height: 280px;
z-index: 1001;
}
.ant-select-selector {
z-index: 1001;
max-height: 191px;
overflow-y: auto;
}

Loading…
Cancel
Save