diff --git a/src/app/gis-management/fire-facilities/fire-facilities.component.html b/src/app/gis-management/fire-facilities/fire-facilities.component.html index 1bc4861..105ddd3 100644 --- a/src/app/gis-management/fire-facilities/fire-facilities.component.html +++ b/src/app/gis-management/fire-facilities/fire-facilities.component.html @@ -8,57 +8,61 @@ -->
-
- - - - - {{item.name}} - - -
-
-
- 项目:{{items.name}} -
-
- {{items.total ? items.total : '总数: 0'}} -
-
-
- 主要情况:{{items.details}} -
-
- 查看图片 - - -
-
-
- - - - - -
{{header}}{{body[header]? body[header] : '暂无数据'}}
-
-
-

楼层/区域名称: {{tableMsg.name? tableMsg.name: '暂无名称'}}

- - - - - -
{{header}}{{body[header]? body[header] : '暂无数据'}}
-
-
- -
- - - -
+
+ + + + + {{item.name}} + + +
+
+
+ 项目:{{items.name}} +
+
+ {{items.total ? items.total : '总数: 0'}} +
+
+
+ 主要情况:{{items.details}} +
+
+ 查看图片 + + +
+
+
+ + + + + +
{{header}}{{body[header]? body[header] : '暂无数据'}}
+
+
+

楼层/区域名称: {{tableMsg.name? tableMsg.name: + '暂无名称'}}

+ + + + + +
{{header}}{{body[header]? body[header] : '暂无数据'}}
+
+
+ +
+ + + +
-
- -
+
+ + \ No newline at end of file diff --git a/src/app/plan-audit/fire-facilities/fire-facilities.component.html b/src/app/plan-audit/fire-facilities/fire-facilities.component.html index a2aae13..3b17153 100644 --- a/src/app/plan-audit/fire-facilities/fire-facilities.component.html +++ b/src/app/plan-audit/fire-facilities/fire-facilities.component.html @@ -8,57 +8,58 @@ -->
-
- - - - - {{item.name}} - - -
-
-
- 项目:{{items.name}} -
-
- {{items.total ? items.total : '总数: 0'}} -
-
-
- 主要情况:{{items.details}} -
-
- 查看图片 - - -
-
-
- - - - - -
{{header}}{{body[header]? body[header] : '暂无数据'}}
-
-
-

楼层/区域名称: {{tableMsg.name? tableMsg.name: '暂无名称'}}

- - - - - -
{{header}}{{body[header]? body[header] : '暂无数据'}}
-
-
- -
- - - -
+
+ + + + + {{item.name}} + + +
+
+
+ 项目:{{items.name}} +
+
+ {{items.total ? items.total : '总数: 0'}} +
+
+
+ 主要情况:{{items.details}} +
+
+ 查看图片 + + +
+
+
+ + + + + +
{{header}}{{body[header]? body[header] : '暂无数据'}}
+
+
+

楼层/区域名称: {{tableMsg.name? tableMsg.name: + '暂无名称'}}

