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/basicinfo.component.ts b/src/app/key-unit/basicinfo/basicinfo.component.ts index 8485907..06854d8 100644 --- a/src/app/key-unit/basicinfo/basicinfo.component.ts +++ b/src/app/key-unit/basicinfo/basicinfo.component.ts @@ -469,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 == "石油化工类" || data[0].buildtype == "化工生产"){ data[0].tongyong = false data[0].isshiyou = true this.deviceinfodata = data[0].buildingBasicGroups[1].propertyInfos //存储装置信息的初始数据,需要转换成datasource形式 @@ -631,7 +631,7 @@ export class BasicinfoComponent implements OnInit { data[0].tongyong = true data[0].index = index - if(data[0].buildtype == "石油化工类"){ + if(data[0].buildtype == "石油化工类" || data[0].buildtype == "化工生产"){ data[0].tongyong = false data[0].isshiyou = true let noemptydeviceArr = data[0].buildingBasicGroups[1].propertyInfos @@ -890,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 == "石油化工类" || data[0].buildtype == "化工生产"){ data[0].tongyong = false data[0].isshiyou = true //如果是石油化工则启用石油化工的模板 this.deviceinfodata = data[0].buildingBasicGroups[1].propertyInfos //存储装置信息表格的初始数据,需要转换成datasource形式 @@ -1470,7 +1470,7 @@ export class BasicinfoComponent implements OnInit { } - if(item.buildtype != "石油化工类" && item.buildtype != "地铁类"){ + if(item.buildtype != "石油化工类" && item.buildtype != "地铁类" && item.buildtype != "化工生产"){ // console.log(this.houses[key]) // console.log(value) this.houses[key].buildingBasicGroups[0].propertyInfos.forEach(item => { @@ -1522,7 +1522,7 @@ export class BasicinfoComponent implements OnInit { }) } } - if(item.buildtype == "石油化工类"){ + if(item.buildtype == "石油化工类" || item.buildtype == "化工生产"){ // console.log(888,item) let bodyObj = _.cloneDeep(item) delete bodyObj.name