Browse Source

[新增]gis管理增加力量显示;消防要素手动输入;实景图增加查看重点部位功能

zhuzhou
邵佳豪 4 years ago
parent
commit
97f18c65f2
  1. 2
      src/app/data-collection/fire-force/fire-force.component.ts
  2. 81
      src/app/gis-management/gis-labeling/gis-labeling.component.html
  3. 2
      src/app/gis-management/gis-labeling/gis-labeling.component.scss
  4. 423
      src/app/gis-management/gis-labeling/gis-labeling.component.ts
  5. 2
      src/app/key-unit/fire-fighting-device/fire-fighting-device.component.html
  6. 298
      src/app/key-unit/fire-fighting-device/fire-fighting-device.component.ts
  7. 6
      src/app/key-unit/realistic-picture-look/realistic-picture.component.html
  8. 7
      src/app/key-unit/realistic-picture-look/realistic-picture.component.scss
  9. 40
      src/app/key-unit/realistic-picture-look/realistic-picture.component.ts
  10. 8
      src/app/key-unit/realistic-picture/realistic-picture.component.html
  11. 7
      src/app/key-unit/realistic-picture/realistic-picture.component.scss
  12. 63
      src/app/key-unit/realistic-picture/realistic-picture.component.ts
  13. 11
      src/app/ui/collection-tools-building/collection-tools.component.ts
  14. 10
      src/app/ui/collection-tools-plan/collection-tools.component.ts
  15. 11
      src/app/ui/collection-tools/collection-tools.component.ts
  16. BIN
      src/assets/images/消防力量.png
  17. BIN
      src/assets/images/联动力量.png

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

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

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

@ -99,7 +99,6 @@
<div class="contantbox">
<div *ngIf="selectedTitle == 0" class="keyUnitBox">
<form [formGroup]="keyUnitForm" class="inputList" (submit)='ketUnitSubmit(keyUnitForm.value)'>
<div style="display: flex;justify-content: space-between;align-items: center;">
<mat-checkbox color="primary" formControlName="allSelectedUnit" (change)="selectedAllUnit($event)">全选</mat-checkbox>
@ -173,14 +172,88 @@
</form>
</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>
<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>
</div>
<button class="clearbutton" (click)="clearnAll()">清除</button>
</div>
<div *ngIf="selectedTitle == 3" class="coverageBox">
<div *ngIf="selectedTitle == 5" class="coverageBox">
<div class="topbox">
<span>图层</span>
<div style="display: flex;align-items: center;">
@ -201,6 +274,8 @@
</div>
</div>
</div>
</div>
<!-- 右上角 -->

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

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

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

