diff --git a/proxy.config.json b/proxy.config.json index b28a11f..1898eac 100644 --- a/proxy.config.json +++ b/proxy.config.json @@ -1,6 +1,6 @@ { "/api": { - "target": "http://121.37.20.190:8000", + "target": "http://39.106.78.171:8000", "secure": false, "changeOrigin": true } diff --git a/src/app/canvas-share-data.service.ts b/src/app/canvas-share-data.service.ts index 6c915cf..aa7fc19 100644 --- a/src/app/canvas-share-data.service.ts +++ b/src/app/canvas-share-data.service.ts @@ -82,6 +82,23 @@ export class CanvasShareDataService { return returnData; } } + /** + * 更新建筑数据 + */ + public updateBuildingData() { + Object.keys(this.originaleveryStoreyData.data).forEach((key) => { + this.originalcompanyBuildingData.data[key] = this.originaleveryStoreyData.data[key]; + }); + } + /** + * 删除建筑数据中当前楼层的数据 + */ + public deleteBuildingDataByCurrentFloorData():void { + Object.keys(this.originaleveryStoreyData.data).forEach((key) => { + // 删除建筑数据 + delete this.originalcompanyBuildingData.data[key]; + }); + } /** * 获取单位毗邻信息 */ @@ -666,7 +683,7 @@ export class AssetData { /// /// 是否来自建筑 /// - public IsFromBuilding: boolean; + public IsFromBuilding: boolean; /// /// 渲染方式。 /// 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 9c0b704..a567a28 100644 --- a/src/app/gis-management/gis-labeling/gis-labeling.component.ts +++ b/src/app/gis-management/gis-labeling/gis-labeling.component.ts @@ -166,7 +166,7 @@ export class GisLabelingComponent implements OnInit { config.duration = 3000 this.snackBar.open('请切换2D模式使用此功能','确定',config); }else{ - console.log('提交',this.selectedUnit) + // console.log('提交',this.selectedUnit) this.circle.setRadius(Number(this.unitAreaDefault)) this.circle.setCenter(this.markers[0]._position) this.circle.setMap(this.map) @@ -185,7 +185,7 @@ export class GisLabelingComponent implements OnInit { Distance : Distance, BuildingTypeIdList : this.selectedUnitList.length != 0 ? this.selectedUnitList : ['123'] } - console.log(666,paramsdata) + // console.log(666,paramsdata) this.http.get("/api/Companies",{params:paramsdata}).subscribe((data:any) => { data.items.forEach((i,index) => { if(i.id == this.selectedUnit.id){ @@ -280,7 +280,7 @@ export class GisLabelingComponent implements OnInit { text: text, }); labelMarker.on('click', (e)=>{ - console.log(item) + // console.log(item) let markerContent = `
${item.name}
@@ -448,7 +448,7 @@ export class GisLabelingComponent implements OnInit { this.keyUnitForm.controls.areaUnit.setValue('0') this.map.remove(this.circle) this.clearUnitMarker()//取消显示单位markers - console.log('取消') + // console.log('取消') } //取消显示水源 @@ -458,7 +458,7 @@ export class GisLabelingComponent implements OnInit { this.watertForm.reset() this.watertForm.controls.areaWater.setValue('0') this.map.remove(this.circleofwater) - console.log('取消') + // console.log('取消') } //右上角点击每一个title @@ -553,6 +553,7 @@ export class GisLabelingComponent implements OnInit { layers:[layer], //当只想显示标准图层时layers属性可缺省, }); + that.map.setCity('上海市'); AMap.plugin(["AMap.RangingTool", "AMap.MouseTool"],function () { that.mouseTool=new AMap.MouseTool(that.map); /* that.measureDistance = new AMap.RangingTool(that.map, rulerOptions); //测距离 @@ -792,6 +793,9 @@ export class GisLabelingComponent implements OnInit { this.leftDivState = false this.showLeftDiv = false this.isShowRouteGIS = true + // console.log(1,e) + this.routeEnd = e.name + this.endCoordinate = new AMap.LngLat(e.location.x, e.location.y) } //全景漫游 @@ -864,9 +868,19 @@ export class GisLabelingComponent implements OnInit { var autoComplete = new AMap.Autocomplete(autoOptions); autoComplete.search(keywords, function(status, result) { if (result && result.tips && result.tips.length) { //搜索到数据时 - - that._ngZone.run(()=>{ e == 0 ? that.routeStartList = result.tips : that.routeEndList = result.tips }); - + that._ngZone.run(()=>{ + if(e == 0){ + that.routeStartList = result.tips + + + that.startCoordinate = new AMap.LngLat(result.tips[0].location.lng, result.tips[0].location.lat) + // console.log(666,result) + }else{ + that.routeEndList = result.tips + that.endCoordinate = new AMap.LngLat(result.tips[0].location.lng, result.tips[0].location.lat) + } + }); + } }) }) @@ -880,9 +894,11 @@ export class GisLabelingComponent implements OnInit { if (e==0) { this.routeStart = null this.routeStartList = [] + this.startCoordinate = null } else { this.routeEnd = null this.routeEndList = [] + this.endCoordinate = null } } @@ -892,9 +908,11 @@ export class GisLabelingComponent implements OnInit { this.routeStartList = [] this.routeEnd = null this.routeEndList = [] + this.startCoordinate = null + this.endCoordinate = null this.routeGIS? this.routeGIS.clear() : null this.routes = { distance: 0, time: 0, steps: [], } - console.log(this.selectedUnit) + // console.log(this.selectedUnit) this.map.setZoomAndCenter(13,[this.selectedUnit.location.x,this.selectedUnit.location.y]); //设置地图中心点 } @@ -905,9 +923,16 @@ export class GisLabelingComponent implements OnInit { this.routeEnd = data this.routeStartList = [] this.routeEndList = [] + let data2 = this.startCoordinate + this.startCoordinate = this.endCoordinate + this.endCoordinate = data2 } routes:any = { distance: 0, time: 0, steps: [], };//导航查询结果 路线规划 + + startCoordinate:any//开始坐标 + endCoordinate:any//结束坐标 + //导航查询 queryGISRoute () { //构造路线导航类 @@ -917,8 +942,10 @@ export class GisLabelingComponent implements OnInit { this.routeGIS = new AMap.Driving({ map: this.map, }); + // console.log(1,this.startCoordinate) + // console.log(2,this.endCoordinate) // 根据起终点名称规划驾车导航路线 - this.routeGIS.search([{keyword: this.routeStart},{keyword: this.routeEnd}], + this.routeGIS.search(this.startCoordinate,this.endCoordinate, function(status, result) { if (status === 'complete') { that.routes = result.routes[0] @@ -938,7 +965,7 @@ export class GisLabelingComponent implements OnInit { policy: e==true? AMap.DrivingPolicy.LEAST_TIME : AMap.DrivingPolicy.REAL_TRAFFIC }); // 根据起终点名称规划驾车导航路线 - this.routeGIS.search([{keyword: this.routeStart},{keyword: this.routeEnd}], + this.routeGIS.search(this.startCoordinate,this.endCoordinate, function(status, result) { if (status === 'complete') { that.routes = result.routes[0] @@ -1051,7 +1078,7 @@ export class LookPlanDialog { ngOnInit() { - console.log(this.data) + // console.log(this.data) this.getAllPlans() } //关闭弹窗 @@ -1073,7 +1100,7 @@ export class LookPlanDialog { } this.http.get("/api/PlanComponents",{params:paramsData}).subscribe((data:any)=>{ this.allPlanComponents = data.items - console.log(this.allPlanComponents) + // console.log(this.allPlanComponents) }) } //查看预案 @@ -1117,7 +1144,7 @@ export class LookPlanDialog { dialogRef.afterClosed().subscribe( data=>{ if(data){ - console.log(123,data) + // console.log(123,data) this.downloadFileName = data.fileName this.download = data this.downloadFile() @@ -1217,7 +1244,7 @@ export class DownloadFile { selectedFileData : any ngOnInit(): void { - console.log(this.data) + // console.log(this.data) this.name = this.data.name this.fileUrls = this.data.attachmentUrls this.fileUrls.forEach(item=>{ @@ -1241,7 +1268,7 @@ export class DownloadFile { //点击想要下载的文件 addurl(item,key){ - console.log(item,key) + // console.log(item,key) this.selectedFileIndex = key this.selectedFileData = item } diff --git a/src/app/key-unit/basicinfo-look/basicinfo.component.ts b/src/app/key-unit/basicinfo-look/basicinfo.component.ts index dc8a770..afb4dc2 100644 --- a/src/app/key-unit/basicinfo-look/basicinfo.component.ts +++ b/src/app/key-unit/basicinfo-look/basicinfo.component.ts @@ -383,7 +383,7 @@ export class BasicinfoLookComponent implements OnInit { data[0].buildtype = n.name data[0].tongyong = true data[0].index = x.index - if(data[0].buildtype == "石油化工类"){ + if(data[0].buildtype == "石油化工类" || data[0].buildtype.indexOf("化工") != -1 ){ data[0].tongyong = false data[0].isshiyou = true this.deviceinfodata = data[0].buildingBasicGroups[1].propertyInfos //存储装置信息的初始数据,需要转换成datasource形式 @@ -545,7 +545,7 @@ export class BasicinfoLookComponent implements OnInit { data[0].tongyong = true data[0].index = index - if(data[0].buildtype == "石油化工类"){ + if(data[0].buildtype.indexOf("储罐") != -1 || data[0].buildtype.indexOf("化工") != -1 ){ data[0].tongyong = false data[0].isshiyou = true let noemptydeviceArr = data[0].buildingBasicGroups[1].propertyInfos @@ -804,7 +804,7 @@ export class BasicinfoLookComponent implements OnInit { data[0].username = n.name data[0].tongyong = true data[0].index = this.houses.length ////////////////// - if(data[0].buildtype == "石油化工类"){ + if(data[0].buildtype.indexOf("储罐") != -1 || data[0].buildtype.indexOf("化工") != -1 ){ data[0].tongyong = false data[0].isshiyou = true //如果是石油化工则启用石油化工的模板 this.deviceinfodata = data[0].buildingBasicGroups[1].propertyInfos //存储装置信息表格的初始数据,需要转换成datasource形式 @@ -1360,7 +1360,7 @@ export class BasicinfoLookComponent implements OnInit { } - if(item.buildtype != "石油化工类" && item.buildtype != "地铁类"){ + if(item.buildtype.indexOf("储罐") == -1 && item.buildtype != "地铁类" && item.buildtype.indexOf("化工") == -1 ){ // console.log(this.houses[key]) // console.log(value) this.houses[key].buildingBasicGroups[0].propertyInfos.forEach(item => { @@ -1411,7 +1411,7 @@ export class BasicinfoLookComponent implements OnInit { }) } } - if(item.buildtype == "石油化工类"){ + if(item.buildtype.indexOf("储罐") != -1 || item.buildtype.indexOf("化工") != -1 ){ // console.log(888,item) let bodyObj = _.cloneDeep(item) delete bodyObj.name diff --git a/src/app/key-unit/basicinfo/basicinfo.component.html b/src/app/key-unit/basicinfo/basicinfo.component.html index 0927268..5e9f5f9 100644 --- a/src/app/key-unit/basicinfo/basicinfo.component.html +++ b/src/app/key-unit/basicinfo/basicinfo.component.html @@ -144,6 +144,15 @@ place 位置
+ diff --git a/src/app/key-unit/basicinfo/basicinfo.component.scss b/src/app/key-unit/basicinfo/basicinfo.component.scss index cb6cf21..7ffed03 100644 --- a/src/app/key-unit/basicinfo/basicinfo.component.scss +++ b/src/app/key-unit/basicinfo/basicinfo.component.scss @@ -86,7 +86,6 @@ } .gistopbox{ position: absolute; - box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.16); border-radius: 4px; left: 5%; @@ -125,9 +124,31 @@ align-items: center; justify-content: center; } - + .inputBox{ + width: 63%; + display: flex; + align-items: center; + .positionInput{ + border: 0; + border-radius: 6px; + width: 90%; + height: 34px; + background: #F2F2F2; + margin-left: 8px; + box-sizing: border-box; + padding-left: 10px; + } + } } + .hidden{ + opacity: 0; + z-index: -1; + } + .show{ + opacity: 1; + z-index: 1; + } } } diff --git a/src/app/key-unit/basicinfo/basicinfo.component.ts b/src/app/key-unit/basicinfo/basicinfo.component.ts index 1fd8443..4583dc2 100644 --- a/src/app/key-unit/basicinfo/basicinfo.component.ts +++ b/src/app/key-unit/basicinfo/basicinfo.component.ts @@ -104,6 +104,7 @@ export class BasicinfoComponent implements OnInit { markerPosition:any = {x: 0, y: 0}//单位坐标 map:any //地图实例 isGisTopBox:boolean = false//点击位置按钮 + isGisTopBoxTwo:boolean = false//点击位置按钮 oldPositionMarker:any //旧位置marker实例 newPositionMarker:any //新位置marker实例 @@ -121,13 +122,48 @@ export class BasicinfoComponent implements OnInit { ' ' + '' //初始化地图 + searchTitle:any//搜索内容 + placeSearch:any//地址搜索类 + search(){ + this.placeSearch.search(this.searchTitle, (status, result) => { + // 搜索成功时,result即是对应的匹配数据 + if(result.info == "OK"){ + this.newPositionMarker.setPosition([result.poiList.pois[0].location.lng,result.poiList.pois[0].location.lat]) + this.markerPosition2 = {x: result.poiList.pois[0].location.lng, y: result.poiList.pois[0].location.lat} + this.map.setCenter([result.poiList.pois[0].location.lng,result.poiList.pois[0].location.lat]); //设置地图中心点 + }else{ + alert('查询不到输入地址信息') + } + + }) + + } labelGis(){ this.map = new AMap.Map('container', { zoom:12 }) + + this.map.on('complete', () => { this.isGisTopBox = true }); + //输入提示 + var autoOptions = { + input: "tipinput" + }; + AMap.plugin(['AMap.PlaceSearch','AMap.AutoComplete'], ()=>{ + var auto = new AMap.AutoComplete(autoOptions); + this.placeSearch = new AMap.PlaceSearch(); //构造地点查询类 + auto.on("select", (e)=>{ + console.log(e) + console.log( this.newPositionMarker) + this.newPositionMarker.setPosition([e.poi.location.lng,e.poi.location.lat]) + this.markerPosition2 = {x: e.poi.location.lng, y: e.poi.location.lat} + this.map.setCenter([e.poi.location.lng,e.poi.location.lat]); //设置地图中心点 + });//注册监听,当选中某条记录时会触发 + + }); + if(this.isMapLabel){//如果已经标注单位坐标 console.log('已标注单位位置') this.map.setCenter([this.unitinfo.location.x,this.unitinfo.location.y]); @@ -143,9 +179,15 @@ export class BasicinfoComponent implements OnInit { this.map.setCity('上海市'); } } + + + markerPosition2 //点击位置按钮 setPosition(){ + + this.isGisTopBox = false + this.isGisTopBoxTwo = true if(this.isMapLabel){//如果已经标注单位坐标 console.log('已标注单位位置') @@ -165,36 +207,38 @@ export class BasicinfoComponent implements OnInit { this.map.add(this.newPositionMarker); - let markerPosition if(this.markerPosition.x && this.markerPosition.x != 0){ - markerPosition = {x: this.markerPosition.x,y: this.markerPosition.y} + this.markerPosition2 = {x: this.markerPosition.x,y: this.markerPosition.y} }else{ - markerPosition = {x: this.map.getCenter().lng,y: this.map.getCenter().lat} //获取当前地图中心位置 + this.markerPosition2 = {x: this.map.getCenter().lng,y: this.map.getCenter().lat} //获取当前地图中心位置 } this.newPositionMarker.on('dragend', (e)=>{ - markerPosition = {x: e.lnglat.lng, y: e.lnglat.lat} + this.markerPosition2 = {x: e.lnglat.lng, y: e.lnglat.lat} }) //点击确定 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionOk'),'click',(event)=>{ this.map.clearMap(); this.isGisTopBox = true + this.isGisTopBoxTwo = false this.newPositionMarker = new AMap.Marker({ - position: [markerPosition.x,markerPosition.y], + position: [this.markerPosition2.x,this.markerPosition2.y], content: this.newPositionMarkerContent, offset: new AMap.Pixel(-15, -18) }); - this.markerPosition = markerPosition + this.markerPosition = this.markerPosition2 this.map.add(this.newPositionMarker); }) //点击取消 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionClose'),'click',(event)=>{ this.isGisTopBox = true + this.isGisTopBoxTwo = false this.map.clearMap(); this.newPositionMarker = new AMap.Marker({ position: [this.markerPosition.x,this.markerPosition.y], content: this.newPositionMarkerContent, offset: new AMap.Pixel(-15, -18) }); + this.map.setCenter([this.markerPosition.x,this.markerPosition.y]); //设置地图中心点 this.map.add(this.newPositionMarker); }) @@ -219,19 +263,20 @@ export class BasicinfoComponent implements OnInit { }); this.map.add(this.newPositionMarker); - let markerPosition + // let markerPosition if(this.markerPosition.x && this.markerPosition.x != 0){ - markerPosition = {x: this.markerPosition.x,y: this.markerPosition.y} + this.markerPosition2 = {x: this.markerPosition.x,y: this.markerPosition.y} }else{ - markerPosition = {x: this.map.getCenter().lng,y: this.map.getCenter().lat} //获取当前地图中心位置 + this.markerPosition2 = {x: this.map.getCenter().lng,y: this.map.getCenter().lat} //获取当前地图中心位置 } this.newPositionMarker.on('dragend', (e)=>{ - markerPosition = {x: e.lnglat.lng, y: e.lnglat.lat} + this.markerPosition2 = {x: e.lnglat.lng, y: e.lnglat.lat} }) //点击确定 this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionOk'),'click',(event)=>{ this.isGisTopBox = true - this.markerPosition = markerPosition + this.isGisTopBoxTwo = false + this.markerPosition = this.markerPosition2 this.map.clearMap(); this.newPositionMarker = new AMap.Marker({ position: [this.markerPosition.x,this.markerPosition.y], @@ -243,19 +288,19 @@ export class BasicinfoComponent implements OnInit { this.renderer2.listen(this.elementRef.nativeElement.querySelector('#setPositionClose'),'click',(event)=>{ this.map.clearMap(); this.isGisTopBox = true + this.isGisTopBoxTwo = false if(this.markerPosition.x && this.markerPosition.x != 0){//说明之前标过点 this.newPositionMarker = new AMap.Marker({ position: [this.markerPosition.x,this.markerPosition.y], content: this.newPositionMarkerContent, offset: new AMap.Pixel(-15, -18) }); + this.map.setCenter([this.markerPosition.x,this.markerPosition.y]); //设置地图中心点 this.map.add(this.newPositionMarker); } })//取消 } - - } //获得所有单位类型 @@ -278,7 +323,9 @@ export class BasicinfoComponent implements OnInit { }else{//未标注 _this.isMapLabel = false } + this.labelGis() + }) } ) @@ -422,7 +469,7 @@ export class BasicinfoComponent implements OnInit { data[0].buildtype = n.name data[0].tongyong = true data[0].index = x.index - if(data[0].buildtype == "石油化工类"){ + if(data[0].buildtype.indexOf('化工') != -1 || data[0].buildtype.indexOf('储罐') != -1){ data[0].tongyong = false data[0].isshiyou = true this.deviceinfodata = data[0].buildingBasicGroups[1].propertyInfos //存储装置信息的初始数据,需要转换成datasource形式 @@ -584,7 +631,7 @@ export class BasicinfoComponent implements OnInit { data[0].tongyong = true data[0].index = index - if(data[0].buildtype == "石油化工类"){ + if(data[0].buildtype.indexOf('化工') != -1 || data[0].buildtype.indexOf('储罐') != -1){ data[0].tongyong = false data[0].isshiyou = true let noemptydeviceArr = data[0].buildingBasicGroups[1].propertyInfos @@ -843,7 +890,7 @@ export class BasicinfoComponent implements OnInit { data[0].username = n.name data[0].tongyong = true data[0].index = this.houses.length ////////////////// - if(data[0].buildtype == "石油化工类"){ + if(data[0].buildtype.indexOf('化工') != -1 || data[0].buildtype.indexOf('储罐') != -1){ data[0].tongyong = false data[0].isshiyou = true //如果是石油化工则启用石油化工的模板 this.deviceinfodata = data[0].buildingBasicGroups[1].propertyInfos //存储装置信息表格的初始数据,需要转换成datasource形式 @@ -1172,7 +1219,7 @@ export class BasicinfoComponent implements OnInit { if(invalid){ const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; - config.duration = 3000 + config.duration = 3000 this.snackBar.open('请填写必填项','确定',config); }else{ sessionStorage.setItem('buildingTypeId',value.unittype) @@ -1423,7 +1470,7 @@ export class BasicinfoComponent implements OnInit { } - if(item.buildtype != "石油化工类" && item.buildtype != "地铁类"){ + if(item.buildtype.indexOf('化工') == -1 && item.buildtype != "地铁类" && item.buildtype.indexOf('储罐') == -1){ // console.log(this.houses[key]) // console.log(value) this.houses[key].buildingBasicGroups[0].propertyInfos.forEach(item => { @@ -1475,7 +1522,7 @@ export class BasicinfoComponent implements OnInit { }) } } - if(item.buildtype == "石油化工类"){ + if(item.buildtype.indexOf('化工') != -1 || item.buildtype.indexOf('储罐') != -1){ // console.log(888,item) let bodyObj = _.cloneDeep(item) delete bodyObj.name diff --git a/src/app/key-unit/key-unit-management/key-unit-management.component.html b/src/app/key-unit/key-unit-management/key-unit-management.component.html index f821dd9..9b78ece 100644 --- a/src/app/key-unit/key-unit-management/key-unit-management.component.html +++ b/src/app/key-unit/key-unit-management/key-unit-management.component.html @@ -15,7 +15,7 @@ - 包含下级 + 包含下级
clear
@@ -94,7 +94,7 @@ - + diff --git a/src/app/navigation/navigation.component.html b/src/app/navigation/navigation.component.html index 113eca0..81efc94 100644 --- a/src/app/navigation/navigation.component.html +++ b/src/app/navigation/navigation.component.html @@ -2,7 +2,7 @@
- +