diff --git a/src/app/canvas-share-data.service.ts b/src/app/canvas-share-data.service.ts index 4fef136..0fbc484 100644 --- a/src/app/canvas-share-data.service.ts +++ b/src/app/canvas-share-data.service.ts @@ -23,24 +23,29 @@ export class CanvasShareDataService { selectTemplateData: any; // 选择当前 模板数据 // 总平面图/建筑 楼层 - selectStorey:any = {area: '', details: ''}; // 选择当前 楼层 数据 - originalcompanyBuildingData:any; // 单位/建筑 数据 - originaleveryStoreyData:any; // 总平面图/楼层/区域 楼层数据 + selectStorey: any = { area: '', details: '' }; // 选择当前 楼层 数据 + originalcompanyBuildingData: any; // 单位/建筑 数据 + originaleveryStoreyData: any; // 总平面图/楼层/区域 楼层数据 // 总平面图/建筑 楼层 + + + + // 处置 节点 - allDisposalNode:any = []; // 所有 处置节点 - allNodeMarkers:any = { highlightMarkers:{}, markers:{} }; // 灾情 标签信息 - selectPanelPoint:DisposalNodeData = new DisposalNodeData(); // 当前数据节点 - selectPanelPointBaseData:any = {description: '', notes: '', weather: '', airTemperature: '', windDirection: '', windScale: ''}; // 当前 数据节点 对应 父级节点 + allDisposalNode: any = []; // 所有 处置节点 + allNodeMarkers: any = { highlightMarkers: {}, markers: {} }; // 灾情 标签信息 + selectPanelPoint: DisposalNodeData = new DisposalNodeData(); // 当前数据节点 + selectPanelPointBaseData: any = { description: '', notes: '', weather: '', airTemperature: '', windDirection: '', windScale: '' }; // 当前 数据节点 对应 父级节点 + isInheritSky:any; //缓存 节点 天气 - customizeDisposalNode:any; // 新建 自定义数据节点 底图+名称 + customizeDisposalNode: any; // 新建 自定义数据节点 底图+名称 // 处置 节点 /** * 游戏模式 */ - gameMode:GameMode = GameMode.BasicInformation; + gameMode: GameMode = GameMode.BasicInformation; facilityAssetsName = new Map([ ['消防水池', '消防水池'], @@ -263,6 +268,7 @@ export class CanvasShareDataService { important.Id = ''; important.ImageUrls = []; important.BuildingId = this.selectStorey.buildingId; + important.BuildingAreaId = item.FloorId; item.PropertyInfos.forEach(element => { if (element.PropertyName === '名称/编号') { important.Name = element.PropertyValue; @@ -409,6 +415,7 @@ export class BuildingAdjoinInfo { */ export class BuildingImportantLocationInfo { public BuildingId: string; + public BuildingAreaId: string; public Id: string; public Name: string; public Position: string; 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/edit-plan-info/edit-plan-info.component.html b/src/app/key-unit/edit-plan-info/edit-plan-info.component.html index 245a209..5443aac 100644 --- a/src/app/key-unit/edit-plan-info/edit-plan-info.component.html +++ b/src/app/key-unit/edit-plan-info/edit-plan-info.component.html @@ -50,7 +50,7 @@ - + diff --git a/src/app/key-unit/edit-unit-info/edit-unit-info.component.html b/src/app/key-unit/edit-unit-info/edit-unit-info.component.html index 264980a..d2b71c7 100644 --- a/src/app/key-unit/edit-unit-info/edit-unit-info.component.html +++ b/src/app/key-unit/edit-unit-info/edit-unit-info.component.html @@ -36,7 +36,7 @@ - + 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 e18b570..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 @@
- +
@@ -15,7 +18,7 @@
-
+
diff --git a/src/app/key-unit/key-site/keysiteimgs.component.ts b/src/app/key-unit/key-site/keysiteimgs.component.ts index 2bd98ac..593431c 100644 --- a/src/app/key-unit/key-site/keysiteimgs.component.ts +++ b/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 { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import Swiper from 'swiper'; - +import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; @Component({ @@ -14,29 +14,32 @@ import Swiper from 'swiper'; export class KeySiteImgs { constructor(private http:HttpClient,public dialog: MatDialog,public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data) { } + @Inject(MAT_DIALOG_DATA) public data,public snackBar: MatSnackBar) { } testSwiper: Swiper; ngOnInit(): void { this.allImages = [] - this.data.forEach(element => { - element = `${element}?x-oss-process=image/auto-orient,1` + this.data.imageUrls.forEach(element => { + element = `${element}` this.allImages.push(element) }); + setTimeout(() => { + this.testSwiper = new Swiper('.swiper-container', { + direction: 'horizontal', + loop: false, + lazy: true, + // 如果需要前进后退按钮 + navigation: { + nextEl: '.swiper-button-next', + prevEl: '.swiper-button-prev', + } + }); + }, 0); } ngAfterViewInit() { - this.testSwiper = new Swiper('.swiper-container', { - direction: 'horizontal', - loop: false, - lazy: true, - // 如果需要前进后退按钮 - navigation: { - nextEl: '.swiper-button-next', - prevEl: '.swiper-button-prev', - } - }); + } @@ -49,7 +52,35 @@ export class KeySiteImgs { 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) + }) + } + } + } } \ No newline at end of file diff --git a/src/app/key-unit/realistic-picture-look/realistic-picture.component.html b/src/app/key-unit/realistic-picture-look/realistic-picture.component.html index 0f42fc6..244a4d9 100644 --- a/src/app/key-unit/realistic-picture-look/realistic-picture.component.html +++ b/src/app/key-unit/realistic-picture-look/realistic-picture.component.html @@ -8,7 +8,7 @@ delete -->
-
+
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/key-unit/view-unit-details-plan/view-unit-details-plan.component.html b/src/app/key-unit/view-unit-details-plan/view-unit-details-plan.component.html index faa85fc..c9d9edb 100644 --- a/src/app/key-unit/view-unit-details-plan/view-unit-details-plan.component.html +++ b/src/app/key-unit/view-unit-details-plan/view-unit-details-plan.component.html @@ -29,7 +29,7 @@ - + diff --git a/src/app/key-unit/view-unit-details/view-unit-details.component.html b/src/app/key-unit/view-unit-details/view-unit-details.component.html index 164fc02..b8a75a1 100644 --- a/src/app/key-unit/view-unit-details/view-unit-details.component.html +++ b/src/app/key-unit/view-unit-details/view-unit-details.component.html @@ -49,7 +49,7 @@ - + diff --git a/src/app/key-unit/water-road/water-road.component.ts b/src/app/key-unit/water-road/water-road.component.ts index 0b63f74..3e87285 100644 --- a/src/app/key-unit/water-road/water-road.component.ts +++ b/src/app/key-unit/water-road/water-road.component.ts @@ -128,20 +128,51 @@ export class WaterRoadComponent implements OnInit { let config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('请选择水源类型','确定',config); + this.snackBar.open('请选择要显示的类型','确定',config); }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 :this.selectedWaterList + WaterSourceTypes :water } - // console.log('paramsdata',paramsdata) - this.http.get("/api/WaterSources",{params:paramsdata}).subscribe((data:any) => { - // console.log('所有水源',data) - this.createwaterMarker(data.items) - }) + let powerparamsdata:any = { + PageSize:99999, + Lon : this.unitData.location.x, + Lat : this.unitData.location.y, + Distance : Distance, + WaterSourceTypes :power + } + if( water.length == 0 ){ + this.http.get("/api/CustomFireForce",{params:powerparamsdata}).subscribe((data2:any) => { + this.createwaterMarker(data2) + }) + }else if( power.length == 0 ){ + this.http.get("/api/WaterSources",{params:waterparamsdata}).subscribe((data:any) => { + 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,19 +185,41 @@ export class WaterRoadComponent implements OnInit { this.waterCluster ? this.waterCluster.setData([]) : null list.forEach((item) => { let image - if(item.waterSourceType == 0){//消火栓 - image = '/assets/waterMarkers/市政消火栓.png' - }else if(item.waterSourceType == 1){//消防水池 - image = '/assets/waterMarkers/方形储水池.png' - }else if(item.waterSourceType == 2){//天然水源 - image = '/assets/waterMarkers/天然水源.png' + if(item.waterSourceType == 0 || item.waterSourceType == 1 || item.waterSourceType == 2){ + if(item.waterSourceType == 0){//消火栓 + image = '/assets/waterMarkers/市政消火栓.png' + }else if(item.waterSourceType == 1){//消防水池 + image = '/assets/waterMarkers/方形储水池.png' + }else if(item.waterSourceType == 2){//天然水源 + image = '/assets/waterMarkers/天然水源.png' + } + // 用于点集合的数组 + item.location ? waterMarkerArrcluster.push({ + lnglat : [item.location.x,item.location.y], + image : image, + 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 } - // 用于点集合的数组 - waterMarkerArrcluster.push({ - lnglat : [item.location.x,item.location.y], - image : image, - data : item - }) + }) this.map.plugin(["AMap.MarkerClusterer"],() => { var gridSize = 60 diff --git a/src/app/statistic-analysis/home/home.component.html b/src/app/statistic-analysis/home/home.component.html index a4c9a1c..77ce2d5 100644 --- a/src/app/statistic-analysis/home/home.component.html +++ b/src/app/statistic-analysis/home/home.component.html @@ -1,7 +1,7 @@
-
+
@@ -77,9 +77,12 @@
-
+
+ + autorenew +
-
+
三维预案总数
{{threePlanNum}}
@@ -97,6 +100,28 @@
{{otherPlanNum}}
+
+
+
一级预案总数
+
{{aPlan}}
+
+
+
二级预案总数
+
{{bPlan}}
+
+
+
三级预案总数
+
{{cPlan}}
+
+
+
四级预案总数
+
{{dPlan}}
+
+
+
五级预案总数
+
{{ePlan}}
+
+
@@ -112,5 +137,5 @@
-
-
\ No newline at end of file +
+
\ No newline at end of file diff --git a/src/app/statistic-analysis/home/home.component.scss b/src/app/statistic-analysis/home/home.component.scss index cb029d6..cf67a23 100644 --- a/src/app/statistic-analysis/home/home.component.scss +++ b/src/app/statistic-analysis/home/home.component.scss @@ -16,6 +16,10 @@ cursor: pointer; } .total-item div{ - height: 25px!important; - line-height: 25px!important; + height: 23px!important; + line-height: 23px!important; +} +.xxx div{ + height: 20px!important; + line-height: 20px!important; } diff --git a/src/app/statistic-analysis/home/home.component.ts b/src/app/statistic-analysis/home/home.component.ts index 52ea61e..d0a351c 100644 --- a/src/app/statistic-analysis/home/home.component.ts +++ b/src/app/statistic-analysis/home/home.component.ts @@ -292,6 +292,12 @@ export class HomeComponent implements OnInit { cardPlanNum = "6403" otherPlanNum = "2208" + + aPlan = '328' + bPlan = '219' + cPlan = '168' + dPlan = '254' + ePlan = '116' ngAfterViewInit(): void { } @@ -736,4 +742,8 @@ export class HomeComponent implements OnInit { }) } + isNumList:boolean = true + changeNumList(){ + this.isNumList = !this.isNumList + } } 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/app/working-area/model/axLegend.ts b/src/app/working-area/model/axLegend.ts index a1c8281..dffc4a8 100644 --- a/src/app/working-area/model/axLegend.ts +++ b/src/app/working-area/model/axLegend.ts @@ -41,6 +41,7 @@ export class AxLegend extends AxShape { public addItem(item: Legend) { if (this.shapeMap.has(item.Name)) { this.shapeMap.get(item.Name).Count++; + this.shapeMap.get(item.Name).Index++; } else { this.shapeMap.set(item.Name, item); } @@ -449,6 +450,7 @@ export class Legend { public Name: string; public ImageUrl: string; public Count: number; + public Index: number; /** * */ @@ -456,5 +458,6 @@ export class Legend { this.Name = name; this.ImageUrl = imageUrl; this.Count = count; + this.Index = 1; } } diff --git a/src/app/working-area/working-area.component.ts b/src/app/working-area/working-area.component.ts index 157d794..52628f2 100644 --- a/src/app/working-area/working-area.component.ts +++ b/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 { Dimensioning } from './model/dimensioning'; import { Configuration, viewBounds } from './model/configuration'; +import { id } from 'date-fns/locale'; @Component({ @@ -144,6 +145,10 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV * 允许编辑 */ public allowEdit = true; + /** + * 图形索引 + */ + public shapesIndex: Map = new Map(); /** * 动画控制器 */ @@ -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 { this.grid2D = new Grid2D(this.camera2D, null); - this.camera2D.addChild(this.grid2D); } /** @@ -593,6 +597,18 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV && axShape.assetData.Name !== '图例') { const itemLegend = new Legend(axShape.assetData.Name, axShape.assetData.ImageUrl, 1); 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.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: break; case PaintMode.singlePointIcon: + // 整理数据 const json = JSON.parse(JSON.stringify(this.canvasData.selectTemplateData.propertyInfos)); const list = []; json.forEach(element => { const property = new PropertyInfo(element); list.push(property); }); - const assetData = { TemplateId: this.canvasData.selectTemplateData.id, CanConnect: this.canvasData.selectTemplateData.canConnect, @@ -793,7 +810,6 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV }; const singleIcon = new AxImageShape(assetData, this); this.emit('createIcon', singleIcon); - // this.emit('backgroundScale', this.backgroundImage.scale.x); break; case PaintMode.lineIcon: this.previewLineSegment.visible = true; @@ -859,18 +875,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV GameMode: this.canvasData.gameMode, 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(this.previewSinglePointIcon.texture, new PIXI.Point(0, 0), this.paintPoints, this, - // this.canvasData.selectTemplateData.name); - // this.emit('backgroundScale', this.backgroundImage.scale.x); break; case PaintMode.polygonIcon: this.previewLineSegment.visible = true; @@ -1427,6 +1432,7 @@ export class WorkingAreaComponent extends EventEmitter implements OnInit, AfterV this.enterPaintEndButton.visible = false; switch (this.paintMode) { case PaintMode.singlePointIcon: + break; case PaintMode.lineIcon: if (this.paintPoints.length >= 2) { diff --git a/src/assets/css/newStyle.css b/src/assets/css/newStyle.css index db64b51..a590f6a 100644 --- a/src/assets/css/newStyle.css +++ b/src/assets/css/newStyle.css @@ -529,7 +529,6 @@ iframe { display: block; } z-index: */ - /*# sourceMappingURL=style.css.map */ @media screen and (max-width:1200px){ .main-left{ diff --git a/src/assets/images/消防力量.png b/src/assets/images/消防力量.png new file mode 100644 index 0000000..18e0993 Binary files /dev/null and b/src/assets/images/消防力量.png differ diff --git a/src/assets/images/联动力量.png b/src/assets/images/联动力量.png new file mode 100644 index 0000000..a283141 Binary files /dev/null and b/src/assets/images/联动力量.png differ