@ -19,6 +19,8 @@ export class GisLabelingComponent implements OnInit {
selectedTitle:number
titleList = [ {name:'重点单位',iconImg:'/assets/images/uniticon.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/coverageicon.png'}
]
@ -27,14 +29,47 @@ export class GisLabelingComponent implements OnInit {
{id:'0',name:'消火栓',selected:false},
{id:'1',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右上角重点单位表单
watertForm : FormGroup//gis右上角水源表单
fireForceForm : FormGroup//gis右上角消防力量表单
linkageForcesForm : FormGroup//gis右上角联动力量表单
selectedUnitList:any = []//选择提交的单位
selectedWaterList:any = []//选择提交的水源
selectedFireForceList:any = []//选择提交的消防力量
selectedLinkageForcesList:any = []//选择提交的联动力量
unitAreaDefault:any = '-1'//默认单位范围
waterAreaDefault:any = '-1'//默认水源范围
fireForceAreaDefault:any = '-1'//默认消防力量范围
linkageForcesAreaDefault:any = '-1'//默认联动力量范围
//获得单位循环出来的checkbox列表(formControl实例)
get units():any{
return this.keyUnitForm.get('units')
@ -42,6 +77,13 @@ export class GisLabelingComponent implements OnInit {
get waters():any{
return this.watertForm.get('waters')
}
get fireForce():any{
return this.fireForceForm.get('fireForce')
}
get linkageForces():any{
return this.linkageForcesForm.get('linkageForces')
}
async getAllBuildingType(){
let result = await new Promise((result,reject)=>{
this.http.get('/api/BuildingTypes/Simple').subscribe((data:any) => {
@ -69,6 +111,17 @@ export class GisLabelingComponent implements OnInit {
allSelectedWater: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到数组
this.units.valueChanges.subscribe(values => {
let selects:string[] = []
@ -84,6 +137,21 @@ export class GisLabelingComponent implements OnInit {
});
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()
})
}
@ -102,6 +170,21 @@ export class GisLabelingComponent implements OnInit {
});
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(){
this.keyUnitList.forEach(item => {
@ -114,6 +197,16 @@ export class GisLabelingComponent implements OnInit {
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({
@ -139,6 +232,32 @@ export class GisLabelingComponent implements OnInit {
fillColor: '#ee2200',
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){
if(this.markers.length == 0){
@ -341,6 +460,271 @@ export class GisLabelingComponent implements OnInit {
this.map.remove(this.circle)
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){
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
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){
@ -501,7 +886,6 @@ export class GisLabelingComponent implements OnInit {
this.keyUnitForm.controls.areaUnit.setValue('0')
}
}
//全选水源
selectedAllWater(event){
if(event.checked){
@ -511,7 +895,24 @@ export class GisLabelingComponent implements OnInit {
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/fire-fighting-device/fire-fighting-device.component.html

@ -1,5 +1,5 @@
<div class="content">
<mat-tab-group>
<mat-tab-group (selectedIndexChange)="selectedChange($event)">
<!-- <mat-tab style="display: none;" label="单位消防设施">
<div class="contentBox">

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

@ -247,56 +247,67 @@ export class FireFightingDeviceComponent implements OnInit {
//消防水系统
fireProtectionWaterSystem = {
waterSupplyNetwork:{total:'666',details:'999'},//供水管网
sprinklerSystem:{total:'666',details:'999'}//自动喷水灭火系统
waterSupplyNetwork:{name:'供水管网',total:'',details:''},//供水管网
sprinklerSystem:{name:'自动喷水灭火系统',total:'',details:''}//自动喷水灭火系统
}
//消防灭火给水系统
FireExtinguishingWaterSupplySystem = {
sprinklerSystem:{total:'666',details:'999'},//供水管网
AutomaticGasFireExtinguishingSystem:{total:'666',details:'999'},//自动喷水灭火系统
firePumpRoom:{total:'666',details:'999'}//消防泵房
sprinklerSystem:{name:'自动喷水灭火系统',total:'',details:''},//自动喷水灭火系统
AutomaticGasFireExtinguishingSystem:{name:'气体自动灭火系统',total:'',details:''},//气体自动灭火系统
firePumpRoom:{name:'消防泵房',total:'',details:''}//消防泵房
}
//其
//其
other = {
purgingSystem:{total:'666',details:'999'},//排烟系统
fireExtinguisher:{total:'666',details:'999'},//灭火器
extinctionUsingGas:{total:'666',details:'999'},//气体灭火
fireControlCommunication:{total:'666',details:'999'}//消防通信
purgingSystem:{name:'排烟系统',total:'',details:''},//排烟系统
fireExtinguisher:{name:'灭火器',total:'',details:''},//灭火器
extinctionUsingGas:{name:'气体灭火',total:'',details:''},//气体灭火
fireControlCommunication:{name:'消防通信',total:'',details:''}//消防通信
}
//消防设施
fireFightingEquipment = {
automaticAlarmSystem:{total:'666',details:'999'},//自动报警系统
firePump:{total:'666',details:'999'}//消防泵
automaticAlarmSystem:{name:'自动报警系统',total:'',details:''},//自动报警系统
firePump:{name:'消防泵',total:'',details:''}//消防泵
}
//消火栓系统
hydrantSystem = {
fireExtinguishingAgent:{total:'666',details:'999'},//灭火剂
AlarmFacilities:{total:'666',details:'999'},//报警设施
FireControlPipeNetwork:{total:'666',details:'999'}//消防管网
fireExtinguishingAgent:{name:'灭火剂',total:'',details:''},//灭火剂
AlarmFacilities:{name:'报警设施',total:'',details:''},//报警设施
FireControlPipeNetwork:{name:'消防管网',total:'',details:''}//消防管网
}
//其它设施
otherFacilities = {
givePriorityToBroadcast:{total:'666',details:'999'},//优先广播
VIdetector:{total:'666',details:'999'},//VI检测仪
foamWaterSpraySystem:{total:'666',details:'999'},//泡沫水喷雾系统
givePriorityToBroadcast:{name:'优先广播',total:'',details:''},//优先广播
VIdetector:{name:'VI检测仪',total:'',details:''},//VI检测仪
foamWaterSpraySystem:{name:'泡沫水喷雾系统',total:'',details:''},//泡沫水喷雾系统
}
//自动消防设施
automaticFireProtectionFacility = {
fireSprinklingSystem:{total:'666',details:'999'},//喷水灭火系统
automaticAlarmSystem:{total:'666',details:'999'},//自动报警系统
smokeControlAndExhaustSystem:{total:'666',details:'999'},//防排烟系统
waterCurtainSystem:{total:'666',details:'999'},//水幕系统
firePump:{total:'666',details:'999'}//消防泵
fireSprinklingSystem:{name:'喷水灭火系统',total:'',details:''},//喷水灭火系统
automaticAlarmSystem:{name:'自动报警系统',total:'',details:''},//自动报警系统
smokeControlAndExhaustSystem:{name:'防排烟系统',total:'',details:''},//防排烟系统
waterCurtainSystem:{name:'水幕系统',total:'',details:''},//水幕系统
firePump:{name:'消防泵',total:'',details:''}//消防泵
}
//消防水源
fireWaterSupply = {
firePool:{total:'666',details:'999'}//消防水池
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 () {
let companyId = this.route.snapshot.queryParams.id
let index = 0
this.allBuildingGrouping.forEach(element => {
let header = {buildingId: element.id, buildingType: element.buildingTypes[0].id,companyId:companyId}
this.http.get('/api/BuildingFacilities',{params:header}).subscribe(data=>{
@ -311,9 +322,144 @@ export class FireFightingDeviceComponent implements OnInit {
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
}
//创建建筑消防设施内置分组项
@ -325,33 +471,89 @@ export class FireFightingDeviceComponent implements OnInit {
});
}
//保存建筑消防设施内置分组项
editBuildingGrouping (e,item) {
console.log(111,e)
console.log(222,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 header = {companyId:companyId,buildingId:e.id, groupId:item.id}
let data = []
// item.facilityItems.forEach((element,index) => {
// let msg = {
// isBuiltin: element.isBuiltin,
// details: element.details,
// name: element.name,
// isEachFloor: element.isEachFloor,
// order: element.order}
// data.push(msg)
// if (index==item.facilityItems.length-1) {
// this.http.post('/api/BuildingFacilityItems/Batch',data,{params:header}).subscribe(data=>{
// const config = new MatSnackBarConfig();
// config.verticalPosition = 'top';
// config.duration = 3000
// this.snackBar.open('数据更新成功','确定',config);
// this.tabbarService.sendMessage('changeScore');//通知服务改变分数
// }) }
// }); //forEach
item.facilityItems.forEach((element,index) => {
let msg = {
isBuiltin: element.isBuiltin,
details: element.details,
name: element.name,
isEachFloor: element.isEachFloor,
order: element.order}
data.push(msg)
if (index==item.facilityItems.length-1) {
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();
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);
})
}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
}
//删除建筑消防设施内置分组项

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

@ -8,7 +8,7 @@
<mat-icon title="删除" (click)='delete()'>delete</mat-icon> -->
</div>
</div>
<div>
<div style="box-sizing: border-box;padding-top: 20px;">
<div *ngFor="let item of allRealPicture,let key=index" class="material"
[ngClass]="{'leftFile': selectRealIndex===key}" (click)="changeReal(item,key)">
<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>
<label style="margin-left: 5px;">图片名称:</label>
<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)="deleteImg(item)">删除</a>
<!-- <a href="javascript:" style="margin-left: 5px;" (click)='preservationImg(item)'>保存</a>
<a href="javascript:" style="margin-left: 5px;" (click)="deleteImg(item)">删除</a> -->
</div>
<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 {
cursor:pointer;
height: 30px;
height: 35px;
line-height: 35px;
font-size: 16px;
margin-top: 10px;
padding-left: 15px;
.mat-icon {
vertical-align:super;
}
span {
max-width: 200px;
display: inline-block;

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

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

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

@ -8,7 +8,7 @@
<mat-icon title="删除" (click)='delete()'>delete</mat-icon>
</div>
</div>
<div>
<div style="box-sizing: border-box;padding-top: 20px;">
<div *ngFor="let item of allRealPicture,let key=index" class="material"
[ngClass]="{'leftFile': selectRealIndex===key}" (click)="changeReal(item,key)">
<mat-icon class="btn">folder</mat-icon><span>{{item.name}}</span>
@ -23,7 +23,7 @@
<div class="topBox">
<div>
<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/*">
</button>
@ -42,8 +42,8 @@
<div class="fixedImg"><img [src]="item.newImageUrl" (click)='operation(item,key)' [ngClass]="{'selectImg': item.checked}"></div>
<label style="margin-left: 5px;">图片名称:</label>
<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)="deleteImg(item)">删除</a>
<a *ngIf="selectReal.id != '重点部位'" href="javascript:" style="margin-left: 5px;" (click)='preservationImg(item)'>保存</a>
<a *ngIf="selectReal.id != '重点部位'" href="javascript:" style="margin-left: 5px;" (click)="deleteImg(item)">删除</a>
</div>
<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 {
cursor:pointer;
height: 30px;
height: 35px;
line-height: 35px;
font-size: 16px;
margin-top: 10px;
padding-left: 15px;
.mat-icon {
vertical-align:super;
}
span {
max-width: 200px;
display: inline-block;

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

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

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

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

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

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