chenjingyu 4 years ago
parent
commit
58292d1aa0
  1. 25
      src/app/canvas-share-data.service.ts
  2. 2
      src/app/data-collection/fire-force/fire-force.component.ts
  3. 81
      src/app/gis-management/gis-labeling/gis-labeling.component.html
  4. 2
      src/app/gis-management/gis-labeling/gis-labeling.component.scss
  5. 421
      src/app/gis-management/gis-labeling/gis-labeling.component.ts
  6. 2
      src/app/key-unit/edit-plan-info/edit-plan-info.component.html
  7. 2
      src/app/key-unit/edit-unit-info/edit-unit-info.component.html
  8. 111
      src/app/key-unit/fire-fighting-device/fire-fighting-device.component.html
  9. 262
      src/app/key-unit/fire-fighting-device/fire-fighting-device.component.ts
  10. 5
      src/app/key-unit/key-site/key-site.component.html
  11. 30
      src/app/key-unit/key-site/key-site.component.scss
  12. 52
      src/app/key-unit/key-site/key-site.component.ts
  13. 9
      src/app/key-unit/key-site/keysiteimgs.component.html
  14. 47
      src/app/key-unit/key-site/keysiteimgs.component.ts
  15. 6
      src/app/key-unit/realistic-picture-look/realistic-picture.component.html
  16. 7
      src/app/key-unit/realistic-picture-look/realistic-picture.component.scss
  17. 30
      src/app/key-unit/realistic-picture-look/realistic-picture.component.ts
  18. 8
      src/app/key-unit/realistic-picture/realistic-picture.component.html
  19. 7
      src/app/key-unit/realistic-picture/realistic-picture.component.scss
  20. 53
      src/app/key-unit/realistic-picture/realistic-picture.component.ts
  21. 2
      src/app/key-unit/view-unit-details-plan/view-unit-details-plan.component.html
  22. 2
      src/app/key-unit/view-unit-details/view-unit-details.component.html
  23. 69
      src/app/key-unit/water-road/water-road.component.ts
  24. 31
      src/app/statistic-analysis/home/home.component.html
  25. 8
      src/app/statistic-analysis/home/home.component.scss
  26. 10
      src/app/statistic-analysis/home/home.component.ts
  27. 11
      src/app/ui/collection-tools-building/collection-tools.component.ts
  28. 10
      src/app/ui/collection-tools-plan/collection-tools.component.ts
  29. 11
      src/app/ui/collection-tools/collection-tools.component.ts
  30. 3
      src/app/working-area/model/axLegend.ts
  31. 36
      src/app/working-area/working-area.component.ts
  32. 1
      src/assets/css/newStyle.css
  33. BIN
      src/assets/images/消防力量.png
  34. BIN
      src/assets/images/联动力量.png

25
src/app/canvas-share-data.service.ts

