chenjingyu 4 years ago
parent
commit
2b48811427
  1. 10
      src/app/key-unit/fire-fighting-device/fire-fighting-device.component.ts
  2. 2
      src/app/key-unit/key-unit.module.ts
  3. 8
      src/app/key-unit/water-road/water-road.component.html
  4. 6
      src/app/key-unit/water-road/water-road.component.scss
  5. 232
      src/app/key-unit/water-road/water-road.component.ts
  6. 169
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html
  7. 61
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss
  8. 129
      src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts
  9. 8
      src/app/plan-management/create-plan-online-five/openPlanTool.html
  10. 2
      src/app/plan-management/entry-plan-look/AddPlanone.html
  11. 5
      src/app/plan-management/entry-plan-look/entry-plan-look.component.ts
  12. 2
      src/app/plan-management/entry-plan/entry-plan.component.html
  13. 4
      src/app/plan-management/plan-management.module.ts
  14. 4
      src/app/tabbar/tabbar.component.html
  15. 14
      src/app/ui/collection-tools-building/collection-tools.component.ts
  16. 68
      src/app/ui/collection-tools-plan/collection-tools.component.ts
  17. 2
      src/app/ui/collection-tools-plan/leftFunctionalDomain.ts
  18. 16
      src/app/ui/collection-tools/collection-tools.component.ts
  19. BIN
      src/assets/images/2Dplan.png

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

