31 changed files with 4626 additions and 320 deletions
@ -0,0 +1,24 @@
|
||||
<div class="functionalDomainContent"> |
||||
<div mat-dialog-title> |
||||
<label *ngIf="!data.parentId">新建处置节点</label> |
||||
<label *ngIf="data.parentId">新建节点</label> |
||||
</div> |
||||
|
||||
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container"> |
||||
|
||||
<div class="keyMargin"> |
||||
<mat-form-field> |
||||
<input matInput name="name" required ngModel placeholder="名称"> |
||||
</mat-form-field> |
||||
</div> |
||||
|
||||
<div class="submitBottom"> |
||||
<button mat-raised-button color="primary" type="submit" [disabled]="!form.form.valid"> |
||||
确定 |
||||
</button> |
||||
<button mat-raised-button mat-dialog-close>取消</button> |
||||
</div> |
||||
|
||||
</form> |
||||
|
||||
</div> |
@ -0,0 +1,38 @@
|
||||
<div class="functionalDomainContent"> |
||||
<div mat-dialog-title> |
||||
<label *ngIf="!data.isBuilding">新建平面图</label> |
||||
<label *ngIf="data.isBuilding">新建楼层/区域</label> |
||||
</div> |
||||
|
||||
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container"> |
||||
|
||||
<div class="keyMargin"> |
||||
<mat-form-field> |
||||
<input matInput name="name" required ngModel placeholder="名称"> |
||||
</mat-form-field> |
||||
</div> |
||||
|
||||
<div class="keyMargin" *ngIf="data.isBuilding"> |
||||
<mat-checkbox name="isRefugeStorey" [(ngModel)]="checked">是否为避难层</mat-checkbox> |
||||
</div> |
||||
|
||||
<div class="keyMargin"> |
||||
<mat-form-field> |
||||
<input matInput name="area" type="number" required ngModel placeholder="面积 (平方米)"> |
||||
</mat-form-field> |
||||
</div> |
||||
|
||||
<div class="keyMargin"> |
||||
<textarea name="details" ngModel placeholder="详情"></textarea> |
||||
</div> |
||||
|
||||
<div class="submitBottom"> |
||||
<button mat-raised-button color="primary" type="submit" [disabled]="!form.form.valid"> |
||||
确定 |
||||
</button> |
||||
<button mat-raised-button mat-dialog-close>取消</button> |
||||
</div> |
||||
|
||||
</form> |
||||
|
||||
</div> |
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; |
||||
|
||||
import { CollectionToolsComponent } from './collection-tools.component'; |
||||
|
||||
describe('CollectionToolsComponent', () => { |
||||
let component: CollectionToolsComponent; |
||||
let fixture: ComponentFixture<CollectionToolsComponent>; |
||||
|
||||
beforeEach(async(() => { |
||||
TestBed.configureTestingModule({ |
||||
declarations: [ CollectionToolsComponent ] |
||||
}) |
||||
.compileComponents(); |
||||
})); |
||||
|
||||
beforeEach(() => { |
||||
fixture = TestBed.createComponent(CollectionToolsComponent); |
||||
component = fixture.componentInstance; |
||||
fixture.detectChanges(); |
||||
}); |
||||
|
||||
it('should create', () => { |
||||
expect(component).toBeTruthy(); |
||||
}); |
||||
}); |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,28 @@
|
||||
<div mat-dialog-title>新增建筑</div> |
||||
<div> |
||||
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container"> |
||||
|
||||
<div mat-dialog-content> |
||||
<mat-form-field> |
||||
<input type="text" matInput ngModel |
||||
required name="propertyName" placeholder="建筑名称" autocomplete="off"> |
||||
</mat-form-field> |
||||
</div> |
||||
<div mat-dialog-content> |
||||
<mat-form-field> |
||||
<mat-select [(value)]="selected" required ngModel name="buildingId" placeholder="建筑类型"> |
||||
<mat-option *ngFor="let item of allBuildingType" [value]="item.id"> |
||||
{{item.name}} |
||||
</mat-option> |
||||
</mat-select> |
||||
</mat-form-field> |
||||
</div> |
||||
<div mat-dialog-actions> |
||||
<button mat-raised-button color="primary" type="submit" |
||||
[disabled]="!form.form.valid"> |
||||
确定 |
||||
</button> |
||||
<button mat-raised-button mat-dialog-close>取消</button> |
||||
</div> |
||||
</form> |
||||
</div> |
@ -0,0 +1,23 @@
|
||||
<div mat-dialog-title>编辑建筑</div> |
||||
<div> |
||||
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container"> |
||||
<div mat-dialog-content> |
||||
<mat-form-field> |
||||
<input type="text" matInput [(ngModel)]="defaultName" required name="propertyName" placeholder="建筑名称" autocomplete="off"> |
||||
</mat-form-field> |
||||
</div> |
||||
<div mat-dialog-content> |
||||
<mat-form-field> |
||||
<mat-select required [(ngModel)]="defaultBuildingType" name="buildingId" placeholder="建筑类型"> |
||||
<mat-option *ngFor="let item of allBuildingType" [value]="item.id"> |
||||
{{item.name}} |
||||
</mat-option> |
||||
</mat-select> |
||||
</mat-form-field> |
||||
</div> |
||||
<div mat-dialog-actions> |
||||
<button mat-raised-button color="primary" type="submit" [disabled]="!form.form.valid">确定</button> |
||||
<button mat-raised-button mat-dialog-close>取消</button> |
||||
</div> |
||||
</form> |
||||
</div> |
@ -0,0 +1,23 @@
|
||||
<div class="functionalDomainContent"> |
||||
<div mat-dialog-title> |
||||
<label>修改灾情节点名称</label> |
||||
</div> |
||||
|
||||
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container"> |
||||
|
||||
<div class="keyMargin"> |
||||
<mat-form-field> |
||||
<input matInput name="name" required [(ngModel)]="nodeName" placeholder="名称"> |
||||
</mat-form-field> |
||||
</div> |
||||
|
||||
<div class="submitBottom"> |
||||
<button mat-raised-button color="primary" type="submit" [disabled]="!form.form.valid"> |
||||
确定 |
||||
</button> |
||||
<button mat-raised-button mat-dialog-close>取消</button> |
||||
</div> |
||||
|
||||
</form> |
||||
|
||||
</div> |
@ -0,0 +1,39 @@
|
||||
<div class="functionalDomainContent"> |
||||
|
||||
<div mat-dialog-title> |
||||
<label *ngIf="!data.isBuilding">编辑平面图</label> |
||||
<label *ngIf="data.isBuilding">编辑楼层/区域</label> |
||||
</div> |
||||
|
||||
<form (ngSubmit)="onSubmit(form.value)" #form="ngForm" class="example-container"> |
||||
|
||||
<div class="keyMargin"> |
||||
<mat-form-field> |
||||
<input matInput name="name" required [(ngModel)]="name" placeholder="名称"> |
||||
</mat-form-field> |
||||
</div> |
||||
|
||||
<div class="keyMargin" *ngIf="data.isBuilding"> |
||||
<mat-checkbox name="isRefugeStorey" [(ngModel)]="checked">是否为避难层</mat-checkbox> |
||||
</div> |
||||
|
||||
<div class="keyMargin"> |
||||
<mat-form-field> |
||||
<input matInput name="area" type="number" required [(ngModel)]="area" placeholder="面积 (平方米)"> |
||||
</mat-form-field> |
||||
</div> |
||||
|
||||
<div class="keyMargin"> |
||||
<textarea name="details" [(ngModel)]="details" placeholder="详情"></textarea> |
||||
</div> |
||||
|
||||
<div class="submitBottom"> |
||||
<button mat-raised-button color="primary" type="submit" [disabled]="!form.form.valid"> |
||||
确定 |
||||
</button> |
||||
<button mat-raised-button mat-dialog-close>取消</button> |
||||
</div> |
||||
|
||||
</form> |
||||
|
||||
</div> |
@ -0,0 +1,180 @@
|
||||
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'; |
||||
|
||||
@Component({ |
||||
selector: 'app-leftFunctionalDomain-building', |
||||
templateUrl: './addPlaneFigure.html', |
||||
styleUrls: ['./panel.scss'] |
||||
}) |
||||
export class leftFunctionalDomainBuildingComponent implements OnInit { |
||||
|
||||
constructor( |
||||
private http:HttpClient, |
||||
public dialog: MatDialog, |
||||
public snackBar: MatSnackBar, |
||||
public dialogRef: MatDialogRef<any>, |
||||
@Inject(MAT_DIALOG_DATA) public data) { } |
||||
|
||||
ngOnInit(): void { |
||||
|
||||
} |
||||
|
||||
params = {companyId: sessionStorage.getItem('companyId')} |
||||
checked:boolean = false;//是否为避难层
|
||||
|
||||
//提交表单创建平面图
|
||||
onSubmit (e) { |
||||
if (!this.data.isBuilding) { //总平面图 创建平面图
|
||||
let data = { |
||||
companyId: sessionStorage.getItem('companyId'), |
||||
name: e.name, |
||||
order: this.data.order, |
||||
area:e.area, |
||||
details:e.details, |
||||
enabled: true, |
||||
modifiedTime: new Date(), |
||||
} |
||||
this.http.post('/api/SitePlans',data).subscribe(data=>{ |
||||
this.dialogRef.close('总平面图'); |
||||
}) |
||||
} else { //建筑 创建楼层/区域
|
||||
let data = { |
||||
isRefugeStorey: e.isRefugeStorey, |
||||
buildingId: this.data.Panel.id, |
||||
name: e.name, |
||||
order: this.data.order, |
||||
area:e.area, |
||||
details:e.details, |
||||
enabled: true, |
||||
modifiedTime: new Date(), |
||||
} |
||||
this.http.post('/api/BuildingAreas',data,{params:this.params}).subscribe(data=>{ |
||||
this.dialogRef.close('建筑'); |
||||
}) |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
} |
||||
|
||||
//编辑平面图 楼层/区域
|
||||
@Component({ |
||||
selector: 'app-editPlaneFigure-building', |
||||
templateUrl: './editPlaneFigure.html', |
||||
styleUrls: ['./panel.scss'] |
||||
}) |
||||
export class editPlaneFigureBuildingComponent implements OnInit { |
||||
|
||||
constructor(private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar,public dialogRef: MatDialogRef<any>,@Inject(MAT_DIALOG_DATA) public data) { } |
||||
|
||||
ngOnInit(): void { |
||||
this.name = this.data.buildingData.name || '' |
||||
this.checked = this.data.buildingData.isRefugeStorey || false |
||||
this.area = this.data.buildingData.area || 0 |
||||
this.details = this.data.buildingData.details || '' |
||||
} |
||||
|
||||
params = {companyId: sessionStorage.getItem('companyId')} |
||||
name:any; //name
|
||||
checked:boolean = false;//是否为避难层
|
||||
area:number; //面积
|
||||
details:string; //详情
|
||||
|
||||
//提交表单修改平面图
|
||||
onSubmit (e) { |
||||
if (!this.data.isBuilding) { //总平面图 修改平面图
|
||||
let data = { |
||||
companyId: sessionStorage.getItem('companyId'), |
||||
id: this.data.buildingData.id, |
||||
name: e.name, |
||||
cadUrl: this.data.buildingData.cadUrl, |
||||
imageUrl: this.data.buildingData.imageUrl, |
||||
imageAngle: this.data.buildingData.imageAngle, |
||||
order: this.data.buildingData.order, |
||||
area:e.area, |
||||
details:e.details, |
||||
enabled: this.data.buildingData.enabled, |
||||
modifiedTime: new Date(), |
||||
} |
||||
this.http.put(`/api/SitePlans/${this.data.buildingData.id}`,data).subscribe(data=>{ |
||||
this.dialogRef.close('总平面图'); |
||||
}) |
||||
} else { //建筑 修改楼层/区域
|
||||
let data = { |
||||
isRefugeStorey: e.isRefugeStorey, |
||||
buildingId: this.data.Panel.id, |
||||
id: this.data.buildingData.id, |
||||
name: e.name, |
||||
cadUrl: this.data.buildingData.cadUrl, |
||||
imageUrl: this.data.buildingData.imageUrl, |
||||
imageAngle: this.data.buildingData.imageAngle, |
||||
order: this.data.buildingData.order, |
||||
area:e.area, |
||||
details:e.details, |
||||
enabled: this.data.buildingData.enabled, |
||||
modifiedTime: new Date(), |
||||
} |
||||
this.http.put(`/api/BuildingAreas/${this.data.buildingData.id}`,data,{params:this.params}).subscribe(data=>{ |
||||
this.dialogRef.close('建筑'); |
||||
}) |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
} |
||||
|
||||
|
||||
|
||||
//创建 处置预案 节点
|
||||
@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<any>,@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<any>,@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); |
||||
}) |
||||
} |
||||
|
||||
} |
@ -0,0 +1,291 @@
|
||||
.matIcons { |
||||
color: #8E909F; |
||||
} |
||||
|
||||
|
||||
|
||||
//平面图 素材库 公共样式 头部 |
||||
.planarGraphHeader{ |
||||
height: 35px; |
||||
min-height: 35px; |
||||
cursor: pointer; |
||||
display: flex; |
||||
flex-direction: row; |
||||
align-items: center; |
||||
padding: 0 24px; |
||||
border-radius: 5px; |
||||
font-family: Roboto, "Helvetica Neue", sans-serif; |
||||
font-size: 15px; |
||||
font-weight: 400; |
||||
color: #000; |
||||
background: linear-gradient(to top,#cdced1,#FFF); |
||||
} |
||||
//平面图头部字体图标样式 |
||||
.hover { |
||||
width: 18px; |
||||
height: 18px; |
||||
margin-left: 90px; |
||||
border: 1px solid #999; |
||||
border-radius: 3px; |
||||
.mat-icon {font-size: 18px; color: #999;} |
||||
} |
||||
.hover:hover { |
||||
background-color: #4DA5FA; |
||||
.mat-icon {color: #fff;} |
||||
} |
||||
|
||||
//平面图 |
||||
.sitePlanContent { |
||||
position: relative; |
||||
width: 100%; |
||||
height: 35px; |
||||
line-height: 35px; |
||||
box-sizing: border-box; |
||||
padding: 0 10px 0 25px; |
||||
.mat-icon { |
||||
font-size: 20px; |
||||
} |
||||
} |
||||
|
||||
//火源/力量 图标 |
||||
.fireForce { |
||||
display: block; |
||||
float: right; |
||||
margin: 8px 5px 0 0; |
||||
width: 40px; |
||||
height: 20px; |
||||
line-height: 20px; |
||||
text-align: center; |
||||
position: relative; |
||||
overflow: hidden; |
||||
img{ |
||||
width: 20px; |
||||
height: 20px; |
||||
} |
||||
} |
||||
//替换底图 inputfile |
||||
.a-upload { |
||||
display: block; |
||||
float: right; |
||||
margin: 8px 18px 0 0; |
||||
width: 20px; |
||||
height: 20px; |
||||
line-height: 20px; |
||||
text-align: center; |
||||
position: relative; |
||||
overflow: hidden; |
||||
input { |
||||
position: absolute; |
||||
width: 20px; |
||||
height: 20px; |
||||
left: 0; |
||||
top: 0; |
||||
opacity: 0; |
||||
} |
||||
} |
||||
.a-upload:hover { |
||||
.mat-icon { |
||||
color: #fff; |
||||
} |
||||
} |
||||
//上传底图 inputfile |
||||
#a-uploadImg { |
||||
display: block; |
||||
width: 300px; |
||||
height: 170px; |
||||
position: fixed; |
||||
top: 40%; |
||||
left: 48%; |
||||
overflow: hidden; |
||||
border-radius: 5px; |
||||
border: 1px solid #999; |
||||
z-index: 999; |
||||
input { |
||||
position: absolute; |
||||
width: 300px; |
||||
height: 170px; |
||||
left: 0; |
||||
top: 0; |
||||
opacity: 0; |
||||
} |
||||
img { |
||||
width: 100%; |
||||
height: auto; |
||||
} |
||||
} |
||||
#a-uploadImg:hover { |
||||
border: 5px solid skyblue; |
||||
} |
||||
|
||||
//hover时显示右边操作栏 |
||||
.sitePlanContent:hover { |
||||
#rightOperate { |
||||
display: block; |
||||
} |
||||
} |
||||
//右边操作栏 |
||||
#rightOperate{ |
||||
width: 50px; |
||||
height: 100px; |
||||
position: absolute; |
||||
top: -32px; |
||||
right: -48px; |
||||
z-index: 99999; |
||||
border-radius: 0 100px 100px 0; |
||||
background-color: #F0F4F7; |
||||
// #F0F4F7 cdced1 |
||||
display: none; |
||||
.functionButton { |
||||
height: 25%; |
||||
line-height: 25px; |
||||
} |
||||
.bigFunctionIcon { |
||||
font-size: 24px; |
||||
} |
||||
.functionIcon { |
||||
color: #999; |
||||
} |
||||
.functionIcon:hover { |
||||
color: #4DA5FA; |
||||
} |
||||
} |
||||
|
||||
//处置预案 素材库 公用div |
||||
.publiclBankPlan { |
||||
flex: 1; |
||||
display: flex; |
||||
flex-direction: column; |
||||
overflow: hidden; |
||||
padding-bottom: 10px; |
||||
// border-top: 1px dashed #999; |
||||
} |
||||
|
||||
|
||||
|
||||
// 基本信息/想定作业 切换 |
||||
.scenarioAssignment { |
||||
overflow-y: auto; |
||||
} |
||||
.selectEditMode { |
||||
flex: 1; |
||||
display: flex; |
||||
flex-direction: column; |
||||
overflow: hidden; |
||||
} |
||||
.materialBankDIV{ |
||||
flex: 1; |
||||
overflow-x: hidden; |
||||
overflow-y: auto; |
||||
} |
||||
// 基本信息/想定作业 切换 |
||||
//处置预案 |
||||
#terrNodePublic { |
||||
height: 35px; |
||||
line-height: 35px; |
||||
display: flex; |
||||
.textNode {flex: 1;} |
||||
} |
||||
//字体图标 |
||||
.planIconDiv { |
||||
display: inline-block; |
||||
.mat-icon{ |
||||
font-size: 20px; |
||||
width: 20px; |
||||
height: 20px; |
||||
color: #666; |
||||
margin-right: 3px; |
||||
} |
||||
} |
||||
|
||||
|
||||
|
||||
.mat-expansion-panel-header { |
||||
height: 40px !important; |
||||
} |
||||
//素材库溢出隐藏 |
||||
#materialBank { |
||||
margin: 1px 0; |
||||
} |
||||
//素材库图片flex |
||||
#panelLibrary .text{ |
||||
box-sizing: border-box; |
||||
margin-left: 10px; |
||||
} |
||||
.panelLibraryFlex { |
||||
display: flex; |
||||
flex-direction: row; |
||||
flex-wrap: wrap; |
||||
justify-content: space-between; /* 水平居中 */ |
||||
.imgBox { |
||||
width: 70px; |
||||
height: 100px; |
||||
display: inline-block; |
||||
text-align: center; |
||||
border-radius: 3px; |
||||
margin: 5px 0; |
||||
img { |
||||
width: 70px; |
||||
height: auto; |
||||
max-height: 70px; |
||||
cursor:pointer; |
||||
} |
||||
p { |
||||
font-size: 12px; |
||||
cursor:pointer; |
||||
} |
||||
} |
||||
} |
||||
|
||||
//文本溢出 |
||||
.overflowText { |
||||
overflow: hidden; |
||||
text-overflow:ellipsis; |
||||
white-space: nowrap; |
||||
} |
||||
// 楼层/区域 是避难层时 |
||||
.isRefugeStorey { |
||||
color: #fff; |
||||
background-color: rgb(238, 186, 186); |
||||
} |
||||
//选中平面图时 |
||||
.selectSitePlan { |
||||
color: #fff; |
||||
background-color: #6BC2FF; |
||||
} |
||||
//选中素材库图片时 |
||||
.selectImg { |
||||
color: #fff; |
||||
background-color: #4DA5FA; |
||||
} |
||||
//选中 处置节点时 |
||||
.selectanelPoint { |
||||
background-color: #F4C235; |
||||
} |
||||
|
||||
|
||||
|
||||
//左侧功能区弹出框样式 |
||||
.keyMargin { |
||||
width: 100%; |
||||
margin: 5px 0; |
||||
.mat-form-field { |
||||
width: 100%; |
||||
} |
||||
} |
||||
.submitBottom { |
||||
display: flex; |
||||
flex-direction: row; |
||||
flex-wrap: wrap; |
||||
justify-content: space-between; /* 水平居中 */ |
||||
} |
||||
.functionalDomainContent { |
||||
width: 300px; |
||||
height: 100%; |
||||
textarea { |
||||
border-radius: 5px; |
||||
border: 1px solid #999; |
||||
width: 100%; |
||||
height: 120px; |
||||
resize:none; |
||||
} |
||||
} |
@ -0,0 +1,300 @@
|
||||
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<any>, |
||||
@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<any>, |
||||
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") |
||||
}) |
||||
}) |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,5 @@
|
||||
<div mat-dialog-title>处置节点保存</div> |
||||
<div style="display: flex;"> |
||||
<button mat-stroked-button style="margin-right: 5px;" (click)="saveType('new')">新建节点并保存</button> |
||||
<button mat-stroked-button (click)="saveType('old')">保存到已有节点</button> |
||||
</div> |
@ -0,0 +1,53 @@
|
||||
<div *ngIf="type == 'new'"> |
||||
<div mat-dialog-title>新增节点</div> |
||||
<div> |
||||
<form (ngSubmit)="onSubmit(form.value,'new')" #form="ngForm" class="example-container"> |
||||
|
||||
<div mat-dialog-content> |
||||
<mat-form-field> |
||||
<input type="text" matInput ngModel |
||||
required name="name" placeholder="节点名称" autocomplete="off"> |
||||
</mat-form-field> |
||||
</div> |
||||
<div mat-dialog-content> |
||||
<mat-form-field> |
||||
<mat-select [(value)]="allRootDisposalNode[0].name" required placeholder="父节点名称"> |
||||
<mat-option *ngFor="let item of allRootDisposalNode" [value]="item.name" (click)="clickNode(item)"> |
||||
{{item.name}} |
||||
</mat-option> |
||||
</mat-select> |
||||
</mat-form-field> |
||||
</div> |
||||
<div mat-dialog-actions> |
||||
<button mat-raised-button color="primary" type="submit" |
||||
[disabled]="!form.form.valid"> |
||||
确定 |
||||
</button> |
||||
<button mat-raised-button mat-dialog-close>取消</button> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
<div *ngIf="type == 'old'"> |
||||
<div mat-dialog-title>保存到已有节点</div> |
||||
<div> |
||||
<form (ngSubmit)="onSubmit(form.value,'old')" #form="ngForm" class="example-container"> |
||||
<div mat-dialog-content> |
||||
<mat-form-field> |
||||
<mat-select required ngModel placeholder="父节点名称" name="nodeId"> |
||||
<mat-option *ngFor="let item of allPlanDisposalNode" [value]="item.id" (click)="clickNode(item)"> |
||||
{{item.name}} |
||||
</mat-option> |
||||
</mat-select> |
||||
</mat-form-field> |
||||
</div> |
||||
<div mat-dialog-actions> |
||||
<button mat-raised-button color="primary" type="submit" |
||||
[disabled]="!form.form.valid"> |
||||
确定 |
||||
</button> |
||||
<button mat-raised-button mat-dialog-close>取消</button> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
</div> |
@ -0,0 +1,24 @@
|
||||
<div style="position: relative;width: 1400px;height: 800px;line-height: 800px;" class="swiper-container"> |
||||
<div style="position: absolute;right: -2px;top: -392px;cursor: pointer;z-index: 999;width: 24px;height: 24px;" (click)="closeDialog()"> |
||||
<span><mat-icon>clear</mat-icon></span> |
||||
</div> |
||||
|
||||
<div class="swiper-wrapper"> |
||||
<div class="swiper-slide" style="text-align: center;" *ngFor="let img of imagesArr"> |
||||
<img id="bigimg" (mousewheel)="zoomimg($event)" style=" |
||||
max-width: 96%; |
||||
max-height: 100%; |
||||
min-width: 1px; |
||||
min-height: 1px; |
||||
position: absolute; |
||||
top: 0; |
||||
left: 0; |
||||
bottom: 0; |
||||
right: 0; |
||||
margin: auto;" [src]="img.PropertyValue" alt=""> |
||||
</div> |
||||
</div> |
||||
<!-- 如果需要导航按钮 --> |
||||
<div class="swiper-button-next"></div> |
||||
<div class="swiper-button-prev"></div> |
||||
</div> |
Loading…
Reference in new issue