Browse Source

[完善]修改测试出的bug

zhuzhou
邵佳豪 4 years ago
parent
commit
088f3299cb
  1. 11
      src/app/data-collection/fire-force/fire-force.component.ts
  2. 1
      src/app/data-collection/linkage-forces/linkage-forces.component.ts
  3. 1
      src/app/data-collection/water-collection/water-collection.component.html
  4. 10
      src/app/data-collection/water-collection/water-collection.component.ts
  5. 3
      src/app/gis-management/gis-labeling/gis-labeling.component.html
  6. 22
      src/app/gis-management/gis-labeling/gis-labeling.component.ts

11
src/app/data-collection/fire-force/fire-force.component.ts

@ -543,7 +543,7 @@ export class FireForceComponent implements OnInit {
//新增消防力量 //新增消防力量
selectedFireForceTypeIndex:any//新增消防力量名称 selectedFireForceTypeIndex:any//新增消防力量名称
addFireForce(){ addFireForce(){
if(this.selectedFireForceId){ if(this.selectedFireForceId && this.selectedFireForce.forceType == 0){
const dialogRef = this.dialog.open(AddFireForce, { const dialogRef = this.dialog.open(AddFireForce, {
data: {}, data: {},
id:'addWater' id:'addWater'
@ -563,7 +563,12 @@ export class FireForceComponent implements OnInit {
} }
} }
); );
}else{ }else if(this.selectedFireForceId && this.selectedFireForce.forceType != 0){
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('该选中机构无法增加其他机构','确定',config);
} else{
let config = new MatSnackBarConfig(); let config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
@ -586,7 +591,6 @@ export class FireForceComponent implements OnInit {
// console.log('删除原文件成功') // console.log('删除原文件成功')
}) })
}); });
} }
this.FireForceDetailInfo.jurisdictionArea = Number(this.FireForceDetailInfo.jurisdictionArea) this.FireForceDetailInfo.jurisdictionArea = Number(this.FireForceDetailInfo.jurisdictionArea)
this.FireForceDetailInfo.relevantInfomationData = JSON.stringify(this.AttachmentArr) this.FireForceDetailInfo.relevantInfomationData = JSON.stringify(this.AttachmentArr)
@ -724,6 +728,7 @@ export class FireForceComponent implements OnInit {
this.selectedFireForceLevel = null this.selectedFireForceLevel = null
this.selectedFireForceId = null this.selectedFireForceId = null
this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null
this.isGisTopBox = false
} }
map:any map:any
placeSearch:any//构造地点查询类 placeSearch:any//构造地点查询类

1
src/app/data-collection/linkage-forces/linkage-forces.component.ts

