From 97f18c65f2879b8ed25aa652cd190dc0fc0f9d9c Mon Sep 17 00:00:00 2001 From: SHAOJIAHAO <55341701@qq.com> Date: Thu, 22 Apr 2021 10:23:46 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]gis=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8A=9B=E9=87=8F=E6=98=BE=E7=A4=BA=EF=BC=9B?= =?UTF-8?q?=E6=B6=88=E9=98=B2=E8=A6=81=E7=B4=A0=E6=89=8B=E5=8A=A8=E8=BE=93?= =?UTF-8?q?=E5=85=A5=EF=BC=9B=E5=AE=9E=E6=99=AF=E5=9B=BE=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E9=87=8D=E7=82=B9=E9=83=A8=E4=BD=8D=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fire-force/fire-force.component.ts | 2 - .../gis-labeling/gis-labeling.component.html | 81 +++- .../gis-labeling/gis-labeling.component.scss | 2 +- .../gis-labeling/gis-labeling.component.ts | 423 +++++++++++++++++- .../fire-fighting-device.component.html | 2 +- .../fire-fighting-device.component.ts | 300 +++++++++++-- .../realistic-picture.component.html | 6 +- .../realistic-picture.component.scss | 7 +- .../realistic-picture.component.ts | 40 +- .../realistic-picture.component.html | 8 +- .../realistic-picture.component.scss | 7 +- .../realistic-picture.component.ts | 63 ++- .../collection-tools.component.ts | 11 +- .../collection-tools.component.ts | 10 + .../collection-tools.component.ts | 13 +- src/assets/images/消防力量.png | Bin 0 -> 338 bytes src/assets/images/联动力量.png | Bin 0 -> 407 bytes 17 files changed, 874 insertions(+), 101 deletions(-) create mode 100644 src/assets/images/消防力量.png create mode 100644 src/assets/images/联动力量.png diff --git a/src/app/data-collection/fire-force/fire-force.component.ts b/src/app/data-collection/fire-force/fire-force.component.ts index ebcbf44..e649243 100644 --- a/src/app/data-collection/fire-force/fire-force.component.ts +++ b/src/app/data-collection/fire-force/fire-force.component.ts @@ -913,8 +913,6 @@ export class FireForceComponent implements OnInit { } - - //上传附件 file:any; //上传的文件 AttachmentArr:any = []//上传附件地址集合 diff --git a/src/app/gis-management/gis-labeling/gis-labeling.component.html b/src/app/gis-management/gis-labeling/gis-labeling.component.html index bb452b1..e357dfe 100644 --- a/src/app/gis-management/gis-labeling/gis-labeling.component.html +++ b/src/app/gis-management/gis-labeling/gis-labeling.component.html @@ -99,7 +99,6 @@
-
全选 @@ -173,14 +172,88 @@
-
+
+
+
+ 全选 + clear +
+
+ + {{fireForceList[i].name}} + +
+
+
+ 显示范围 : + + + +
+ + + +
+ +
+
+
+
+
+ 全选 + clear +
+
+ + {{linkageForcesList[i].name}} + +
+
+
+ 显示范围 : + + + +
+ + + +
+ +
+
+
 距离测量  面积测量
-
+
图层
@@ -201,6 +274,8 @@
+ +
diff --git a/src/app/gis-management/gis-labeling/gis-labeling.component.scss b/src/app/gis-management/gis-labeling/gis-labeling.component.scss index ef6b432..85d5aef 100644 --- a/src/app/gis-management/gis-labeling/gis-labeling.component.scss +++ b/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; diff --git a/src/app/gis-management/gis-labeling/gis-labeling.component.ts b/src/app/gis-management/gis-labeling/gis-labeling.component.ts index a869833..ebed877 100644 --- a/src/app/gis-management/gis-labeling/gis-labeling.component.ts +++ b/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 = ``; + 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 = ``; + 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') + } + } diff --git a/src/app/key-unit/fire-fighting-device/fire-fighting-device.component.html b/src/app/key-unit/fire-fighting-device/fire-fighting-device.component.html index 37151f4..d2e59a5 100644 --- a/src/app/key-unit/fire-fighting-device/fire-fighting-device.component.html +++ b/src/app/key-unit/fire-fighting-device/fire-fighting-device.component.html @@ -1,5 +1,5 @@
- +
-
+
folder{{item.name}} @@ -42,8 +42,8 @@
- 保存 - 删除 +

