From aebabf7706cc323cff52f0ad3677cb6addf218cf Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Fri, 18 Dec 2020 10:21:25 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=20=E8=80=83=E8=AF=95?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=A4=84=E7=BD=AE=E8=8A=82=E7=82=B9=E5=AE=8C?= =?UTF-8?q?=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../collection-tools.component.html | 7 ++--- .../collection-tools.component.scss | 2 +- .../collection-tools.component.ts | 16 ++++------ .../collection-tools/examinationQuestions.ts | 31 ++++++++++++++++++- .../collection-tools/uploadDisposalNodes.html | 14 +++++++++ src/app/ui/ui.module.ts | 5 ++- 6 files changed, 56 insertions(+), 19 deletions(-) create mode 100644 src/app/ui/collection-tools/uploadDisposalNodes.html diff --git a/src/app/ui/collection-tools/collection-tools.component.html b/src/app/ui/collection-tools/collection-tools.component.html index f5daa5e..55bc9e1 100644 --- a/src/app/ui/collection-tools/collection-tools.component.html +++ b/src/app/ui/collection-tools/collection-tools.component.html @@ -43,10 +43,9 @@ keyboard_arrow_up keyboard_arrow_down - +
diff --git a/src/app/ui/collection-tools/collection-tools.component.scss b/src/app/ui/collection-tools/collection-tools.component.scss index be59497..8c43cd2 100644 --- a/src/app/ui/collection-tools/collection-tools.component.scss +++ b/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 { diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts index cd4e9d3..2937762 100644 --- a/src/app/ui/collection-tools/collection-tools.component.ts +++ b/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=>{ + }) } diff --git a/src/app/ui/collection-tools/examinationQuestions.ts b/src/app/ui/collection-tools/examinationQuestions.ts index 03a2a91..00bf2ee 100644 --- a/src/app/ui/collection-tools/examinationQuestions.ts +++ b/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, + @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) + } + } \ No newline at end of file diff --git a/src/app/ui/collection-tools/uploadDisposalNodes.html b/src/app/ui/collection-tools/uploadDisposalNodes.html new file mode 100644 index 0000000..33bd90c --- /dev/null +++ b/src/app/ui/collection-tools/uploadDisposalNodes.html @@ -0,0 +1,14 @@ +
+
+ + +
+ +
+
+
+
+ + +
+
\ No newline at end of file diff --git a/src/app/ui/ui.module.ts b/src/app/ui/ui.module.ts index be7bbbe..e2a3352 100644 --- a/src/app/ui/ui.module.ts +++ b/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, From 831921552a51bfa551a166ce8a02cf2b72a76faa Mon Sep 17 00:00:00 2001 From: cpf <1105965053@qq.com> Date: Fri, 18 Dec 2020 10:24:51 +0800 Subject: [PATCH 2/3] =?UTF-8?q?[=E5=AE=8C=E5=96=84]=20=E6=98=BE=E9=9A=90?= =?UTF-8?q?=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/ui/collection-tools/collection-tools.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/ui/collection-tools/collection-tools.component.html b/src/app/ui/collection-tools/collection-tools.component.html index 46378ff..c0e72cd 100644 --- a/src/app/ui/collection-tools/collection-tools.component.html +++ b/src/app/ui/collection-tools/collection-tools.component.html @@ -38,7 +38,7 @@
-