diff --git a/src/app/ui/collection-tools/collection-tools.component.html b/src/app/ui/collection-tools/collection-tools.component.html index d82aacb..b4b0f33 100644 --- a/src/app/ui/collection-tools/collection-tools.component.html +++ b/src/app/ui/collection-tools/collection-tools.component.html @@ -104,12 +104,14 @@
- + delete_forever -
--> + diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts index e9162b1..14767a2 100644 --- a/src/app/ui/collection-tools/collection-tools.component.ts +++ b/src/app/ui/collection-tools/collection-tools.component.ts @@ -2306,9 +2306,10 @@ export class CollectionToolsComponent implements OnInit { //删除 处置预案 节点 deletePanelPoint(e, item) { + console.log(item) e.stopPropagation(); if (confirm(`确定要删除 ${item.name} ?`)) { - this.http.delete(`/api/DisposalNodes/${item.id}`).subscribe((data) => { + this.http.delete(`/api/ExamDisposalNodes/${item.id}`).subscribe((data) => { this.refurbishTreeData(); }); } diff --git a/src/app/ui/collection-tools/leftFunctionalDomain.ts b/src/app/ui/collection-tools/leftFunctionalDomain.ts index 2a039d0..e8b7abd 100644 --- a/src/app/ui/collection-tools/leftFunctionalDomain.ts +++ b/src/app/ui/collection-tools/leftFunctionalDomain.ts @@ -1,45 +1,49 @@ -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 { 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', - templateUrl: './addPlaneFigure.html', - styleUrls: ['./panel.scss'] + selector: "app-leftFunctionalDomain", + templateUrl: "./addPlaneFigure.html", + styleUrls: ["./panel.scss"], }) export class leftFunctionalDomainComponent implements OnInit { - constructor( private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data) { } + @Inject(MAT_DIALOG_DATA) public data + ) {} - ngOnInit(): void { + ngOnInit(): void {} - } - - params = { companyId: sessionStorage.getItem('companyId') } - checked: boolean = false;//是否为避难层 + params = { companyId: sessionStorage.getItem("companyId") }; + checked: boolean = false; //是否为避难层 //提交表单创建平面图 onSubmit(e) { - if (!this.data.isBuilding) { //总平面图 创建平面图 + if (!this.data.isBuilding) { + //总平面图 创建平面图 let data = { - companyId: sessionStorage.getItem('companyId'), + 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 { //建筑 创建楼层/区域 + }; + this.http.post("/api/SitePlans", data).subscribe((data) => { + this.dialogRef.close("总平面图"); + }); + } else { + //建筑 创建楼层/区域 let data = { isRefugeStorey: e.isRefugeStorey, buildingId: this.data.Panel.id, @@ -49,45 +53,50 @@ export class leftFunctionalDomainComponent implements OnInit { details: e.details, enabled: true, modifiedTime: new Date(), - } - this.http.post('/api/BuildingAreas', data, { params: this.params }).subscribe(data => { - this.dialogRef.close('建筑'); - }) + }; + this.http + .post("/api/BuildingAreas", data, { params: this.params }) + .subscribe((data) => { + this.dialogRef.close("建筑"); + }); } } - - - } //编辑平面图 楼层/区域 @Component({ - selector: 'app-editPlaneFigure', - templateUrl: './editPlaneFigure.html', - styleUrls: ['./panel.scss'] + selector: "app-editPlaneFigure", + templateUrl: "./editPlaneFigure.html", + styleUrls: ["./panel.scss"], }) export class editPlaneFigureComponent implements OnInit { - - constructor(private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data) { } + constructor( + private http: HttpClient, + public dialog: MatDialog, + public snackBar: MatSnackBar, + public dialogRef: MatDialogRef, + @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 || '' + 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') } + params = { companyId: sessionStorage.getItem("companyId") }; name: any; //name - checked: boolean = false;//是否为避难层 + checked: boolean = false; //是否为避难层 area: number; //面积 details: string; //详情 //提交表单修改平面图 onSubmit(e) { - if (!this.data.isBuilding) { //总平面图 修改平面图 + if (!this.data.isBuilding) { + //总平面图 修改平面图 let data = { - companyId: sessionStorage.getItem('companyId'), + companyId: sessionStorage.getItem("companyId"), id: this.data.buildingData.id, name: e.name, cadUrl: this.data.buildingData.cadUrl, @@ -98,11 +107,14 @@ export class editPlaneFigureComponent implements OnInit { 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 { //建筑 修改楼层/区域 + }; + 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, @@ -116,65 +128,72 @@ export class editPlaneFigureComponent implements OnInit { 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('建筑'); - }) + }; + this.http + .put(`/api/BuildingAreas/${this.data.buildingData.id}`, data, { + params: this.params, + }) + .subscribe((data) => { + this.dialogRef.close("建筑"); + }); } } - - - } - - //创建 处置预案 节点 @Component({ - selector: 'app-addDisposalNode', - templateUrl: './addDisposalNode.html', - styleUrls: ['./panel.scss'] + selector: "app-addDisposalNode", + templateUrl: "./addDisposalNode.html", + styleUrls: ["./panel.scss"], }) export class addDisposalNodeComponent implements OnInit { + constructor( + private http: HttpClient, + public dialog: MatDialog, + public snackBar: MatSnackBar, + public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data + ) {} - constructor(private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data) { } - - ngOnInit(): void { - } + ngOnInit(): void {} //提交表单 onSubmit(e) { - this.data.name = e.name - this.http.post('/api/DisposalNodes', this.data).subscribe(data => { - this.dialogRef.close('success'); - }) + this.data.name = e.name; + this.http.post("/api/DisposalNodes", this.data).subscribe((data) => { + this.dialogRef.close("success"); + }); } - } - - //编辑 处置预案 节点 @Component({ - selector: 'app-editDisposalNode', - templateUrl: './editDisposalNode.html', - styleUrls: ['./panel.scss'] + selector: "app-editDisposalNode", + templateUrl: "./editDisposalNode.html", + styleUrls: ["./panel.scss"], }) export class editDisposalNodeComponent implements OnInit { - - constructor(private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar, public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data) { } + 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 || '')) + console.log(666, this.data); + 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); - }) + this.data.name = e.name; + this.http + .put(`/api/ExamDisposalNodes/${this.data.id}`, this.data) + .subscribe((data) => { + this.dialogRef.close(e.name); + }); } - -} \ No newline at end of file +}