@ -23,24 +23,29 @@ export class CanvasShareDataService {
selectTemplateData: any; // 选择当前 模板数据 selectTemplateData: any; // 选择当前 模板数据
// 总平面图/建筑 楼层 // 总平面图/建筑 楼层
selectStorey:any = {area: '', details: ''}; // 选择当前 楼层 数据 selectStorey: any = { area: '', details: '' }; // 选择当前 楼层 数据
originalcompanyBuildingData:any; // 单位/建筑 数据 originalcompanyBuildingData: any; // 单位/建筑 数据
originaleveryStoreyData:any; // 总平面图/楼层/区域 楼层数据 originaleveryStoreyData: any; // 总平面图/楼层/区域 楼层数据
// 总平面图/建筑 楼层 // 总平面图/建筑 楼层
// 处置 节点 // 处置 节点
allDisposalNode:any = []; // 所有 处置节点 allDisposalNode: any = []; // 所有 处置节点
allNodeMarkers:any = { highlightMarkers:{}, markers:{} }; // 灾情 标签信息 allNodeMarkers: any = { highlightMarkers: {}, markers: {} }; // 灾情 标签信息
selectPanelPoint:DisposalNodeData = new DisposalNodeData(); // 当前数据节点 selectPanelPoint: DisposalNodeData = new DisposalNodeData(); // 当前数据节点
selectPanelPointBaseData:any = {description: '', notes: '', weather: '', airTemperature: '', windDirection: '', windScale: ''}; // 当前 数据节点 对应 父级节点 selectPanelPointBaseData: any = { description: '', notes: '', weather: '', airTemperature: '', windDirection: '', windScale: '' }; // 当前 数据节点 对应 父级节点
isInheritSky:any; //缓存 节点 天气 isInheritSky:any; //缓存 节点 天气
customizeDisposalNode:any; // 新建 自定义数据节点 底图+名称 customizeDisposalNode: any; // 新建 自定义数据节点 底图+名称
// 处置 节点 // 处置 节点
/** /**
* *
*/ */
gameMode:GameMode = GameMode.BasicInformation; gameMode: GameMode = GameMode.BasicInformation;
facilityAssetsName = new Map<string, string>([ facilityAssetsName = new Map<string, string>([
['消防水池', '消防水池'], ['消防水池', '消防水池'],
@ -263,6 +268,7 @@ export class CanvasShareDataService {
important.Id = ''; important.Id = '';
important.ImageUrls = []; important.ImageUrls = [];
important.BuildingId = this.selectStorey.buildingId; important.BuildingId = this.selectStorey.buildingId;
important.BuildingAreaId = item.FloorId;
item.PropertyInfos.forEach(element => { item.PropertyInfos.forEach(element => {
if (element.PropertyName === '名称/编号') { if (element.PropertyName === '名称/编号') {
important.Name = element.PropertyValue; important.Name = element.PropertyValue;
@ -409,6 +415,7 @@ export class BuildingAdjoinInfo {
*/ */
export class BuildingImportantLocationInfo { export class BuildingImportantLocationInfo {
public BuildingId: string; public BuildingId: string;
public BuildingAreaId: string;
public Id: string; public Id: string;
public Name: string; public Name: string;
public Position: string; public Position: string;

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

@ -913,8 +913,6 @@ export class FireForceComponent implements OnInit {
} }
//上传附件 //上传附件
file:any; //上传的文件 file:any; //上传的文件
AttachmentArr:any = []//上传附件地址集合 AttachmentArr:any = []//上传附件地址集合

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

@ -99,7 +99,6 @@
<div class="contantbox"> <div class="contantbox">
<div *ngIf="selectedTitle == 0" class="keyUnitBox"> <div *ngIf="selectedTitle == 0" class="keyUnitBox">
<form [formGroup]="keyUnitForm" class="inputList" (submit)='ketUnitSubmit(keyUnitForm.value)'> <form [formGroup]="keyUnitForm" class="inputList" (submit)='ketUnitSubmit(keyUnitForm.value)'>
<div style="display: flex;justify-content: space-between;align-items: center;"> <div style="display: flex;justify-content: space-between;align-items: center;">
<mat-checkbox color="primary" formControlName="allSelectedUnit" (change)="selectedAllUnit($event)">全选</mat-checkbox> <mat-checkbox color="primary" formControlName="allSelectedUnit" (change)="selectedAllUnit($event)">全选</mat-checkbox>
@ -173,14 +172,88 @@
</form> </form>
</div> </div>
<div *ngIf="selectedTitle == 2" class="distanceBox"> <div *ngIf="selectedTitle == 2" class="fireForceBox">
<form [formGroup]="fireForceForm" class="inputList" (submit)='fireForceSubmit(fireForceForm.value)'>
<div style="display: flex;justify-content: space-between;align-items: center;">
<mat-checkbox color="primary" formControlName="allSelectedFireForce" (change)="selectedAllFireForce($event)">全选</mat-checkbox>
<mat-icon (click)="closertdiv()">clear</mat-icon>
</div>
<div class="inputItem">
<mat-checkbox *ngFor="let fire of fireForce.controls;let i = index" color="primary" [formControl]="fire">
{{fireForceList[i].name}}
</mat-checkbox>
</div>
<div class="btnbox">
<div>
<span>显示范围 : </span>
<mat-form-field>
<select matNativeControl formControlName="areaFireForce" [(ngModel)]="fireForceAreaDefault">
<option value="-1">全部</option>
<option value="0">当前视野范围</option>
<option value="200">200米</option>
<option value="500">500米</option>
<option value="1000">1000米</option>
<option value="1500">1500米</option>
<option value="2000">2000米</option>
<option value="2500">2500米</option>
<option value="3000">3000米</option>
<option value="4000">4000米</option>
<option value="5000">5000米</option>
</select>
</mat-form-field>
</div>
<button class="submit" id="submit3">确定</button>
<button class="cancel" type="button" (click)="resetFireForce()">取消显示</button>
</div>
</form>
</div>
<div *ngIf="selectedTitle == 3" class="linkageForcesBox">
<form [formGroup]="linkageForcesForm" class="inputList" (submit)='linkageForcesSubmit(linkageForcesForm.value)'>
<div style="display: flex;justify-content: space-between;align-items: center;">
<mat-checkbox color="primary" formControlName="allSelectedLinkageForces" (change)="selectedAllLinkageForces($event)">全选</mat-checkbox>
<mat-icon (click)="closertdiv()">clear</mat-icon>
</div>
<div class="inputItem">
<mat-checkbox *ngFor="let linkage of linkageForces.controls;let i = index" color="primary" [formControl]="linkage">
{{linkageForcesList[i].name}}
</mat-checkbox>
</div>
<div class="btnbox">
<div>
<span>显示范围 : </span>
<mat-form-field>
<select matNativeControl formControlName="areaLinkageForces" [(ngModel)]="linkageForcesAreaDefault">
<option value="-1">全部</option>
<option value="0">当前视野范围</option>
<option value="200">200米</option>
<option value="500">500米</option>
<option value="1000">1000米</option>
<option value="1500">1500米</option>
<option value="2000">2000米</option>
<option value="2500">2500米</option>
<option value="3000">3000米</option>
<option value="4000">4000米</option>
<option value="5000">5000米</option>
</select>
</mat-form-field>
</div>
<button class="submit" id="submit4">确定</button>
<button class="cancel" type="button" (click)="resetLinkageForces()">取消显示</button>
</div>
</form>
</div>
<div *ngIf="selectedTitle == 4" class="distanceBox">
<div> <div>
<input type="radio" name='func' [(ngModel)]="checkRadio" value='rule' (click)="measure('rule')" checked><span class="input-text" style="margin-right: 15px;">&nbsp;距离测量</span> <input type="radio" name='func' [(ngModel)]="checkRadio" value='rule' (click)="measure('rule')" checked><span class="input-text" style="margin-right: 15px;">&nbsp;距离测量</span>
<input type="radio" name='func' [(ngModel)]="checkRadio" value='measureArea' (click)="measure('measureArea')"><span class="input-text"> &nbsp;面积测量</span> <input type="radio" name='func' [(ngModel)]="checkRadio" value='measureArea' (click)="measure('measureArea')"><span class="input-text"> &nbsp;面积测量</span>
</div> </div>
<button class="clearbutton" (click)="clearnAll()">清除</button> <button class="clearbutton" (click)="clearnAll()">清除</button>
</div> </div>
<div *ngIf="selectedTitle == 3" class="coverageBox"> <div *ngIf="selectedTitle == 5" class="coverageBox">
<div class="topbox"> <div class="topbox">
<span>图层</span> <span>图层</span>
<div style="display: flex;align-items: center;"> <div style="display: flex;align-items: center;">
@ -201,6 +274,8 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- 右上角 --> <!-- 右上角 -->

2
src/app/gis-management/gis-labeling/gis-labeling.component.scss

@ -261,7 +261,7 @@
background: #fff; background: #fff;
margin-top: 3px; margin-top: 3px;
border-radius: 6px; border-radius: 6px;
.keyUnitBox,.waterBox,.coverageBox{ .keyUnitBox,.waterBox,.coverageBox,.fireForceBox,.linkageForcesBox{
box-sizing: border-box; box-sizing: border-box;
padding:8px 15px; padding:8px 15px;
// cursor: default; // cursor: default;

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

@ -19,6 +19,8 @@ export class GisLabelingComponent implements OnInit {
selectedTitle:number selectedTitle:number
titleList = [ {name:'重点单位',iconImg:'/assets/images/uniticon.png'}, titleList = [ {name:'重点单位',iconImg:'/assets/images/uniticon.png'},
{name:'水源',iconImg:'/assets/images/watericon.png'}, {name:'水源',iconImg:'/assets/images/watericon.png'},
{name:'消防力量',iconImg:'/assets/images/消防力量.png'},
{name:'联动力量',iconImg:'/assets/images/联动力量.png'},
{name:'测量工具',iconImg:'/assets/images/distanceicon.png'}, {name:'测量工具',iconImg:'/assets/images/distanceicon.png'},
{name:'图层选择',iconImg:'/assets/images/coverageicon.png'} {name:'图层选择',iconImg:'/assets/images/coverageicon.png'}
] ]
@ -28,13 +30,46 @@ export class GisLabelingComponent implements OnInit {
{id:'1',name:'消防水池',selected:false}, {id:'1',name:'消防水池',selected:false},
{id:'2',name:'天然水源',selected:false}, {id:'2',name:'天然水源',selected:false},
] ]
fireForceList = [
{id:'0',name:'总队',selected:false},
{id:'1',name:'支队',selected:false},
{id:'2',name:'大队',selected:false},
{id:'3',name:'中队(消防站)',selected:false},
{id:'4',name:'其他消防队伍',selected:false}
]
linkageForcesList = [
{id:'0',name:'安监',selected:false},
{id:'1',name:'电力局',selected:false},
{id:'2',name:'公安',selected:false},
{id:'3',name:'海事',selected:false},
{id:'4',name:'环保局',selected:false},
{id:'5',name:'交通',selected:false},
{id:'6',name:'民政',selected:false},
{id:'7',name:'气象局',selected:false},
{id:'8',name:'燃气局',selected:false},
{id:'9',name:'市政',selected:false},
{id:'10',name:'水利',selected:false},
{id:'11',name:'通信',selected:false},
{id:'12',name:'医疗',selected:false},
{id:'13',name:'应急管理',selected:false},
{id:'14',name:'住建',selected:false}
]
keyUnitForm : FormGroup//gis右上角重点单位表单 keyUnitForm : FormGroup//gis右上角重点单位表单
watertForm : FormGroup//gis右上角水源表单 watertForm : FormGroup//gis右上角水源表单
fireForceForm : FormGroup//gis右上角消防力量表单
linkageForcesForm : FormGroup//gis右上角联动力量表单
selectedUnitList:any = []//选择提交的单位 selectedUnitList:any = []//选择提交的单位
selectedWaterList:any = []//选择提交的水源 selectedWaterList:any = []//选择提交的水源
selectedFireForceList:any = []//选择提交的消防力量
selectedLinkageForcesList:any = []//选择提交的联动力量
unitAreaDefault:any = '-1'//默认单位范围 unitAreaDefault:any = '-1'//默认单位范围
waterAreaDefault:any = '-1'//默认水源范围 waterAreaDefault:any = '-1'//默认水源范围
fireForceAreaDefault:any = '-1'//默认消防力量范围
linkageForcesAreaDefault:any = '-1'//默认联动力量范围
//获得单位循环出来的checkbox列表(formControl实例) //获得单位循环出来的checkbox列表(formControl实例)
get units():any{ get units():any{
return this.keyUnitForm.get('units') return this.keyUnitForm.get('units')
@ -42,6 +77,13 @@ export class GisLabelingComponent implements OnInit {
get waters():any{ get waters():any{
return this.watertForm.get('waters') return this.watertForm.get('waters')
} }
get fireForce():any{
return this.fireForceForm.get('fireForce')
}
get linkageForces():any{
return this.linkageForcesForm.get('linkageForces')
}
async getAllBuildingType(){ async getAllBuildingType(){
let result = await new Promise((result,reject)=>{ let result = await new Promise((result,reject)=>{
this.http.get('/api/BuildingTypes/Simple').subscribe((data:any) => { this.http.get('/api/BuildingTypes/Simple').subscribe((data:any) => {
@ -69,6 +111,17 @@ export class GisLabelingComponent implements OnInit {
allSelectedWater:new FormControl(), allSelectedWater:new FormControl(),
areaWater:new FormControl() areaWater:new FormControl()
}) })
this.fireForceForm = this.fb.group({
fireForce:this.fireForceController(),
allSelectedFireForce:new FormControl(),
areaFireForce:new FormControl()
})
this.linkageForcesForm = this.fb.group({
linkageForces:this.linkageForcesController(),
allSelectedLinkageForces:new FormControl(),
areaLinkageForces:new FormControl()
})
//将选中的push到数组 //将选中的push到数组
this.units.valueChanges.subscribe(values => { this.units.valueChanges.subscribe(values => {
let selects:string[] = [] let selects:string[] = []
@ -84,6 +137,21 @@ export class GisLabelingComponent implements OnInit {
}); });
this.selectedWaterList = selects this.selectedWaterList = selects
}) })
this.fireForce.valueChanges.subscribe(values => {
let selects:string[] = []
values.forEach((selected:boolean,i:number) => {
selected === true && selects.push(this.fireForceList[i].id)
});
this.selectedFireForceList = selects
})
this.linkageForces.valueChanges.subscribe(values => {
let selects:string[] = []
values.forEach((selected:boolean,i:number) => {
selected === true && selects.push(this.linkageForcesList[i].id)
});
this.selectedLinkageForcesList = selects
})
this.unitSelected() this.unitSelected()
}) })
} }
@ -102,6 +170,21 @@ export class GisLabelingComponent implements OnInit {
}); });
return this.fb.array(arr); return this.fb.array(arr);
} }
//构造消防力量checkbox控制器
fireForceController() {
const arr = this.fireForceList.map(item => {
return this.fb.control(item.selected);
});
return this.fb.array(arr);
}
//构造联动力量checkbox控制器
linkageForcesController() {
const arr = this.linkageForcesList.map(item => {
return this.fb.control(item.selected);
});
return this.fb.array(arr);
}
//初始化获取勾选项 //初始化获取勾选项
unitSelected(){ unitSelected(){
this.keyUnitList.forEach(item => { this.keyUnitList.forEach(item => {
@ -114,6 +197,16 @@ export class GisLabelingComponent implements OnInit {
this.selectedWaterList.push(item.name) this.selectedWaterList.push(item.name)
} }
}) })
this.fireForceList.forEach(item => {
if(item.selected){
this.selectedFireForceList.push(item.name)
}
})
this.linkageForcesList.forEach(item => {
if(item.selected){
this.selectedLinkageForcesList.push(item.name)
}
})
} }
//地图范围圆圈---重点单位 //地图范围圆圈---重点单位
circle = new AMap.Circle({ circle = new AMap.Circle({
@ -139,6 +232,32 @@ export class GisLabelingComponent implements OnInit {
fillColor: '#ee2200', fillColor: '#ee2200',
zIndex: 50, zIndex: 50,
}) })
//地图范围圆圈---消防力量
circleoffireForce = new AMap.Circle({
center: null,
radius: 0, //半径
strokeOpacity: 1,
fillOpacity: 0.4,
strokeStyle: 'dashed',
strokeDasharray: [10, 10],
// 线样式还支持 'dashed'
fillColor: '#e830cc',
zIndex: 50,
})
//地图范围圆圈---联动力量
circleoflinkageForces = new AMap.Circle({
center: null,
radius: 0, //半径
strokeOpacity: 1,
fillOpacity: 0.4,
strokeStyle: 'dashed',
strokeDasharray: [10, 10],
// 线样式还支持 'dashed'
fillColor: '#f6a317',
zIndex: 50,
})
//重点单位提交 //重点单位提交
ketUnitSubmit(value){ ketUnitSubmit(value){
if(this.markers.length == 0){ if(this.markers.length == 0){
@ -341,6 +460,271 @@ export class GisLabelingComponent implements OnInit {
this.map.remove(this.circle) this.map.remove(this.circle)
this.unitCluster.setData([]) this.unitCluster.setData([])
} }
//消防力量提交
fireForceSubmit(value){
if(this.markers.length == 0){
let paramsdata:any = {
PageSize:99999,
Levels : this.selectedFireForceList.length != 0 ? this.selectedFireForceList : -1
}
this.http.get("/api/CustomFireForce",{params:paramsdata}).subscribe((data:any) => {
this.createFireForceMarker(data)
})
}else{
this.circleoffireForce.setRadius(Number(this.fireForceAreaDefault))
this.circleoffireForce.setCenter(this.markers[0]._position)
this.circleoffireForce.setMap(this.map)
let Distance
let lnglat = new AMap.LngLat(this.selectedUnit.location.x, this.selectedUnit.location.y) // lng, lat 替换成传入的坐标
if(this.fireForceAreaDefault == '0'){
this.circleoffireForce.setRadius(this.Calculationofdistance(this.map.getBounds())/2)
Distance = Math.abs(lnglat.offset(0, this.Calculationofdistance(this.map.getBounds())/2).lat - this.selectedUnit.location.y)
}else{
Distance = Math.abs(lnglat.offset(0, this.fireForceAreaDefault).lat - this.selectedUnit.location.y)
}
if(this.fireForceAreaDefault == '-1'){//如果勾选全部
let paramsdata:any = {
PageSize:99999,
Levels : this.selectedFireForceList.length != 0 ? this.selectedFireForceList : -1
}
this.http.get("/api/CustomFireForce",{params:paramsdata}).subscribe((data:any) => {
this.createFireForceMarker(data)
})
}else{
let paramsdata:any = {
PageSize:99999,
Lon : this.selectedUnit.location.x,
Lat : this.selectedUnit.location.y,
Distance : Distance,
Levels : this.selectedFireForceList.length != 0 ? this.selectedFireForceList : -1
}
this.http.get("/api/CustomFireForce",{params:paramsdata}).subscribe((data:any) => {
this.createFireForceMarker(data)
})
}
}
}
//创建消防力量markers
fireForceCluster:any //消防力量点聚合实例
createFireForceMarker(list){
let fireForceMarkerArrcluster = []
this.fireForceCluster ? this.fireForceCluster.setData([]) : null
list.forEach((item) => {
let image
if(item.forceType == 2){
image = '/assets/fireForcesMarkers/其他.png'
}else if(item.level == 0){
image = '/assets/fireForcesMarkers/总队.png'
}else if(item.level == 1){
image = '/assets/fireForcesMarkers/支队.png'
}else if(item.level == 2){
image = '/assets/fireForcesMarkers/大队.png'
}else if(item.level == 3){
image = '/assets/fireForcesMarkers/中队.png'
}
// 用于点集合的数组
item.fireForceDetailInfo.location ?
fireForceMarkerArrcluster.push({
lnglat : [item.fireForceDetailInfo.location.x,item.fireForceDetailInfo.location.y],
image : image,
data : item
}) : null
})
this.map.plugin(["AMap.MarkerClusterer"],() => {
var gridSize = 60
var count = fireForceMarkerArrcluster.length;
var _renderClusterMarker = function (context) {
var factor = Math.pow(context.count / count, 1 / 18);
var div = document.createElement('div');
var Hue = 180 - factor * 180;
var bgColor = 'hsla(' + Hue + ',100%,40%,0.7)';
var fontColor = 'hsla(' + Hue + ',100%,90%,1)';
var borderColor = 'hsla(' + Hue + ',100%,40%,1)';
var shadowColor = 'hsla(' + Hue + ',100%,90%,1)';
div.style.backgroundColor = bgColor;
var size = Math.round(30 + Math.pow(context.count / count, 1 / 5) * 20);
div.style.width = div.style.height = size + 'px';
div.style.border = 'solid 1px ' + borderColor;
div.style.borderRadius = size / 2 + 'px';
div.style.boxShadow = '0 0 5px ' + shadowColor;
div.innerHTML = context.count;
div.style.lineHeight = size + 'px';
div.style.color = fontColor;
div.style.fontSize = '14px';
div.style.textAlign = 'center';
context.marker.setOffset(new AMap.Pixel(-size / 2, -size / 2));
context.marker.setContent(div)
};
var _renderMarker = (context)=> {
var content = `<img class='clusterImg' src="${context.data[0].image}" alt="">`;
var offset = new AMap.Pixel(-15, -15);
context.marker.setContent(content)
context.marker.setOffset(offset)
}
this.fireForceCluster = new AMap.MarkerCluster(this.map, fireForceMarkerArrcluster, {
gridSize: gridSize, // 设置网格像素大小
renderClusterMarker: _renderClusterMarker, // 自定义聚合点样式
renderMarker: _renderMarker, // 自定义非聚合点样式
});
});
}
//取消消防力量
resetFireForce(){
this.fireForceForm.reset()
this.fireForceForm.controls.areaFireForce.setValue('-1')
this.map.remove(this.circleoffireForce)
this.fireForceCluster.setData([])
}
//联动力量提交
linkageForcesSubmit(value){
console.log(this.selectedLinkageForcesList)
if(this.markers.length == 0){
let paramsdata:any = {
PageSize : 999999,
LinkageForceTypes:this.selectedLinkageForcesList.length != 0 ? this.selectedLinkageForcesList : -1
}
this.http.get("/api/LinkageForces",{params:paramsdata}).subscribe((data:any) => {
console.log(data)
this.createLinkageForcesMarker(data.items)
})
}else{
this.circleoflinkageForces.setRadius(Number(this.linkageForcesAreaDefault))
this.circleoflinkageForces.setCenter(this.markers[0]._position)
this.circleoflinkageForces.setMap(this.map)
let Distance
let lnglat = new AMap.LngLat(this.selectedUnit.location.x, this.selectedUnit.location.y) // lng, lat 替换成传入的坐标
if(this.linkageForcesAreaDefault == '0'){
this.circleoflinkageForces.setRadius(this.Calculationofdistance(this.map.getBounds())/2)
Distance = Math.abs(lnglat.offset(0, this.Calculationofdistance(this.map.getBounds())/2).lat - this.selectedUnit.location.y)
}else{
Distance = Math.abs(lnglat.offset(0, this.linkageForcesAreaDefault).lat - this.selectedUnit.location.y)
}
if(this.linkageForcesAreaDefault == '-1'){//如果勾选全部
let paramsdata:any = {
PageSize : 999999,
LinkageForceTypes:this.selectedLinkageForcesList.length != 0 ? this.selectedLinkageForcesList : -1
}
this.http.get("/api/LinkageForces",{params:paramsdata}).subscribe((data:any) => {
this.createLinkageForcesMarker(data.items)
})
}else{
let paramsdata:any = {
PageSize:99999,
Lon : this.selectedUnit.location.x,
Lat : this.selectedUnit.location.y,
Distance : Distance,
LinkageForceTypes:this.selectedLinkageForcesList.length != 0 ? this.selectedLinkageForcesList : -1
}
this.http.get("/api/LinkageForces",{params:paramsdata}).subscribe((data:any) => {
this.createLinkageForcesMarker(data.items)
})
}
}
}
//创建联动力量markers
linkageForcesCluster:any //联动力量点聚合实例
createLinkageForcesMarker(list){
let linkageForcesMarkerArrcluster = []
this.linkageForcesCluster ? this.linkageForcesCluster.setData([]) : null
list.forEach((item) => {
let image
if(item.linkageForceType == 0){//消火栓
image = '/assets/linkageForcesMarkers/安监.png'
}else if(item.linkageForceType == 1){//消防水池
image = '/assets/linkageForcesMarkers/电力局.png'
}else if(item.linkageForceType == 2){//天然联动力量
image = '/assets/linkageForcesMarkers/公安.png'
}else if(item.linkageForceType == 3){//天然水源
image = '/assets/linkageForcesMarkers/海事.png'
}else if(item.linkageForceType == 4){//天然水源
image = '/assets/linkageForcesMarkers/环保局.png'
}else if(item.linkageForceType == 5){//天然水源
image = '/assets/linkageForcesMarkers/交通.png'
}else if(item.linkageForceType == 6){//天然水源
image = '/assets/linkageForcesMarkers/民政.png'
}else if(item.linkageForceType == 7){//天然水源
image = '/assets/linkageForcesMarkers/气象局.png'
}else if(item.linkageForceType == 8){//天然水源
image = '/assets/linkageForcesMarkers/燃气局.png'
}else if(item.linkageForceType == 9){//天然水源
image = '/assets/linkageForcesMarkers/市政.png'
}else if(item.linkageForceType == 10){//天然水源
image = '/assets/linkageForcesMarkers/水利.png'
}else if(item.linkageForceType == 11){//天然水源
image = '/assets/linkageForcesMarkers/通信.png'
}else if(item.linkageForceType == 12){//天然水源
image = '/assets/linkageForcesMarkers/医疗.png'
}else if(item.linkageForceType == 13){//天然水源
image = '/assets/linkageForcesMarkers/应急管理.png'
}else if(item.linkageForceType == 14){//天然水源
image = '/assets/linkageForcesMarkers/住建.png'
}
// 用于点集合的数组
if(item.location && item.location.x){
linkageForcesMarkerArrcluster.push({
lnglat : [item.location.x,item.location.y],
image : image,
data : item
})
}
// 用于点集合的数组
})
this.map.plugin(["AMap.MarkerClusterer"],() => {
var gridSize = 60
var count = linkageForcesMarkerArrcluster.length;
var _renderClusterMarker = function (context) {
var factor = Math.pow(context.count / count, 1 / 18);
var div = document.createElement('div');
var Hue = 180 - factor * 180;
var bgColor = 'hsla(' + Hue + ',100%,40%,0.7)';
var fontColor = 'hsla(' + Hue + ',100%,90%,1)';
var borderColor = 'hsla(' + Hue + ',100%,40%,1)';
var shadowColor = 'hsla(' + Hue + ',100%,90%,1)';
div.style.backgroundColor = bgColor;
var size = Math.round(30 + Math.pow(context.count / count, 1 / 5) * 20);
div.style.width = div.style.height = size + 'px';
div.style.border = 'solid 1px ' + borderColor;
div.style.borderRadius = size / 2 + 'px';
div.style.boxShadow = '0 0 5px ' + shadowColor;
div.innerHTML = context.count;
div.style.lineHeight = size + 'px';
div.style.color = fontColor;
div.style.fontSize = '14px';
div.style.textAlign = 'center';
context.marker.setOffset(new AMap.Pixel(-size / 2, -size / 2));
context.marker.setContent(div)
};
var _renderMarker = (context)=> {
var content = `<img class='clusterImg' src="${context.data[0].image}" alt="">`;
var offset = new AMap.Pixel(-15, -15);
context.marker.setContent(content)
context.marker.setOffset(offset)
}
this.linkageForcesCluster = new AMap.MarkerCluster(this.map, linkageForcesMarkerArrcluster, {
gridSize: gridSize, // 设置网格像素大小
renderClusterMarker: _renderClusterMarker, // 自定义聚合点样式
renderMarker: _renderMarker, // 自定义非聚合点样式
});
});
}
//取消联动力量
resetLinkageForces(){
this.linkageForcesForm.reset()
this.linkageForcesForm.controls.areaLinkageForces.setValue('-1')
this.map.remove(this.circleoflinkageForces)
this.linkageForcesCluster.setData([])
}
//水源提交 //水源提交
waterSubmit(value){ waterSubmit(value){
if(this.markers.length == 0){ if(this.markers.length == 0){
@ -409,13 +793,6 @@ export class GisLabelingComponent implements OnInit {
} }
} }
} }
}
//取消显示水源
resetWater(){
this.watertForm.reset()
this.watertForm.controls.areaWater.setValue('-1')
this.map.remove(this.circleofwater)
this.waterCluster.setData([])
} }
//循环渲染出所有水源markers //循环渲染出所有水源markers
waterCluster:any //水源聚合实例 waterCluster:any //水源聚合实例
@ -482,6 +859,14 @@ export class GisLabelingComponent implements OnInit {
}); });
} }
//取消显示水源
resetWater(){
this.watertForm.reset()
this.watertForm.controls.areaWater.setValue('-1')
this.map.remove(this.circleofwater)
this.waterCluster.setData([])
}
//计算两地距离 //计算两地距离
Calculationofdistance(bounds){ Calculationofdistance(bounds){
@ -501,7 +886,6 @@ export class GisLabelingComponent implements OnInit {
this.keyUnitForm.controls.areaUnit.setValue('0') this.keyUnitForm.controls.areaUnit.setValue('0')
} }
} }
//全选水源 //全选水源
selectedAllWater(event){ selectedAllWater(event){
if(event.checked){ if(event.checked){
@ -511,7 +895,24 @@ export class GisLabelingComponent implements OnInit {
this.watertForm.controls.areaWater.setValue('0') this.watertForm.controls.areaWater.setValue('0')
} }
} }
//全选消防力量
selectedAllFireForce(event){
if(event.checked){
this.fireForce.controls.forEach(item => {item.setValue(true)})
}else{
this.fireForceForm.reset()
this.fireForceForm.controls.areaFireForce.setValue('0')
}
}
//全选联动力量
selectedAllLinkageForces(event){
if(event.checked){
this.linkageForces.controls.forEach(item => {item.setValue(true)})
}else{
this.linkageForcesForm.reset()
this.linkageForcesForm.controls.areaLinkageForces.setValue('0')
}
}

2
src/app/key-unit/edit-plan-info/edit-plan-info.component.html

@ -50,7 +50,7 @@
<app-router-gis></app-router-gis> <app-router-gis></app-router-gis>
</ng-template> </ng-template>
</mat-tab> </mat-tab>
<mat-tab label="9.周边水源"> <mat-tab label="9.周边水源及力量">
<ng-template matTabContent> <ng-template matTabContent>
<app-water-road></app-water-road> <app-water-road></app-water-road>
</ng-template> </ng-template>

2
src/app/key-unit/edit-unit-info/edit-unit-info.component.html

@ -36,7 +36,7 @@
<app-router-gis></app-router-gis> <app-router-gis></app-router-gis>
</ng-template> </ng-template>
</mat-tab> </mat-tab>
<mat-tab label="7.周边水源"> <mat-tab label="7.周边水源及力量">
<ng-template matTabContent> <ng-template matTabContent>
<app-water-road></app-water-road> <app-water-road></app-water-road>
</ng-template> </ng-template>

111
src/app/key-unit/fire-fighting-device/fire-fighting-device.component.html

@ -1,5 +1,5 @@
<div class="content"> <div class="content">
<mat-tab-group> <mat-tab-group (selectedIndexChange)="selectedChange($event)">
<!-- <mat-tab style="display: none;" label="单位消防设施"> <!-- <mat-tab style="display: none;" label="单位消防设施">
<div class="contentBox"> <div class="contentBox">
@ -125,10 +125,115 @@
</label> </label>
<label class="textContent">{{items.name}}</label> <label class="textContent">{{items.name}}</label>
<label class="textContent"><a href="javascript:void(0)" (click)='previewBuildingImg(newItem,items)'>查看图片</a></label> <label class="textContent"><a href="javascript:void(0)" (click)='previewBuildingImg(newItem,items)'>查看图片</a></label>
<label class="totalContent">{{items.total ? items.total : '总数: 0'}}</label> <label class="totalContent">
<span *ngIf="item.name == '消防水系统' && items.name == '供水管网'">
<input type="text" value="" [(ngModel)]="fireProtectionWaterSystem.waterSupplyNetwork.total">
</span>
<span *ngIf="item.name == '消防水系统' && items.name == '自动喷水灭火系统'">
<input type="text" value="" [(ngModel)]="fireProtectionWaterSystem.sprinklerSystem.total">
</span>
<span *ngIf="item.name == '消防灭火给水系统' && items.name == '自动喷水灭火系统'">
<input type="text" value="" [(ngModel)]="FireExtinguishingWaterSupplySystem.sprinklerSystem.total">
</span>
<span *ngIf="item.name == '消防灭火给水系统' && items.name == '气体自动灭火系统'">
<input type="text" value="" [(ngModel)]="FireExtinguishingWaterSupplySystem.AutomaticGasFireExtinguishingSystem.total">
</span>
<span *ngIf="item.name == '消防灭火给水系统' && items.name == '消防泵房'">
<input type="text" value="" [(ngModel)]="FireExtinguishingWaterSupplySystem.firePumpRoom.total">
</span>
<span *ngIf="item.name == '其它' && items.name == '排烟系统'">
<input type="text" value="" [(ngModel)]="other.purgingSystem.total">
</span>
<span *ngIf="item.name == '其它' && items.name == '灭火器'">
<input type="text" value="" [(ngModel)]="other.fireExtinguisher.total">
</span>
<span *ngIf="item.name == '其它' && items.name == '气体灭火'">
<input type="text" value="" [(ngModel)]="other.extinctionUsingGas.total">
</span>
<span *ngIf="item.name == '其它' && items.name == '消防通信'">
<input type="text" value="" [(ngModel)]="other.fireControlCommunication.total">
</span>
<span *ngIf="item.name == '消防设施' && items.name == '自动报警系统'">
<input type="text" value="" [(ngModel)]="fireFightingEquipment.automaticAlarmSystem.total">
</span>
<span *ngIf="item.name == '消防设施' && items.name == '消防泵'">
<input type="text" value="" [(ngModel)]="fireFightingEquipment.firePump.total">
</span>
<span *ngIf="item.name == '消火栓系统' && items.name == '灭火剂'">
<input type="text" value="" [(ngModel)]="hydrantSystem.fireExtinguishingAgent.total">
</span>
<span *ngIf="item.name == '消火栓系统' && items.name == '报警设施'">
<input type="text" value="" [(ngModel)]="hydrantSystem.AlarmFacilities.total">
</span>
<span *ngIf="item.name == '消火栓系统' && items.name == '消防管网'">
<input type="text" value="" [(ngModel)]="hydrantSystem.FireControlPipeNetwork.total">
</span>
<span *ngIf="item.name == '其它设施' && items.name == '优先广播'">
<input type="text" value="" [(ngModel)]="otherFacilities.givePriorityToBroadcast.total">
</span>
<span *ngIf="item.name == '其它设施' && items.name == 'VI检测仪'">
<input type="text" value="" [(ngModel)]="otherFacilities.VIdetector.total">
</span>
<span *ngIf="item.name == '其它设施' && items.name == '泡沫水喷雾系统'">
<input type="text" value="" [(ngModel)]="otherFacilities.foamWaterSpraySystem.total">
</span>
<span *ngIf="item.name == '自动消防设施' && items.name == '喷水灭火系统'">
<input type="text" value="" [(ngModel)]="automaticFireProtectionFacility.fireSprinklingSystem.total">
</span>
<span *ngIf="item.name == '自动消防设施' && items.name == '自动报警系统'">
<input type="text" value="" [(ngModel)]="automaticFireProtectionFacility.automaticAlarmSystem.total">
</span>
<span *ngIf="item.name == '自动消防设施' && items.name == '防排烟系统'">
<input type="text" value="" [(ngModel)]="automaticFireProtectionFacility.smokeControlAndExhaustSystem.total">
</span>
<span *ngIf="item.name == '自动消防设施' && items.name == '水幕系统'">
<input type="text" value="" [(ngModel)]="automaticFireProtectionFacility.waterCurtainSystem.total">
</span>
<span *ngIf="item.name == '自动消防设施' && items.name == '消防泵'">
<input type="text" value="" [(ngModel)]="automaticFireProtectionFacility.firePump.total">
</span>
<span *ngIf="item.name == '消防水源' && items.name == '消防水池'">
<input type="text" value="" [(ngModel)]="fireWaterSupply.firePool.total">
</span>
<span *ngIf="!((item.name == '消防水系统' && items.name == '供水管网') || (item.name == '消防水系统' && items.name == '自动喷水灭火系统') || (item.name == '消防灭火给水系统' && items.name == '自动喷水灭火系统') || (item.name == '消防灭火给水系统' && items.name == '气体自动灭火系统') || (item.name == '消防灭火给水系统' && items.name == '消防泵房') || (item.name == '其它' && items.name == '排烟系统') || (item.name == '其它' && items.name == '灭火器') || (item.name == '其它' && items.name == '气体灭火') || (item.name == '其它' && items.name == '消防通信') || (item.name == '消防设施' && items.name == '自动报警系统') || (item.name == '消防设施' && items.name == '消防泵') || (item.name == '消火栓系统' && items.name == '灭火剂') || (item.name == '消火栓系统' && items.name == '报警设施') || (item.name == '消火栓系统' && items.name == '消防管网') || (item.name == '其它设施' && items.name == '优先广播') || (item.name == '其它设施' && items.name == 'VI检测仪') || (item.name == '其它设施' && items.name == '泡沫水喷雾系统') || (item.name == '自动消防设施' && items.name == '喷水灭火系统') || (item.name == '自动消防设施' && items.name == '自动报警系统') || (item.name == '自动消防设施' && items.name == '防排烟系统') || (item.name == '自动消防设施' && items.name == '水幕系统') || (item.name == '自动消防设施' && items.name == '消防泵') || (item.name == '消防水源' && items.name == '消防水池'))">
{{items.total ? items.total : '总数: 0'}}
</span>
</label>
<label class="lastTextContent"> <label class="lastTextContent">
<textarea maxlength="250" [(ngModel)]="items.details" style="width: 80%;"></textarea> <textarea *ngIf="item.name == '消防水系统' && items.name == '供水管网'" maxlength="250" [(ngModel)]="fireProtectionWaterSystem.waterSupplyNetwork.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防水系统' && items.name == '自动喷水灭火系统'" maxlength="250" [(ngModel)]="fireProtectionWaterSystem.sprinklerSystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防灭火给水系统' && items.name == '自动喷水灭火系统'" maxlength="250" [(ngModel)]="FireExtinguishingWaterSupplySystem.sprinklerSystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防灭火给水系统' && items.name == '气体自动灭火系统'" maxlength="250" [(ngModel)]="FireExtinguishingWaterSupplySystem.AutomaticGasFireExtinguishingSystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防灭火给水系统' && items.name == '消防泵房'" maxlength="250" [(ngModel)]="FireExtinguishingWaterSupplySystem.firePumpRoom.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它' && items.name == '排烟系统'" maxlength="250" [(ngModel)]="other.purgingSystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它' && items.name == '灭火器'" maxlength="250" [(ngModel)]="other.fireExtinguisher.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它' && items.name == '气体灭火'" maxlength="250" [(ngModel)]="other.extinctionUsingGas.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它' && items.name == '消防通信'" maxlength="250" [(ngModel)]="other.fireControlCommunication.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防设施' && items.name == '自动报警系统'" maxlength="250" [(ngModel)]="fireFightingEquipment.automaticAlarmSystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防设施' && items.name == '消防泵'" maxlength="250" [(ngModel)]="fireFightingEquipment.firePump.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消火栓系统' && items.name == '灭火剂'" maxlength="250" [(ngModel)]="hydrantSystem.fireExtinguishingAgent.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消火栓系统' && items.name == '报警设施'" maxlength="250" [(ngModel)]="hydrantSystem.AlarmFacilities.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消火栓系统' && items.name == '消防管网'" maxlength="250" [(ngModel)]="hydrantSystem.FireControlPipeNetwork.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它设施' && items.name == '优先广播'" maxlength="250" [(ngModel)]="otherFacilities.givePriorityToBroadcast.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它设施' && items.name == 'VI检测仪'" maxlength="250" [(ngModel)]="otherFacilities.VIdetector.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '其它设施' && items.name == '泡沫水喷雾系统'" maxlength="250" [(ngModel)]="otherFacilities.foamWaterSpraySystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '自动消防设施' && items.name == '喷水灭火系统'" maxlength="250" [(ngModel)]="automaticFireProtectionFacility.fireSprinklingSystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '自动消防设施' && items.name == '自动报警系统'" maxlength="250" [(ngModel)]="automaticFireProtectionFacility.automaticAlarmSystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '自动消防设施' && items.name == '防排烟系统'" maxlength="250" [(ngModel)]="automaticFireProtectionFacility.smokeControlAndExhaustSystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '自动消防设施' && items.name == '水幕系统'" maxlength="250" [(ngModel)]="automaticFireProtectionFacility.waterCurtainSystem.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '自动消防设施' && items.name == '消防泵'" maxlength="250" [(ngModel)]="automaticFireProtectionFacility.firePump.details" style="width: 80%;"></textarea>
<textarea *ngIf="item.name == '消防水源' && items.name == '消防水池'" maxlength="250" [(ngModel)]="fireWaterSupply.firePool.details" style="width: 80%;"></textarea>
<textarea maxlength="250" [(ngModel)]="items.details" style="width: 80%;" *ngIf="!((item.name == '消防水系统' && items.name == '供水管网') || (item.name == '消防水系统' && items.name == '自动喷水灭火系统') || (item.name == '消防灭火给水系统' && items.name == '自动喷水灭火系统') || (item.name == '消防灭火给水系统' && items.name == '气体自动灭火系统') || (item.name == '消防灭火给水系统' && items.name == '消防泵房') || (item.name == '其它' && items.name == '排烟系统') || (item.name == '其它' && items.name == '灭火器') || (item.name == '其它' && items.name == '气体灭火') || (item.name == '其它' && items.name == '消防通信') || (item.name == '消防设施' && items.name == '自动报警系统') || (item.name == '消防设施' && items.name == '消防泵') || (item.name == '消火栓系统' && items.name == '灭火剂') || (item.name == '消火栓系统' && items.name == '报警设施') || (item.name == '消火栓系统' && items.name == '消防管网') || (item.name == '其它设施' && items.name == '优先广播') || (item.name == '其它设施' && items.name == 'VI检测仪') || (item.name == '其它设施' && items.name == '泡沫水喷雾系统') || (item.name == '自动消防设施' && items.name == '喷水灭火系统') || (item.name == '自动消防设施' && items.name == '自动报警系统') || (item.name == '自动消防设施' && items.name == '防排烟系统') || (item.name == '自动消防设施' && items.name == '水幕系统') || (item.name == '自动消防设施' && items.name == '消防泵') || (item.name == '消防水源' && items.name == '消防水池'))"></textarea>
</label> </label>
<label><mat-icon (click)='SwitchBuildingBoard(newItem,items)' *ngIf="items.isBuiltin">keyboard_arrow_down</mat-icon></label> <label><mat-icon (click)='SwitchBuildingBoard(newItem,items)' *ngIf="items.isBuiltin">keyboard_arrow_down</mat-icon></label>

262
src/app/key-unit/fire-fighting-device/fire-fighting-device.component.ts

@ -233,6 +233,7 @@ export class FireFightingDeviceComponent implements OnInit {
companyId:companyId companyId:companyId
}}).subscribe((data:any)=>{ }}).subscribe((data:any)=>{
this.allBuildingGrouping = data this.allBuildingGrouping = data
console.log(888,data)
if (this.allBuildingGrouping.length) { if (this.allBuildingGrouping.length) {
this.getAllBuildingFacilities() this.getAllBuildingFacilities()
} else { } else {
@ -244,9 +245,69 @@ export class FireFightingDeviceComponent implements OnInit {
}) })
} }
//消防水系统
fireProtectionWaterSystem = {
waterSupplyNetwork:{name:'供水管网',total:'',details:''},//供水管网
sprinklerSystem:{name:'自动喷水灭火系统',total:'',details:''}//自动喷水灭火系统
}
//消防灭火给水系统
FireExtinguishingWaterSupplySystem = {
sprinklerSystem:{name:'自动喷水灭火系统',total:'',details:''},//自动喷水灭火系统
AutomaticGasFireExtinguishingSystem:{name:'气体自动灭火系统',total:'',details:''},//气体自动灭火系统
firePumpRoom:{name:'消防泵房',total:'',details:''}//消防泵房
}
//其它
other = {
purgingSystem:{name:'排烟系统',total:'',details:''},//排烟系统
fireExtinguisher:{name:'灭火器',total:'',details:''},//灭火器
extinctionUsingGas:{name:'气体灭火',total:'',details:''},//气体灭火
fireControlCommunication:{name:'消防通信',total:'',details:''}//消防通信
}
//消防设施
fireFightingEquipment = {
automaticAlarmSystem:{name:'自动报警系统',total:'',details:''},//自动报警系统
firePump:{name:'消防泵',total:'',details:''}//消防泵
}
//消火栓系统
hydrantSystem = {
fireExtinguishingAgent:{name:'灭火剂',total:'',details:''},//灭火剂
AlarmFacilities:{name:'报警设施',total:'',details:''},//报警设施
FireControlPipeNetwork:{name:'消防管网',total:'',details:''}//消防管网
}
//其它设施
otherFacilities = {
givePriorityToBroadcast:{name:'优先广播',total:'',details:''},//优先广播
VIdetector:{name:'VI检测仪',total:'',details:''},//VI检测仪
foamWaterSpraySystem:{name:'泡沫水喷雾系统',total:'',details:''},//泡沫水喷雾系统
}
//自动消防设施
automaticFireProtectionFacility = {
fireSprinklingSystem:{name:'喷水灭火系统',total:'',details:''},//喷水灭火系统
automaticAlarmSystem:{name:'自动报警系统',total:'',details:''},//自动报警系统
smokeControlAndExhaustSystem:{name:'防排烟系统',total:'',details:''},//防排烟系统
waterCurtainSystem:{name:'水幕系统',total:'',details:''},//水幕系统
firePump:{name:'消防泵',total:'',details:''}//消防泵
}
//消防水源
fireWaterSupply = {
firePool:{name:'消防水池',total:'',details:''}//消防水池
}
//获得当前建筑的手动输入值
FacilityStat:any//存放当前建筑手动输入的值
selectedChange($event){
//获得手动输入的值
this.http.get('/api/BuildingFacilities/FacilityStat',{params:{
buildingId : this.allBuildingGrouping[$event].id
}}).subscribe(data=>{
this.FacilityStat = data
this.changeData()
})
}
//获取所有建筑的消防设施 //获取所有建筑的消防设施
getAllBuildingFacilities () { getAllBuildingFacilities () {
let companyId = this.route.snapshot.queryParams.id let companyId = this.route.snapshot.queryParams.id
let index = 0
this.allBuildingGrouping.forEach(element => { this.allBuildingGrouping.forEach(element => {
let header = {buildingId: element.id, buildingType: element.buildingTypes[0].id,companyId:companyId} let header = {buildingId: element.id, buildingType: element.buildingTypes[0].id,companyId:companyId}
this.http.get('/api/BuildingFacilities',{params:header}).subscribe(data=>{ this.http.get('/api/BuildingFacilities',{params:header}).subscribe(data=>{
@ -261,9 +322,144 @@ export class FireFightingDeviceComponent implements OnInit {
newElement.expanded = false }); newElement.expanded = false });
}); });
}) })
}); });
}
//清空手动输入的值
emptyData(){
this.fireProtectionWaterSystem = {
waterSupplyNetwork:{name:'供水管网',total:'',details:''},//供水管网
sprinklerSystem:{name:'自动喷水灭火系统',total:'',details:''}//自动喷水灭火系统
}
this.FireExtinguishingWaterSupplySystem = {
sprinklerSystem:{name:'自动喷水灭火系统',total:'',details:''},//自动喷水灭火系统
AutomaticGasFireExtinguishingSystem:{name:'气体自动灭火系统',total:'',details:''},//气体自动灭火系统
firePumpRoom:{name:'消防泵房',total:'',details:''}//消防泵房
}
this.other = {
purgingSystem:{name:'排烟系统',total:'',details:''},//排烟系统
fireExtinguisher:{name:'灭火器',total:'',details:''},//灭火器
extinctionUsingGas:{name:'气体灭火',total:'',details:''},//气体灭火
fireControlCommunication:{name:'消防通信',total:'',details:''}//消防通信
}
this.fireFightingEquipment = {
automaticAlarmSystem:{name:'自动报警系统',total:'',details:''},//自动报警系统
firePump:{name:'消防泵',total:'',details:''}//消防泵
}
this.hydrantSystem = {
fireExtinguishingAgent:{name:'灭火剂',total:'',details:''},//灭火剂
AlarmFacilities:{name:'报警设施',total:'',details:''},//报警设施
FireControlPipeNetwork:{name:'消防管网',total:'',details:''}//消防管网
}
this.otherFacilities = {
givePriorityToBroadcast:{name:'优先广播',total:'',details:''},//优先广播
VIdetector:{name:'VI检测仪',total:'',details:''},//VI检测仪
foamWaterSpraySystem:{name:'泡沫水喷雾系统',total:'',details:''},//泡沫水喷雾系统
}
this.automaticFireProtectionFacility = {
fireSprinklingSystem:{name:'喷水灭火系统',total:'',details:''},//喷水灭火系统
automaticAlarmSystem:{name:'自动报警系统',total:'',details:''},//自动报警系统
smokeControlAndExhaustSystem:{name:'防排烟系统',total:'',details:''},//防排烟系统
waterCurtainSystem:{name:'水幕系统',total:'',details:''},//水幕系统
firePump:{name:'消防泵',total:'',details:''}//消防泵
}
this.fireWaterSupply = {
firePool:{name:'消防水池',total:'',details:''}//消防水池
}
}
//将数据库获取的手动输入的值变成指定形式
changeData(){
this.emptyData();
this.FacilityStat.length != 0 ?
this.FacilityStat.forEach(element => {
if(element.groupName == '消防水系统'){
if(element.facilityName == '供水管网'){
this.fireProtectionWaterSystem.waterSupplyNetwork.total = element.count
this.fireProtectionWaterSystem.waterSupplyNetwork.details = element.description
}else if(element.facilityName == '自动喷水灭火系统'){
this.fireProtectionWaterSystem.sprinklerSystem.total = element.count
this.fireProtectionWaterSystem.sprinklerSystem.details = element.description
}
}else if(element.groupName == '消防灭火给水系统'){
if(element.facilityName == '自动喷水灭火系统'){
this.FireExtinguishingWaterSupplySystem.sprinklerSystem.total = element.count
this.FireExtinguishingWaterSupplySystem.sprinklerSystem.details = element.description
}else if(element.facilityName == '气体自动灭火系统'){
this.FireExtinguishingWaterSupplySystem.AutomaticGasFireExtinguishingSystem.total = element.count
this.FireExtinguishingWaterSupplySystem.AutomaticGasFireExtinguishingSystem.details = element.description
}else if(element.facilityName == '消防泵房'){
this.FireExtinguishingWaterSupplySystem.firePumpRoom.total = element.count
this.FireExtinguishingWaterSupplySystem.firePumpRoom.details = element.description
}
}else if(element.groupName == '其它'){
if(element.facilityName == '排烟系统'){
this.other.purgingSystem.total = element.count
this.other.purgingSystem.details = element.description
}else if(element.facilityName == '灭火器'){
this.other.fireExtinguisher.total = element.count
this.other.fireExtinguisher.details = element.description
}else if(element.facilityName == '气体灭火'){
this.other.extinctionUsingGas.total = element.count
this.other.extinctionUsingGas.details = element.description
}else if(element.facilityName == '消防通信'){
this.other.fireControlCommunication.total = element.count
this.other.fireControlCommunication.details = element.description
}
}else if(element.groupName == '消防设施'){
if(element.facilityName == '自动报警系统'){
this.fireFightingEquipment.automaticAlarmSystem.total = element.count
this.fireFightingEquipment.automaticAlarmSystem.details = element.description
}else if(element.facilityName == '消防泵'){
this.fireFightingEquipment.firePump.total = element.count
this.fireFightingEquipment.firePump.details = element.description
}
}else if(element.groupName == '消火栓系统'){
if(element.facilityName == '灭火剂'){
this.hydrantSystem.fireExtinguishingAgent.total = element.count
this.hydrantSystem.fireExtinguishingAgent.details = element.description
}else if(element.facilityName == '报警设施'){
this.hydrantSystem.AlarmFacilities.total = element.count
this.hydrantSystem.AlarmFacilities.details = element.description
}else if(element.facilityName == '消防管网'){
this.hydrantSystem.FireControlPipeNetwork.total = element.count
this.hydrantSystem.FireControlPipeNetwork.details = element.description
}
}else if(element.groupName == '其它设施'){
if(element.facilityName == '优先广播'){
this.otherFacilities.givePriorityToBroadcast.total = element.count
this.otherFacilities.givePriorityToBroadcast.details = element.description
}else if(element.facilityName == 'VI检测仪'){
this.otherFacilities.VIdetector.total = element.count
this.otherFacilities.VIdetector.details = element.description
}else if(element.facilityName == '泡沫水喷雾系统'){
this.otherFacilities.foamWaterSpraySystem.total = element.count
this.otherFacilities.foamWaterSpraySystem.details = element.description
}
}else if(element.groupName == '自动消防设施'){
if(element.facilityName == '喷水灭火系统'){
this.automaticFireProtectionFacility.fireSprinklingSystem.total = element.count
this.automaticFireProtectionFacility.fireSprinklingSystem.details = element.description
}else if(element.facilityName == '自动报警系统'){
this.automaticFireProtectionFacility.automaticAlarmSystem.total = element.count
this.automaticFireProtectionFacility.automaticAlarmSystem.details = element.description
}else if(element.facilityName == '防排烟系统'){
this.automaticFireProtectionFacility.smokeControlAndExhaustSystem.total = element.count
this.automaticFireProtectionFacility.smokeControlAndExhaustSystem.details = element.description
}else if(element.facilityName == '水幕系统'){
this.automaticFireProtectionFacility.waterCurtainSystem.total = element.count
this.automaticFireProtectionFacility.waterCurtainSystem.details = element.description
}else if(element.facilityName == '消防泵'){
this.automaticFireProtectionFacility.firePump.total = element.count
this.automaticFireProtectionFacility.firePump.details = element.description
}
}else if(element.groupName == '消防水源'){
if(element.facilityName == '消防水池'){
this.fireWaterSupply.firePool.total = element.count
this.fireWaterSupply.firePool.details = element.description
}
}
}) : null
} }
//创建建筑消防设施内置分组项 //创建建筑消防设施内置分组项
@ -277,6 +473,24 @@ export class FireFightingDeviceComponent implements OnInit {
//保存建筑消防设施内置分组项 //保存建筑消防设施内置分组项
editBuildingGrouping (e,item) { editBuildingGrouping (e,item) {
function returnBody(object,groupName){
let body = []
for (const key in object) {
if (Object.prototype.hasOwnProperty.call(object, key)) {
const element = object[key];
if(element.total || element.details){
body.push({
buildingId: item.buildingId,
groupName: groupName,
facilityName: element.name,
count: element.total,
description: element.details
})
}
}
}
return body
}
let companyId = this.route.snapshot.queryParams.id let companyId = this.route.snapshot.queryParams.id
let header = {companyId:companyId,buildingId:e.id, groupId:item.id} let header = {companyId:companyId,buildingId:e.id, groupId:item.id}
let data = [] let data = []
@ -290,14 +504,56 @@ export class FireFightingDeviceComponent implements OnInit {
data.push(msg) data.push(msg)
if (index==item.facilityItems.length-1) { if (index==item.facilityItems.length-1) {
this.http.post('/api/BuildingFacilityItems/Batch',data,{params:header}).subscribe(data=>{ this.http.post('/api/BuildingFacilityItems/Batch',data,{params:header}).subscribe(data=>{
let putBody
if(item.name == '消防水源'){
putBody = returnBody(this.fireWaterSupply,'消防水源')
}else if(item.name == '消防水系统'){
putBody = returnBody(this.fireProtectionWaterSystem,'消防水系统')
}else if(item.name == '消防灭火给水系统'){
putBody = returnBody(this.FireExtinguishingWaterSupplySystem,'消防灭火给水系统')
}else if(item.name == '其它'){
putBody = returnBody(this.other,'其它')
}else if(item.name == '消防设施'){
putBody = returnBody(this.fireFightingEquipment,'消防设施')
}else if(item.name == '消火栓系统'){
putBody = returnBody(this.hydrantSystem,'消火栓系统')
}else if(item.name == '其它设施'){
putBody = returnBody(this.otherFacilities,'其它设施')
}else if(item.name == '自动消防设施'){
putBody = returnBody(this.otherFacilities,'自动消防设施')
}
if(putBody.length != 0){
this.http.put('/api/BuildingFacilities/FacilityStatUpdate',putBody,{
params:{
buildingId : item.buildingId
}
}).subscribe(data => {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
this.snackBar.open('数据更新成功','确定',config); this.snackBar.open('数据更新成功','确定',config);
this.tabbarService.sendMessage('changeScore');//通知服务改变分数 this.tabbarService.sendMessage('changeScore');//通知服务改变分数
}) } },err => {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('更新失败','确定',config);
})
}else{
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('数据更新成功','确定',config);
this.tabbarService.sendMessage('changeScore');//通知服务改变分数
}
},err => {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('更新失败','确定',config);
})
}
}); //forEach }); //forEach
} }
//删除建筑消防设施内置分组项 //删除建筑消防设施内置分组项