暂无数据

diff --git a/src/app/key-unit/realistic-picture-look/realistic-picture.component.scss b/src/app/key-unit/realistic-picture-look/realistic-picture.component.scss index bc7edcb..c6f4426 100644 --- a/src/app/key-unit/realistic-picture-look/realistic-picture.component.scss +++ b/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; diff --git a/src/app/key-unit/realistic-picture-look/realistic-picture.component.ts b/src/app/key-unit/realistic-picture-look/realistic-picture.component.ts index 7aeee4e..3024591 100644 --- a/src/app/key-unit/realistic-picture-look/realistic-picture.component.ts +++ b/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地址 + } }); } diff --git a/src/app/key-unit/realistic-picture/realistic-picture.component.html b/src/app/key-unit/realistic-picture/realistic-picture.component.html index 1f9fd76..34cfb72 100644 --- a/src/app/key-unit/realistic-picture/realistic-picture.component.html +++ b/src/app/key-unit/realistic-picture/realistic-picture.component.html @@ -8,7 +8,7 @@ delete
-
+
folder{{item.name}} @@ -23,7 +23,7 @@
{{selectReal.name}} - @@ -42,8 +42,8 @@
- 保存 - 删除 + 保存 + 删除

暂无数据

diff --git a/src/app/key-unit/realistic-picture/realistic-picture.component.scss b/src/app/key-unit/realistic-picture/realistic-picture.component.scss index 01acbee..3265929 100644 --- a/src/app/key-unit/realistic-picture/realistic-picture.component.scss +++ b/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; diff --git a/src/app/key-unit/realistic-picture/realistic-picture.component.ts b/src/app/key-unit/realistic-picture/realistic-picture.component.ts index 4b66124..01fef81 100644 --- a/src/app/key-unit/realistic-picture/realistic-picture.component.ts +++ b/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.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', diff --git a/src/app/ui/collection-tools-building/collection-tools.component.ts b/src/app/ui/collection-tools-building/collection-tools.component.ts index 1f400df..fc5c389 100644 --- a/src/app/ui/collection-tools-building/collection-tools.component.ts +++ b/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 diff --git a/src/app/ui/collection-tools-plan/collection-tools.component.ts b/src/app/ui/collection-tools-plan/collection-tools.component.ts index 05e59e8..22c666e 100644 --- a/src/app/ui/collection-tools-plan/collection-tools.component.ts +++ b/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 diff --git a/src/app/ui/collection-tools/collection-tools.component.ts b/src/app/ui/collection-tools/collection-tools.component.ts index 641f566..e044107 100644 --- a/src/app/ui/collection-tools/collection-tools.component.ts +++ b/src/app/ui/collection-tools/collection-tools.component.ts @@ -423,7 +423,7 @@ export class CollectionToolsComponent implements OnInit { //素材宽度输入框改变 assetWidthIunput(){ - this.canvasAssetObj.Width = this.assetWidth + this.canvasAssetObj.Width = this.assetWidth this.canvasData.isChange = true this.canvas.refreshIcon(this.canvasAssetObj.Id) } @@ -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 diff --git a/src/assets/images/消防力量.png b/src/assets/images/消防力量.png new file mode 100644 index 0000000000000000000000000000000000000000..18e09934dcaec27d71e54de4ae3f46387a9f3498 GIT binary patch literal 338 zcmV-Y0j>UtP)tbE5vytrg;R3XPlSz{RZb2h@e_W_$25lwx&wD zh;{4MJEp6cAwR+NgZUeA44O{JYy)^>t_z{ZpcmH};iHG+LWFqj*#5d{mI7|>2g8#}A01VK{vj0_zCr$FUDprmlJC=S9-lOVQ{&_H9a!?1vve1ck9{6|m)702i1`fL$RJaj5ae z3kUMqTu2jwYO2b%?AqI;80PbyM_s-hHDUL4W0ZWfM8HVC?_^002ovPDHLkV1hcC Bq{ILK literal 0 HcmV?d00001