@ -496,6 +496,7 @@ export class LinkageForcesComponent implements OnInit {
close(){ close(){
this.LinkageForceDetailInfo={} this.LinkageForceDetailInfo={}
this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null
this.isGisTopBox = false
} }
map:any map:any
placeSearch:any//构造地点查询类 placeSearch:any//构造地点查询类

1
src/app/data-collection/water-collection/water-collection.component.html

@ -6,6 +6,7 @@
<mat-slide-toggle color="primary" (change)='slideChange($event)' checked labelPosition='before'>列表过滤</mat-slide-toggle> <mat-slide-toggle color="primary" (change)='slideChange($event)' checked labelPosition='before'>列表过滤</mat-slide-toggle>
</div> </div>
<div> <div>
<button (click)="reset()" style="width: 68px;margin-right: 12px;" mat-flat-button color="primary">重置</button>
<button (click)="addWater()" style="width: 68px;" mat-flat-button color="primary">新增</button> <button (click)="addWater()" style="width: 68px;" mat-flat-button color="primary">新增</button>
</div> </div>
</div> </div>

10
src/app/data-collection/water-collection/water-collection.component.ts

@ -386,6 +386,15 @@ export class WaterCollectionComponent implements OnInit {
{PropertyName :'备注',PropertyValue:''} {PropertyName :'备注',PropertyValue:''}
] ]
} }
//重置搜索
reset(){
this.searchForm = {
name:'',
integrityNum:''
}
this.getAllWaterData()
}
//新增水源 //新增水源
selectedWaterTypeIndex:any//新增水源类型 selectedWaterTypeIndex:any//新增水源类型
addWater(){ addWater(){
@ -493,6 +502,7 @@ export class WaterCollectionComponent implements OnInit {
this.selectedWaterTypeIndex = null this.selectedWaterTypeIndex = null
this.selectedLiIndex = null this.selectedLiIndex = null
this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null
this.isGisTopBox = false
} }
map:any map:any
placeSearch:any//构造地点查询类 placeSearch:any//构造地点查询类

3
src/app/gis-management/gis-labeling/gis-labeling.component.html

@ -6,7 +6,8 @@
<div class="searchInput"> <div class="searchInput">
<div style="height: 36px; overflow: hidden; position: relative;"> <div style="height: 36px; overflow: hidden; position: relative;">
<input type="text" [(ngModel)]="searchText" placeholder="请输入地址"> <input type="text" [(ngModel)]="searchText" placeholder="请输入地址">
<label class="clearIcon" title="清除" (click)='clear()' *ngIf="searchText || allCompany.length">×</label> <!-- *ngIf="searchText || allCompany.length" -->
<label class="clearIcon" title="清除" (click)='clear()'>×</label>
<button (click)='search()'><mat-icon>search</mat-icon></button> <button (click)='search()'><mat-icon>search</mat-icon></button>
</div> </div>
<div class="searchDataDiv"> <div class="searchDataDiv">

22
src/app/gis-management/gis-labeling/gis-labeling.component.ts

@ -149,11 +149,6 @@ export class GisLabelingComponent implements OnInit {
this.http.get("/api/Companies",{params:paramsdata}).subscribe((data:any) => { this.http.get("/api/Companies",{params:paramsdata}).subscribe((data:any) => {
this.createUnitMarker(data.items) this.createUnitMarker(data.items)
}) })
}else if(!this.mapPattern){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请切换2D模式使用此功能','确定',config);
}else{ }else{
this.circle.setRadius(Number(this.unitAreaDefault)) this.circle.setRadius(Number(this.unitAreaDefault))
this.circle.setCenter(this.markers[0]._position) this.circle.setCenter(this.markers[0]._position)
@ -355,7 +350,6 @@ export class GisLabelingComponent implements OnInit {
WaterSourceTypes : this.selectedWaterList WaterSourceTypes : this.selectedWaterList
} }
this.http.get("/api/WaterSources",{params:paramsdata}).subscribe((data:any) => { this.http.get("/api/WaterSources",{params:paramsdata}).subscribe((data:any) => {
console.log('所有水源',data)
this.createwaterMarker(data.items) this.createwaterMarker(data.items)
}) })
}else{ }else{
@ -364,11 +358,6 @@ export class GisLabelingComponent implements OnInit {
config.duration = 3000 config.duration = 3000
this.snackBar.open('请勾选想要显示的水源类型','确定',config); this.snackBar.open('请勾选想要显示的水源类型','确定',config);
} }
}else if(!this.mapPattern){
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('请切换2D模式使用此功能','确定',config);
}else{ }else{
this.circleofwater.setRadius(Number(this.waterAreaDefault)) this.circleofwater.setRadius(Number(this.waterAreaDefault))
this.circleofwater.setCenter(this.markers[0]._position) this.circleofwater.setCenter(this.markers[0]._position)
@ -391,7 +380,6 @@ export class GisLabelingComponent implements OnInit {
WaterSourceTypes : this.selectedWaterList WaterSourceTypes : this.selectedWaterList
} }
this.http.get("/api/WaterSources",{params:paramsdata}).subscribe((data:any) => { this.http.get("/api/WaterSources",{params:paramsdata}).subscribe((data:any) => {
console.log('所有水源',data)
this.createwaterMarker(data.items) this.createwaterMarker(data.items)
}) })
}else{ }else{
@ -411,7 +399,6 @@ export class GisLabelingComponent implements OnInit {
WaterSourceTypes :this.selectedWaterList WaterSourceTypes :this.selectedWaterList
} }
this.http.get("/api/WaterSources",{params:paramsdata}).subscribe((data:any) => { this.http.get("/api/WaterSources",{params:paramsdata}).subscribe((data:any) => {
console.log('所有水源',data)
this.createwaterMarker(data.items) this.createwaterMarker(data.items)
}) })
}else{ }else{
@ -426,9 +413,7 @@ export class GisLabelingComponent implements OnInit {
//取消显示水源 //取消显示水源
resetWater(){ resetWater(){
this.watertForm.reset() this.watertForm.reset()
this.watertForm.controls.areaWater.setValue('-1') this.watertForm.controls.areaWater.setValue('-1')
this.map.remove(this.circleofwater) this.map.remove(this.circleofwater)
this.waterCluster.setData([]) this.waterCluster.setData([])
} }
@ -574,6 +559,8 @@ export class GisLabelingComponent implements OnInit {
//地图2D 3D切换 //地图2D 3D切换
mapPattern:boolean = true//默认是2D mapPattern:boolean = true//默认是2D
mapPatternChange(type){ mapPatternChange(type){
this.unitCluster = null
this.waterCluster = null
if(type == '2D'){ if(type == '2D'){
this.mapPattern = true this.mapPattern = true
var layer = new AMap.createDefaultLayer({ var layer = new AMap.createDefaultLayer({
@ -586,7 +573,9 @@ export class GisLabelingComponent implements OnInit {
this.map = new AMap.Map('map',{ this.map = new AMap.Map('map',{
layers:[layer], //当只想显示标准图层时layers属性可缺省, layers:[layer], //当只想显示标准图层时layers属性可缺省,
}); });
this.map.setCity('上海市');
}else{ }else{
this.unitCluster ? this.unitCluster.setData([]) : null
this.mapPattern = false this.mapPattern = false
this.map = new AMap.Map('map',{ this.map = new AMap.Map('map',{
viewMode: '3D', viewMode: '3D',
@ -595,6 +584,7 @@ export class GisLabelingComponent implements OnInit {
features: ['bg', 'road', 'point','building'], features: ['bg', 'road', 'point','building'],
mapStyle: 'amap://styles/light', mapStyle: 'amap://styles/light',
}); });
this.map.setCity('上海市');
} }
this.satelliteModel = false this.satelliteModel = false
this.loadModel = false this.loadModel = false
@ -738,6 +728,8 @@ export class GisLabelingComponent implements OnInit {
clear () { clear () {
this.allCompany = [] this.allCompany = []
this.searchText = '' this.searchText = ''
this.markers ? this.markers.forEach((element,index) => { this.map.remove(element);}) : null
this.infoWindow ? this.map.remove(this.infoWindow) : null
} }
selectedUnit:any//当前打开的单位 selectedUnit:any//当前打开的单位

Loading…
Cancel
Save