5
src/app/key-unit/key-site/key-site.component.html

@ -40,7 +40,10 @@
<ng-container matColumnDef="img"> <ng-container matColumnDef="img">
<th mat-header-cell *matHeaderCellDef>图片</th> <th mat-header-cell *matHeaderCellDef>图片</th>
<td mat-cell *matCellDef="let element"> <td mat-cell *matCellDef="let element">
<a href="javascript:void(0);" (click)='seeImg(element.imageUrls)' style="color: blue;">查看图片</a> <a href="javascript:void(0);" (click)='seeImg(element)' style="color: blue;">查看图片</a>
<a href="javascript:;" class="file">
<input type="file" name="" id="" (change)="selectFile(element,$event)" >上传图片
</a>
</td> </td>
</ng-container> </ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>

30
src/app/key-unit/key-site/key-site.component.scss

@ -20,6 +20,35 @@ table {
} }
} }
.file {
position: relative;
display: inline-block;
background: #D0EEFF;
border: 1px solid #99D3F5;
border-radius: 4px;
padding: 4px 12px;
overflow: hidden;
color: #1E88C7;
text-decoration: none;
text-indent: 0;
line-height: 20px;
vertical-align: middle;
margin-left: 3px;
}
.file input {
position: absolute;
font-size: 100px;
right: 0;
top: 0;
opacity: 0;
}
.file:hover {
background: #AADFFD;
border-color: #78C3F3;
color: #004974;
text-decoration: none;
}
//重点提示 //重点提示
.tips{ .tips{
width: 75%; width: 75%;
@ -44,6 +73,7 @@ table {
.imgDiaLogBox{ .imgDiaLogBox{
width: 1450px; width: 1450px;
height: 810px; height: 810px;
position: relative;
//预览图片 //预览图片
.previewImgBox { .previewImgBox {
width: 1350px; width: 1350px;

52
src/app/key-unit/key-site/key-site.component.ts

@ -147,7 +147,7 @@ export class KeySiteComponent implements OnInit {
//查看图片 //查看图片
seeImg (e) { seeImg (e) {
if (e.length) { if (e.imageUrls.length != 0) {
let data = e let data = e
const dialogRef = this.dialog.open(KeySiteImgs, {//调用open方法打开对话框并且携带参数过去 const dialogRef = this.dialog.open(KeySiteImgs, {//调用open方法打开对话框并且携带参数过去
data}); data});
@ -160,6 +160,56 @@ export class KeySiteComponent implements OnInit {
} }
} }
objectName:any //上传对象名
keySiteItem:any
keySiteItemImgList:any //重点部位图片集合
//上传素材图片
selectFile(element,e){
let imgFile = e.target.files[0] || null //上传的文件
this.keySiteItemImgList = element.imageUrls ? element.imageUrls : []
this.keySiteItem = element
console.log(this.keySiteItem)
this.startUploading(imgFile)
}
startUploading (imgFile) {
let _this = this
let file = imgFile || null //获取上传的文件
let fileSize = file.size || null //上传文件的总大小
let shardSize = 5 * 1024 * 1024 //5MB一个分片
let companyId = sessionStorage.getItem("companyId")
if (file && fileSize <= shardSize) { //上传文件<=5MB时
let formData = new FormData()
formData.append("file",file)
this.http.post(`api/Objects/WebPlan2D/${companyId}`,formData).subscribe((data:any)=>{
this.objectName = data.objectName
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('上传成功','确定',config)
this.keySiteItemImgList.push("/api/Objects/WebPlan2D/" + this.objectName)
this.keySiteItem.imageUrls = this.keySiteItemImgList
this.http.put(`/api/BuildingImportantLocations/${this.keySiteItem.id}`,this.keySiteItem,{
params:{
companyId : companyId
}
}).subscribe((data)=>{
// console.log(666,'修改成功')
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('修改成功','确定',config)
})
})
} else if (file && fileSize > shardSize) { //上传文件>5MB时,分块上传
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('上传图片文件不允许大于5mb','确定',config);
}
}
//封装方法获取更新当前tab页重点提示 //封装方法获取更新当前tab页重点提示
toUpdate (e) { toUpdate (e) {
let id = {buildingId:e.id} let id = {buildingId:e.id}

9
src/app/key-unit/key-site/keysiteimgs.component.html

@ -1,12 +1,15 @@
<div class="imgDiaLogBox"> <div class="imgDiaLogBox">
<div mat-dialog-title>图片详情</div> <div mat-dialog-title>图片详情</div>
<span *ngIf="allImages.length != 0" style="position: absolute;right: 2px;top: 2px;cursor: pointer;z-index: 200;">
<mat-icon class="hoverred" (click)="deleteImg()">delete</mat-icon>
</span>
<div class="swiper-container"> <div class="swiper-container">
<div class="swiper-wrapper"> <div class="swiper-wrapper">
<div *ngFor="let item of allImages" class="swiper-slide previewImgBox"> <div *ngFor="let item of allImages" class="swiper-slide previewImgBox">
<img [ngClass]="{'rotateA':rotationAngle==90,'rotateB':rotationAngle==180,'rotateC':rotationAngle==270} " class="swiper-lazy" <img [ngClass]="{'rotateA':rotationAngle==90,'rotateB':rotationAngle==180,'rotateC':rotationAngle==270} " class="swiper-lazy"
[attr.data-src]="item"> [src]="item">
<div class="swiper-lazy-preloader"></div> <!-- <div class="swiper-lazy-preloader"></div> -->
</div> </div>
</div> </div>
@ -15,7 +18,7 @@
<div class="swiper-button-next"></div> <div class="swiper-button-next"></div>
</div> </div>
<div class="previewImgBottom"> <div class="previewImgBottom" *ngIf="allImages.length != 0">
<button type="button" mat-icon-button (click)='rotate()'><mat-icon>refresh</mat-icon></button> <button type="button" mat-icon-button (click)='rotate()'><mat-icon>refresh</mat-icon></button>
</div> </div>
</div> </div>

47
src/app/key-unit/key-site/keysiteimgs.component.ts

@ -2,7 +2,7 @@ import { Component, OnInit, Inject ,ViewChild} from '@angular/core';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import Swiper from 'swiper'; import Swiper from 'swiper';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
@Component({ @Component({
@ -14,19 +14,16 @@ import Swiper from 'swiper';
export class KeySiteImgs { export class KeySiteImgs {
constructor(private http:HttpClient,public dialog: MatDialog,public dialogRef: MatDialogRef<KeySiteImgs>, constructor(private http:HttpClient,public dialog: MatDialog,public dialogRef: MatDialogRef<KeySiteImgs>,
@Inject(MAT_DIALOG_DATA) public data) { } @Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) { }
testSwiper: Swiper; testSwiper: Swiper;
ngOnInit(): void { ngOnInit(): void {
this.allImages = [] this.allImages = []
this.data.forEach(element => { this.data.imageUrls.forEach(element => {
element = `${element}?x-oss-process=image/auto-orient,1` element = `${element}`
this.allImages.push(element) this.allImages.push(element)
}); });
} setTimeout(() => {
ngAfterViewInit() {
this.testSwiper = new Swiper('.swiper-container', { this.testSwiper = new Swiper('.swiper-container', {
direction: 'horizontal', direction: 'horizontal',
loop: false, loop: false,
@ -37,6 +34,12 @@ export class KeySiteImgs {
prevEl: '.swiper-button-prev', prevEl: '.swiper-button-prev',
} }
}); });
}, 0);
}
ngAfterViewInit() {
} }
@ -49,7 +52,35 @@ export class KeySiteImgs {
if (this.rotationAngle === 360) {this.rotationAngle = 0} if (this.rotationAngle === 360) {this.rotationAngle = 0}
} }
deleteImg(){
if(this.allImages.legth != 0){
let isTrue = window.confirm('您确定要删除该图片吗?')
if(isTrue){
// this.allImages = [...this.allImages.filter((item)=>{
// return item != this.allImages[this.testSwiper.activeIndex]
// })]
//在图片循环数组中将图片去掉
this.allImages.splice(this.testSwiper.activeIndex, 1);
//更新swiper视图
setTimeout(() => {
this.testSwiper.update()
}, 0);
this.data.imageUrls = this.allImages
this.http.put(`/api/BuildingImportantLocations/${this.data.id}`,this.data,{
params:{
companyId : sessionStorage.getItem("companyId")
}
}).subscribe((data)=>{
// console.log(666,'修改成功')
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('删除成功','确定',config)
})
}
}
}
} }

6
src/app/key-unit/realistic-picture-look/realistic-picture.component.html

@ -8,7 +8,7 @@
<mat-icon title="删除" (click)='delete()'>delete</mat-icon> --> <mat-icon title="删除" (click)='delete()'>delete</mat-icon> -->
</div> </div>
</div> </div>
<div> <div style="box-sizing: border-box;padding-top: 20px;">
<div *ngFor="let item of allRealPicture,let key=index" class="material" <div *ngFor="let item of allRealPicture,let key=index" class="material"
[ngClass]="{'leftFile': selectRealIndex===key}" (click)="changeReal(item,key)"> [ngClass]="{'leftFile': selectRealIndex===key}" (click)="changeReal(item,key)">
<mat-icon class="btn">folder</mat-icon><span>{{item.name}}</span> <mat-icon class="btn">folder</mat-icon><span>{{item.name}}</span>
@ -42,8 +42,8 @@
<div class="fixedImg"><img [src]="item.newImageUrl" (click)='operation(item,key)' [ngClass]="{'selectImg': item.checked}"></div> <div class="fixedImg"><img [src]="item.newImageUrl" (click)='operation(item,key)' [ngClass]="{'selectImg': item.checked}"></div>
<label style="margin-left: 5px;">图片名称:</label> <label style="margin-left: 5px;">图片名称:</label>
<input type="text" style="margin-left: 10px;" [(ngModel)]="item.nameStart" maxlength="20"> <input type="text" style="margin-left: 10px;" [(ngModel)]="item.nameStart" maxlength="20">
<a href="javascript:" style="margin-left: 5px;" (click)='preservationImg(item)'>保存</a> <!-- <a href="javascript:" style="margin-left: 5px;" (click)='preservationImg(item)'>保存</a>
<a href="javascript:" style="margin-left: 5px;" (click)="deleteImg(item)">删除</a> <a href="javascript:" style="margin-left: 5px;" (click)="deleteImg(item)">删除</a> -->
</div> </div>
<p style="width: 100px;margin: 30px auto;" *ngIf="!allImages.length">暂无数据</p> <p style="width: 100px;margin: 30px auto;" *ngIf="!allImages.length">暂无数据</p>

7
src/app/key-unit/realistic-picture-look/realistic-picture.component.scss

@ -49,10 +49,13 @@
.material { .material {
cursor:pointer; cursor:pointer;
height: 30px; height: 35px;
line-height: 35px;
font-size: 16px; font-size: 16px;
margin-top: 10px;
padding-left: 15px; padding-left: 15px;
.mat-icon {
vertical-align:super;
}
span { span {
max-width: 200px; max-width: 200px;
display: inline-block; display: inline-block;

30
src/app/key-unit/realistic-picture-look/realistic-picture.component.ts

@ -29,6 +29,12 @@ export class RealisticPictureLookComponent implements OnInit {
companyId : companyId companyId : companyId
}}).subscribe((data:any)=>{ }}).subscribe((data:any)=>{
this.allRealPicture = data this.allRealPicture = data
this.allRealPicture.unshift({
companyId:sessionStorage.getItem('companyId'),
id:'重点部位',
name: "重点部位",
realityImages:null
})
this.selectReal = data[0] this.selectReal = data[0]
this.getAllRealPicture() this.getAllRealPicture()
}) })
@ -70,20 +76,35 @@ export class RealisticPictureLookComponent implements OnInit {
//获取实景图分组对应实景图 //获取实景图分组对应实景图
getAllRealPicture () { getAllRealPicture () {
if (this.selectReal) { if (this.selectReal) {
let data ={ let data
if(this.selectReal.id == '重点部位'){
data = {
groupId: this.selectReal.id,
companyId : this.selectReal.companyId,
PageNumber: this.PageNumber || 1,
pageSize: this.pageSize,
}
}else{
data = {
groupId: this.selectReal.id, groupId: this.selectReal.id,
PageNumber: this.PageNumber || 1, PageNumber: this.PageNumber || 1,
pageSize: this.pageSize, pageSize: this.pageSize,
} }
}
this.http.get('/api/RealityImages',{params:data}).subscribe((data:any)=>{ this.http.get('/api/RealityImages',{params:data}).subscribe((data:any)=>{
this.allImages = data.items this.allImages = data.items
this.length = data.totalCount this.length = data.totalCount
this.pageSize = data.pageSize this.pageSize = data.pageSize
this.downloadList = [] this.downloadList = []
this.allImages.forEach(element => { //每张图片设置选中状态为false this.allImages.forEach(element => { //每张图片设置选中状态为false
if(this.selectReal.id == '重点部位'){
element.newImageUrl = `${element.imageUrl}?x-oss-process=image/resize,m_fill,h_170,w_299`
element.nameStart = element.name
}else{
element.newImageUrl = `/api/Objects/PlanPlatform/${element.imageUrl}?x-oss-process=image/resize,m_fill,h_170,w_299` //处理图片URL地址 element.newImageUrl = `/api/Objects/PlanPlatform/${element.imageUrl}?x-oss-process=image/resize,m_fill,h_170,w_299` //处理图片URL地址
element.checked = false //图片是否选中布尔值
element.nameStart = element.name.substring(0,element.name.lastIndexOf(".")); //图片名称前缀 element.nameStart = element.name.substring(0,element.name.lastIndexOf(".")); //图片名称前缀
}
element.checked = false //图片是否选中布尔值
element.nameEnd = element.name.substring(element.name.lastIndexOf("."),element.name.length); //图片名称后缀 element.nameEnd = element.name.substring(element.name.lastIndexOf("."),element.name.length); //图片名称后缀
}); });
@ -119,6 +140,7 @@ export class RealisticPictureLookComponent implements OnInit {
else {this.downloadList.splice(this.downloadList.findIndex(item => item.id === e.id), 1)} else {this.downloadList.splice(this.downloadList.findIndex(item => item.id === e.id), 1)}
} else { //预览图片 } else { //预览图片
let data = { let data = {
selectReal:this.selectReal,
allImages:this.allImages, allImages:this.allImages,
imgIndex: index} imgIndex: index}
let dialogRef = this.dialog.open(previewImg3, let dialogRef = this.dialog.open(previewImg3,
@ -374,7 +396,11 @@ export class previewImg3 {
ngOnInit(): void { ngOnInit(): void {
this.allImages = this.data.allImages this.allImages = this.data.allImages
this.allImages.forEach(element => { this.allImages.forEach(element => {
if( this.data.selectReal.id == '重点部位'){
element.previewImageUrl = `${element.imageUrl}` //处理图片URL地址
}else{
element.previewImageUrl = `/api/Objects/PlanPlatform/${element.imageUrl}?x-oss-process=image/auto-orient,1` //处理图片URL地址 element.previewImageUrl = `/api/Objects/PlanPlatform/${element.imageUrl}?x-oss-process=image/auto-orient,1` //处理图片URL地址
}
}); });
} }

8
src/app/key-unit/realistic-picture/realistic-picture.component.html

@ -8,7 +8,7 @@
<mat-icon title="删除" (click)='delete()'>delete</mat-icon> <mat-icon title="删除" (click)='delete()'>delete</mat-icon>
</div> </div>
</div> </div>
<div> <div style="box-sizing: border-box;padding-top: 20px;">
<div *ngFor="let item of allRealPicture,let key=index" class="material" <div *ngFor="let item of allRealPicture,let key=index" class="material"
[ngClass]="{'leftFile': selectRealIndex===key}" (click)="changeReal(item,key)"> [ngClass]="{'leftFile': selectRealIndex===key}" (click)="changeReal(item,key)">
<mat-icon class="btn">folder</mat-icon><span>{{item.name}}</span> <mat-icon class="btn">folder</mat-icon><span>{{item.name}}</span>
@ -23,7 +23,7 @@
<div class="topBox"> <div class="topBox">
<div> <div>
<span class="title" *ngIf="selectReal">{{selectReal.name}}</span> <span class="title" *ngIf="selectReal">{{selectReal.name}}</span>
<button mat-raised-button color="primary" class="uploadFileFixed" *ngIf="!isLoading"> <button mat-raised-button color="primary" class="uploadFileFixed" *ngIf="!isLoading && selectReal && selectReal.id != '重点部位'">
上传图片 上传图片
<input type="file" id="uploadFile" class="uploadFile" (change)='uploadFile($event)' ng2FileSelect [uploader]="uploader" accept="image/*"> <input type="file" id="uploadFile" class="uploadFile" (change)='uploadFile($event)' ng2FileSelect [uploader]="uploader" accept="image/*">
</button> </button>
@ -42,8 +42,8 @@
<div class="fixedImg"><img [src]="item.newImageUrl" (click)='operation(item,key)' [ngClass]="{'selectImg': item.checked}"></div> <div class="fixedImg"><img [src]="item.newImageUrl" (click)='operation(item,key)' [ngClass]="{'selectImg': item.checked}"></div>
<label style="margin-left: 5px;">图片名称:</label> <label style="margin-left: 5px;">图片名称:</label>
<input type="text" style="margin-left: 10px;" [(ngModel)]="item.nameStart" maxlength="20"> <input type="text" style="margin-left: 10px;" [(ngModel)]="item.nameStart" maxlength="20">
<a href="javascript:" style="margin-left: 5px;" (click)='preservationImg(item)'>保存</a> <a *ngIf="selectReal.id != '重点部位'" href="javascript:" style="margin-left: 5px;" (click)='preservationImg(item)'>保存</a>
<a href="javascript:" style="margin-left: 5px;" (click)="deleteImg(item)">删除</a> <a *ngIf="selectReal.id != '重点部位'" href="javascript:" style="margin-left: 5px;" (click)="deleteImg(item)">删除</a>
</div> </div>
<p style="width: 100px;margin: 30px auto;" *ngIf="!allImages.length">暂无数据</p> <p style="width: 100px;margin: 30px auto;" *ngIf="!allImages.length">暂无数据</p>

7
src/app/key-unit/realistic-picture/realistic-picture.component.scss

@ -49,10 +49,13 @@
.material { .material {
cursor:pointer; cursor:pointer;
height: 30px; height: 35px;
line-height: 35px;
font-size: 16px; font-size: 16px;
margin-top: 10px;
padding-left: 15px; padding-left: 15px;
.mat-icon {
vertical-align:super;
}
span { span {
max-width: 200px; max-width: 200px;
display: inline-block; display: inline-block;

53
src/app/key-unit/realistic-picture/realistic-picture.component.ts

@ -30,6 +30,12 @@ export class RealisticPictureComponent implements OnInit {
companyId : companyId companyId : companyId
}}).subscribe((data:any)=>{ }}).subscribe((data:any)=>{
this.allRealPicture = data this.allRealPicture = data
this.allRealPicture.unshift({
companyId:sessionStorage.getItem('companyId'),
id:'重点部位',
name: "重点部位",
realityImages:null
})
this.selectReal = data[0] this.selectReal = data[0]
this.getAllRealPicture() this.getAllRealPicture()
}) })
@ -71,20 +77,35 @@ export class RealisticPictureComponent implements OnInit {
//获取实景图分组对应实景图 //获取实景图分组对应实景图
getAllRealPicture () { getAllRealPicture () {
if (this.selectReal) { if (this.selectReal) {
let data ={ let data
if(this.selectReal.id == '重点部位'){
data = {
groupId: this.selectReal.id,
companyId : this.selectReal.companyId,
PageNumber: this.PageNumber || 1,
pageSize: this.pageSize,
}
}else{
data = {
groupId: this.selectReal.id, groupId: this.selectReal.id,
PageNumber: this.PageNumber || 1, PageNumber: this.PageNumber || 1,
pageSize: this.pageSize, pageSize: this.pageSize,
} }
}
this.http.get('/api/RealityImages',{params:data}).subscribe((data:any)=>{ this.http.get('/api/RealityImages',{params:data}).subscribe((data:any)=>{
this.allImages = data.items this.allImages = data.items
this.length = data.totalCount this.length = data.totalCount
this.pageSize = data.pageSize this.pageSize = data.pageSize
this.downloadList = [] this.downloadList = []
this.allImages.forEach(element => { //每张图片设置选中状态为false this.allImages.forEach(element => { //每张图片设置选中状态为false
if(this.selectReal.id == '重点部位'){
element.newImageUrl = `${element.imageUrl}?x-oss-process=image/resize,m_fill,h_170,w_299`
element.nameStart = element.name
}else{
element.newImageUrl = `/api/Objects/PlanPlatform/${element.imageUrl}?x-oss-process=image/resize,m_fill,h_170,w_299` //处理图片URL地址 element.newImageUrl = `/api/Objects/PlanPlatform/${element.imageUrl}?x-oss-process=image/resize,m_fill,h_170,w_299` //处理图片URL地址
element.checked = false //图片是否选中布尔值
element.nameStart = element.name.substring(0,element.name.lastIndexOf(".")); //图片名称前缀 element.nameStart = element.name.substring(0,element.name.lastIndexOf(".")); //图片名称前缀
}
element.checked = false //图片是否选中布尔值
element.nameEnd = element.name.substring(element.name.lastIndexOf("."),element.name.length); //图片名称后缀 element.nameEnd = element.name.substring(element.name.lastIndexOf("."),element.name.length); //图片名称后缀
}); });
@ -120,6 +141,7 @@ export class RealisticPictureComponent implements OnInit {
else {this.downloadList.splice(this.downloadList.findIndex(item => item.id === e.id), 1)} else {this.downloadList.splice(this.downloadList.findIndex(item => item.id === e.id), 1)}
} else { //预览图片 } else { //预览图片
let data = { let data = {
selectReal:this.selectReal,
allImages:this.allImages, allImages:this.allImages,
imgIndex: index} imgIndex: index}
let dialogRef = this.dialog.open(previewImg, let dialogRef = this.dialog.open(previewImg,
@ -351,15 +373,28 @@ export class RealisticPictureComponent implements OnInit {
this.isLoading = true this.isLoading = true
for (let i=0;i<this.downloadList.length;i++) { for (let i=0;i<this.downloadList.length;i++) {
let result = await new Promise ((result,reject)=>{ let result = await new Promise ((result,reject)=>{
this.http.get(`/api/Objects/PlanPlatform/${this.downloadList[i].imageUrl}`,{responseType: 'blob'},).subscribe(data=>{ let url
if(this.selectReal.id == '重点部位'){
url = this.downloadList[i].imageUrl
}else{
url =`/api/Objects/PlanPlatform/${this.downloadList[i].imageUrl}`
}
this.http.get(url,{responseType: 'blob'},).subscribe((data:any)=>{
let url = window.URL.createObjectURL(new Blob([data])); //createObjectURL创建一个下载Blob的url地址 let url = window.URL.createObjectURL(new Blob([data])); //createObjectURL创建一个下载Blob的url地址
let link = document.createElement("a"); let link = document.createElement("a");
link.style.display = "none"; link.style.display = "none";
link.href = url; link.href = url;
link.setAttribute("download", this.downloadList[i].name); let imgName
if(this.selectReal.id == '重点部位'){
imgName = this.downloadList[i].name + '.' + data.type.split('/')[data.type.split('/').length - 1]
}else{
imgName = this.downloadList[i].name
}
link.setAttribute("download", imgName);
document.body.appendChild(link); document.body.appendChild(link);
link.click(); link.click();
result('success')}) result('success')
})
}) })
if(i == this.downloadList.length-1) { //判断是否下载完毕 if(i == this.downloadList.length-1) { //判断是否下载完毕
this.isLoading = false this.isLoading = false
@ -398,7 +433,12 @@ export class previewImg {
ngOnInit(): void { ngOnInit(): void {
this.allImages = this.data.allImages this.allImages = this.data.allImages
this.allImages.forEach(element => { this.allImages.forEach(element => {
if( this.data.selectReal.id == '重点部位'){
element.previewImageUrl = `${element.imageUrl}` //处理图片URL地址
}else{
element.previewImageUrl = `/api/Objects/PlanPlatform/${element.imageUrl}?x-oss-process=image/auto-orient,1` //处理图片URL地址 element.previewImageUrl = `/api/Objects/PlanPlatform/${element.imageUrl}?x-oss-process=image/auto-orient,1` //处理图片URL地址
}
}); });
} }
@ -408,9 +448,6 @@ export class previewImg {
initialSlide: this.data.imgIndex, initialSlide: this.data.imgIndex,
direction: 'horizontal', direction: 'horizontal',
loop: false, loop: false,
// 如果需要前进后退按钮 // 如果需要前进后退按钮
navigation: { navigation: {
nextEl: '.swiper-button-next', nextEl: '.swiper-button-next',

2
src/app/key-unit/view-unit-details-plan/view-unit-details-plan.component.html

@ -29,7 +29,7 @@
<app-router-gis></app-router-gis> <app-router-gis></app-router-gis>
</ng-template> </ng-template>
</mat-tab> </mat-tab>
<mat-tab label="7.周边水源"> <mat-tab label="7.周边水源及力量">
<ng-template matTabContent> <ng-template matTabContent>
<app-water-road></app-water-road> <app-water-road></app-water-road>
</ng-template> </ng-template>

2
src/app/key-unit/view-unit-details/view-unit-details.component.html

@ -49,7 +49,7 @@
<app-router-gis></app-router-gis> <app-router-gis></app-router-gis>
</ng-template> </ng-template>
</mat-tab> </mat-tab>
<mat-tab label="9.周边水源"> <mat-tab label="9.周边水源及力量">
<ng-template matTabContent> <ng-template matTabContent>
<app-water-road></app-water-road> <app-water-road></app-water-road>
</ng-template> </ng-template>

69
src/app/key-unit/water-road/water-road.component.ts

@ -128,20 +128,51 @@ export class WaterRoadComponent implements OnInit {
let config = new MatSnackBarConfig(); let config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
this.snackBar.open('请选择水源类型','确定',config); this.snackBar.open('请选择要显示的类型','确定',config);
}else{ }else{
let paramsdata:any = {
console.log('选中的内容',this.selectedWaterList)
function checkAdult(item) {
return item <= 2;
}
function checkAdult2(item) {
return item >= 3;
}
const water = this.selectedWaterList.filter(checkAdult);
const power = this.selectedWaterList.filter(checkAdult2);
console.log('water',water)
console.log('power',power)
let waterparamsdata:any = {
PageSize:99999,
Lon : this.unitData.location.x,
Lat : this.unitData.location.y,
Distance : Distance,
WaterSourceTypes :water
}
let powerparamsdata:any = {
PageSize:99999, PageSize:99999,
Lon : this.unitData.location.x, Lon : this.unitData.location.x,
Lat : this.unitData.location.y, Lat : this.unitData.location.y,
Distance : Distance, Distance : Distance,
WaterSourceTypes :this.selectedWaterList WaterSourceTypes :power
} }
// console.log('paramsdata',paramsdata) if( water.length == 0 ){
this.http.get("/api/WaterSources",{params:paramsdata}).subscribe((data:any) => { this.http.get("/api/CustomFireForce",{params:powerparamsdata}).subscribe((data2:any) => {
// console.log('所有水源',data) this.createwaterMarker(data2)
})
}else if( power.length == 0 ){
this.http.get("/api/WaterSources",{params:waterparamsdata}).subscribe((data:any) => {
this.createwaterMarker(data.items) this.createwaterMarker(data.items)
}) })
}else{
this.http.get("/api/WaterSources",{params:waterparamsdata}).subscribe((data:any) => {
this.http.get("/api/CustomFireForce",{params:powerparamsdata}).subscribe((data2:any) => {
let allData = [...data.items,...data2]
this.createwaterMarker(allData)
})
})
}
} }
} }
@ -154,6 +185,7 @@ export class WaterRoadComponent implements OnInit {
this.waterCluster ? this.waterCluster.setData([]) : null this.waterCluster ? this.waterCluster.setData([]) : null
list.forEach((item) => { list.forEach((item) => {
let image let image
if(item.waterSourceType == 0 || item.waterSourceType == 1 || item.waterSourceType == 2){
if(item.waterSourceType == 0){//消火栓 if(item.waterSourceType == 0){//消火栓
image = '/assets/waterMarkers/市政消火栓.png' image = '/assets/waterMarkers/市政消火栓.png'
}else if(item.waterSourceType == 1){//消防水池 }else if(item.waterSourceType == 1){//消防水池
@ -162,11 +194,32 @@ export class WaterRoadComponent implements OnInit {
image = '/assets/waterMarkers/天然水源.png' image = '/assets/waterMarkers/天然水源.png'
} }
// 用于点集合的数组 // 用于点集合的数组
waterMarkerArrcluster.push({ item.location ? waterMarkerArrcluster.push({
lnglat : [item.location.x,item.location.y], lnglat : [item.location.x,item.location.y],
image : image, image : image,
data : item data : item
}) }) : null
}else{
if(item.forceType == 2){
image = '/assets/fireForcesMarkers/其他.png'
}else if(item.level == 0){
image = '/assets/fireForcesMarkers/总队.png'
}else if(item.level == 1){
image = '/assets/fireForcesMarkers/支队.png'
}else if(item.level == 2){
image = '/assets/fireForcesMarkers/大队.png'
}else if(item.level == 3){
image = '/assets/fireForcesMarkers/中队.png'
}
// 用于点集合的数组
item.fireForceDetailInfo.location ?
waterMarkerArrcluster.push({
lnglat : [item.fireForceDetailInfo.location.x,item.fireForceDetailInfo.location.y],
image : image,
data : item
}) : null
}
}) })
this.map.plugin(["AMap.MarkerClusterer"],() => { this.map.plugin(["AMap.MarkerClusterer"],() => {
var gridSize = 60 var gridSize = 60

31
src/app/statistic-analysis/home/home.component.html

@ -77,9 +77,12 @@
</div> </div>
<!-- 右侧 --> <!-- 右侧 -->
<div class="main-right"> <div class="main-right">
<div class="box-wrap planNum" style="flex: 0.7"> <div class="box-wrap planNum" style="flex: 0.7;position: relative;">
<span style="position: absolute;right: 3px;top: 3px;color: white;cursor: pointer;" (click)="changeNumList()">
<mat-icon>autorenew</mat-icon>
</span>
<div class="panel-bd" style="padding-top: 13px;"> <div class="panel-bd" style="padding-top: 13px;">
<div class="total-box"> <div class="total-box" *ngIf="isNumList">
<div class="total-item" (click)="threePlan()"> <div class="total-item" (click)="threePlan()">
<div class="total-name">三维预案总数</div> <div class="total-name">三维预案总数</div>
<div class="total-num">{{threePlanNum}}</div> <div class="total-num">{{threePlanNum}}</div>
@ -97,6 +100,28 @@
<div class="total-num">{{otherPlanNum}}</div> <div class="total-num">{{otherPlanNum}}</div>
</div> </div>
</div> </div>
<div class="total-box" *ngIf="!isNumList">
<div class="total-item xxx">
<div class="total-name">一级预案总数</div>
<div class="total-num">{{aPlan}}</div>
</div>
<div class="total-item xxx">
<div class="total-name">二级预案总数</div>
<div class="total-num">{{bPlan}}</div>
</div>
<div class="total-item xxx">
<div class="total-name">三级预案总数</div>
<div class="total-num">{{cPlan}}</div>
</div>
<div class="total-item xxx">
<div class="total-name">四级预案总数</div>
<div class="total-num">{{dPlan}}</div>
</div>
<div class="total-item xxx">
<div class="total-name">五级预案总数</div>
<div class="total-num">{{ePlan}}</div>
</div>
</div>
</div> </div>
</div> </div>
<div class="box-wrap mt" style="flex: 2.3; max-height: 410px;"> <div class="box-wrap mt" style="flex: 2.3; max-height: 410px;">
@ -113,4 +138,4 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>

8
src/app/statistic-analysis/home/home.component.scss

@ -16,6 +16,10 @@
cursor: pointer; cursor: pointer;
} }
.total-item div{ .total-item div{
height: 25px!important; height: 23px!important;
line-height: 25px!important; line-height: 23px!important;
}
.xxx div{
height: 20px!important;
line-height: 20px!important;
} }

10
src/app/statistic-analysis/home/home.component.ts

@ -292,6 +292,12 @@ export class HomeComponent implements OnInit {
cardPlanNum = "6403" cardPlanNum = "6403"
otherPlanNum = "2208" otherPlanNum = "2208"
aPlan = '328'
bPlan = '219'
cPlan = '168'
dPlan = '254'
ePlan = '116'
ngAfterViewInit(): void { ngAfterViewInit(): void {
} }
@ -736,4 +742,8 @@ export class HomeComponent implements OnInit {
}) })
} }
isNumList:boolean = true
changeNumList(){
this.isNumList = !this.isNumList
}
} }

11
src/app/ui/collection-tools-building/collection-tools.component.ts

@ -424,11 +424,17 @@ export class CollectionToolsBuildingComponent implements OnInit {
let index = this.canvasAssetObj.PropertyInfos.findIndex((item)=>{ let index = this.canvasAssetObj.PropertyInfos.findIndex((item)=>{
return i.PropertyName == item.PropertyName return i.PropertyName == item.PropertyName
}) })
if(this.myIsNaN(e.target.value)){
e.target.value = String(e.target.value)
}
this.canvasAssetObj.PropertyInfos[index].PropertyValue = e.target.value this.canvasAssetObj.PropertyInfos[index].PropertyValue = e.target.value
this.canvasData.isChange = true this.canvasData.isChange = true
this.canvas.refreshIcon(this.canvasAssetObj.Id) this.canvas.refreshIcon(this.canvasAssetObj.Id)
} }
//判断是否是数字类型
myIsNaN(value) {
return typeof value === 'number' && !isNaN(value);
}
//动态属性素材布尔值框改变radio //动态属性素材布尔值框改变radio
assetRadioChange(i,boolean){ assetRadioChange(i,boolean){
let index = this.canvasAssetObj.PropertyInfos.findIndex((item)=>{ let index = this.canvasAssetObj.PropertyInfos.findIndex((item)=>{
@ -770,6 +776,9 @@ export class CollectionToolsBuildingComponent implements OnInit {
// console.log(item) // console.log(item)
item.assetData.PropertyInfos.forEach(element => { item.assetData.PropertyInfos.forEach(element => {
if(element.PropertyName == i.PropertyName){ if(element.PropertyName == i.PropertyName){
if(this.myIsNaN(i.PropertyValue)){
i.PropertyValue = String(i.PropertyValue)
}
element.PropertyValue = i.PropertyValue element.PropertyValue = i.PropertyValue
this.canvas.refreshIcon(item.assetData.Id) this.canvas.refreshIcon(item.assetData.Id)
this.canvasData.isChange = true this.canvasData.isChange = true

10
src/app/ui/collection-tools-plan/collection-tools.component.ts

@ -423,11 +423,18 @@ export class CollectionToolsPlanComponent implements OnInit {
// this.canvas.setHighlight(arr) // this.canvas.setHighlight(arr)
} }
//判断是否是数字类型
myIsNaN(value) {
return typeof value === 'number' && !isNaN(value);
}
//动态属性素材input框值改变 //动态属性素材input框值改变
assetInputChange(i,e){ assetInputChange(i,e){
let index = this.canvasAssetObj.PropertyInfos.findIndex((item)=>{ let index = this.canvasAssetObj.PropertyInfos.findIndex((item)=>{
return i.PropertyName == item.PropertyName return i.PropertyName == item.PropertyName
}) })
if(this.myIsNaN(e.target.value)){
e.target.value = String(e.target.value)
}
this.canvasAssetObj.PropertyInfos[index].PropertyValue = e.target.value this.canvasAssetObj.PropertyInfos[index].PropertyValue = e.target.value
this.canvasData.isChange = true this.canvasData.isChange = true
this.canvas.refreshIcon(this.canvasAssetObj.Id) this.canvas.refreshIcon(this.canvasAssetObj.Id)
@ -775,6 +782,9 @@ export class CollectionToolsPlanComponent implements OnInit {
this.multipleAssetData.forEach(item=>{ this.multipleAssetData.forEach(item=>{
item.assetData.PropertyInfos.forEach(element => { item.assetData.PropertyInfos.forEach(element => {
if(element.PropertyName == i.PropertyName){ if(element.PropertyName == i.PropertyName){
if(this.myIsNaN(i.PropertyValue)){
i.PropertyValue = String(i.PropertyValue)
}
element.PropertyValue = i.PropertyValue element.PropertyValue = i.PropertyValue
this.canvas.refreshIcon(item.assetData.Id) this.canvas.refreshIcon(item.assetData.Id)
this.canvasData.isChange = true this.canvasData.isChange = true

11
src/app/ui/collection-tools/collection-tools.component.ts

@ -453,12 +453,18 @@ export class CollectionToolsComponent implements OnInit {
assetHighLightIunput(){ assetHighLightIunput(){
} }
//判断是否是数字类型
myIsNaN(value) {
return typeof value === 'number' && !isNaN(value);
}
//动态属性素材input框值改变 //动态属性素材input框值改变
assetInputChange(i,e){ assetInputChange(i,e){
let index = this.canvasAssetObj.PropertyInfos.findIndex((item)=>{ let index = this.canvasAssetObj.PropertyInfos.findIndex((item)=>{
return i.PropertyName == item.PropertyName return i.PropertyName == item.PropertyName
}) })
if(this.myIsNaN(e.target.value)){
e.target.value = String(e.target.value)
}
this.canvasAssetObj.PropertyInfos[index].PropertyValue = e.target.value this.canvasAssetObj.PropertyInfos[index].PropertyValue = e.target.value
this.canvasData.isChange = true this.canvasData.isChange = true
this.canvas.refreshIcon(this.canvasAssetObj.Id) this.canvas.refreshIcon(this.canvasAssetObj.Id)
@ -801,6 +807,9 @@ export class CollectionToolsComponent implements OnInit {
this.multipleAssetData.forEach(item=>{ this.multipleAssetData.forEach(item=>{
item.assetData.PropertyInfos.forEach(element => { item.assetData.PropertyInfos.forEach(element => {
if(element.PropertyName == i.PropertyName){ if(element.PropertyName == i.PropertyName){
if(this.myIsNaN(i.PropertyValue)){
i.PropertyValue = String(i.PropertyValue)
}
element.PropertyValue = i.PropertyValue element.PropertyValue = i.PropertyValue
this.canvas.refreshIcon(item.assetData.Id) this.canvas.refreshIcon(item.assetData.Id)
this.canvasData.isChange = true this.canvasData.isChange = true

3
src/app/working-area/model/axLegend.ts

@ -41,6 +41,7 @@ export class AxLegend extends AxShape {
public addItem(item: Legend) { public addItem(item: Legend) {
if (this.shapeMap.has(item.Name)) { if (this.shapeMap.has(item.Name)) {
this.shapeMap.get(item.Name).Count++; this.shapeMap.get(item.Name).Count++;
this.shapeMap.get(item.Name).Index++;
} else { } else {
this.shapeMap.set(item.Name, item); this.shapeMap.set(item.Name, item);
} }
@ -449,6 +450,7 @@ export class Legend {
public Name: string; public Name: string;
public ImageUrl: string; public ImageUrl: string;
public Count: number; public Count: number;
public Index: number;
/** /**
* *
*/ */
@ -456,5 +458,6 @@ export class Legend {
this.Name = name; this.Name = name;
this.ImageUrl = imageUrl; this.ImageUrl = imageUrl;
this.Count = count; this.Count = count;
this.Index = 1;
} }
} }

36
src/app/working-area/working-area.component.ts

@ -24,6 +24,7 @@ import { Viewport } from 'pixi-viewport';
import { EVENT_IMAGE_RESIZE, EVENT_SELECTION_CHANGED } from './model/events'; import { EVENT_IMAGE_RESIZE, EVENT_SELECTION_CHANGED } from './model/events';
import { Dimensioning } from './model/dimensioning'; import { Dimensioning } from './model/dimensioning';
import { Configuration, viewBounds } from './model/configuration'; import { Configuration, viewBounds } from './model/configuration';
import { id } from 'date-fns/locale';
@Component({ @Component({
@ -144,6 +145,10 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
* *
*/ */
public allowEdit = true; public allowEdit = true;
/**
*
*/
public shapesIndex: Map<string, number> = new Map<string, number>();
/** /**
* *
*/ */
@ -166,7 +171,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
* - * -
* - * -
*/ */
public VERSION = '1.4.2.20210325_rc'; public VERSION = '1.4.3.20210415_rc';
/** /**
* *
*/ */
@ -524,7 +529,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
*/ */
private createGrid2D(): void { private createGrid2D(): void {
this.grid2D = new Grid2D(this.camera2D, null); this.grid2D = new Grid2D(this.camera2D, null);
this.camera2D.addChild(this.grid2D); this.camera2D.addChild(this.grid2D);
} }
/** /**
@ -593,6 +597,18 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
&& axShape.assetData.Name !== '图例') { && axShape.assetData.Name !== '图例') {
const itemLegend = new Legend(axShape.assetData.Name, axShape.assetData.ImageUrl, 1); const itemLegend = new Legend(axShape.assetData.Name, axShape.assetData.ImageUrl, 1);
temp.addItem(itemLegend); temp.addItem(itemLegend);
// 设置新增图形的名称/编号
let Id = temp.shapeMap.get(axShape.assetData.Name).Index;
let index = "000";
// 检查Id的长度
if (Id < 10) {
index = axShape.assetData.Name + "00" + Id;
} else if (Id < 100) {
index = axShape.assetData.Name + "0" + Id;
} else {
index = axShape.assetData.Name + Id;
}
(axShape.assetData.PropertyInfos.find(i => i.PropertyName == "名称/编号")).PropertyValue = index;
} }
this.emit('canvasDataChanged'); this.emit('canvasDataChanged');
this.canvasData.isChange = true; this.canvasData.isChange = true;
@ -721,6 +737,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
}); });
} }
} }
/** /**
* *
*/ */
@ -757,13 +774,13 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
case PaintMode.endPaint: case PaintMode.endPaint:
break; break;
case PaintMode.singlePointIcon: case PaintMode.singlePointIcon:
// 整理数据
const json = JSON.parse(JSON.stringify(this.canvasData.selectTemplateData.propertyInfos)); const json = JSON.parse(JSON.stringify(this.canvasData.selectTemplateData.propertyInfos));
const list = []; const list = [];
json.forEach(element => { json.forEach(element => {
const property = new PropertyInfo(element); const property = new PropertyInfo(element);
list.push(property); list.push(property);
}); });
const assetData = { const assetData = {
TemplateId: this.canvasData.selectTemplateData.id, TemplateId: this.canvasData.selectTemplateData.id,
CanConnect: this.canvasData.selectTemplateData.canConnect, CanConnect: this.canvasData.selectTemplateData.canConnect,
@ -793,7 +810,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
}; };
const singleIcon = new AxImageShape(assetData, this); const singleIcon = new AxImageShape(assetData, this);
this.emit('createIcon', singleIcon); this.emit('createIcon', singleIcon);
// this.emit('backgroundScale', this.backgroundImage.scale.x);
break; break;
case PaintMode.lineIcon: case PaintMode.lineIcon:
this.previewLineSegment.visible = true; this.previewLineSegment.visible = true;
@ -859,18 +875,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
GameMode: this.canvasData.gameMode, GameMode: this.canvasData.gameMode,
Tag: this.canvasData.selectTemplateData.tag Tag: this.canvasData.selectTemplateData.tag
}; };
// const assetData1 = {
// ImageUrl: this.canvasData.selectTemplateData.imageUrl,
// Point: new PIXI.Point(0, 0),
// Width: 32,
// Height: 32,
// MultiPoint: this.paintPoints,
// Name: this.canvasData.selectTemplateData.name
// };
this.paintingIcon = new MultipointIcon(assetData1, this); this.paintingIcon = new MultipointIcon(assetData1, this);
// this.paintingIcon = new MultipointIcon(this.previewSinglePointIcon.texture, new PIXI.Point(0, 0), this.paintPoints, this,
// this.canvasData.selectTemplateData.name);
// this.emit('backgroundScale', this.backgroundImage.scale.x);
break; break;
case PaintMode.polygonIcon: case PaintMode.polygonIcon:
this.previewLineSegment.visible = true; this.previewLineSegment.visible = true;
@ -1427,6 +1432,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV
this.enterPaintEndButton.visible = false; this.enterPaintEndButton.visible = false;
switch (this.paintMode) { switch (this.paintMode) {
case PaintMode.singlePointIcon: case PaintMode.singlePointIcon:
break; break;
case PaintMode.lineIcon: case PaintMode.lineIcon:
if (this.paintPoints.length >= 2) { if (this.paintPoints.length >= 2) {

1
src/assets/css/newStyle.css

@ -529,7 +529,6 @@ iframe { display: block; }
z-index: z-index:
*/ */
/*# sourceMappingURL=style.css.map */ /*# sourceMappingURL=style.css.map */
@media screen and (max-width:1200px){ @media screen and (max-width:1200px){
.main-left{ .main-left{

BIN
src/assets/images/消防力量.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

BIN
src/assets/images/联动力量.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 B

Loading…
Cancel
Save