diff --git a/src/app/ui/collection-tools-building/addDisposalNode.html b/src/app/ui/collection-tools-building/addDisposalNode.html deleted file mode 100644 index 27654e8..0000000 --- a/src/app/ui/collection-tools-building/addDisposalNode.html +++ /dev/null @@ -1,24 +0,0 @@ -
-
- - -
- -
- -
- - - -
- -
- - -
- -
- -
\ No newline at end of file diff --git a/src/app/ui/collection-tools-building/collection-tools.component.html b/src/app/ui/collection-tools-building/collection-tools.component.html index 3a5f682..2a4a2b1 100644 --- a/src/app/ui/collection-tools-building/collection-tools.component.html +++ b/src/app/ui/collection-tools-building/collection-tools.component.html @@ -20,7 +20,14 @@ - + + + 适应缩放 + + + + 重置缩放 + @@ -131,35 +138,6 @@ - -
-
- keyboard_arrow_up - keyboard_arrow_down - - -
-
- - - -
- -
- edit - add - library_books - delete_forever -
-
-
- -
-
- diff --git a/src/app/ui/collection-tools-building/collection-tools.component.scss b/src/app/ui/collection-tools-building/collection-tools.component.scss index 02c4e97..2c39cc0 100644 --- a/src/app/ui/collection-tools-building/collection-tools.component.scss +++ b/src/app/ui/collection-tools-building/collection-tools.component.scss @@ -25,6 +25,15 @@ align-items:center; min-height: 40px; background-color: #fff; + .zoom{ + display: flex; + align-items: center; + margin-left: 15px; + cursor: pointer; + img{ + margin-right: 3px; + } + } .marginLeftRight { margin: 0 8px; font-size: 16px; diff --git a/src/app/ui/collection-tools-building/collection-tools.component.ts b/src/app/ui/collection-tools-building/collection-tools.component.ts index 23660b4..44c36d1 100644 --- a/src/app/ui/collection-tools-building/collection-tools.component.ts +++ b/src/app/ui/collection-tools-building/collection-tools.component.ts @@ -2,14 +2,13 @@ import { Component, OnInit, Inject, ViewChild,ElementRef,Renderer2, ViewContaine 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 {leftFunctionalDomainBuildingComponent,editPlaneFigureBuildingComponent,addDisposalNodeBuildingComponent,editDisposalNodeBuildingComponent} from './leftFunctionalDomain' +import {leftFunctionalDomainBuildingComponent,editPlaneFigureBuildingComponent} from './leftFunctionalDomain' import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree'; import {FlatTreeControl} from '@angular/cdk/tree'; import {WorkingAreaComponent} from '../../working-area/working-area.component' import {CanvasShareDataService, DisposalNodeData} from '../../canvas-share-data.service' //引入服务 import Viewer from 'viewerjs'; import Swiper from 'swiper'; -import { saveOneDialogBuilding } from './save'; import { NzFormatBeforeDropEvent, NzFormatEmitEvent,NzTreeComponent } from 'ng-zorro-antd/tree'; import { Observable, of } from 'rxjs'; import { GameMode } from 'src/app/working-area/model/gameMode'; @@ -172,7 +171,14 @@ export class CollectionToolsBuildingComponent implements OnInit { this.getDisposalNode() } } - + //适应缩放 + adaptZoom(){ + this.canvas.zoomFit() + } + //重置缩放 + resetZoom(){ + this.canvas.resetCamera2D() + } //ngzorro tree 拖拽 nzEvent(event: NzFormatEmitEvent): void { if(this.isDrag){ @@ -457,14 +463,6 @@ export class CollectionToolsBuildingComponent implements OnInit { this.canvas.refreshIcon(this.canvasAssetObj.Id) } - //查看图片详情 - lookImg(){ - const dialogRef = this.dialog.open(ViewDetailsBuilding, {//调用open方法打开对话框并且携带参数过去 - data: {imagesArr:this.imagesArr,index:this.clickedIndex} - }); - dialogRef.afterClosed().subscribe(data=>{ }); - } - //上传素材图片 selectFile(e){ let imgFile = e.target.files[0] || null //上传的文件 @@ -1167,21 +1165,7 @@ export class CollectionToolsBuildingComponent implements OnInit { } } - }else{//如果是想定作业编辑模式 - const dialogRef = this.dialog.open(saveOneDialogBuilding, { - data: {allDisposalNode: this.canvasData.allDisposalNode, - selectedBuildingData:this.beforeOneCheckedBuilding, - selectedSiteData:this.selectingSitePlan, - siteOrbuilding:this.checkedBuildingIndex, - disasterId: this.allFirePlan[0].id || '' - } - }); - - dialogRef.afterClosed().subscribe(result => { - // console.log('The dialog was closed'); - }); } - } else { //if const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; @@ -2237,43 +2221,6 @@ export class CollectionToolsBuildingComponent implements OnInit { }) } - //新建 处置预案 节点 - addPanelPoint (e,item,treeData) { - e.stopPropagation() - let order - if (item) { - item.children.length? order = item.children[item.children.length-1].order+1 : order = 0 - } else { - treeData.length? order = treeData[treeData.length-1].order+1 : order = 0 - } - let data = { - name: '', - level: item? 1 : 0, - order: order, - description: '', - disasterId: this.allFirePlan[0].id || '', - parentId: item? item.id : null, - planComponentId: sessionStorage.getItem('planId') || '', - } - let dialogRef = this.dialog.open(addDisposalNodeBuildingComponent,{data}); - dialogRef.afterClosed().subscribe(data=>{ - if (data) { this.refurbishTreeData() } - }) - } - - //编辑 处置预案 节点 - editPanelPoint (e,item) { - e.stopPropagation() - let data = item.origin - let dialogRef = this.dialog.open(editDisposalNodeBuildingComponent,{data}); - dialogRef.afterClosed().subscribe(data=>{ - if (data) { - item.title = data - this.canvasData.allDisposalNode.forEach(element => { element.id === item.key? element.name=data : null }); - } - }) - } - //复制 处置预案 节点 copyPanelPoint (e,item,treeData) { e.stopPropagation() @@ -2489,50 +2436,3 @@ export class EditBuildingBuilding { } } -//查看图片大图 -@Component({ - selector: 'viewdetails-building', - templateUrl: './viewdetails.html', - styleUrls: ['./collection-tools.component.scss'] -}) -export class ViewDetailsBuilding { - // myControl = new FormControl(); - //注入MatDialogRef,可以用来关闭对话框 - //要访问对话框组件中的数据,必须使用MAT_DIALOG_DATA注入令牌 - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,private element: ElementRef) {} - imagesArr = this.data.imagesArr - onNoClick(): void { - this.dialogRef.close(); - } - ngOnInit(): void { - setTimeout(() => { - var mySwiper = new Swiper('.swiper-container',{ - loop: false, - initialSlide :this.data.index,//默认索引 - // 如果需要前进后退按钮 - navigation: { - nextEl: '.swiper-button-next', - prevEl: '.swiper-button-prev', - } - //其他设置 - }); - }, 0); - } - closeDialog(){ - this.dialogRef.close(); - } - count = 10 - zoomimg(e) { - if(this.count != 1 || e.wheelDelta >= 120){ - if(e.wheelDelta >= 120){ - this.count++ - }else{ - this.count-- - } - } - e.srcElement.style.zoom = this.count + '0%' - e.srcElement.style.maxWidth = null - e.srcElement.style.maxHeight = null - } - -} diff --git a/src/app/ui/collection-tools-building/editDisposalNode.html b/src/app/ui/collection-tools-building/editDisposalNode.html deleted file mode 100644 index 40b2270..0000000 --- a/src/app/ui/collection-tools-building/editDisposalNode.html +++ /dev/null @@ -1,23 +0,0 @@ -
-
- -
- -
- -
- - - -
- -
- - -
- -
- -
\ No newline at end of file diff --git a/src/app/ui/collection-tools-building/leftFunctionalDomain.ts b/src/app/ui/collection-tools-building/leftFunctionalDomain.ts index e60ca32..1190a74 100644 --- a/src/app/ui/collection-tools-building/leftFunctionalDomain.ts +++ b/src/app/ui/collection-tools-building/leftFunctionalDomain.ts @@ -126,55 +126,3 @@ export class editPlaneFigureBuildingComponent implements OnInit { } - - - -//创建 处置预案 节点 -@Component({ - selector: 'app-addDisposalNode-building', - templateUrl: './addDisposalNode.html', - styleUrls: ['./panel.scss'] -}) -export class addDisposalNodeBuildingComponent implements OnInit { - - constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data) { } - - ngOnInit(): void { - } - - //提交表单 - onSubmit (e) { - this.data.name = e.name - this.http.post('/api/DisposalNodes',this.data).subscribe(data=>{ - this.dialogRef.close('success'); - }) - } - -} - - - -//编辑 处置预案 节点 -@Component({ - selector: 'app-editDisposalNode-building', - templateUrl: './editDisposalNode.html', - styleUrls: ['./panel.scss'] -}) -export class editDisposalNodeBuildingComponent implements OnInit { - - constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data) { } - - ngOnInit(): void { - this.nodeName = JSON.parse(JSON.stringify( this.data.name || '' )) - } - nodeName:string; - - //提交表单 - onSubmit (e) { - this.data.name = e.name - this.http.put(`/api/DisposalNodes/${this.data.id}`,this.data).subscribe(data=>{ - this.dialogRef.close(e.name); - }) - } - -} \ No newline at end of file diff --git a/src/app/ui/collection-tools-building/save.ts b/src/app/ui/collection-tools-building/save.ts deleted file mode 100644 index 03b5abd..0000000 --- a/src/app/ui/collection-tools-building/save.ts +++ /dev/null @@ -1,300 +0,0 @@ -import { Component, OnInit, Inject } 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' //引入服务 -// 保存想定作业第一个弹窗 -@Component({ - selector: 'dialog-overview-example-dialog-building', - templateUrl: 'saveOne.html', - styleUrls: ['./collection-tools.component.scss'] -}) -export class saveOneDialogBuilding { - - constructor( - private http:HttpClient, - public dialog: MatDialog, - public snackBar: MatSnackBar, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data) {} - - onNoClick(): void { - this.dialogRef.close() - } - allDisposalNode = this.data.allDisposalNode - - saveType(type){ - this.dialogRef.close() - const dialogRef = this.dialog.open(saveTwoDialogBuilding, { - data: {type: type, - allDisposalNode: this.data.allDisposalNode, - selectedBuildingData:this.data.selectedBuildingData, - selectedSiteData:this.data.selectedSiteData, - siteOrbuilding:this.data.siteOrbuilding, - disasterId:this.data.disasterId} - }); - dialogRef.afterClosed().subscribe(result => { - }); - } - -} - - // 保存想定作业第二个弹窗 -@Component({ - selector: 'dialog-overview-example-dialog-building', - templateUrl: 'saveTwo.html', - styleUrls: ['./collection-tools.component.scss'] -}) -export class saveTwoDialogBuilding { - - constructor( - private http:HttpClient, - public dialogRef: MatDialogRef, - public canvasData: CanvasShareDataService, - public snackBar: MatSnackBar, - @Inject(MAT_DIALOG_DATA) public data) {} - - type = this.data.type - allDisposalNode = this.data.allDisposalNode - allPlanDisposalNode = [] - allRootDisposalNode = [{name:"根节点",id:null}] - allDisposalNodeChild = [] - ngOnInit(): void { - //所有非数据节点 - this.allDisposalNode.forEach(item => { - if(!item.sitePlanId && !item.buildingAreaId){ - this.allPlanDisposalNode.push(item) - } - }) - - //所有一级节点 - this.allDisposalNode.forEach(item => { - if(!item.parentId){ - this.allRootDisposalNode.push(item) - } - }) - this.allDisposalNodeChild = JSON.parse(JSON.stringify(this.allDisposalNode)) - this.allDisposalNodeChild.forEach(item => { - item.children = [] - this.allDisposalNodeChild.forEach(i => { - if(i.parentId == item.id){ - item.children.push(i) - } - }) - }) - // console.log(this.nodeItem.id) - } - onNoClick(): void { - this.dialogRef.close(); - } - nodeItem - itemChildNum = 0 //点击处置节点子数据节点的数量 - clickNode(item){ - // console.log(item) - this.nodeItem = item - this.allDisposalNodeChild.forEach(item => { - if(item.id == this.nodeItem.id){ - this.itemChildNum = item.children.length - } - }) - } - - selectedBuildingData = this.data.selectedBuildingData - selectedSiteData = this.data.selectedSiteData - onSubmit(value,type){ - // console.log(type) - let name = this.selectedBuildingData.name + '-' + this.selectedSiteData.name - //如果保存到已有节点 - var postdata = { - id: "", - name: name, - level: 0, - order: this.itemChildNum, - description: "", - notes: "", - weather: null, - airTemperature: null, - windDirection: null, - windScale: null, - imageNames: null, - imageUrls: null, - parentId: this.nodeItem ? this.nodeItem.id : null, - disasterId: this.data.disasterId, - planComponentId: sessionStorage.getItem('planId') || '', - companyId: this.data.siteOrbuilding == -1 ? sessionStorage.getItem('companyId') : null, - sitePlanId: this.data.siteOrbuilding==-1 ? this.selectedSiteData.id : null, - buildingId: this.selectedBuildingData.id || null, - buildingAreaId: this.data.siteOrbuilding!=-1 ? this.selectedSiteData.id : null - } - if(type == 'old'){ - let istrue = this.canvasData.findDisposalNode(this.nodeItem.id,name) - let putdata = this.nodeItem - putdata.weather = this.canvasData.selectPanelPointBaseData.weather - putdata.airTemperature = Number(this.canvasData.selectPanelPointBaseData.airTemperature) - putdata.windScale = Number(this.canvasData.selectPanelPointBaseData.windScale) - putdata.windDirection = Number(this.canvasData.selectPanelPointBaseData.windDirection) - putdata.description = this.canvasData.selectPanelPointBaseData.description - putdata.notes = this.canvasData.selectPanelPointBaseData.notes - - - if(istrue){//如果该处置节点下已有同名数据节点 则只修改 2个接口 - new Promise((resolve,reject)=>{ - this.http.put(`/api/DisposalNodes/${value.nodeId}`,putdata).subscribe(data => { - resolve("更新处置节点成功,将天气 节点详情等信息保存到点击的节点") - }) - }).then((values)=>{ - this.canvasData.sendMessage('send a message');//发布一条消息 - // 保存平面图数据到当前节点 - let postdata =JSON.parse(JSON.stringify(this.canvasData.selectPanelPoint)) - postdata.Data = JSON.stringify(postdata.Data) - this.http.post(`/api/DisposalNodeData`,postdata).subscribe(data => { - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('保存成功','确定',config) - },err=>{ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('保存失败','确定',config) - }) - this.dialogRef.close(); - this.canvasData.sendMessage('send a message');//发布一条消息 - }) - - }else{//需要3个接口 - new Promise((resolve,reject)=>{ - this.http.put(`/api/DisposalNodes/${value.nodeId}`,putdata).subscribe(data => { - resolve("更新处置节点成功,将天气 节点详情等信息保存到点击的节点") - }) - }).then((values)=>{ - // console.log(values) - postdata.level = putdata.level + 1 - new Promise((resolve,reject) => { - this.http.post(`/api/DisposalNodes`,postdata).subscribe(data => { - resolve(data) - }) - }).then((data:any)=>{ - // console.log(7788,data) - let objData = { - id: "", - data: JSON.stringify(this.canvasData.selectPanelPoint.Data) || null, - version: this.canvasData.selectPanelPoint.Version || "2.0", - disposalNodeId: data.id, - planComponentId: sessionStorage.getItem("planId"), - } - this.http.post(`/api/DisposalNodeData`,objData).subscribe(data => { - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('保存成功','确定',config) - },err=>{ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('保存失败','确定',config) - }) - this.dialogRef.close(); - this.canvasData.sendMessage('send a message');//发布一条消息 - }) - }) - } - - }else{//如果保存到新建节点 - let dispositionNodeData //处置节点data - let order - let oneLevelNum = [] - //将order赋值为所有一级节点最后一个+1 - this.allDisposalNode.forEach(item => { - if(!item.parentId){ - oneLevelNum.push(item) - } - }) - if(oneLevelNum.length == 0){ - order = 0 - }else{ - order = oneLevelNum[oneLevelNum.length - 1].order + 1 - } - - if(this.nodeItem){//如果点击了下拉选择框 - if(this.nodeItem.id != null){ - this.allDisposalNodeChild.forEach(item => { - if(item.id == this.nodeItem.id){ - order = item.children.length - } - }) - } - } - dispositionNodeData = { - id: "", - name: value.name, - level: this.nodeItem && this.nodeItem.id != null ? this.nodeItem.level + 1 : 0, - order: order, - description: "", - notes: "", - weather: null, - airTemperature: 0, - windDirection: 0, - windScale: 0, - imageNames: null, - imageUrls: null, - parentId: this.nodeItem ? this.nodeItem.id : null, - disasterId: this.data.disasterId, - planComponentId: sessionStorage.getItem('planId') || '', - companyId: null, - sitePlanId: null, - buildingId: null, - buildingAreaId: null - } - - dispositionNodeData.weather = this.canvasData.selectPanelPointBaseData.weather - dispositionNodeData.airTemperature = Number(this.canvasData.selectPanelPointBaseData.airTemperature) - dispositionNodeData.windScale = Number(this.canvasData.selectPanelPointBaseData.windScale) - dispositionNodeData.windDirection = Number(this.canvasData.selectPanelPointBaseData.windDirection) - dispositionNodeData.description = this.canvasData.selectPanelPointBaseData.description - dispositionNodeData.notes = this.canvasData.selectPanelPointBaseData.notes - //1.先创建一个处置节点 然后 .then 2.创建数据节点到刚创建的处置节点 3.然后拿着创建好的数据节点的id 将平面图data保存 - new Promise((resolve,reject) => { - this.http.post("/api/DisposalNodes",dispositionNodeData).subscribe((data:any) => { - resolve(data.id) - }) - }).then((id) => { - let dataNodeData - new Promise((resolve,reject) => { - postdata.parentId = id - postdata.level = dispositionNodeData.level + 1 - this.http.post("/api/DisposalNodes",postdata).subscribe((data:any) => { - resolve(data) - }) - }).then((data:any) => { - // 保存平面图数据到当前节点 - // console.log(6666,data) - // let postdata =JSON.parse(JSON.stringify(this.canvasData.selectPanelPoint)) - // postdata.Data = JSON.stringify(postdata.Data) - let objData = { - id: "", - data: JSON.stringify(this.canvasData.selectPanelPoint.Data) || null, - version: this.canvasData.selectPanelPoint.Version || "2.0", - disposalNodeId: data.id, - planComponentId: sessionStorage.getItem("planId"), - } - - this.http.post(`/api/DisposalNodeData`,objData).subscribe(data => { - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('保存成功','确定',config) - - },err=>{ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('保存失败','确定',config) - }) - this.dialogRef.close(); - this.canvasData.sendMessage("send a message") - }) - }) - } - } -} \ No newline at end of file diff --git a/src/app/ui/collection-tools-building/saveOne.html b/src/app/ui/collection-tools-building/saveOne.html deleted file mode 100644 index a6b0b32..0000000 --- a/src/app/ui/collection-tools-building/saveOne.html +++ /dev/null @@ -1,5 +0,0 @@ -
处置节点保存
-
- - -
\ No newline at end of file diff --git a/src/app/ui/collection-tools-building/saveTwo.html b/src/app/ui/collection-tools-building/saveTwo.html deleted file mode 100644 index fec97ff..0000000 --- a/src/app/ui/collection-tools-building/saveTwo.html +++ /dev/null @@ -1,53 +0,0 @@ -
-
新增节点
-
-
- -
- - - -
-
- - - - {{item.name}} - - - -
-
- - -
-
-
-
-
-
保存到已有节点
-
-
-
- - - - {{item.name}} - - - -
-
- - -
-
-
-
\ No newline at end of file diff --git a/src/app/ui/collection-tools-building/viewdetails.html b/src/app/ui/collection-tools-building/viewdetails.html deleted file mode 100644 index 76638c2..0000000 --- a/src/app/ui/collection-tools-building/viewdetails.html +++ /dev/null @@ -1,24 +0,0 @@ -
-
- clear -
- -
-
- -
-
- -
-
-
\ No newline at end of file diff --git a/src/app/ui/collection-tools-plan/addDisposalNode.html b/src/app/ui/collection-tools-plan/addDisposalNode.html deleted file mode 100644 index 27654e8..0000000 --- a/src/app/ui/collection-tools-plan/addDisposalNode.html +++ /dev/null @@ -1,24 +0,0 @@ -
-
- - -
- -
- -
- - - -
- -
- - -
- -
- -
\ No newline at end of file diff --git a/src/app/ui/collection-tools-plan/collection-tools.component.html b/src/app/ui/collection-tools-plan/collection-tools.component.html index 4a12770..c2c2e9f 100644 --- a/src/app/ui/collection-tools-plan/collection-tools.component.html +++ b/src/app/ui/collection-tools-plan/collection-tools.component.html @@ -20,7 +20,14 @@ - + + + 适应缩放 + + + + 重置缩放 + @@ -114,35 +121,6 @@ - -
-
- keyboard_arrow_up - keyboard_arrow_down - - -
-
- - - -
- -
- edit - add - library_books - delete_forever -
-
-
- -
-
- diff --git a/src/app/ui/collection-tools-plan/collection-tools.component.scss b/src/app/ui/collection-tools-plan/collection-tools.component.scss index acae429..e99f1d4 100644 --- a/src/app/ui/collection-tools-plan/collection-tools.component.scss +++ b/src/app/ui/collection-tools-plan/collection-tools.component.scss @@ -25,6 +25,15 @@ align-items:center; min-height: 40px; background-color: #fff; + .zoom{ + display: flex; + align-items: center; + margin-left: 15px; + cursor: pointer; + img{ + margin-right: 3px; + } + } .marginLeftRight { margin: 0 8px; font-size: 16px; diff --git a/src/app/ui/collection-tools-plan/collection-tools.component.ts b/src/app/ui/collection-tools-plan/collection-tools.component.ts index 0b522e8..e23c11c 100644 --- a/src/app/ui/collection-tools-plan/collection-tools.component.ts +++ b/src/app/ui/collection-tools-plan/collection-tools.component.ts @@ -2,14 +2,13 @@ import { Component, OnInit, Inject, ViewChild,ElementRef,Renderer2, ViewContaine 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 {leftFunctionalDomainComponentPlan,editPlaneFigureComponentPlan,editDisposalNodeComponentPlan,addDisposalNodeComponentPlan} from './leftFunctionalDomain' +import {leftFunctionalDomainComponentPlan,editPlaneFigureComponentPlan} from './leftFunctionalDomain' import {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree'; import {FlatTreeControl} from '@angular/cdk/tree'; import {WorkingAreaComponent} from '../../working-area/working-area.component' import {CanvasShareDataService, DisposalNodeData} from '../../canvas-share-data.service' //引入服务 import Viewer from 'viewerjs'; import Swiper from 'swiper'; -import { saveOneDialogPlan } from './save'; import { NzFormatBeforeDropEvent, NzFormatEmitEvent,NzTreeComponent } from 'ng-zorro-antd/tree'; import { Observable, of } from 'rxjs'; import { GameMode } from 'src/app/working-area/model/gameMode'; @@ -173,6 +172,14 @@ export class CollectionToolsPlanComponent implements OnInit { } } + //适应缩放 + adaptZoom(){ + this.canvas.zoomFit() + } + //重置缩放 + resetZoom(){ + this.canvas.resetCamera2D() + } //ngzorro tree 拖拽 nzEvent(event: NzFormatEmitEvent): void { if(this.isDrag){ @@ -460,14 +467,6 @@ export class CollectionToolsPlanComponent implements OnInit { this.canvas.refreshIcon(this.canvasAssetObj.Id) } - //查看图片详情 - lookImg(){ - const dialogRef = this.dialog.open(ViewDetailsPlan, {//调用open方法打开对话框并且携带参数过去 - data: {imagesArr:this.imagesArr,index:this.clickedIndex} - }); - dialogRef.afterClosed().subscribe(data=>{ }); - } - //上传素材图片 selectFile(e){ let imgFile = e.target.files[0] || null //上传的文件 @@ -1168,21 +1167,7 @@ export class CollectionToolsPlanComponent implements OnInit { } } - }else{//如果是想定作业编辑模式 - const dialogRef = this.dialog.open(saveOneDialogPlan, { - data: {allDisposalNode: this.canvasData.allDisposalNode, - selectedBuildingData:this.beforeOneCheckedBuilding, - selectedSiteData:this.selectingSitePlan, - siteOrbuilding:this.checkedBuildingIndex, - disasterId: this.allFirePlan[0].id || '' - } - }); - - dialogRef.afterClosed().subscribe(result => { - // console.log('The dialog was closed'); - }); } - } else { //if const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; @@ -2246,43 +2231,6 @@ export class CollectionToolsPlanComponent implements OnInit { }) } - //新建 处置预案 节点 - addPanelPoint (e,item,treeData) { - e.stopPropagation() - let order - if (item) { - item.children.length? order = item.children[item.children.length-1].order+1 : order = 0 - } else { - treeData.length? order = treeData[treeData.length-1].order+1 : order = 0 - } - let data = { - name: '', - level: item? 1 : 0, - order: order, - description: '', - disasterId: this.allFirePlan[0].id || '', - parentId: item? item.id : null, - planComponentId: sessionStorage.getItem('planId') || '', - } - let dialogRef = this.dialog.open(addDisposalNodeComponentPlan,{data}); - dialogRef.afterClosed().subscribe(data=>{ - if (data) { this.refurbishTreeData() } - }) - } - - //编辑 处置预案 节点 - editPanelPoint (e,item) { - e.stopPropagation() - let data = item.origin - let dialogRef = this.dialog.open(editDisposalNodeComponentPlan,{data}); - dialogRef.afterClosed().subscribe(data=>{ - if (data) { - item.title = data - this.canvasData.allDisposalNode.forEach(element => { element.id === item.key? element.name=data : null }); - } - }) - } - //复制 处置预案 节点 copyPanelPoint (e,item,treeData) { e.stopPropagation() @@ -2497,51 +2445,3 @@ export class EditBuildingPlan { }) } } - -//查看图片大图 -@Component({ - selector: 'viewdetails-plan', - templateUrl: './viewdetails.html', - styleUrls: ['./collection-tools.component.scss'] -}) -export class ViewDetailsPlan { - // myControl = new FormControl(); - //注入MatDialogRef,可以用来关闭对话框 - //要访问对话框组件中的数据,必须使用MAT_DIALOG_DATA注入令牌 - constructor(private http: HttpClient,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data,private element: ElementRef) {} - imagesArr = this.data.imagesArr - onNoClick(): void { - this.dialogRef.close(); - } - ngOnInit(): void { - setTimeout(() => { - var mySwiper = new Swiper('.swiper-container',{ - loop: false, - initialSlide :this.data.index,//默认索引 - // 如果需要前进后退按钮 - navigation: { - nextEl: '.swiper-button-next', - prevEl: '.swiper-button-prev', - } - //其他设置 - }); - }, 0); - } - closeDialog(){ - this.dialogRef.close(); - } - count = 10 - zoomimg(e) { - if(this.count != 1 || e.wheelDelta >= 120){ - if(e.wheelDelta >= 120){ - this.count++ - }else{ - this.count-- - } - } - e.srcElement.style.zoom = this.count + '0%' - e.srcElement.style.maxWidth = null - e.srcElement.style.maxHeight = null - } - -} diff --git a/src/app/ui/collection-tools-plan/editDisposalNode.html b/src/app/ui/collection-tools-plan/editDisposalNode.html deleted file mode 100644 index 40b2270..0000000 --- a/src/app/ui/collection-tools-plan/editDisposalNode.html +++ /dev/null @@ -1,23 +0,0 @@ -
-
- -
- -
- -
- - - -
- -
- - -
- -
- -
\ No newline at end of file diff --git a/src/app/ui/collection-tools-plan/leftFunctionalDomain.ts b/src/app/ui/collection-tools-plan/leftFunctionalDomain.ts index 49b60b7..bce9606 100644 --- a/src/app/ui/collection-tools-plan/leftFunctionalDomain.ts +++ b/src/app/ui/collection-tools-plan/leftFunctionalDomain.ts @@ -164,55 +164,3 @@ export class editPlaneFigureComponentPlan implements OnInit { } - - - -//创建 处置预案 节点 -@Component({ - selector: 'app-addDisposalNode-plan', - templateUrl: './addDisposalNode.html', - styleUrls: ['./panel.scss'] -}) -export class addDisposalNodeComponentPlan implements OnInit { - - constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data) { } - - ngOnInit(): void { - } - - //提交表单 - onSubmit (e) { - this.data.name = e.name - this.http.post('/api/DisposalNodes',this.data).subscribe(data=>{ - this.dialogRef.close('success'); - }) - } - -} - - - -//编辑 处置预案 节点 -@Component({ - selector: 'app-editDisposalNode-plan', - templateUrl: './editDisposalNode.html', - styleUrls: ['./panel.scss'] -}) -export class editDisposalNodeComponentPlan implements OnInit { - - constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data) { } - - ngOnInit(): void { - this.nodeName = JSON.parse(JSON.stringify( this.data.name || '' )) - } - nodeName:string; - - //提交表单 - onSubmit (e) { - this.data.name = e.name - this.http.put(`/api/DisposalNodes/${this.data.id}`,this.data).subscribe(data=>{ - this.dialogRef.close(e.name); - }) - } - -} \ No newline at end of file diff --git a/src/app/ui/collection-tools-plan/save.ts b/src/app/ui/collection-tools-plan/save.ts deleted file mode 100644 index df7489c..0000000 --- a/src/app/ui/collection-tools-plan/save.ts +++ /dev/null @@ -1,300 +0,0 @@ -import { Component, OnInit, Inject } 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' //引入服务 -// 保存想定作业第一个弹窗 -@Component({ - selector: 'dialog-overview-example-dialog', - templateUrl: 'saveOne.html', - styleUrls: ['./collection-tools.component.scss'] -}) -export class saveOneDialogPlan { - - constructor( - private http:HttpClient, - public dialog: MatDialog, - public snackBar: MatSnackBar, - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data) {} - - onNoClick(): void { - this.dialogRef.close() - } - allDisposalNode = this.data.allDisposalNode - - saveType(type){ - this.dialogRef.close() - const dialogRef = this.dialog.open(saveTwoDialogPlan, { - data: {type: type, - allDisposalNode: this.data.allDisposalNode, - selectedBuildingData:this.data.selectedBuildingData, - selectedSiteData:this.data.selectedSiteData, - siteOrbuilding:this.data.siteOrbuilding, - disasterId:this.data.disasterId} - }); - dialogRef.afterClosed().subscribe(result => { - }); - } - -} - - // 保存想定作业第二个弹窗 -@Component({ - selector: 'dialog-overview-example-dialog', - templateUrl: 'saveTwo.html', - styleUrls: ['./collection-tools.component.scss'] -}) -export class saveTwoDialogPlan { - - constructor( - private http:HttpClient, - public dialogRef: MatDialogRef, - public canvasData: CanvasShareDataService, - public snackBar: MatSnackBar, - @Inject(MAT_DIALOG_DATA) public data) {} - - type = this.data.type - allDisposalNode = this.data.allDisposalNode - allPlanDisposalNode = [] - allRootDisposalNode = [{name:"根节点",id:null}] - allDisposalNodeChild = [] - ngOnInit(): void { - //所有非数据节点 - this.allDisposalNode.forEach(item => { - if(!item.sitePlanId && !item.buildingAreaId){ - this.allPlanDisposalNode.push(item) - } - }) - - //所有一级节点 - this.allDisposalNode.forEach(item => { - if(!item.parentId){ - this.allRootDisposalNode.push(item) - } - }) - this.allDisposalNodeChild = JSON.parse(JSON.stringify(this.allDisposalNode)) - this.allDisposalNodeChild.forEach(item => { - item.children = [] - this.allDisposalNodeChild.forEach(i => { - if(i.parentId == item.id){ - item.children.push(i) - } - }) - }) - // console.log(this.nodeItem.id) - } - onNoClick(): void { - this.dialogRef.close(); - } - nodeItem - itemChildNum = 0 //点击处置节点子数据节点的数量 - clickNode(item){ - // console.log(item) - this.nodeItem = item - this.allDisposalNodeChild.forEach(item => { - if(item.id == this.nodeItem.id){ - this.itemChildNum = item.children.length - } - }) - } - - selectedBuildingData = this.data.selectedBuildingData - selectedSiteData = this.data.selectedSiteData - onSubmit(value,type){ - // console.log(type) - let name = this.selectedBuildingData.name + '-' + this.selectedSiteData.name - //如果保存到已有节点 - var postdata = { - id: "", - name: name, - level: 0, - order: this.itemChildNum, - description: "", - notes: "", - weather: null, - airTemperature: null, - windDirection: null, - windScale: null, - imageNames: null, - imageUrls: null, - parentId: this.nodeItem ? this.nodeItem.id : null, - disasterId: this.data.disasterId, - planComponentId: sessionStorage.getItem('planId') || '', - companyId: this.data.siteOrbuilding == -1 ? sessionStorage.getItem('companyId') : null, - sitePlanId: this.data.siteOrbuilding==-1 ? this.selectedSiteData.id : null, - buildingId: this.selectedBuildingData.id || null, - buildingAreaId: this.data.siteOrbuilding!=-1 ? this.selectedSiteData.id : null - } - if(type == 'old'){ - let istrue = this.canvasData.findDisposalNode(this.nodeItem.id,name) - let putdata = this.nodeItem - putdata.weather = this.canvasData.selectPanelPointBaseData.weather - putdata.airTemperature = Number(this.canvasData.selectPanelPointBaseData.airTemperature) - putdata.windScale = Number(this.canvasData.selectPanelPointBaseData.windScale) - putdata.windDirection = Number(this.canvasData.selectPanelPointBaseData.windDirection) - putdata.description = this.canvasData.selectPanelPointBaseData.description - putdata.notes = this.canvasData.selectPanelPointBaseData.notes - - - if(istrue){//如果该处置节点下已有同名数据节点 则只修改 2个接口 - new Promise((resolve,reject)=>{ - this.http.put(`/api/DisposalNodes/${value.nodeId}`,putdata).subscribe(data => { - resolve("更新处置节点成功,将天气 节点详情等信息保存到点击的节点") - }) - }).then((values)=>{ - this.canvasData.sendMessage('send a message');//发布一条消息 - // 保存平面图数据到当前节点 - let postdata =JSON.parse(JSON.stringify(this.canvasData.selectPanelPoint)) - postdata.Data = JSON.stringify(postdata.Data) - this.http.post(`/api/DisposalNodeData`,postdata).subscribe(data => { - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('保存成功','确定',config) - },err=>{ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('保存失败','确定',config) - }) - this.dialogRef.close(); - this.canvasData.sendMessage('send a message');//发布一条消息 - }) - - }else{//需要3个接口 - new Promise((resolve,reject)=>{ - this.http.put(`/api/DisposalNodes/${value.nodeId}`,putdata).subscribe(data => { - resolve("更新处置节点成功,将天气 节点详情等信息保存到点击的节点") - }) - }).then((values)=>{ - // console.log(values) - postdata.level = putdata.level + 1 - new Promise((resolve,reject) => { - this.http.post(`/api/DisposalNodes`,postdata).subscribe(data => { - resolve(data) - }) - }).then((data:any)=>{ - // console.log(7788,data) - let objData = { - id: "", - data: JSON.stringify(this.canvasData.selectPanelPoint.Data) || null, - version: this.canvasData.selectPanelPoint.Version || "2.0", - disposalNodeId: data.id, - planComponentId: sessionStorage.getItem("planId"), - } - this.http.post(`/api/DisposalNodeData`,objData).subscribe(data => { - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('保存成功','确定',config) - },err=>{ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('保存失败','确定',config) - }) - this.dialogRef.close(); - this.canvasData.sendMessage('send a message');//发布一条消息 - }) - }) - } - - }else{//如果保存到新建节点 - let dispositionNodeData //处置节点data - let order - let oneLevelNum = [] - //将order赋值为所有一级节点最后一个+1 - this.allDisposalNode.forEach(item => { - if(!item.parentId){ - oneLevelNum.push(item) - } - }) - if(oneLevelNum.length == 0){ - order = 0 - }else{ - order = oneLevelNum[oneLevelNum.length - 1].order + 1 - } - - if(this.nodeItem){//如果点击了下拉选择框 - if(this.nodeItem.id != null){ - this.allDisposalNodeChild.forEach(item => { - if(item.id == this.nodeItem.id){ - order = item.children.length - } - }) - } - } - dispositionNodeData = { - id: "", - name: value.name, - level: this.nodeItem && this.nodeItem.id != null ? this.nodeItem.level + 1 : 0, - order: order, - description: "", - notes: "", - weather: null, - airTemperature: 0, - windDirection: 0, - windScale: 0, - imageNames: null, - imageUrls: null, - parentId: this.nodeItem ? this.nodeItem.id : null, - disasterId: this.data.disasterId, - planComponentId: sessionStorage.getItem('planId') || '', - companyId: null, - sitePlanId: null, - buildingId: null, - buildingAreaId: null - } - - dispositionNodeData.weather = this.canvasData.selectPanelPointBaseData.weather - dispositionNodeData.airTemperature = Number(this.canvasData.selectPanelPointBaseData.airTemperature) - dispositionNodeData.windScale = Number(this.canvasData.selectPanelPointBaseData.windScale) - dispositionNodeData.windDirection = Number(this.canvasData.selectPanelPointBaseData.windDirection) - dispositionNodeData.description = this.canvasData.selectPanelPointBaseData.description - dispositionNodeData.notes = this.canvasData.selectPanelPointBaseData.notes - //1.先创建一个处置节点 然后 .then 2.创建数据节点到刚创建的处置节点 3.然后拿着创建好的数据节点的id 将平面图data保存 - new Promise((resolve,reject) => { - this.http.post("/api/DisposalNodes",dispositionNodeData).subscribe((data:any) => { - resolve(data.id) - }) - }).then((id) => { - let dataNodeData - new Promise((resolve,reject) => { - postdata.parentId = id - postdata.level = dispositionNodeData.level + 1 - this.http.post("/api/DisposalNodes",postdata).subscribe((data:any) => { - resolve(data) - }) - }).then((data:any) => { - // 保存平面图数据到当前节点 - // console.log(6666,data) - // let postdata =JSON.parse(JSON.stringify(this.canvasData.selectPanelPoint)) - // postdata.Data = JSON.stringify(postdata.Data) - let objData = { - id: "", - data: JSON.stringify(this.canvasData.selectPanelPoint.Data) || null, - version: this.canvasData.selectPanelPoint.Version || "2.0", - disposalNodeId: data.id, - planComponentId: sessionStorage.getItem("planId"), - } - - this.http.post(`/api/DisposalNodeData`,objData).subscribe(data => { - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('保存成功','确定',config) - - },err=>{ - const config = new MatSnackBarConfig(); - config.verticalPosition = 'top'; - config.duration = 3000 - this.snackBar.open('保存失败','确定',config) - }) - this.dialogRef.close(); - this.canvasData.sendMessage("send a message") - }) - }) - } - } -} \ No newline at end of file diff --git a/src/app/ui/collection-tools-plan/saveOne.html b/src/app/ui/collection-tools-plan/saveOne.html deleted file mode 100644 index a6b0b32..0000000 --- a/src/app/ui/collection-tools-plan/saveOne.html +++ /dev/null @@ -1,5 +0,0 @@ -
处置节点保存
-
- - -
\ No newline at end of file diff --git a/src/app/ui/collection-tools-plan/saveTwo.html b/src/app/ui/collection-tools-plan/saveTwo.html deleted file mode 100644 index fec97ff..0000000 --- a/src/app/ui/collection-tools-plan/saveTwo.html +++ /dev/null @@ -1,53 +0,0 @@ -
-
新增节点
-
-
- -
- - - -
-
- - - - {{item.name}} - - - -
-
- - -
-
-
-
-
-
保存到已有节点
-
-
-
- - - - {{item.name}} - - - -
-
- - -
-
-
-
\ No newline at end of file diff --git a/src/app/ui/collection-tools-plan/viewdetails.html b/src/app/ui/collection-tools-plan/viewdetails.html deleted file mode 100644 index 76638c2..0000000 --- a/src/app/ui/collection-tools-plan/viewdetails.html +++ /dev/null @@ -1,24 +0,0 @@ -
-
- clear -
- -
-
- -
-
- -
-
-
\ No newline at end of file diff --git a/src/app/ui/collection-tools/collection-tools.component.html b/src/app/ui/collection-tools/collection-tools.component.html index dac8a36..27b1d13 100644 --- a/src/app/ui/collection-tools/collection-tools.component.html +++ b/src/app/ui/collection-tools/collection-tools.component.html @@ -27,7 +27,15 @@ - + + + + 适应缩放 + + + + 重置缩放 +
天气 diff --git a/src/app/ui/collection-tools/collection-tools.component.scss b/src/app/ui/collection-tools/collection-tools.component.scss index 1d5a3de..c7c80a4 100644 --- a/src/app/ui/collection-tools/collection-tools.component.scss +++ b/src/app/ui/collection-tools/collection-tools.component.scss @@ -25,6 +25,15 @@ align-items:center; min-height: 40px; background-color: #fff; + .zoom{ + display: flex; + align-items: center; + margin-left: 15px; + cursor: pointer; + img{ + margin-right: 3px; + } + } .marginLeftRight { margin: 0 8px; font-size: 16px; diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts index 5fe1722..71adcb5 100644 --- a/src/app/ui/collection-tools/collection-tools.component.ts +++ b/src/app/ui/collection-tools/collection-tools.component.ts @@ -179,7 +179,14 @@ export class CollectionToolsComponent implements OnInit { this.getDisposalNode() } } - + //适应缩放 + adaptZoom(){ + this.canvas.zoomFit() + } + //重置缩放 + resetZoom(){ + this.canvas.resetCamera2D() + } //ngzorro tree 拖拽 nzEvent(event: NzFormatEmitEvent): void { if(this.isDrag){ diff --git a/src/app/ui/ui.module.ts b/src/app/ui/ui.module.ts index db5cace..c3c5fcd 100644 --- a/src/app/ui/ui.module.ts +++ b/src/app/ui/ui.module.ts @@ -80,14 +80,12 @@ import { CollectionToolsComponent, CreateBuilding, EditBuilding, ViewDetails } f import { WorkingAreaComponent } from '../working-area/working-area.component'; import {leftFunctionalDomainComponent,editPlaneFigureComponent,addDisposalNodeComponent,editDisposalNodeComponent,addBGCDisposalNodeComponent} from './collection-tools/leftFunctionalDomain' import { saveOneDialog, saveTwoDialog } from './collection-tools/save'; -import { CollectionToolsPlanComponent, CreateBuildingPlan, EditBuildingPlan, ViewDetailsPlan } from './collection-tools-plan/collection-tools.component'; -import { addDisposalNodeComponentPlan, editDisposalNodeComponentPlan, editPlaneFigureComponentPlan, leftFunctionalDomainComponentPlan } from './collection-tools-plan/leftFunctionalDomain'; -import { saveOneDialogPlan, saveTwoDialogPlan } from './collection-tools-plan/save'; -import {CollectionToolsBuildingComponent,CreateBuildingBuilding,EditBuildingBuilding,ViewDetailsBuilding} from './collection-tools-building/collection-tools.component' -import {leftFunctionalDomainBuildingComponent,editPlaneFigureBuildingComponent,addDisposalNodeBuildingComponent,editDisposalNodeBuildingComponent} from './collection-tools-building/leftFunctionalDomain' -import {saveOneDialogBuilding,saveTwoDialogBuilding} from './collection-tools-building/save' +import { CollectionToolsPlanComponent, CreateBuildingPlan, EditBuildingPlan } from './collection-tools-plan/collection-tools.component'; +import { editPlaneFigureComponentPlan, leftFunctionalDomainComponentPlan } from './collection-tools-plan/leftFunctionalDomain'; +import {CollectionToolsBuildingComponent,CreateBuildingBuilding,EditBuildingBuilding} from './collection-tools-building/collection-tools.component' +import {leftFunctionalDomainBuildingComponent,editPlaneFigureBuildingComponent} from './collection-tools-building/leftFunctionalDomain' @NgModule({ - declarations: [UiComponent, UserdataComponent, ChangepasswordComponent, OrganizationComponent, UnittypeComponent, AuthorityComponent, RoleComponent, UsermanagementComponent,IsnoPipe,ConfirmpswDirective,DialogOverviewExampleDialog,CreateAuthority,CreateRole,TimePipe,CreateNewUser,EditNewUser,allRoles,EditRole,CreateOrganization,EditOrganization,seeInformation,EditUser,editorialUnit,FireProtectionElementsComponent,Establish,EditingFireControl,FireFightingTemplateComponent, NavmenusComponent,CreateMenus,EditMenus,NewFireFighting,EditFireClassification, MaterialBankComponent, UnitInformationComponent,AddMatLibrary,EditMatLibrary,attributeComponent,AddOriginalCopy,addAttributeComponent,editAttribute,EditOriginalCopy,SelectOriginalCopy,EditUnitInfo,AddUnitInfo,AddGroups,EditGroup, EnterpriseuserComponent,AddEnterpriserUser,addUnitAttributeComponent,editUnitAttribute,seeenterpriseuser,editenterpriseuser, FireFightingFacilitiesFormworkComponent,addFireFightingFacilitiesFormworkComponent,editFireFightingFacilitiesFormworkComponent,addBuiltInComponent,addBuiltInAttributeComponent,addOptionalComponent,addOptionalAttributeComponent,editBuiltInAttributeComponent,editOptionalAttributeComponent, CollectionToolsComponent,WorkingAreaComponent,CreateBuilding,EditBuilding,leftFunctionalDomainComponent,editPlaneFigureComponent,ViewDetails,saveOneDialog,saveTwoDialog,addDisposalNodeComponent,editDisposalNodeComponent,CollectionToolsPlanComponent,CreateBuildingPlan,EditBuildingPlan,ViewDetailsPlan,leftFunctionalDomainComponentPlan,editPlaneFigureComponentPlan,addDisposalNodeComponentPlan,editDisposalNodeComponentPlan,saveOneDialogPlan,saveTwoDialogPlan,addOffices,editOffices,addBGCDisposalNodeComponent,CollectionToolsBuildingComponent,CreateBuildingBuilding,EditBuildingBuilding,ViewDetailsBuilding,leftFunctionalDomainBuildingComponent,editPlaneFigureBuildingComponent,addDisposalNodeBuildingComponent,editDisposalNodeBuildingComponent,saveOneDialogBuilding,saveTwoDialogBuilding], + declarations: [UiComponent, UserdataComponent, ChangepasswordComponent, OrganizationComponent, UnittypeComponent, AuthorityComponent, RoleComponent, UsermanagementComponent,IsnoPipe,ConfirmpswDirective,DialogOverviewExampleDialog,CreateAuthority,CreateRole,TimePipe,CreateNewUser,EditNewUser,allRoles,EditRole,CreateOrganization,EditOrganization,seeInformation,EditUser,editorialUnit,FireProtectionElementsComponent,Establish,EditingFireControl,FireFightingTemplateComponent, NavmenusComponent,CreateMenus,EditMenus,NewFireFighting,EditFireClassification, MaterialBankComponent, UnitInformationComponent,AddMatLibrary,EditMatLibrary,attributeComponent,AddOriginalCopy,addAttributeComponent,editAttribute,EditOriginalCopy,SelectOriginalCopy,EditUnitInfo,AddUnitInfo,AddGroups,EditGroup, EnterpriseuserComponent,AddEnterpriserUser,addUnitAttributeComponent,editUnitAttribute,seeenterpriseuser,editenterpriseuser, FireFightingFacilitiesFormworkComponent,addFireFightingFacilitiesFormworkComponent,editFireFightingFacilitiesFormworkComponent,addBuiltInComponent,addBuiltInAttributeComponent,addOptionalComponent,addOptionalAttributeComponent,editBuiltInAttributeComponent,editOptionalAttributeComponent, CollectionToolsComponent,WorkingAreaComponent,CreateBuilding,EditBuilding,leftFunctionalDomainComponent,editPlaneFigureComponent,ViewDetails,saveOneDialog,saveTwoDialog,addDisposalNodeComponent,editDisposalNodeComponent,CollectionToolsPlanComponent,CreateBuildingPlan,EditBuildingPlan,leftFunctionalDomainComponentPlan,editPlaneFigureComponentPlan,addOffices,editOffices,addBGCDisposalNodeComponent,CollectionToolsBuildingComponent,CreateBuildingBuilding,EditBuildingBuilding,leftFunctionalDomainBuildingComponent,editPlaneFigureBuildingComponent], imports: [ CommonModule, diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index 0f47f43..20dfa38 100644 --- a/src/app/working-area/working-area.component.ts +++ b/src/app/working-area/working-area.component.ts @@ -458,7 +458,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV /** * 重置相机 */ - private resetCamera2D() { + public resetCamera2D() { this.camera2D.scale.set(1); this.camera2D.x = (this.app.view.width - this.backgroundImage.width) / 2; this.camera2D.y = (this.app.view.height - this.backgroundImage.height) / 2; diff --git a/src/assets/images/适应缩放.png b/src/assets/images/适应缩放.png new file mode 100644 index 0000000..818de89 Binary files /dev/null and b/src/assets/images/适应缩放.png differ diff --git a/src/assets/images/重置缩放.png b/src/assets/images/重置缩放.png new file mode 100644 index 0000000..735886f Binary files /dev/null and b/src/assets/images/重置缩放.png differ