Browse Source

[完善] 考试选择处置节点完善

master
陈鹏飞 4 years ago
parent
commit
aebabf7706
  1. 7
      src/app/ui/collection-tools/collection-tools.component.html
  2. 2
      src/app/ui/collection-tools/collection-tools.component.scss
  3. 16
      src/app/ui/collection-tools/collection-tools.component.ts
  4. 31
      src/app/ui/collection-tools/examinationQuestions.ts
  5. 14
      src/app/ui/collection-tools/uploadDisposalNodes.html
  6. 5
      src/app/ui/ui.module.ts

7
src/app/ui/collection-tools/collection-tools.component.html

@ -43,10 +43,9 @@
<mat-icon *ngIf="toggleHandlePlans">keyboard_arrow_up</mat-icon>
<mat-icon *ngIf="!toggleHandlePlans">keyboard_arrow_down</mat-icon>
<label class="overflowText" style="font-weight: 550;">处置预案</label>
<!-- <label style="margin-left: 45px;" *ngIf="isEditPattern">
<mat-icon style="color: #c2a40ce8;" title="计算差异" (click)='countValue($event)'>flash_on</mat-icon>
<mat-icon style="margin-left: 3px;" title="新建空节点" (click)='addPanelPoint($event,null,treeData)'>add</mat-icon>
</label> -->
<label style="margin-left: 45px;">
<mat-icon title="选择考试节点" (click)='countValue($event)'>dashboard</mat-icon>
</label>
</div>
<div [hidden]="!toggleHandlePlans">

2
src/app/ui/collection-tools/collection-tools.component.scss