@ -233,7 +233,7 @@ export class FireFightingDeviceComponent implements OnInit {
companyId:companyId companyId:companyId
}}).subscribe((data:any)=>{ }}).subscribe((data:any)=>{
this.allBuildingGrouping = data this.allBuildingGrouping = data
console.log(888,data) // console.log(888,data)
if (this.allBuildingGrouping.length) { if (this.allBuildingGrouping.length) {
this.getAllBuildingFacilities() this.getAllBuildingFacilities()
} else { } else {
@ -478,17 +478,15 @@ export class FireFightingDeviceComponent implements OnInit {
for (const key in object) { for (const key in object) {
if (Object.prototype.hasOwnProperty.call(object, key)) { if (Object.prototype.hasOwnProperty.call(object, key)) {
const element = object[key]; const element = object[key];
if(element.total || element.details){
body.push({ body.push({
buildingId: item.buildingId, buildingId: item.buildingId,
groupName: groupName, groupName: groupName,
facilityName: element.name, facilityName: element.name,
count: element.total, count: element.total || '',
description: element.details description: element.details || ''
}) })
} }
} }
}
return body return body
} }
let companyId = this.route.snapshot.queryParams.id let companyId = this.route.snapshot.queryParams.id
@ -520,7 +518,7 @@ export class FireFightingDeviceComponent implements OnInit {
}else if(item.name == '其它设施'){ }else if(item.name == '其它设施'){
putBody = returnBody(this.otherFacilities,'其它设施') putBody = returnBody(this.otherFacilities,'其它设施')
}else if(item.name == '自动消防设施'){ }else if(item.name == '自动消防设施'){
putBody = returnBody(this.otherFacilities,'自动消防设施') putBody = returnBody(this.automaticFireProtectionFacility,'自动消防设施')
} }
if(putBody.length != 0){ if(putBody.length != 0){
this.http.put('/api/BuildingFacilities/FacilityStatUpdate',putBody,{ this.http.put('/api/BuildingFacilities/FacilityStatUpdate',putBody,{

2
src/app/key-unit/key-unit.module.ts

@ -88,7 +88,7 @@ import { SpecialWarningComponent } from './special-warning/special-warning.compo
@NgModule({ @NgModule({
declarations: [KeyUnitManagementComponent, EditUnitInfoComponent, ViewUnitDetailsComponent,CreateUnit,BasicinfoComponent,LookMaster,AddHouseInfo, EditPlanInfoComponent,BasicinfoLookComponent, ViewUnitDetailsPlanComponent,FunctionDivisionComponent,addPartition,addPartitionAttribute,AllaroundComponent,ImgDetails,RealisticPictureComponent,previewImg,addRealPicture,editRealPicture,KeySiteComponent,KeySiteImgs,UploadingCADComponent,readFile,editFile,KeySiteLookComponent,KeySiteImgs2,FunctionDivisionLookComponent,RealisticPictureLookComponent,previewImg3,UploadingCADLookComponent,FireFightingDeviceComponent,ImagesData,previewBigImg,ImgsDataDetail,FireFightingDeviceLookComponent,ImagesData2,ImgsDataDetail2,previewBigImg2,addPartitionAttribute2, SixFamiliarityComponent, ActualCombatDrillComponent,routerMapComponent, SixFamiliarListComponent,TrainingRecordinfoComponent,RouterGISComponent,WaterRoadComponent,PhotoofthesceneComponent,KnowRouteComponent,FindProblemComponent,upname,companyAuditResult,StatisticsOfFireFightingFacilities, SpecialWarningComponent], declarations: [KeyUnitManagementComponent, EditUnitInfoComponent, ViewUnitDetailsComponent,CreateUnit,BasicinfoComponent,LookMaster,AddHouseInfo, EditPlanInfoComponent,BasicinfoLookComponent, ViewUnitDetailsPlanComponent,FunctionDivisionComponent,addPartition,addPartitionAttribute,AllaroundComponent,ImgDetails,RealisticPictureComponent,previewImg,addRealPicture,editRealPicture,KeySiteComponent,KeySiteImgs,UploadingCADComponent,readFile,editFile,KeySiteLookComponent,KeySiteImgs2,FunctionDivisionLookComponent,RealisticPictureLookComponent,previewImg3,UploadingCADLookComponent,FireFightingDeviceComponent,ImagesData,previewBigImg,ImgsDataDetail,FireFightingDeviceLookComponent,ImagesData2,ImgsDataDetail2,previewBigImg2,addPartitionAttribute2, SixFamiliarityComponent, ActualCombatDrillComponent,routerMapComponent, SixFamiliarListComponent,TrainingRecordinfoComponent,RouterGISComponent,WaterRoadComponent,PhotoofthesceneComponent,KnowRouteComponent,FindProblemComponent,upname,companyAuditResult,StatisticsOfFireFightingFacilities, SpecialWarningComponent],
exports:[ViewUnitDetailsPlanComponent], exports:[ViewUnitDetailsPlanComponent,WaterRoadComponent],
imports: [ imports: [
CommonModule, CommonModule,
KeyUnitRoutingModule, KeyUnitRoutingModule,

8
src/app/key-unit/water-road/water-road.component.html

@ -1,7 +1,7 @@
<div class="content"> <div class="content">
<div class="center" id="center"></div> <div class="center" id="center"></div>
<!-- 上角 --> <!-- 上角 -->
<div class="rightTopBox"> <div class="rightTopBox">
<div class="contantbox"> <div class="contantbox">
@ -39,7 +39,11 @@
</div> </div>
</div> </div>
<!-- 右上角 --> <!-- 左上角 -->
<button mat-flat-button color="primary" class="createImg" (click)="takeScreenshotGis()">
生成图片
</button>
</div> </div>

6
src/app/key-unit/water-road/water-road.component.scss

@ -136,3 +136,9 @@
} }
} }
} }
.createImg{
position: absolute;
right: 30px;
top: 15px;
}

232
src/app/key-unit/water-road/water-road.component.ts

@ -5,7 +5,7 @@ import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dial
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { ActivatedRoute } from '@angular/router'; import { ActivatedRoute } from '@angular/router';
declare var AMap: any; declare var AMap: any;
declare var html2canvas: any;
@Component({ @Component({
selector: 'app-water-road', selector: 'app-water-road',
templateUrl: './water-road.component.html', templateUrl: './water-road.component.html',
@ -13,38 +13,40 @@ declare var AMap: any;
}) })
export class WaterRoadComponent implements OnInit { export class WaterRoadComponent implements OnInit {
constructor(private http: HttpClient,public renderer2: Renderer2,public snackBar: MatSnackBar,public dialog: MatDialog,private fb: FormBuilder,private route:ActivatedRoute) { } constructor(private http: HttpClient, public renderer2: Renderer2, public snackBar: MatSnackBar, public dialog: MatDialog, private fb: FormBuilder, private route: ActivatedRoute) { }
//获得单位信息 //获得单位信息
unitData:any unitData: any
async getUnitData(){ async getUnitData() {
await new Promise((resolve, reject) =>{ await new Promise((resolve, reject) => {
this.http.get(`/api/Companies/${this.route.snapshot.queryParams.id}`).subscribe(data => { let id
this.route.snapshot.queryParams.id ? id = this.route.snapshot.queryParams.id : id = this.route.snapshot.queryParams.companyId
this.http.get(`/api/Companies/${id}`).subscribe(data => {
this.unitData = data this.unitData = data
resolve(data) resolve(data)
}) })
}) })
} }
map:any //地图 map: any //地图
watertForm:FormGroup //gis右上角水源表单 watertForm: FormGroup //gis右上角水源表单
waterList = [ waterList = [
{id:'0',name:'消火栓',selected:true}, { id: '0', name: '消火栓', selected: true },
{id:'1',name:'消防水池',selected:true}, { id: '1', name: '消防水池', selected: true },
{id:'2',name:'天然水源',selected:true}, { id: '2', name: '天然水源', selected: true },
{id:'3',name:'总队',selected:true}, { id: '3', name: '总队', selected: true },
{id:'4',name:'支队',selected:true}, { id: '4', name: '支队', selected: true },
{id:'5',name:'大队',selected:true}, { id: '5', name: '大队', selected: true },
{id:'6',name:'中队(消防站)',selected:true}, { id: '6', name: '中队(消防站)', selected: true },
{id:'7',name:'其他消防队伍',selected:true} { id: '7', name: '其他消防队伍', selected: true }
] ]
fireForceList:any[] = [ fireForceList: any[] = [
] ]
waterAreaDefault:any = '5000' //默认水源范围 waterAreaDefault: any = '5000' //默认水源范围
selectedWaterList:any = [] //选择提交的水源 selectedWaterList: any = [] //选择提交的水源
//地图范围圆圈---水源 //地图范围圆圈---水源
circleofwater = new AMap.Circle({ circleofwater = new AMap.Circle({
center: null, center: null,
@ -60,19 +62,19 @@ export class WaterRoadComponent implements OnInit {
async ngOnInit(): Promise<void> { async ngOnInit(): Promise<void> {
this.watertForm = this.fb.group({ this.watertForm = this.fb.group({
waters:this.waterUnits(), waters: this.waterUnits(),
allSelectedWater:new FormControl(), allSelectedWater: new FormControl(),
areaWater:new FormControl() areaWater: new FormControl()
}) })
this.waters.valueChanges.subscribe(values => { this.waters.valueChanges.subscribe(values => {
let selects:string[] = [] let selects: string[] = []
values.forEach((selected:boolean,i:number) => { values.forEach((selected: boolean, i: number) => {
selected === true && selects.push(this.waterList[i].id) selected === true && selects.push(this.waterList[i].id)
}); });
this.selectedWaterList = selects this.selectedWaterList = selects
}) })
this.waterList.forEach(item => { this.waterList.forEach(item => {
if(item.selected){ if (item.selected) {
this.selectedWaterList.push(item.id) this.selectedWaterList.push(item.id)
} }
}) })
@ -82,28 +84,28 @@ export class WaterRoadComponent implements OnInit {
}, 0); }, 0);
} }
get waters():any{ get waters(): any {
return this.watertForm.get('waters') return this.watertForm.get('waters')
} }
//全选水源 //全选水源
selectedAllWater(event){ selectedAllWater(event) {
if(event.checked){ if (event.checked) {
this.waters.controls.forEach(item => {item.setValue(true)}) this.waters.controls.forEach(item => { item.setValue(true) })
}else{ } else {
this.watertForm.reset() this.watertForm.reset()
this.watertForm.controls.areaWater.setValue('0') this.watertForm.controls.areaWater.setValue('0')
} }
} }
//水源提交 //水源提交
waterSubmit(value){ waterSubmit(value) {
if(!this.unitMarker){ if (!this.unitMarker) {
let config = new MatSnackBarConfig(); let config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
this.snackBar.open('请前往基本信息标注单位坐标','确定',config); this.snackBar.open('请前往基本信息标注单位坐标', '确定', config);
}else{ } else {
this.circleofwater.setRadius(Number(this.waterAreaDefault)) this.circleofwater.setRadius(Number(this.waterAreaDefault))
this.circleofwater.setCenter(this.unitMarker._position) this.circleofwater.setCenter(this.unitMarker._position)
this.circleofwater.setMap(this.map) this.circleofwater.setMap(this.map)
@ -112,10 +114,10 @@ export class WaterRoadComponent implements OnInit {
let lnglat = new AMap.LngLat(this.unitData.location.x, this.unitData.location.y) // lng, lat 替换成传入的坐标 let lnglat = new AMap.LngLat(this.unitData.location.x, this.unitData.location.y) // lng, lat 替换成传入的坐标
//如果选择当前的视野范围算出查询半径 //如果选择当前的视野范围算出查询半径
if(this.waterAreaDefault == '0'){ if (this.waterAreaDefault == '0') {
this.circleofwater.setRadius(this.Calculationofdistance(this.map.getBounds())/2) this.circleofwater.setRadius(this.Calculationofdistance(this.map.getBounds()) / 2)
Distance = Math.abs(lnglat.offset(0, this.Calculationofdistance(this.map.getBounds())/2).lat - this.unitData.location.y) Distance = Math.abs(lnglat.offset(0, this.Calculationofdistance(this.map.getBounds()) / 2).lat - this.unitData.location.y)
}else{ } else {
Distance = Math.abs(lnglat.offset(0, this.waterAreaDefault).lat - this.unitData.location.y) Distance = Math.abs(lnglat.offset(0, this.waterAreaDefault).lat - this.unitData.location.y)
} }
this.getWaterData(Distance) this.getWaterData(Distance)
@ -123,15 +125,15 @@ export class WaterRoadComponent implements OnInit {
} }
//获得水源列表 //获得水源列表
getWaterData(Distance){ getWaterData(Distance) {
if(this.selectedWaterList.length == 0){ if (this.selectedWaterList.length == 0) {
let config = new MatSnackBarConfig(); let config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
this.snackBar.open('请选择要显示的类型','确定',config); this.snackBar.open('请选择要显示的类型', '确定', config);
}else{ } else {
console.log('选中的内容',this.selectedWaterList) // console.log('选中的内容', this.selectedWaterList)
function checkAdult(item) { function checkAdult(item) {
return item <= 2; return item <= 2;
} }
@ -140,34 +142,34 @@ export class WaterRoadComponent implements OnInit {
} }
const water = this.selectedWaterList.filter(checkAdult); const water = this.selectedWaterList.filter(checkAdult);
const power = this.selectedWaterList.filter(checkAdult2); const power = this.selectedWaterList.filter(checkAdult2);
console.log('water',water) // console.log('water', water)
console.log('power',power) // console.log('power', power)
let waterparamsdata:any = { let waterparamsdata: any = {
PageSize:99999, PageSize: 99999,
Lon : this.unitData.location.x, Lon: this.unitData.location.x,
Lat : this.unitData.location.y, Lat: this.unitData.location.y,
Distance : Distance, Distance: Distance,
WaterSourceTypes :water WaterSourceTypes: water
} }
let powerparamsdata:any = { let powerparamsdata: any = {
PageSize:99999, PageSize: 99999,
Lon : this.unitData.location.x, Lon: this.unitData.location.x,
Lat : this.unitData.location.y, Lat: this.unitData.location.y,
Distance : Distance, Distance: Distance,
WaterSourceTypes :power WaterSourceTypes: power
} }
if( water.length == 0 ){ if (water.length == 0) {
this.http.get("/api/CustomFireForce",{params:powerparamsdata}).subscribe((data2:any) => { this.http.get("/api/CustomFireForce", { params: powerparamsdata }).subscribe((data2: any) => {
this.createwaterMarker(data2) this.createwaterMarker(data2)
}) })
}else if( power.length == 0 ){ } else if (power.length == 0) {
this.http.get("/api/WaterSources",{params:waterparamsdata}).subscribe((data:any) => { this.http.get("/api/WaterSources", { params: waterparamsdata }).subscribe((data: any) => {
this.createwaterMarker(data.items) this.createwaterMarker(data.items)
}) })
}else{ } else {
this.http.get("/api/WaterSources",{params:waterparamsdata}).subscribe((data:any) => { this.http.get("/api/WaterSources", { params: waterparamsdata }).subscribe((data: any) => {
this.http.get("/api/CustomFireForce",{params:powerparamsdata}).subscribe((data2:any) => { this.http.get("/api/CustomFireForce", { params: powerparamsdata }).subscribe((data2: any) => {
let allData = [...data.items,...data2] let allData = [...data.items, ...data2]
this.createwaterMarker(allData) this.createwaterMarker(allData)
}) })
}) })
@ -179,49 +181,49 @@ export class WaterRoadComponent implements OnInit {
//循环渲染出所有水源markers //循环渲染出所有水源markers
waterCluster:any //水源聚合实例 waterCluster: any //水源聚合实例
createwaterMarker(list){ createwaterMarker(list) {
let waterMarkerArrcluster = [] let waterMarkerArrcluster = []
this.waterCluster ? this.waterCluster.setData([]) : null this.waterCluster ? this.waterCluster.setData([]) : null
list.forEach((item) => { list.forEach((item) => {
let image let image
if(item.waterSourceType == 0 || item.waterSourceType == 1 || item.waterSourceType == 2){ if (item.waterSourceType == 0 || item.waterSourceType == 1 || item.waterSourceType == 2) {
if(item.waterSourceType == 0){//消火栓 if (item.waterSourceType == 0) {//消火栓
image = '/assets/waterMarkers/szxhs.png' image = '/assets/waterMarkers/szxhs.png'
}else if(item.waterSourceType == 1){//消防水池 } else if (item.waterSourceType == 1) {//消防水池
image = '/assets/waterMarkers/fxcsc.png' image = '/assets/waterMarkers/fxcsc.png'
}else if(item.waterSourceType == 2){//天然水源 } else if (item.waterSourceType == 2) {//天然水源
image = '/assets/waterMarkers/trsy.png' image = '/assets/waterMarkers/trsy.png'
} }
// 用于点集合的数组 // 用于点集合的数组
item.location ? waterMarkerArrcluster.push({ item.location ? waterMarkerArrcluster.push({
lnglat : [item.location.x,item.location.y], lnglat: [item.location.x, item.location.y],
image : image, image: image,
data : item data: item
}) : null }) : null
}else{ } else {
if(item.forceType == 2){ if (item.forceType == 2) {
image = '/assets/fireForcesMarkers/qita.png' image = '/assets/fireForcesMarkers/qita.png'
}else if(item.level == 0){ } else if (item.level == 0) {
image = '/assets/fireForcesMarkers/zongdui.png' image = '/assets/fireForcesMarkers/zongdui.png'
}else if(item.level == 1){ } else if (item.level == 1) {
image = '/assets/fireForcesMarkers/zhidui.png' image = '/assets/fireForcesMarkers/zhidui.png'
}else if(item.level == 2){ } else if (item.level == 2) {
image = '/assets/fireForcesMarkers/dadui.png' image = '/assets/fireForcesMarkers/dadui.png'
}else if(item.level == 3){ } else if (item.level == 3) {
image = '/assets/fireForcesMarkers/zhongdui.png' image = '/assets/fireForcesMarkers/zhongdui.png'
} }
// 用于点集合的数组 // 用于点集合的数组
item.fireForceDetailInfo.location ? item.fireForceDetailInfo.location ?
waterMarkerArrcluster.push({ waterMarkerArrcluster.push({
lnglat : [item.fireForceDetailInfo.location.x,item.fireForceDetailInfo.location.y], lnglat: [item.fireForceDetailInfo.location.x, item.fireForceDetailInfo.location.y],
image : image, image: image,
data : item data: item
}) : null }) : null
} }
}) })
this.map.plugin(["AMap.MarkerClusterer"],() => { this.map.plugin(["AMap.MarkerClusterer"], () => {
var gridSize = 60 var gridSize = 60
var count = waterMarkerArrcluster.length; var count = waterMarkerArrcluster.length;
var _renderClusterMarker = function (context) { var _renderClusterMarker = function (context) {
@ -237,7 +239,7 @@ export class WaterRoadComponent implements OnInit {
div.style.width = div.style.height = size + 'px'; div.style.width = div.style.height = size + 'px';
div.style.border = 'solid 1px ' + borderColor; div.style.border = 'solid 1px ' + borderColor;
div.style.borderRadius = size / 2 + 'px'; div.style.borderRadius = size / 2 + 'px';
div.style.boxShadow = '0 0 5px ' + shadowColor; // div.style.boxShadow = '0 0 5px ' + shadowColor;
div.innerHTML = context.count; div.innerHTML = context.count;
div.style.lineHeight = size + 'px'; div.style.lineHeight = size + 'px';
div.style.color = fontColor; div.style.color = fontColor;
@ -246,7 +248,7 @@ export class WaterRoadComponent implements OnInit {
context.marker.setOffset(new AMap.Pixel(-size / 2, -size / 2)); context.marker.setOffset(new AMap.Pixel(-size / 2, -size / 2));
context.marker.setContent(div) context.marker.setContent(div)
}; };
var _renderMarker = (context)=> { var _renderMarker = (context) => {
var content = `<img class='clusterImgCollection' src="${context.data[0].image}" alt="">`; var content = `<img class='clusterImgCollection' src="${context.data[0].image}" alt="">`;
var offset = new AMap.Pixel(-12.5, -12.5); var offset = new AMap.Pixel(-12.5, -12.5);
context.marker.setContent(content) context.marker.setContent(content)
@ -257,8 +259,8 @@ export class WaterRoadComponent implements OnInit {
renderClusterMarker: _renderClusterMarker, // 自定义聚合点样式 renderClusterMarker: _renderClusterMarker, // 自定义聚合点样式
renderMarker: _renderMarker, // 自定义非聚合点样式 renderMarker: _renderMarker, // 自定义非聚合点样式
}); });
this.waterCluster.on('click',(e)=>{ this.waterCluster.on('click', (e) => {
if(e.clusterData.length == 1){ if (e.clusterData.length == 1) {
} }
}) })
@ -267,7 +269,7 @@ export class WaterRoadComponent implements OnInit {
} }
//取消显示水源 //取消显示水源
resetWater(){ resetWater() {
this.watertForm.reset() this.watertForm.reset()
this.watertForm.controls.areaWater.setValue('0') this.watertForm.controls.areaWater.setValue('0')
this.map.remove(this.circleofwater) this.map.remove(this.circleofwater)
@ -275,7 +277,7 @@ export class WaterRoadComponent implements OnInit {
} }
//计算两地距离 //计算两地距离
Calculationofdistance(bounds){ Calculationofdistance(bounds) {
let p1 = [bounds.northEast.lng, bounds.northEast.lat]; let p1 = [bounds.northEast.lng, bounds.northEast.lat];
let p2 = [bounds.northEast.lng, bounds.southWest.lat]; let p2 = [bounds.northEast.lng, bounds.southWest.lat];
// 返回 p1 到 p2 间的地面距离,单位:米 // 返回 p1 到 p2 间的地面距离,单位:米
@ -292,35 +294,67 @@ export class WaterRoadComponent implements OnInit {
} }
//地图初始化 //地图初始化
unitMarker:any//单位标点 unitMarker: any//单位标点
newPositionMarkerContent:any = newPositionMarkerContent: any =
'<div class="custom-content-marker">' + '<div class="custom-content-marker">' +
' <img style="width:20px;height:26px" src="/assets/images/dingwei.png">' + ' <img style="width:20px;height:26px" src="/assets/images/dingwei.png">' +
'</div>' '</div>'
creatMap(){ creatMap() {
this.map = new AMap.Map('center',{ this.map = new AMap.Map('center', {
zoom: 13, //初始地图级别 zoom: 13, //初始地图级别
WebGLParams: {
preserveDrawingBuffer: true
}
}); });
if(this.unitData.location && this.unitData.location.x){ if (this.unitData.location && this.unitData.location.x) {
this.map.setCenter([this.unitData.location.x,this.unitData.location.y]); this.map.setCenter([this.unitData.location.x, this.unitData.location.y]);
this.unitMarker = new AMap.Marker({ this.unitMarker = new AMap.Marker({
position: [this.unitData.location.x,this.unitData.location.y], position: [this.unitData.location.x, this.unitData.location.y],
content: this.newPositionMarkerContent, content: this.newPositionMarkerContent,
offset: new AMap.Pixel(-10, -13) offset: new AMap.Pixel(-10, -13)
}) })
// 将 markers 添加到地图 // 将 markers 添加到地图
this.map.add(this.unitMarker); this.map.add(this.unitMarker);
this.waterSubmit(1) this.waterSubmit(1)
}else{ } else {
this.map.setCity('上海市'); this.map.setCity('上海市');
let config = new MatSnackBarConfig(); let config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
this.snackBar.open('请先前往基本信息标注单位位置','确定',config); this.snackBar.open('请先前往基本信息标注单位位置', '确定', config);
} }
} }
canvasImg
takeScreenshotGis() {
// console.log(666666, this.selectingSitePlan)
// 使用html2canvas插件,将数据源中的数据转换成画布。
html2canvas(document.querySelector("#center"), {
useCORS: true, // 【重要】开启跨域配置,
allowTaint: true,//允许跨域图片
taintTest: false,//是否在渲染前测试图片
onrendered: function (canvas) {
var dataUrl = canvas.toDataURL("image/png");
}
}).then(canvas => {
// 修改生成的宽度
this.canvasImg = canvas.toDataURL("image/png");
// console.log(this.canvasImg)
}).then(() => {
this.downloadFile('水源图', this.canvasImg);
})
}
downloadFile(filename, content) {
var base64Img = content;
var oA = document.createElement('a');
oA.href = base64Img;
oA.download = filename;
var event = document.createEvent('MouseEvents');
event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
oA.dispatchEvent(event);
}
} }

169
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.html

@ -1,16 +1,13 @@
<div class="bigbox"> <div class="bigbox">
<div class="titlebox"> <div class="titlebox" *ngIf="pattern == 'edit'">
<div class="titleitembox"> <div class="titleitembox">
<div class="item" [ngClass]="{'selectedItem': selectedItem == '封面'}" (click)="clickTitleItem('封面')">
1.封面
</div>
<div class="item" *ngFor="let item of planTemplateData;let key = index" (click)="clickTitleItem(item)" <div class="item" *ngFor="let item of planTemplateData;let key = index" (click)="clickTitleItem(item)"
[ngClass]="{'selectedItem': selectedItem == item.groupName}"> [ngClass]="{'selectedItem': selectedItem == item.groupName}" [title]="item.groupName">
{{key + 2}}.{{item.groupName}} {{key + 1}}.{{item.groupName}}
</div> </div>
</div> </div>
<div class="btnbox"> <div class="btnbox">
<button mat-stroked-button> <button mat-stroked-button (click)="preview()">
<mat-icon>visibility</mat-icon> 预览 <mat-icon>visibility</mat-icon> 预览
</button> </button>
<button mat-flat-button color="primary"> <button mat-flat-button color="primary">
@ -18,8 +15,12 @@
</button> </button>
</div> </div>
</div> </div>
<div class="contentbox"> <button mat-stroked-button (click)="quitPreview()" class="quitPreview">
<div class="leftbox"> <mat-icon>visibility</mat-icon> 退出预览
</button>
<div class="contentbox" [ngClass]="{'noPadding': pattern == 'look'}">
<div class="leftbox"
*ngIf="pattern == 'edit' && (selectedItem == '重点图示' || selectedItem == '交通水源' || selectedItem == '预案附件' || selectedItem == '单位概况')">
<div *ngIf="selectedItem == '重点图示'" class="leftKeyImg"> <div *ngIf="selectedItem == '重点图示'" class="leftKeyImg">
<div class="keyImgTitle"> <div class="keyImgTitle">
重点图示 重点图示
@ -38,7 +39,7 @@
<div class="content"> <div class="content">
<div class="contentitem" *ngFor="let item of sitePlanItems"> <div class="contentitem" *ngFor="let item of sitePlanItems">
<div> <div>
<img (click)="openPlan(item,-1)" <img (click)="openPlan(item,-1,'平面图')"
[src]="item.imageUrl && item.imageUrl != 'null' ? item.imageUrl+'?x-oss-process=image/resize,m_fill,h_100,w_100' : '/assets/images/2D.jpg'" [src]="item.imageUrl && item.imageUrl != 'null' ? item.imageUrl+'?x-oss-process=image/resize,m_fill,h_100,w_100' : '/assets/images/2D.jpg'"
alt=""> alt="">
</div> </div>
@ -63,7 +64,7 @@
<div class="content"> <div class="content">
<div class="contentitem" *ngFor="let i of item.plandata"> <div class="contentitem" *ngFor="let i of item.plandata">
<div> <div>
<img (click)="openPlan(i,key)" <img (click)="openPlan(i,key,'平面图')"
[src]="i.imageUrl ? i.imageUrl+'?x-oss-process=image/resize,m_fill,h_100,w_100' : '../../../assets/images/noImg.png'" [src]="i.imageUrl ? i.imageUrl+'?x-oss-process=image/resize,m_fill,h_100,w_100' : '../../../assets/images/noImg.png'"
alt=""> alt="">
</div> </div>
@ -112,12 +113,68 @@
</div> </div>
</div> </div>
</div> </div>
<div class="leftBuilding" *ngIf="selectedItem == '单位概况'"> <div *ngIf="selectedItem == '交通水源'" class="leftKeyImg">
<div class="buildingHead" > <div class="keyImgTitle">
交通水源
</div>
<div class="planlist" id="planlist">
<div style="margin: 10px 0;">
<mat-accordion>
<mat-expansion-panel expanded style="box-shadow: 0 0 black;border: 1px solid #EEF1F5;">
<mat-expansion-panel-header collapsedHeight='33px' expandedHeight='33px'
style="position: relative;padding-left:20px;background: #F2F9FF;">
<mat-panel-title>
水源
</mat-panel-title>
</mat-expansion-panel-header>
<div class="content">
<div class="contentitem">
<div>
<img (click)="openPlan(1,-1,'水源')" src='/assets/images/2D.jpg' alt="">
</div>
<p>交通水源</p>
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
</div>
<div *ngIf="selectedItem == '预案附件'" class="leftKeyImg">
<div class="keyImgTitle">
预案附件
</div>
<div class="planlist" id="planlist">
<div style="margin: 10px 0;">
<mat-accordion>
<mat-expansion-panel expanded style="box-shadow: 0 0 black;border: 1px solid #EEF1F5;">
<mat-expansion-panel-header collapsedHeight='33px' expandedHeight='33px'
style="position: relative;padding-left:20px;background: #F2F9FF;">
<mat-panel-title>
二维预案列表
</mat-panel-title>
</mat-expansion-panel-header>
<div class="content">
<div class="contentitem" *ngFor="let TwoDPlan of TwoDPlanList">
<div>
<img (click)="openPlan(TwoDPlan,-1,'预案')" src='/assets/images/2Dplan.png'
alt="">
</div>
<p>{{TwoDPlan.name}}</p>
</div>
</div>
</mat-expansion-panel>
</mat-accordion>
</div>
</div>
</div>
<div *ngIf="selectedItem == '单位概况'" class="leftBuilding">
<div class="buildingHead">
<span>建筑列表</span> <span>建筑列表</span>
</div> </div>
<div class="buildingBody"> <div class="buildingBody">
<div class="buildName" *ngFor="let item of allBuildings;let i=index" [ngClass]="{'selectedTr': i == clicki}" (click)='clickBuilding(item,i)'> <div class="buildName" *ngFor="let item of allBuildings;let i=index"
[ngClass]="{'selectedTr': i == clicki}" (click)='clickBuilding(item,i)'>
<mat-checkbox class="example-margin" color='primary'></mat-checkbox> <mat-checkbox class="example-margin" color='primary'></mat-checkbox>
<span>{{item.name}}</span> <span>{{item.name}}</span>
</div> </div>
@ -125,19 +182,22 @@
</div> </div>
</div> </div>
<div class="mainbox"> <div class="mainbox">
<!-- 模板页面 -->
<div *ngFor="let item of planTemplateData;let key = index">
<div *ngIf="selectedItem == item.groupName || pattern == 'look'">
<!-- 封面 --> <!-- 封面 -->
<div class="cover" *ngIf="selectedItem == '封面'"> <div class="cover" *ngIf="item.groupName == '封面'">
<p class="planNum"> <p class="planNum">
预案编号: <input type="text" name="" id=""> 预案编号: <input [(ngModel)]="item.attribute.planNumber" type="text" name="" id="">
</p> </p>
<h1>{{planName}}</h1> <h1>{{item.attribute.planName}}</h1>
<ul *ngIf="unitData"> <ul>
<li> <li>
<div> <div>
对象名称: 对象名称:
</div> </div>
<div> <div>
{{unitData.name}} {{item.attribute.objName}}
</div> </div>
</li> </li>
<li> <li>
@ -145,7 +205,7 @@
单位性质: 单位性质:
</div> </div>
<div> <div>
{{unitData.buildingTypes[0].name}} {{item.attribute.unitNature}}
</div> </div>
</li> </li>
<li> <li>
@ -166,7 +226,7 @@
<span class="redspan">*</span>灾害类型: <span class="redspan">*</span>灾害类型:
</div> </div>
<div> <div>
<select ngModel="0"> <select [(ngModel)]="item.attribute.disasterType">
<option value="0">火灾</option> <option value="0">火灾</option>
<option value="1">抢险救援</option> <option value="1">抢险救援</option>
<option value="2">其他</option> <option value="2">其他</option>
@ -178,7 +238,7 @@
防火级别: 防火级别:
</div> </div>
<div> <div>
<input type="text" [(ngModel)]="item.attribute.fireproofingLevel">
</div> </div>
</li> </li>
<li> <li>
@ -186,7 +246,7 @@
防火管辖: 防火管辖:
</div> </div>
<div> <div>
{{unitData.organizationName}} {{item.attribute.fireproofingAdminister}}
</div> </div>
</li> </li>
<li> <li>
@ -194,7 +254,7 @@
灭火责任队站: 灭火责任队站:
</div> </div>
<div> <div>
<input type="text" [(ngModel)]="item.attribute.putOutFireAdminister">
</div> </div>
</li> </li>
<li> <li>
@ -202,8 +262,9 @@
制作人职务/姓名: 制作人职务/姓名:
</div> </div>
<div> <div>
<input type="text" style="width: 160px;margin-right: 10px;"> <input [(ngModel)]="item.attribute.producer.duty" type="text"
<input type="text" style="width: 50px;"> style="margin-right: 10px;">
<input [(ngModel)]="item.attribute.producer.name" type="text" style="width: 50px;">
</div> </div>
</li> </li>
<li> <li>
@ -211,7 +272,9 @@
审核人职务/姓名: 审核人职务/姓名:
</div> </div>
<div> <div>
<input [(ngModel)]="item.attribute.verifier.duty" type="text"
style="margin-right: 10px;">
<input [(ngModel)]="item.attribute.verifier.name" type="text" style="width: 50px;">
</div> </div>
</li> </li>
<li> <li>
@ -219,18 +282,14 @@
审核时间: 审核时间:
</div> </div>
<div> <div>
<input type="text" [(ngModel)]="item.attribute.auditTime">
</div> </div>
</li> </li>
</ul> </ul>
</div> </div>
<!-- 模板页面 -->
<div *ngFor="let item of planTemplateData;let key = index">
<div *ngIf="selectedItem == item.groupName">
<!-- <p>{{item.groupName}}</p> -->
<div class="centerBox" <div class="centerBox"
*ngIf="item.groupName!='单位概况'&&item.groupName!='交通水源'&&item.groupName!='重点图示'&&item.groupName!='预案附件'"> *ngIf="item.groupName!='单位概况'&&item.groupName!='交通水源'&&item.groupName!='重点图示'&&item.groupName!='预案附件'&&item.groupName!='特别警示'&&item.groupName!='处置要点'&&item.groupName!='封面'">
<div class="boxHead"> <div class="titleItem">
<span>{{item.groupName}}</span> <span>{{item.groupName}}</span>
</div> </div>
<div class="boxBody" *ngFor="let element of item.attribute;let i=index"> <div class="boxBody" *ngFor="let element of item.attribute;let i=index">
@ -284,7 +343,11 @@
</div> </div>
</div> </div>
</div> </div>
<div class="keyImg" *ngIf="item.groupName == '重点图示'"> <div class="keyImg"
*ngIf="item.groupName == '重点图示' || item.groupName == '交通水源' || item.groupName == '预案附件'">
<div class="titleItem">
<span>{{item.groupName}}</span>
</div>
<div class="keyImgItem" *ngFor="let i of item.attribute;let key = index"> <div class="keyImgItem" *ngFor="let i of item.attribute;let key = index">
<div class="keyImgTitle"> <div class="keyImgTitle">
<input type="text" placeholder="请输入分组名称" [(ngModel)]="i.name"> <input type="text" placeholder="请输入分组名称" [(ngModel)]="i.name">
@ -297,7 +360,7 @@
</mat-icon> </mat-icon>
<img [src]="imgUrl" alt=""> <img [src]="imgUrl" alt="">
</div> </div>
<div class="uploadBtn"> <div class="uploadBtn" *ngIf="pattern == 'edit'">
<button mat-stroked-button> <button mat-stroked-button>
<mat-icon>add</mat-icon>上传图片 <mat-icon>add</mat-icon>上传图片
</button> </button>
@ -306,13 +369,16 @@
</div> </div>
</div> </div>
<!-- 增加分组 --> <!-- 增加分组 -->
<div class="addkeyImgItem"> <div class="addkeyImgItem" *ngIf="pattern == 'edit'">
<button mat-flat-button color="primary" (click)="addkeyImgItem(item)"> <button mat-flat-button color="primary" (click)="addkeyImgItem(item)">
增加分组 增加分组
</button> </button>
</div> </div>
</div> </div>
<div class="disposalPoint" *ngIf="item.groupName == '处置要点'"> <div class="disposalPoint" *ngIf="item.groupName == '处置要点'">
<div class="titleItem">
<span>{{item.groupName}}</span>
</div>
<div class="disposalPointItem" *ngFor="let i of item.attribute;let key = index"> <div class="disposalPointItem" *ngFor="let i of item.attribute;let key = index">
<div class="disposalPointTitle"> <div class="disposalPointTitle">
<input type="text" placeholder="请输入分组名称" [(ngModel)]="i.name"> <input type="text" placeholder="请输入分组名称" [(ngModel)]="i.name">
@ -320,7 +386,8 @@
</mat-icon> </mat-icon>
</div> </div>
<div class="disposalPointTextarea"> <div class="disposalPointTextarea">
<textarea [(ngModel)]="i.cantent" style="resize: none;" placeholder="请填写自定义内容" name="" id="" cols="30" rows="10"></textarea> <textarea [(ngModel)]="i.cantent" style="resize: none;" placeholder="请填写自定义内容" name=""
id="" cols="30" rows="10"></textarea>
</div> </div>
</div> </div>
<!-- 增加分组 --> <!-- 增加分组 -->
@ -330,7 +397,24 @@
</button> </button>
</div> </div>
</div> </div>
<div class="disposalPoint" *ngIf="item.groupName == '特别警示'">
<div class="titleItem">
<span>{{item.groupName}}</span>
</div>
<div class="disposalPointItem" *ngFor="let i of item.attribute;let key = index">
<div class="disposalPointTitle">
<input type="text" placeholder="请输入分组名称" [(ngModel)]="i.name">
</div>
<div class="disposalPointTextarea">
<textarea [(ngModel)]="i.cantent" style="resize: none;" placeholder="请填写自定义内容" name=""
id="" cols="30" rows="10"></textarea>
</div>
</div>
</div>
<div class="unit" *ngIf="item.groupName == '单位概况'"> <div class="unit" *ngIf="item.groupName == '单位概况'">
<div class="titleItem">
<span>单位基本信息</span>
</div>
<div class="unithead"> <div class="unithead">
<span>{{buildingName}}</span> <span>{{buildingName}}</span>
</div> </div>
@ -347,13 +431,16 @@
<div *ngFor="let attack of element.attinf;let attacki=index"> <div *ngFor="let attack of element.attinf;let attacki=index">
<div class="attackhead"> <div class="attackhead">
<span>{{attack.head}}</span> <span>{{attack.head}}</span>
<img src="../../../assets/images/deleteblue.png" (click)='unitDel(element.surveyName,attacki)'> <img src="../../../assets/images/deleteblue.png"
<img src="../../../assets/images/add.png" (click)='unitadd(element.surveyName,attacki)'> (click)='unitDel(element.surveyName,attacki)'>
<img src="../../../assets/images/add.png"
(click)='unitadd(element.surveyName,attacki)'>
</div> </div>
<div class="attackbody"> <div class="attackbody">
<table> <table>
<thead> <thead>
<th *ngFor="let itemth of attack.tableth;let tablethi=index;TrackBy:trackByFn"> <th
*ngFor="let itemth of attack.tableth;let tablethi=index;TrackBy:trackByFn">
<input type="text" placeholder="请输入内容" <input type="text" placeholder="请输入内容"
[(ngModel)]="attack.tableth[tablethi]"> [(ngModel)]="attack.tableth[tablethi]">
</th> </th>

61
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.scss

@ -42,6 +42,9 @@
box-sizing: border-box; box-sizing: border-box;
padding: 0 10px; padding: 0 10px;
font-size: 14px; font-size: 14px;
overflow: hidden; /*超出部分隐藏*/
white-space: nowrap; /*不换行*/
text-overflow: ellipsis; /*超出部分文字以...显示*/
} }
.item:hover { .item:hover {
background: #e8f4fe; background: #e8f4fe;
@ -66,12 +69,12 @@
} }
} }
} }
.contentbox { .contentbox {
height: 100%; height: 100%;
box-sizing: border-box; box-sizing: border-box;
padding-top: 66px; padding-top: 66px;
overflow-y: auto; overflow-y: auto;
.leftbox { .leftbox {
position: fixed; position: fixed;
width: 14%; width: 14%;
@ -171,24 +174,24 @@
} }
} }
} }
.leftBuilding{ .leftBuilding {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.buildingHead{ .buildingHead {
height: 40px; height: 40px;
width: 100%; width: 100%;
background-color: #e8f4fe; background-color: #e8f4fe;
text-align: center; text-align: center;
span{ span {
line-height: 40px; line-height: 40px;
color: #2196f3; color: #2196f3;
font-size: 16px; font-size: 16px;
} }
} }
.buildingBody{ .buildingBody {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
@ -196,11 +199,11 @@
.selectedTr { .selectedTr {
background-color: #b3d3ee; background-color: #b3d3ee;
} }
.buildName{ .buildName {
cursor: pointer; cursor: pointer;
height: 40px; height: 40px;
width: 100%; width: 100%;
border-bottom: 1px solid #F2F4F5; border-bottom: 1px solid #f2f4f5;
.example-margin { .example-margin {
width: 14px; width: 14px;
height: 14px; height: 14px;
@ -209,7 +212,7 @@
position: relative; position: relative;
bottom: 1px; bottom: 1px;
} }
span{ span {
line-height: 40px; line-height: 40px;
font-size: 16px; font-size: 16px;
margin-left: 5px; margin-left: 5px;
@ -226,6 +229,7 @@
padding: 10px 10px 0; padding: 10px 10px 0;
.cover { .cover {
width: 100%; width: 100%;
min-height: 780px;
input, input,
select { select {
border: 1px solid #ebebeb; border: 1px solid #ebebeb;
@ -233,6 +237,9 @@
height: 28px; height: 28px;
line-height: 28px; line-height: 28px;
} }
input{
width: 140px;
}
p { p {
height: 28px; height: 28px;
line-height: 28px; line-height: 28px;
@ -456,13 +463,13 @@
margin: 10px 0; margin: 10px 0;
} }
} }
.unit{ .unit {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y: auto; overflow-y: auto;
.unithead{ .unithead {
height: 40px; height: 40px;
width: 100%; width: 100%;
background-color: #e8f4fe; background-color: #e8f4fe;
@ -476,22 +483,22 @@
line-height: 40px; line-height: 40px;
} }
} }
.unitbody{ .unitbody {
height: 100%; height: 100%;
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.unitbodyHead{ .unitbodyHead {
width: 100%; width: 100%;
height: 40px; height: 40px;
background-color: #2196F3; background-color: #2196f3;
text-align: center; text-align: center;
span { span {
font-size: 16px; font-size: 16px;
text-align: center; text-align: center;
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
color: #FFFFFF; color: #ffffff;
} }
img { img {
cursor: pointer; cursor: pointer;
@ -502,13 +509,13 @@
margin-right: 10px; margin-right: 10px;
} }
} }
.body{ .body {
width: 100%; width: 100%;
height: 100%; height: 100%;
.attack{ .attack {
width: 100%; width: 100%;
height: 100%; height: 100%;
.attackhead{ .attackhead {
width: 100%; width: 100%;
height: 40px; height: 40px;
background-color: #ffd91d; background-color: #ffd91d;
@ -529,7 +536,7 @@
margin-right: 10px; margin-right: 10px;
} }
} }
.attackbody{ .attackbody {
width: 100%; width: 100%;
height: 100%; height: 100%;
thead { thead {
@ -734,6 +741,7 @@
} }
} }
} }
}
.disposalPoint { .disposalPoint {
div { div {
width: 100%; width: 100%;
@ -782,7 +790,22 @@
margin: 10px 0; margin: 10px 0;
} }
} }
.titleItem{
width: 100%;
height: 36px;
line-height: 36px;
background-color: #2196F3;
text-align: center;
color: white;
} }
} }
} }
.noPadding{
padding-top: 10px;
}
.quitPreview{
position: fixed;
top: 10px;
right: 15px;
}
} }

129
src/app/plan-management/create-plan-online-five/create-plan-online-five.component.ts

@ -4,7 +4,7 @@
* @Author: sueRimn * @Author: sueRimn
* @Date: 2021-06-16 13:56:54 * @Date: 2021-06-16 13:56:54
* @LastEditors: sueRimn * @LastEditors: sueRimn
* @LastEditTime: 2021-06-28 17:09:10 * @LastEditTime: 2021-06-29 17:00:09
*/ */
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { Component, Inject, OnInit, Renderer2, ViewChild, Input } from '@angular/core'; import { Component, Inject, OnInit, Renderer2, ViewChild, Input } from '@angular/core';
@ -22,13 +22,9 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
constructor(private http: HttpClient, private route: ActivatedRoute, public snackBar: MatSnackBar, public dialog: MatDialog) { } constructor(private http: HttpClient, private route: ActivatedRoute, public snackBar: MatSnackBar, public dialog: MatDialog) { }
planName: string //预案名称
planLevel: string//预案级别 planLevel: string//预案级别
ngOnInit(): void { ngOnInit(): void {
this.planName = this.route.snapshot.queryParams.planName
this.planLevel = this.route.snapshot.queryParams.planCategory this.planLevel = this.route.snapshot.queryParams.planCategory
console.log('级别', this.planLevel)
this.getTemplateData()
this.getUnitData() this.getUnitData()
//this.getAllBuildings() //this.getAllBuildings()
this.tree = { this.tree = {
@ -64,8 +60,8 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
data.items.forEach(element => { data.items.forEach(element => {
if (element.id == this.route.snapshot.queryParams.companyId) { if (element.id == this.route.snapshot.queryParams.companyId) {
this.unitData = element this.unitData = element
console.log('单位列表信息', this.unitData) // console.log('单位列表信息', this.unitData)
this.getTemplateData()
} }
}); });
}) })
@ -74,7 +70,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
selectedItem: string = '封面' selectedItem: string = '封面'
clickTitleItem(item) { clickTitleItem(item) {
this.addNumber = -1 this.addNumber = -1
item == '封面' ? this.selectedItem = '封面' : this.selectedItem = item.groupName this.selectedItem = item.groupName
if (this.selectedItem == '重点图示') { if (this.selectedItem == '重点图示') {
this.getAllBuildings() this.getAllBuildings()
this.getSitePlan() this.getSitePlan()
@ -87,21 +83,43 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
this.planTemplateData[0].attribute[0].attinf[3].value=this.unitData.phone this.planTemplateData[0].attribute[0].attinf[3].value=this.unitData.phone
this.planTemplateData[0].attribute[0].attinf[4].value=this.unitData.organizationName this.planTemplateData[0].attribute[0].attinf[4].value=this.unitData.organizationName
this.planTemplateData[0].attribute[0].attinf[5].value=this.unitData.address this.planTemplateData[0].attribute[0].attinf[5].value=this.unitData.address
} /* else if (this.selectedItem == '单位概况') {
//this.getAllBuildings()
} */ else if (this.selectedItem == '') {
this.getTwoDPlanList()
}
} }
//获取当前单位的二维预案
TwoDPlanList: any
getTwoDPlanList() {
let paramsData = {
companyId: this.route.snapshot.queryParams.companyId,
pageSize: "999"
}
this.http.get("/api/PlanComponents", { params: paramsData }).subscribe((data: any) => {
this.TwoDPlanList = data.items.filter((item) => {
return item.planType == 1
})
})
} }
//获取实景图 //获取实景图
allRealPicture allRealPicture
getRealPicture() { getRealPicture() {
let companyId = this.unitId let companyId = this.unitId
this.http.get('/api/RealityImageGroups', { this.http.get('/api/RealityImageGroups', {
params: { params: {
companyId: '5e9964caa760a059e84512e9' companyId: this.route.snapshot.queryParams.companyId
} }
}).subscribe((data: any) => { }).subscribe((data: any) => {
this.allRealPicture = data this.allRealPicture = data
this.getAllRealPicture().then(() => { this.getAllRealPicture().then(() => {
console.log('实景图', this.allRealPicture) // console.log('实景图', this.allRealPicture)
}) })
}) })
} }
@ -132,24 +150,68 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
planTemplateData: any planTemplateData: any
//获得模板信息 //获得模板信息
getTemplateData() { getTemplateData() {
this.http.get('/api/PlanTemplate').subscribe(data => { this.http.get(`/api/PlanComponents/${this.route.snapshot.queryParams.planId}/WebText`).subscribe((data: any) => {
this.planTemplateData = JSON.parse(data[2].data).filter(item => // console.log('预案内容', data)
this.planTemplateData = JSON.parse(data.webTextData).filter(item =>
item.completed == true item.completed == true
) )
console.log(this.planTemplateData) // console.log(this.planTemplateData)
if (this.planTemplateData[0].groupName != '封面') {
let obj = {
completed: true,
groupName: "封面",
attribute: {
planNumber: '',
planName: this.route.snapshot.queryParams.planName,
objName: this.unitData.name,
unitNature: this.unitData.buildingTypes[0].name,
planLevel: '',
disasterType: '0',
fireproofingLevel: '',
fireproofingAdminister: this.unitData.organizationName,
putOutFireAdminister: '',
producer: {
name: '',
duty: ''
},
verifier: {
name: '',
duty: ''
},
auditTime: ''
}
}
this.planTemplateData.unshift(obj)
}
this.planTemplateData.forEach(element => { this.planTemplateData.forEach(element => {
if (element.groupName == '重点图示') { if (element.groupName == '重点图示') {
if (!element.attribute) { if (!element.attribute) {
element.attribute = [{ name: '', imgArr: [] }] element.attribute = [{ name: '', imgArr: [] }]
} }
} }
if (element.groupName == '交通水源') {
if (!element.attribute) {
element.attribute = [{ name: '', imgArr: [] }]
}
}
if (element.groupName == '预案附件') {
if (!element.attribute) {
element.attribute = [{ name: '', imgArr: [] }]
}
}
if (element.groupName == '处置要点') { if (element.groupName == '处置要点') {
if (!element.attribute) { if (!element.attribute) {
element.attribute = [{ name: '', content: '' }] element.attribute = [{ name: '', content: '' }]
} }
} }
if (element.groupName == '特别警示') {
if (!element.attribute) {
element.attribute = [{ name: '特别警示', content: '' }]
}
}
}); });
}) })
} }
@ -163,7 +225,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
} }
//通过左侧查看实景图 //通过左侧查看实景图
gallery gallery
lookkeyImgItemLeft(key1, key2,i) { lookkeyImgItemLeft(key1, key2, i) {
let dom = document.getElementById(`viewerjs`) let dom = document.getElementById(`viewerjs`)
let pObjs = dom.childNodes; let pObjs = dom.childNodes;
let node = document.createElement("img") let node = document.createElement("img")
@ -261,11 +323,20 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
}) })
} }
//打开采集工具 //打开采集工具
openPlan(item, index) { openPlan(item, index, type?: string) {
sessionStorage.setItem("gisplan", 'look') sessionStorage.setItem("gisplan", 'look')
sessionStorage.setItem("companyId", this.unitId) sessionStorage.setItem("companyId", this.unitId)
// console.log(item) // console.log(item)
let data = { select: item, key: index, allBuildings: this.allBuildings } if (type == '预案') {
sessionStorage.setItem("planId", item.id)
sessionStorage.setItem("companyId", this.route.snapshot.queryParams.companyId)
sessionStorage.setItem("buildingTypeId", this.route.snapshot.queryParams.unitTypeId)
sessionStorage.setItem("editable", "0")
sessionStorage.setItem("planName", item.name)
sessionStorage.setItem("orName", item.name)
sessionStorage.setItem("orId", item.name)
}
let data = { select: item, key: index, allBuildings: this.allBuildings, type: type }
let width = Math.round(document.body.clientWidth * 0.8) + 'px' let width = Math.round(document.body.clientWidth * 0.8) + 'px'
let height = Math.round(document.body.clientHeight * 0.9) + 'px' let height = Math.round(document.body.clientHeight * 0.9) + 'px'
// console.log('宽度',width) // console.log('宽度',width)
@ -309,7 +380,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
this.planTemplateData[key].attribute[i].tabletr[this.addNumber].tabletd.push('') this.planTemplateData[key].attribute[i].tabletr[this.addNumber].tabletd.push('')
} }
} }
console.log(this.planTemplateData) // console.log(this.planTemplateData)
} }
//灾情设定表格删除一行 //灾情设定表格删除一行
delTd(key, i) { delTd(key, i) {
@ -329,7 +400,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
} }
//单位概况左侧建筑点击事件 //单位概况左侧建筑点击事件
buildingName buildingName
clicki=0 clicki = 0
group group
clickBuilding(item,i){ clickBuilding(item,i){
this.buildingName=item.name this.buildingName=item.name
@ -338,9 +409,9 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
} }
//单位概况增加一行 //单位概况增加一行
unitadd(surveyName,attacki){ unitadd(surveyName, attacki) {
this.addNumber++ this.addNumber++
if(surveyName=='进攻通道'){ if (surveyName == '进攻通道') {
if (this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr == undefined) { if (this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr == undefined) {
this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr = [] this.planTemplateData[0].building[this.clicki].body[4].attinf[attacki].tabletr = []
} }
@ -354,7 +425,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
} }
} }
console.log(this.planTemplateData) // console.log(this.planTemplateData)
} }
else if(surveyName=='功能分区'){ else if(surveyName=='功能分区'){
console.log(this.clicki) console.log(this.clicki)
@ -364,7 +435,7 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
} }
} }
//单位概况删除一行 //单位概况删除一行
unitDel(surveyName,attacki){ unitDel(surveyName, attacki) {
const config = new MatSnackBarConfig(); const config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
@ -434,6 +505,15 @@ export class CreatePlanOnlineFiveComponent implements OnInit {
}) })
}) })
} }
//预览
pattern:string = 'edit'
preview(){
this.pattern = 'look'
}
quitPreview(){
this.pattern = 'edit'
}
} }
@ -451,13 +531,16 @@ export class OpenPlanToolDialog {
@ViewChild('plan') plan: any //子组件 @ViewChild('plan') plan: any //子组件
type: any//打开的类型 是平面图还是水源
ngOnInit() { ngOnInit() {
this.type = this.data.type
} }
ngAfterViewInit(): void { ngAfterViewInit(): void {
if (this.type != '水源' && this.type != '预案') {
this.noticePlan() this.noticePlan()
} }
}
//通知 子组件 传递参数 //通知 子组件 传递参数
noticePlan() { noticePlan() {

8
src/app/plan-management/create-plan-online-five/openPlanTool.html

@ -1,3 +1,9 @@
<div class="divbox"> <div class="divbox" *ngIf="type == '水源'">
<app-water-road></app-water-road>
</div>
<div class="divbox" *ngIf="type == '平面图'">
<app-collection-tools-plan #plan></app-collection-tools-plan> <app-collection-tools-plan #plan></app-collection-tools-plan>
</div> </div>
<div class="divbox" *ngIf="type == '预案'">
<app-collection-tools></app-collection-tools>
</div>

2
src/app/plan-management/entry-plan-look/AddPlanone.html

@ -62,7 +62,7 @@
<span *ngIf="uploadover" style="font-size: 13px;">(已上传)</span> <span *ngIf="uploadover" style="font-size: 13px;">(已上传)</span>
</div> </div>
<div *ngIf="inputword"> <div *ngIf="inputword">
<mat-radio-button value="2" style="margin-right: 10px;">在线编制</mat-radio-button> <!-- <mat-radio-button value="2" style="margin-right: 10px;">在线编制</mat-radio-button> -->
<!-- <button mat-raised-button *ngIf="isinput" (click)='createWord()'>在线编制预案</button> --> <!-- <button mat-raised-button *ngIf="isinput" (click)='createWord()'>在线编制预案</button> -->
</div> </div>
<!-- <div *ngIf="inputword"> <!-- <div *ngIf="inputword">

5
src/app/plan-management/entry-plan-look/entry-plan-look.component.ts

@ -94,7 +94,7 @@ export class EntryPlanLookComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
this.tabledataSource = [ this.tabledataSource = [
] ]
// this.getCompanyData() this.getCompanyData()
this.isoperation = this.route.snapshot.queryParams.operation this.isoperation = this.route.snapshot.queryParams.operation
this.unitdata.unitname = this.route.snapshot.queryParams.unitName this.unitdata.unitname = this.route.snapshot.queryParams.unitName
this.unitdata.organizationName = this.route.snapshot.queryParams.orName this.unitdata.organizationName = this.route.snapshot.queryParams.orName
@ -207,7 +207,8 @@ export class EntryPlanLookComponent implements OnInit {
} }
else if (e.planType == 16) { else if (e.planType == 16) {
if (e.attachmentUrls == null) { if (e.attachmentUrls == null) {
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}`) console.log(this.compantData)
window.open(`/planManagement/createplanonlinefive?navIsOpen=false&companyId=${this.companyId}&planName=${e.name}&unitName=${this.unitdata.unitname}&planCategory=${e.planCategory}&planId=${e.id}&unitTypeId=${this.compantData.buildingTypes[0].id}&orName=${this.compantData.organizationName}&orId=${this.compantData.organizationId}`)
} }
else { else {
let body = {}; let body = {};

2
src/app/plan-management/entry-plan/entry-plan.component.html

@ -142,7 +142,7 @@
<td mat-cell *matCellDef="let element;let i = index"> <td mat-cell *matCellDef="let element;let i = index">
<div class="integrityDiv"> <div class="integrityDiv">
<span class="integrityNum"> <span class="integrityNum">
{{(element.company.companyIntegrityScore.totalScore.toFixed(2) * 100).toFixed()}} {{(element.company.companyIntegrityScore.totalScore.toFixed(2) * 100).toFixed()}}%
</span> </span>
<div class="integrityColorDiv" [style]="integrity((element.company.companyIntegrityScore.totalScore.toFixed(2) * 100).toFixed())"> <div class="integrityColorDiv" [style]="integrity((element.company.companyIntegrityScore.totalScore.toFixed(2) * 100).toFixed())">
</div> </div>

4
src/app/plan-management/plan-management.module.ts

@ -68,6 +68,7 @@ import { CreatePlanOnlineFiveComponent, OpenPlanToolDialog } from './create-plan
import { CreatePlanOnlineThreeComponent } from './create-plan-online-three/create-plan-online-three.component' import { CreatePlanOnlineThreeComponent } from './create-plan-online-three/create-plan-online-three.component'
import { UiModule } from '../ui/ui.module'; import { UiModule } from '../ui/ui.module';
import { TreeDiagramModule } from '../ui/ng-tree-diagram/src/ng-tree-diagram'; import { TreeDiagramModule } from '../ui/ng-tree-diagram/src/ng-tree-diagram';
import { KeyUnitModule } from '../key-unit/key-unit.module';
@NgModule({ @NgModule({
declarations: [EntryPlanComponent, PassPlanComponent, OpenPlanComponent, EntryPlanLookComponent, AddPlanone, PlanType, AuditSatus, PlanLevel, DownloadFile, AuditResult, ChangeName, declarations: [EntryPlanComponent, PassPlanComponent, OpenPlanComponent, EntryPlanLookComponent, AddPlanone, PlanType, AuditSatus, PlanLevel, DownloadFile, AuditResult, ChangeName,
@ -121,7 +122,8 @@ import { TreeDiagramModule } from '../ui/ng-tree-diagram/src/ng-tree-diagram';
MatTooltipModule, MatTooltipModule,
MatTreeModule, MatTreeModule,
UiModule, UiModule,
TreeDiagramModule TreeDiagramModule,
KeyUnitModule
], ],
exports: [PlanType, AuditSatus, PlanLevel, state] exports: [PlanType, AuditSatus, PlanLevel, state]
}) })

4
src/app/tabbar/tabbar.component.html

@ -154,7 +154,7 @@
<table> <table>
<tr> <tr>
<td>名称</td> <td>名称</td>
<td>分值</td> <td>占比</td>
<td>规则说明</td> <td>规则说明</td>
</tr> </tr>
<tr> <tr>
@ -194,7 +194,7 @@
<tr> <tr>
<td>实景图</td> <td>实景图</td>
<td class="bulecolor">10%</td> <td class="bulecolor">10%</td>
<td>外观,保证有<span class="bulecolor">2</span>张照片(占<span class="bulecolor">30%</span>); 室内,保证有<span <td>外观,保证有<span class="bulecolor">2</span>张照片(占<span class="bulecolor">30%</span>); 重点部位,保证有<span
class="bulecolor">2</span>张照片(占<span class="bulecolor">30%</span>);安全出口,保证有<span class="bulecolor">2</span>张照片(占<span class="bulecolor">30%</span>);安全出口,保证有<span
class="bulecolor">2</span>张照片(占<span class="bulecolor">40%</span></td> class="bulecolor">2</span>张照片(占<span class="bulecolor">40%</span></td>
</tr> </tr>

14
src/app/ui/collection-tools-building/collection-tools.component.ts

@ -1935,6 +1935,12 @@ export class CollectionToolsBuildingComponent implements OnInit {
item.name = item.name + '(副本)' item.name = item.name + '(副本)'
item.order = this.sitePlanData[this.sitePlanData.length - 1].order + 1 item.order = this.sitePlanData[this.sitePlanData.length - 1].order + 1
this.http.post('/api/SitePlans', item).subscribe((data: any) => { this.http.post('/api/SitePlans', item).subscribe((data: any) => {
for (const key in paramsData) {
if (Object.prototype.hasOwnProperty.call(paramsData, key)) {
const element = paramsData[key];
element.FloorId = data.id
}
}
let newData = { let newData = {
version: "2.0", version: "2.0",
id: "", id: "",
@ -1991,6 +1997,14 @@ export class CollectionToolsBuildingComponent implements OnInit {
item.name = item.name + '(副本)' item.name = item.name + '(副本)'
item.order = this.sitePlanData[this.sitePlanData.length - 1].order + 1 item.order = this.sitePlanData[this.sitePlanData.length - 1].order + 1
this.http.post('/api/BuildingAreas', item, { params: this.params }).subscribe((data: any) => { this.http.post('/api/BuildingAreas', item, { params: this.params }).subscribe((data: any) => {
// console.log('复制出的新楼层',data.id)
// console.log('复制的数据',paramsData)
for (const key in paramsData) {
if (Object.prototype.hasOwnProperty.call(paramsData, key)) {
const element = paramsData[key];
element.FloorId = data.id
}
}
let newData = { let newData = {
version: "2.0", version: "2.0",
id: "", id: "",

68
src/app/ui/collection-tools-plan/collection-tools.component.ts

@ -233,7 +233,6 @@ export class CollectionToolsPlanComponent implements OnInit {
if (!this.isGis) { if (!this.isGis) {
this.canvas.refreshIcon(this.canvasAssetObj.Id) this.canvas.refreshIcon(this.canvasAssetObj.Id)
} }
} }
//素材高度输入框改变 //素材高度输入框改变
assetHeightIunput() { assetHeightIunput() {
@ -705,7 +704,6 @@ export class CollectionToolsPlanComponent implements OnInit {
let buildingId = this.beforeOneCheckedBuilding.id let buildingId = this.beforeOneCheckedBuilding.id
let floorId = this.selectingSitePlan.id let floorId = this.selectingSitePlan.id
this.canvas.paste(companyId, buildingId, floorId) this.canvas.paste(companyId, buildingId, floorId)
// this.renovateTreeData(false)
} }
//截图 //截图
takeScreenshot() { takeScreenshot() {
@ -781,6 +779,7 @@ export class CollectionToolsPlanComponent implements OnInit {
saveNum: any = [] saveNum: any = []
saveSite() { saveSite() {
//更新用于统计的数据 //更新用于统计的数据
this.canvasData.updateBuildingData() this.canvasData.updateBuildingData()
if (this.selectingSitePlan && this.selectingSitePlan.id) { if (this.selectingSitePlan && this.selectingSitePlan.id) {
@ -793,12 +792,11 @@ export class CollectionToolsPlanComponent implements OnInit {
CompanyData.data = JSON.stringify(CompanyData.data) CompanyData.data = JSON.stringify(CompanyData.data)
let object = this.canvasData.originalcompanyBuildingData.data let object = this.canvasData.originalcompanyBuildingData.data
console.log('建筑数据',object)
let adjoinArr = [] //毗邻数组 let adjoinArr = [] //毗邻数组
if (this.pattern) {//如果是基本信息编辑模式 if (this.pattern) {//如果是基本信息编辑模式
for (const key in object) { for (const key in object) {
if (object[key].Name == "毗邻") {//如果是相同楼层,则筛选出毗邻 if (object[key].Name == "毗邻") {//如果是相同楼层,则筛选出毗邻
object[key].PropertyInfos.forEach(element => { object[key].PropertyInfos.forEach(element => {
if (element.PropertyName == "方向") { if (element.PropertyName == "方向") {
adjoinArr.push(element.PropertyValue) adjoinArr.push(element.PropertyValue)
@ -806,6 +804,7 @@ export class CollectionToolsPlanComponent implements OnInit {
}); });
} }
} }
console.log('adjoinArr',adjoinArr)
if ((new Set(adjoinArr)).size != adjoinArr.length) { if ((new Set(adjoinArr)).size != adjoinArr.length) {
this.maskLayerService.sendMessage(false) this.maskLayerService.sendMessage(false)
let config = new MatSnackBarConfig(); let config = new MatSnackBarConfig();
@ -816,7 +815,6 @@ export class CollectionToolsPlanComponent implements OnInit {
} else { } else {
//如果是单位 总平面图 //如果是单位 总平面图
if (this.checkedBuildingIndex == -1) { if (this.checkedBuildingIndex == -1) {
if (this.isGis) { if (this.isGis) {
let data = JSON.parse(JSON.stringify(this.selectingSitePlan)) let data = JSON.parse(JSON.stringify(this.selectingSitePlan))
data.zoomLevel = this.map.getZoom(), data.zoomLevel = this.map.getZoom(),
@ -865,6 +863,9 @@ export class CollectionToolsPlanComponent implements OnInit {
}) })
//保存建筑数据 //保存建筑数据
// console.log('CompanyData',CompanyData)
CompanyData.data = "{\"图例\":{\"Id\":\"图例\",\"Name\":\"图例\",\"Angle\":0,\"Color\":\"#066EED80\",\"Point\":{\"x\":200,\"y\":200},\"Scale\":1,\"Width\":32,\"Border\":null,\"Height\":32,\"PivotX\":0,\"PivotY\":0,\"Enabled\":true,\"FloorId\":\"60d43256660b093f1c3b5aa5\",\"DrawMode\":null,\"FillMode\":null,\"GameMode\":0,\"ImageUrl\":null,\"FixedSize\":null,\"Thickness\":null,\"MultiPoint\":null,\"TemplateId\":null,\"FireElementId\":null,\"PropertyInfos\":[{\"Tag\":\"\",\"Order\":0,\"Enabled\":true,\"Visible\":true,\"Required\":false,\"RuleName\":\"\",\"RuleValue\":\"\",\"PhysicalUnit\":\"\",\"PropertyName\":\"列\",\"PropertyType\":2,\"PropertyValue\":\"2\"}],\"IsFromBuilding\":null,\"InteractiveMode\":null}}"
this.http.post("/api/CompanyData", CompanyData, { this.http.post("/api/CompanyData", CompanyData, {
params: { params: {
companyId: this.params.companyId companyId: this.params.companyId
@ -954,7 +955,6 @@ export class CollectionToolsPlanComponent implements OnInit {
}).subscribe(data => { }).subscribe(data => {
this.saveNum.push("1") this.saveNum.push("1")
if (this.saveNum.length == 5) { if (this.saveNum.length == 5) {
this.maskLayerService.sendMessage(false)
this.maskLayerService.sendMessage(false) this.maskLayerService.sendMessage(false)
this.canvasData.isChange = false this.canvasData.isChange = false
let config = new MatSnackBarConfig(); let config = new MatSnackBarConfig();
@ -1239,7 +1239,6 @@ export class CollectionToolsPlanComponent implements OnInit {
storeyData //将建筑素材和当前楼层素材合二为一 storeyData //将建筑素材和当前楼层素材合二为一
//处理 tree 数据结构 //处理 tree 数据结构
handleTreeData(storeyData) { handleTreeData(storeyData) {
this.storeyData = storeyData this.storeyData = storeyData
let data = this.allFireElements //所有消防要素模板 let data = this.allFireElements //所有消防要素模板
let treeData = [] //tree型 处理完成后的数据 let treeData = [] //tree型 处理完成后的数据
@ -1387,8 +1386,6 @@ export class CollectionToolsPlanComponent implements OnInit {
//封装 刷新 tree 数据 //封装 刷新 tree 数据
async renovateTreeData(isRefresh: boolean = true) { async renovateTreeData(isRefresh: boolean = true) {
// this.allFireElements[this.allFireElements.length-1].children = []
console.log(888, this.selectingSitePlan)
if (!this.selectingSitePlan.isGis) { if (!this.selectingSitePlan.isGis) {
isRefresh ? await this.canvas.refresh() : null isRefresh ? await this.canvas.refresh() : null
this.canvas.setNameVisible(this.basicInfo, 0) this.canvas.setNameVisible(this.basicInfo, 0)
@ -1421,7 +1418,6 @@ export class CollectionToolsPlanComponent implements OnInit {
} }
map: any map: any
toLoadGis() { toLoadGis() {
console.log(666666, this.isGis)
this.map = new AMap.Map('planContainer', { this.map = new AMap.Map('planContainer', {
viewMode: '2D', // 默认使用 2D 模式,如果希望使用带有俯仰角的 3D 模式,请设置 viewMode: '3D', viewMode: '2D', // 默认使用 2D 模式,如果希望使用带有俯仰角的 3D 模式,请设置 viewMode: '3D',
zoom: 11, //初始化地图层级 zoom: 11, //初始化地图层级
@ -1490,12 +1486,6 @@ export class CollectionToolsPlanComponent implements OnInit {
} }
//陈鹏飞↓↓↓ //陈鹏飞↓↓↓
//陈鹏飞↓↓↓ //陈鹏飞↓↓↓
//陈鹏飞↓↓↓ //陈鹏飞↓↓↓
@ -1837,29 +1827,13 @@ export class CollectionToolsPlanComponent implements OnInit {
const isDelete = confirm('您确定要删除吗'); const isDelete = confirm('您确定要删除吗');
if (isDelete) { if (isDelete) {
if (this.checkedBuildingIndex == -1) { //总平面图 if (this.checkedBuildingIndex == -1) { //总平面图
let isHave = this.canvasData.allDisposalNode.find(items => { return items.sitePlanId === item.id })
if (isHave == undefined) {
this.http.delete(`/api/SitePlans/${item.id}`).subscribe(data => { this.http.delete(`/api/SitePlans/${item.id}`).subscribe(data => {
this.deleteShareData(item, -1) this.deleteShareData(item, -1)
}) })
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('含有数据节点的楼层不允许删除', '确定', config);
}
} else { //楼层/区域 } else { //楼层/区域
let isHave = this.canvasData.allDisposalNode.find(items => { return items.buildingAreaId === item.id })
if (isHave == undefined) {
this.http.delete(`/api/BuildingAreas/${item.id}`).subscribe(data => { this.http.delete(`/api/BuildingAreas/${item.id}`).subscribe(data => {
this.deleteShareData(item, 1) this.deleteShareData(item, 1)
}) })
} else {
const config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('含有数据节点的楼层不允许删除', '确定', config);
}
} }
} }
} }
@ -1878,13 +1852,17 @@ export class CollectionToolsPlanComponent implements OnInit {
delete data.data[key] delete data.data[key]
} }
} }
console.log('删除e',e)
console.log('删除建筑数据',data)
let newData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData)); let newData = JSON.parse(JSON.stringify(this.canvasData.originalcompanyBuildingData));
newData.data = JSON.stringify(newData.data) // 转换JSON 数据格式 newData.data = JSON.stringify(newData.data) // 转换JSON 数据格式
this.selectingSitePlan = this.sitePlanData[0] || {} this.selectingSitePlan = this.sitePlanData[0] || {}
this.sitePlanData[0] ? this.isGis = this.sitePlanData[0].isGis : null
this.canvasData.selectStorey = this.sitePlanData[0] || {} //服务中 存一份数据 this.canvasData.selectStorey = this.sitePlanData[0] || {} //服务中 存一份数据
this.selectSitePlanIndex = 0 this.selectSitePlanIndex = 0
this.canvasData.isChange = false this.canvasData.isChange = false
if (isCompany === -1) { if (isCompany === -1) {
console.log('保存建筑数据',newData)
this.http.post("/api/CompanyData", newData).subscribe(data => { }) this.http.post("/api/CompanyData", newData).subscribe(data => { })
this.getSitePlanStorey(this.selectingSitePlan) //获取 平面图 楼层数据 this.getSitePlanStorey(this.selectingSitePlan) //获取 平面图 楼层数据
} else { } else {
@ -1918,6 +1896,12 @@ export class CollectionToolsPlanComponent implements OnInit {
item.name = item.name + '(副本)' item.name = item.name + '(副本)'
item.order = this.sitePlanData[this.sitePlanData.length - 1].order + 1 item.order = this.sitePlanData[this.sitePlanData.length - 1].order + 1
this.http.post('/api/SitePlans', item).subscribe((data: any) => { this.http.post('/api/SitePlans', item).subscribe((data: any) => {
for (const key in paramsData) {
if (Object.prototype.hasOwnProperty.call(paramsData, key)) {
const element = paramsData[key];
element.FloorId = data.id
}
}
let newData = { let newData = {
version: "2.0", version: "2.0",
id: "", id: "",
@ -1974,6 +1958,12 @@ export class CollectionToolsPlanComponent implements OnInit {
item.name = item.name + '(副本)' item.name = item.name + '(副本)'
item.order = this.sitePlanData[this.sitePlanData.length - 1].order + 1 item.order = this.sitePlanData[this.sitePlanData.length - 1].order + 1
this.http.post('/api/BuildingAreas', item, { params: this.params }).subscribe((data: any) => { this.http.post('/api/BuildingAreas', item, { params: this.params }).subscribe((data: any) => {
for (const key in paramsData) {
if (Object.prototype.hasOwnProperty.call(paramsData, key)) {
const element = paramsData[key];
element.FloorId = data.id
}
}
let newData = { let newData = {
version: "2.0", version: "2.0",
id: "", id: "",
@ -2217,8 +2207,7 @@ export class CollectionToolsPlanComponent implements OnInit {
// console.log('选中图片',this.selectImage) // console.log('选中图片',this.selectImage)
this.selectImageIndex = index this.selectImageIndex = index
if (this.isGis) { if (this.isGis) {
console.log(this.map) // console.log(this.map)
} else { } else {
this.canvasData.selectTemplateData = items this.canvasData.selectTemplateData = items
this.canvas.beginPaint() this.canvas.beginPaint()
@ -2272,6 +2261,7 @@ export class CollectionToolsPlanComponent implements OnInit {
let itemData = JSON.parse(JSON.stringify(this.selectImage)) let itemData = JSON.parse(JSON.stringify(this.selectImage))
itemData.id = id itemData.id = id
itemData.point = { x: e.lnglat.lng, y: e.lnglat.lat } itemData.point = { x: e.lnglat.lng, y: e.lnglat.lat }
itemData.floorId = this.selectingSitePlan.id
itemData = this.canvasData.deserialize(JSON.stringify(itemData))//反序列化为大写 itemData = this.canvasData.deserialize(JSON.stringify(itemData))//反序列化为大写
// 添加楼层数据 // 添加楼层数据
this.canvasData.originaleveryStoreyData.data[id] = itemData; this.canvasData.originaleveryStoreyData.data[id] = itemData;
@ -2291,7 +2281,7 @@ export class CollectionToolsPlanComponent implements OnInit {
seekPanelPoint(paramsData) { seekPanelPoint(paramsData) {
this.checkedBuildingIndex = paramsData.buildingIndex this.checkedBuildingIndex = paramsData.buildingIndex
if (paramsData.buildingIndex == -1) { //总平面图时 if (paramsData.buildingIndex == -1) { //总平面图时
console.log('走了1') // console.log('走了1')
this.beforeOneCheckedBuilding = { name: "总平面图" } this.beforeOneCheckedBuilding = { name: "总平面图" }
let fireData = this.getFireElements(sessionStorage.getItem('buildingTypeId')) //获取单位下 消防要素 let fireData = this.getFireElements(sessionStorage.getItem('buildingTypeId')) //获取单位下 消防要素
let planData = this.getSitePlanCompanyData() //获取 单位 数据 let planData = this.getSitePlanCompanyData() //获取 单位 数据
@ -2306,15 +2296,15 @@ export class CollectionToolsPlanComponent implements OnInit {
}) })
}) //get }) //get
} else { //建筑时 } else { //建筑时
console.log('走了2') // console.log('走了2')
console.log('allBuildings', this.allBuildings) // console.log('allBuildings', this.allBuildings)
console.log('paramsData', paramsData) // console.log('paramsData', paramsData)
this.beforeOneCheckedBuilding = this.allBuildings[paramsData.buildingIndex] this.beforeOneCheckedBuilding = this.allBuildings[paramsData.buildingIndex]
let params = { buildingId: this.beforeOneCheckedBuilding.id } let params = { buildingId: this.beforeOneCheckedBuilding.id }
let fireData = this.getFireElements(this.beforeOneCheckedBuilding.buildingTypes[0].id || '') //获取建筑下 消防要素 let fireData = this.getFireElements(this.beforeOneCheckedBuilding.buildingTypes[0].id || '') //获取建筑下 消防要素
let planData = this.getBuildingData(params) //获取 建筑 数据 let planData = this.getBuildingData(params) //获取 建筑 数据
this.http.get('/api/BuildingAreas', { params }).subscribe(data => { this.http.get('/api/BuildingAreas', { params }).subscribe(data => {
console.log('BuildingAreas', data) // console.log('BuildingAreas', data)
this.sitePlanData = data this.sitePlanData = data
let index = this.sitePlanData.findIndex(item => { return item.id === paramsData.storeyId }) let index = this.sitePlanData.findIndex(item => { return item.id === paramsData.storeyId })
this.selectingSitePlan = this.sitePlanData[index] || {} this.selectingSitePlan = this.sitePlanData[index] || {}

2
src/app/ui/collection-tools-plan/leftFunctionalDomain.ts

@ -113,7 +113,7 @@ export class leftFunctionalDomainComponentPlan implements OnInit {
} }
} }
}) //post }) //post
} else if (this.file.size>5*1024*1024 && this.file.size<=10*1024*1024) { //大于5MB } else if (this.file.size>5*1024*1024 && this.file.size<=100*1024*1024) { //大于5MB
let upload = this.canvasData.sectionUpload(sessionStorage.getItem('companyId'),this.file) let upload = this.canvasData.sectionUpload(sessionStorage.getItem('companyId'),this.file)
upload.then(res=>{ upload.then(res=>{
let imgURL = '/api/Objects/PlanPlatform/' + res let imgURL = '/api/Objects/PlanPlatform/' + res

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

@ -662,8 +662,8 @@ export class CollectionToolsComponent implements OnInit {
}//多个素材共同属性 }//多个素材共同属性
multipleAssetData: any//当前多选的素材 multipleAssetData: any//当前多选的素材
firstMultipleAssetData: any//当前多选的第一个素材 firstMultipleAssetData: any//当前多选的第一个素材
organizationName: any = this.route.snapshot.queryParams.orName//当前预案单位所属机构名称 organizationName: any = this.route.snapshot.queryParams.orName || sessionStorage.getItem('orName')//当前预案单位所属机构名称
organizationId: any = this.route.snapshot.queryParams.orId//当前预案单位所属机构名称 organizationId: any = this.route.snapshot.queryParams.orId || sessionStorage.getItem('orId')//当前预案单位所属机构名称
ngOnInit(): void { ngOnInit(): void {
this.canvasData.isInheritSky = { weather: '', airTemperature: '', windDirection: '', windScale: '', }; //缓存 节点 天气 this.canvasData.isInheritSky = { weather: '', airTemperature: '', windDirection: '', windScale: '', }; //缓存 节点 天气
AxMessageSystem.addListener('selectionChanged', () => { AxMessageSystem.addListener('selectionChanged', () => {
@ -2004,6 +2004,12 @@ export class CollectionToolsComponent implements OnInit {
item.name = item.name + '(副本)' item.name = item.name + '(副本)'
item.order = this.sitePlanData[this.sitePlanData.length - 1].order + 1 item.order = this.sitePlanData[this.sitePlanData.length - 1].order + 1
this.http.post('/api/SitePlans', item).subscribe((data: any) => { this.http.post('/api/SitePlans', item).subscribe((data: any) => {
for (const key in paramsData) {
if (Object.prototype.hasOwnProperty.call(paramsData, key)) {
const element = paramsData[key];
element.FloorId = data.id
}
}
let newData = { let newData = {
version: "2.0", version: "2.0",
id: "", id: "",
@ -2060,6 +2066,12 @@ export class CollectionToolsComponent implements OnInit {
item.name = item.name + '(副本)' item.name = item.name + '(副本)'
item.order = this.sitePlanData[this.sitePlanData.length - 1].order + 1 item.order = this.sitePlanData[this.sitePlanData.length - 1].order + 1
this.http.post('/api/BuildingAreas', item, { params: this.params }).subscribe((data: any) => { this.http.post('/api/BuildingAreas', item, { params: this.params }).subscribe((data: any) => {
for (const key in paramsData) {
if (Object.prototype.hasOwnProperty.call(paramsData, key)) {
const element = paramsData[key];
element.FloorId = data.id
}
}
let newData = { let newData = {
version: "2.0", version: "2.0",
id: "", id: "",

BIN
src/assets/images/2Dplan.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Loading…
Cancel
Save