+ + + + + +
{{header}}{{body[header]? body[header] : '暂无数据'}}
+
+
+ +
+
-
- -
+
+ + \ No newline at end of file diff --git a/src/app/plan-audit/function-partition/function-partition.component.html b/src/app/plan-audit/function-partition/function-partition.component.html index ffe3698..a5ccca9 100644 --- a/src/app/plan-audit/function-partition/function-partition.component.html +++ b/src/app/plan-audit/function-partition/function-partition.component.html @@ -7,18 +7,18 @@ * @LastEditTime: 2020-11-25 18:41:18 -->
- - -
-
- - - + + +
+
+ + + 单位功能分区 - +
区域:{{item.region}} @@ -31,34 +31,33 @@
-
-
- -
- - - - - {{item.name}} - - - -
-
- 区域:{{item.region}} -
-
- 面积:{{item.area}} -
-
- 基本情况:{{item.details}} + +
+ +
+ + + + + {{item.name}} + + + +
+
+ 区域:{{i.region}} +
+
+ 面积:{{i.area}} +
+
+ 基本情况:{{i.details}} +
-
- - -
- -
+ + +
-
+
+
\ No newline at end of file diff --git a/src/app/plan-audit/function-partition/function-partition.component.ts b/src/app/plan-audit/function-partition/function-partition.component.ts index a5ccfd8..5fe38a9 100644 --- a/src/app/plan-audit/function-partition/function-partition.component.ts +++ b/src/app/plan-audit/function-partition/function-partition.component.ts @@ -2,7 +2,7 @@ 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 { Router,ActivatedRoute } from '@angular/router' +import { Router, ActivatedRoute } from '@angular/router' @Component({ selector: 'app-function-partition', @@ -11,7 +11,7 @@ import { Router,ActivatedRoute } from '@angular/router' }) export class FunctionPartitionComponent implements OnInit { - constructor(private router:Router,private route:ActivatedRoute,private http:HttpClient,public dialog: MatDialog,public snackBar: MatSnackBar) { } + constructor(private router: Router, private route: ActivatedRoute, private http: HttpClient, public dialog: MatDialog, public snackBar: MatSnackBar) { } ngOnInit(): void { this.companyId = this.unitId @@ -20,49 +20,54 @@ export class FunctionPartitionComponent implements OnInit { } displayedColumns: string[] = ['checked', 'region', 'measure', 'situation']; - unitId:any = sessionStorage.getItem('companyId') + unitId: any = sessionStorage.getItem('companyId') - companyId:any; //单位编号 - companyFunctionalZoning:any=[]; //所有单位功能分区属性 - selectFunctionalZoning:any=[]; //选中的单位功能分区属性 + companyId: any; //单位编号 + companyFunctionalZoning: any = []; //所有单位功能分区属性 + selectFunctionalZoning: any = []; //选中的单位功能分区属性 //获得所有单位功能分区属性 - getAllCompany () { + getAllCompany() { let companyId = this.unitId - this.http.get('/api/CompanyFunctionalDivisions',{params:{ - companyId:companyId - }}).subscribe((data:any)=>{ + this.http.get('/api/CompanyFunctionalDivisions', { + params: { + companyId: companyId + } + }).subscribe((data: any) => { this.companyFunctionalZoning = data + console.log(this.companyFunctionalZoning) this.selectFunctionalZoning = [] }) } //新建单位功能分区属性 - addCompany () { + addCompany() { let companyId = this.route.snapshot.queryParams.id - let data = {companyId:companyId, region:'', area:0, details:''} + let data = { companyId: companyId, region: '', area: 0, details: '' } this.companyFunctionalZoning.push(data) this.preservation() } //保存单位功能分区属性 - preservation () { + preservation() { let companyId = this.unitId if (this.companyFunctionalZoning.length) { - this.http.post('/api/CompanyFunctionalDivisions/Batch',this.companyFunctionalZoning,{params:{ - companyId:companyId - }}).subscribe(data=>{ + this.http.post('/api/CompanyFunctionalDivisions/Batch', this.companyFunctionalZoning, { + params: { + companyId: companyId + } + }).subscribe(data => { this.getAllCompany() const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('数据更新成功','确定',config); + this.snackBar.open('数据更新成功', '确定', config); }) } } //单位功能分区checked选择 - changeCompany (ele,e) { + changeCompany(ele, e) { if (e.checked) { this.selectFunctionalZoning.push(ele.id) } else { @@ -71,23 +76,26 @@ export class FunctionPartitionComponent implements OnInit { } //删除单位功能分区属性 - delete () { + delete() { let companyId = this.unitId if (this.selectFunctionalZoning.length) { let isDelete = confirm('您确定要删除吗') if (isDelete) { - this.http.post('/api/CompanyFunctionalDivisions/Batch',this.companyFunctionalZoning,{params:{ - companyId:companyId - }}).subscribe(data=>{ + this.http.post('/api/CompanyFunctionalDivisions/Batch', this.companyFunctionalZoning, { + params: { + companyId: companyId + } + }).subscribe(data => { const options = { - headers: new HttpHeaders({'Content-Type': 'application/json',}), - body:this.selectFunctionalZoning} - this.http.delete(`/api/CompanyFunctionalDivisions/Batch`,options).subscribe(data=>{ + headers: new HttpHeaders({ 'Content-Type': 'application/json', }), + body: this.selectFunctionalZoning + } + this.http.delete(`/api/CompanyFunctionalDivisions/Batch`, options).subscribe(data => { this.getAllCompany() const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('数据更新成功','确定',config); + this.snackBar.open('数据更新成功', '确定', config); }) }) } @@ -95,7 +103,7 @@ export class FunctionPartitionComponent implements OnInit { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('请选择单位功能分区','确定',config); + this.snackBar.open('请选择单位功能分区', '确定', config); } } @@ -104,16 +112,18 @@ export class FunctionPartitionComponent implements OnInit { //建筑功能分区↓ - allBuilding:any = []; //所有建筑 - allBuildingFunctionalZoning:any = []; //所有建筑的功能分区 - selectBuildingFunctionalZoning:any = []; //选中的建筑的功能分区 + allBuilding: any = []; //所有建筑 + allBuildingFunctionalZoning: any = []; //所有建筑的功能分区 + selectBuildingFunctionalZoning: any = []; //选中的建筑的功能分区 //获得所有建筑 - getAllBuilding () { + getAllBuilding() { let companyId = this.unitId - this.http.get(`/api/Buildings`,{params:{ - companyId:companyId - }}).subscribe((data:any)=>{ + this.http.get(`/api/Buildings`, { + params: { + companyId: companyId + } + }).subscribe((data: any) => { if (data.length) { this.allBuilding = data this.allBuilding.forEach(element => { //为每个建筑添加一个 功能分区对象 @@ -125,55 +135,57 @@ export class FunctionPartitionComponent implements OnInit { } //获得所有建筑的功能分区 - getAllBuildingFunctionalZoning () { + getAllBuildingFunctionalZoning() { this.selectBuildingFunctionalZoning = [] this.allBuildingFunctionalZoning = [] this.allBuilding.forEach(element => { - let data={buildingId: element.id} - this.http.get(`/api/BuildingFunctionalDivisions`,{params:data}).subscribe((data:any)=>{ + let data = { buildingId: element.id } + this.http.get(`/api/BuildingFunctionalDivisions`, { params: data }).subscribe((data: any) => { if (data.length) { element.functionalZoning = data this.selectBuildingFunctionalZoning.push([]) //拥有建筑功能分区的提前push空数组 - this.allBuildingFunctionalZoning.push(element) } + this.allBuildingFunctionalZoning.push(element) + } }) }); + console.log(this.allBuilding) } //封装函数刷新当前建筑功能分区 - updateCurrent (e,index) { - let data= {buildingId: e.id} - this.http.get(`/api/BuildingFunctionalDivisions`,{params:data}).subscribe((data:any)=>{ + updateCurrent(e, index) { + let data = { buildingId: e.id } + this.http.get(`/api/BuildingFunctionalDivisions`, { params: data }).subscribe((data: any) => { this.selectBuildingFunctionalZoning[index] = [] this.allBuildingFunctionalZoning[index].functionalZoning = data const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('数据更新成功','确定',config); + this.snackBar.open('数据更新成功', '确定', config); }) } //创建建筑功能分区 - addPartition () { + addPartition() { } //创建建筑功能分区属性 - addBuilding (e,index) { - let data = {buildingId:e.id, region:'', area:0, details:''} - this.http.post('/api/BuildingFunctionalDivisions',data).subscribe(data=>{ - this.preservationBuilding(e,index) + addBuilding(e, index) { + let data = { buildingId: e.id, region: '', area: 0, details: '' } + this.http.post('/api/BuildingFunctionalDivisions', data).subscribe(data => { + this.preservationBuilding(e, index) }) } //保存建筑功能分区属性 - preservationBuilding (e,index) { - let data ={buildingId:e.id} - this.http.post(`/api/BuildingFunctionalDivisions/Batch`,this.allBuildingFunctionalZoning[index].functionalZoning,{params:data}).subscribe(data=>{ - this.updateCurrent(e,index) + preservationBuilding(e, index) { + let data = { buildingId: e.id } + this.http.post(`/api/BuildingFunctionalDivisions/Batch`, this.allBuildingFunctionalZoning[index].functionalZoning, { params: data }).subscribe(data => { + this.updateCurrent(e, index) }) } //建筑功能分区checked选择 - changeBuilding (ele,e,index) { + changeBuilding(ele, e, index) { if (e.checked) { this.selectBuildingFunctionalZoning[index].push(ele.id) } else { @@ -182,25 +194,27 @@ export class FunctionPartitionComponent implements OnInit { } //删除建筑功能分区 - deleteBuilding (e,index) { + deleteBuilding(e, index) { if (this.selectBuildingFunctionalZoning[index].length) { let isDelete = confirm('您确定要删除吗') if (isDelete) { - let data ={buildingId:e.id} - this.http.post(`/api/BuildingFunctionalDivisions/Batch`,this.allBuildingFunctionalZoning[index].functionalZoning,{params:data}).subscribe(data=>{ + let data = { buildingId: e.id } + this.http.post(`/api/BuildingFunctionalDivisions/Batch`, this.allBuildingFunctionalZoning[index].functionalZoning, { params: data }).subscribe(data => { const options = { - headers: new HttpHeaders({'Content-Type': 'application/json',}), - body:this.selectBuildingFunctionalZoning[index], - params:{buildingId:e.id}} - this.http.delete(`/api/BuildingFunctionalDivisions/Batch`,options).subscribe(data=>{ - this.selectBuildingFunctionalZoning[index].forEach((element,newIndex) => { - this.allBuildingFunctionalZoning[index].functionalZoning.splice(this.allBuildingFunctionalZoning[index].functionalZoning.findIndex(item=>item.id==element),1) - if (newIndex==this.selectBuildingFunctionalZoning[index].length-1) { + headers: new HttpHeaders({ 'Content-Type': 'application/json', }), + body: this.selectBuildingFunctionalZoning[index], + params: { buildingId: e.id } + } + this.http.delete(`/api/BuildingFunctionalDivisions/Batch`, options).subscribe(data => { + this.selectBuildingFunctionalZoning[index].forEach((element, newIndex) => { + this.allBuildingFunctionalZoning[index].functionalZoning.splice(this.allBuildingFunctionalZoning[index].functionalZoning.findIndex(item => item.id == element), 1) + if (newIndex == this.selectBuildingFunctionalZoning[index].length - 1) { if (this.allBuildingFunctionalZoning[index].functionalZoning.length) { - this.updateCurrent(e,index) + this.updateCurrent(e, index) } else { - this.selectBuildingFunctionalZoning.splice(index,1) - this.allBuildingFunctionalZoning.splice(index,1)} + this.selectBuildingFunctionalZoning.splice(index, 1) + this.allBuildingFunctionalZoning.splice(index, 1) + } } }); @@ -212,7 +226,7 @@ export class FunctionPartitionComponent implements OnInit { const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('请选择建筑功能分区','确定',config); + this.snackBar.open('请选择建筑功能分区', '确定', config); } } diff --git a/src/app/plan-audit/plan-list/plan-list.component.html b/src/app/plan-audit/plan-list/plan-list.component.html index fd814a3..c9b1b55 100644 --- a/src/app/plan-audit/plan-list/plan-list.component.html +++ b/src/app/plan-audit/plan-list/plan-list.component.html @@ -1,45 +1,51 @@
-
- - - - - 总平面图 - - -
-
-
- -
-

{{item.name}}

+
+ + + + + 总平面图 + + +
+
+
+ +
+

{{item.name}}

+
+
+
+
+
+
+
+ + + + + {{item.name}} + + + +
+
+
+
+

{{i.name}}

- - +
+
+
+
-
-
- - - - - {{item.name}} - - - -
-
-
- -
-

{{i.name}}

-
-
-
-
-
-
-
- +
+
\ No newline at end of file diff --git a/src/app/plan-audit/plan-list/plan-list.component.ts b/src/app/plan-audit/plan-list/plan-list.component.ts index 0c76f51..e000056 100644 --- a/src/app/plan-audit/plan-list/plan-list.component.ts +++ b/src/app/plan-audit/plan-list/plan-list.component.ts @@ -35,6 +35,7 @@ export class PlanListComponent implements OnInit { }) }) this.allBuildings = data + console.log('所有的建筑物',this.allBuildings) }) } //获取总平面图 @@ -44,6 +45,7 @@ export class PlanListComponent implements OnInit { this.http.get('/api/SitePlans',{params:params}).subscribe(data=>{ this.sitePlanItems = data }) + console.log('总平面图',this.sitePlanItems) } //打开采集工具 openPlan(item,index){ diff --git a/src/app/plan-audit/plan-record/plan-record.component.html b/src/app/plan-audit/plan-record/plan-record.component.html index 3e17754..20e1890 100644 --- a/src/app/plan-audit/plan-record/plan-record.component.html +++ b/src/app/plan-audit/plan-record/plan-record.component.html @@ -159,7 +159,7 @@ - +