@ -121,7 +121,7 @@
width: 400px;
top: 40px;
left: 240px;
z-index: 1111;
z-index: 119;
display: flex;
}
.functionalDomainLeft {

16
src/app/ui/collection-tools/collection-tools.component.ts

@ -16,7 +16,7 @@ import { delay } from 'rxjs/operators';
import { windows } from 'src/app/interface';
import { GameMode } from 'src/app/working-area/model/gameMode';
import { ActivatedRoute, Router } from '@angular/router';
import { examinationQuestions,uploadQuestions } from './examinationQuestions'
import { examinationQuestions,uploadDisposalNodes,uploadQuestions } from './examinationQuestions'
@ -2032,17 +2032,13 @@ export class CollectionToolsComponent implements OnInit {
});
}
//计算差异
//选择 考试节点
countValue (e) {
e.stopPropagation()
let params = {disasterId: this.allFirePlan[0].id || ''}
this.http.get('/api/DisasterData/Diffs',{params:params}).subscribe(data=>{
this.canvasData.allNodeMarkers = data
this.mateFireForce()
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('计算差异完成','确定',config);
let data = {treeData: JSON.parse( JSON.stringify(this.treeData) ), oldTreeData: JSON.parse( JSON.stringify(this.canvasData.allDisposalNode) )}
let dialogRef = this.dialog.open(uploadDisposalNodes,{data});
dialogRef.afterClosed().subscribe(data=>{
})
}

31
src/app/ui/collection-tools/examinationQuestions.ts

@ -1,10 +1,11 @@
import { Component, OnInit, Inject } from '@angular/core';
import { Component, OnInit, Inject, ViewChild } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import {CanvasShareDataService,DisposalNodeData} from '../../canvas-share-data.service' //引入服务
import { FlatTreeControl } from '@angular/cdk/tree';
import { MatTreeFlatDataSource, MatTreeFlattener } from '@angular/material/tree';
import { NzFormatBeforeDropEvent, NzFormatEmitEvent,NzTreeComponent } from 'ng-zorro-antd/tree';
@Component({
selector: 'dialog-examination-questions',
@ -84,4 +85,32 @@ export class uploadQuestions {
console.log(this.data.question)
}
}
@Component({
selector: 'dialog-disposal-nodes',
templateUrl: './uploadDisposalNodes.html',
styleUrls: ['./collection-tools.component.scss',]
})
export class uploadDisposalNodes {
constructor(private http:HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef<any>,
@Inject(MAT_DIALOG_DATA) public data) {}
@ViewChild('nzTreeComponent', { static: false }) nzTreeComponent!: NzTreeComponent;
ngOnInit(): void {
this.treeData = [...this.data.treeData]
}
treeData:any = []; //tree
//提交 保存考试节点
submit () {
let checkList = []
this.data.oldTreeData.forEach(element => {
let isChecked = (this.nzTreeComponent.getTreeNodeByKey(element.id)).isChecked
isChecked? checkList.push(element) : null
});
console.log(checkList)
}
}

14
src/app/ui/collection-tools/uploadDisposalNodes.html

@ -0,0 +1,14 @@
<div>
<div style="max-height: 500px;overflow-x: hidden;overflow-y: auto;margin-bottom: 25px;width: 330px;padding-right: 10px;">
<nz-tree #nzTreeComponent [nzData]="treeData" nzCheckable nzMultiple [nzTreeTemplate]="nzTreeTemplate"></nz-tree>
<ng-template #nzTreeTemplate let-node let-origin="origin">
<div id="terrNodePublic">
<label title="{{node.title}}" class="overflowText textNode">{{node.title}}</label>
</div>
</ng-template>
</div>
<div style="text-align: center;">
<button mat-stroked-button style="margin-right: 15px;border: none;background: #07CDCF;color: #fff;" (click)='submit()'>确定</button>
<button mat-stroked-button style="margin-left: 15px;border: none;background: #dfe0e0;" mat-dialog-close>取消</button>
</div>
</div>

5
src/app/ui/ui.module.ts

@ -57,14 +57,13 @@ import {leftFunctionalDomainComponent,editPlaneFigureComponent,addDisposalNodeCo
import {saveOneDialog,saveTwoDialog} from './collection-tools/save'
import {WorkingAreaComponent} from '../working-area/working-area.component'
import { NzTreeModule } from 'ng-zorro-antd/tree';
import { examinationQuestions,uploadQuestions } from './collection-tools/examinationQuestions'
import { examinationQuestions,uploadQuestions,uploadDisposalNodes } from './collection-tools/examinationQuestions'
import {AddEnterpriserUser} from './enterpriseuser/addenterpriseuser.component'
import {EnterpriseuserComponent,editenterpriseuser,seeenterpriseuser} from './enterpriseuser/enterpriseuser.component'
import {AddTeacher} from './teacherManagement/addenterpriseuser.component'
import {TeacherManagementComponent,editTeacher,seeTeacher} from './teacherManagement/enterpriseuser.component'
@NgModule({
declarations: [ChangepasswordComponent,ConfirmpswDirective, ChangeuserdataComponent,testState,CollectionToolsComponent,CreateBuilding,EditBuilding,ViewDetailss,leftFunctionalDomainComponent,editPlaneFigureComponent,addDisposalNodeComponent,editDisposalNodeComponent,saveOneDialog,saveTwoDialog,WorkingAreaComponent,examinationQuestions,uploadQuestions,AddEnterpriserUser,EnterpriseuserComponent,editenterpriseuser,seeenterpriseuser,AddTeacher,TeacherManagementComponent,editTeacher,seeTeacher],
declarations: [ChangepasswordComponent,ConfirmpswDirective, ChangeuserdataComponent,testState,CollectionToolsComponent,CreateBuilding,EditBuilding,ViewDetailss,leftFunctionalDomainComponent,editPlaneFigureComponent,addDisposalNodeComponent,editDisposalNodeComponent,saveOneDialog,saveTwoDialog,WorkingAreaComponent,examinationQuestions,uploadQuestions,AddEnterpriserUser,EnterpriseuserComponent,editenterpriseuser,seeenterpriseuser,AddTeacher,TeacherManagementComponent,editTeacher,seeTeacher,uploadDisposalNodes],
imports: [
NzDatePickerModule,
CommonModule,

Loading…
Cancel
Save