|
|
|
@ -57,10 +57,8 @@ export class FireForceComponent implements OnInit {
|
|
|
|
|
PageSize : 999999, |
|
|
|
|
Levels:Levels |
|
|
|
|
} |
|
|
|
|
console.log('4444',Levels) |
|
|
|
|
if(Levels.length != 0){//如果勾选了checkbox
|
|
|
|
|
this.http.get('/api/CustomFireForce',{params:params}).subscribe((data:any) => { |
|
|
|
|
console.log('所有力量',data) |
|
|
|
|
this.createMarker(data) |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
@ -177,7 +175,6 @@ export class FireForceComponent implements OnInit {
|
|
|
|
|
MaxIntegrity : MaxIntegrity |
|
|
|
|
} |
|
|
|
|
this.http.get('/api/CustomFireForce',{params:params}).subscribe((data:any) => { |
|
|
|
|
console.log('所有消防力量列表',data) |
|
|
|
|
this.allFireForceList = data |
|
|
|
|
this.dataSource.data = this.tree.toTree(data) |
|
|
|
|
this.treeControl.expand(this.treeControl.dataNodes[0]); |
|
|
|
@ -198,11 +195,9 @@ export class FireForceComponent implements OnInit {
|
|
|
|
|
newNodes = newNodes.filter(n => { |
|
|
|
|
return expandNodes.indexOf(n.id) >= 0; |
|
|
|
|
}); |
|
|
|
|
console.log(newNodes) |
|
|
|
|
newNodes.forEach(item => { |
|
|
|
|
this.treeControl.expand(item); |
|
|
|
|
}); |
|
|
|
|
console.log('所有消防力量',data) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
private _transformer = (node, level: number) => {//要给渲染节点传那些属性参数
|
|
|
|
@ -235,7 +230,6 @@ export class FireForceComponent implements OnInit {
|
|
|
|
|
code:'' |
|
|
|
|
} |
|
|
|
|
selectTreeNode(node){ |
|
|
|
|
console.log(node) |
|
|
|
|
this.isGisTopBox = false |
|
|
|
|
if(this.selectedFireForceId != node.id){ |
|
|
|
|
this.clearData() |
|
|
|
@ -264,7 +258,6 @@ export class FireForceComponent implements OnInit {
|
|
|
|
|
this.isMasklayer = false |
|
|
|
|
this.FireForceDetailInfo = data |
|
|
|
|
if(data.location && data.location.x){//如果已经标注单位坐标
|
|
|
|
|
console.log('开始标注') |
|
|
|
|
this.positionLngLat = data.location |
|
|
|
|
this.map.setCenter([data.location.x,data.location.y]); |
|
|
|
|
this.newPositionMarker = new AMap.Marker({ |
|
|
|
@ -278,7 +271,6 @@ export class FireForceComponent implements OnInit {
|
|
|
|
|
this.map.setCity('上海市'); |
|
|
|
|
} |
|
|
|
|
//相关资料
|
|
|
|
|
console.log('详情',data) |
|
|
|
|
data.relevantInfomationData ? this.AttachmentArr = JSON.parse(data.relevantInfomationData) : null |
|
|
|
|
|
|
|
|
|
if(node.forceType == 0 && node.level == 0){ |
|
|
|
@ -315,7 +307,6 @@ export class FireForceComponent implements OnInit {
|
|
|
|
|
//搜索
|
|
|
|
|
isTreeView:boolean = true//决定显示树还是列表
|
|
|
|
|
searchList(){ |
|
|
|
|
console.log(this.searchForm) |
|
|
|
|
if(!this.searchForm.name && !this.searchForm.integrityNum){ |
|
|
|
|
this.isTreeView = true |
|
|
|
|
}else{ |
|
|
|
@ -573,11 +564,8 @@ export class FireForceComponent implements OnInit {
|
|
|
|
|
//删除一下数据库的文件
|
|
|
|
|
if(this.deletedFile.length != 0){ |
|
|
|
|
this.deletedFile.forEach(item => { |
|
|
|
|
// this.http.delete(`/api/Objects/PlanPlatform/${item.objectName}?x-oss-process=image/resize,m_fixed,h_100,w_100`).subscribe(data=>{
|
|
|
|
|
// console.log('删除缩略图成功')
|
|
|
|
|
// })
|
|
|
|
|
this.http.delete(`/api/Objects/PlanPlatform/${item.objectName}`).subscribe(data=>{ |
|
|
|
|
console.log('删除原文件成功') |
|
|
|
|
// console.log('删除原文件成功')
|
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
@ -637,7 +625,6 @@ export class FireForceComponent implements OnInit {
|
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
this.upDateAllFireForce() |
|
|
|
|
// console.log(123,data)
|
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
let forceType |
|
|
|
@ -654,7 +641,6 @@ export class FireForceComponent implements OnInit {
|
|
|
|
|
organizationId : this.selectedFireForce.id |
|
|
|
|
} |
|
|
|
|
this.http.post('/api/CustomFireForce',body,{params:params}).subscribe((data:any) => { |
|
|
|
|
console.log('创建其他消防力量成功',data) |
|
|
|
|
this.newselectedFireForceId = data.id |
|
|
|
|
this.selectedFireForce = data |
|
|
|
|
let body = this.FireForceDetailInfo |
|
|
|
@ -669,7 +655,6 @@ export class FireForceComponent implements OnInit {
|
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('保存成功','确定',config); |
|
|
|
|
console.log(123,data2) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
@ -717,21 +702,6 @@ export class FireForceComponent implements OnInit {
|
|
|
|
|
});//注册监听,当选中某条记录时会触发
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
if(this.isMapLabel){//如果已经标注单位坐标
|
|
|
|
|
console.log('已标注单位位置') |
|
|
|
|
// this.map.setCenter([this.unitinfo.location.x,this.unitinfo.location.y]);
|
|
|
|
|
// this.oldPositionMarker = new AMap.Marker({
|
|
|
|
|
// position: [this.unitinfo.location.x,this.unitinfo.location.y],
|
|
|
|
|
// content: this.newPositionMarkerContent,
|
|
|
|
|
// offset: new AMap.Pixel(-15, -18)
|
|
|
|
|
// })
|
|
|
|
|
// // 将 markers 添加到地图
|
|
|
|
|
// this.map.add(this.oldPositionMarker);
|
|
|
|
|
}else{ |
|
|
|
|
console.log('未标注单位位置') |
|
|
|
|
// this.map.setCity('上海市');
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//点击位置
|
|
|
|
|
isGisTopBox:boolean = false //
|
|
|
|
@ -744,15 +714,11 @@ export class FireForceComponent implements OnInit {
|
|
|
|
|
this.isGisTopBox = true |
|
|
|
|
this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null |
|
|
|
|
let center |
|
|
|
|
console.log(789,this.atLastPositionLngLat) |
|
|
|
|
if(this.newPositionMarker && this.atLastPositionLngLat.x){//如果已经标注单位坐标
|
|
|
|
|
console.log(1) |
|
|
|
|
center = [this.atLastPositionLngLat.x, this.atLastPositionLngLat.y] |
|
|
|
|
}else if(this.newPositionMarker && !this.atLastPositionLngLat.x && this.FireForceDetailInfo.location && this.FireForceDetailInfo.location.x){ |
|
|
|
|
console.log(2) |
|
|
|
|
center = [this.FireForceDetailInfo.location.x, this.FireForceDetailInfo.location.y] |
|
|
|
|
}else{ |
|
|
|
|
console.log(3) |
|
|
|
|
center = this.map.getCenter(); //获取当前地图中心位置
|
|
|
|
|
} |
|
|
|
|
this.newPositionMarker = new AMap.Marker({ |
|
|
|
@ -815,7 +781,6 @@ export class FireForceComponent implements OnInit {
|
|
|
|
|
isMasklayerUploading:boolean = false//上传进度条遮罩层是否打开
|
|
|
|
|
isMasklayerDownload:boolean = false//下载进度条遮罩层是否打开
|
|
|
|
|
uploadAttachment(e){ |
|
|
|
|
console.log('选择的文件',e) |
|
|
|
|
this.file = e.target.files[0] || null //上传的文件
|
|
|
|
|
let file = e.target.files[0] || null //获取上传的文件
|
|
|
|
|
let fileSize = file.size || null //上传文件的总大小
|
|
|
|
@ -823,12 +788,9 @@ export class FireForceComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
if (file && fileSize<=shardSize) { //上传文件<=5MB时
|
|
|
|
|
this.isMasklayer = true |
|
|
|
|
console.log('file',this.file) |
|
|
|
|
let formData = new FormData() |
|
|
|
|
formData.append("file",file) |
|
|
|
|
//this.selectedFireForce.id 选择的组织机构的id
|
|
|
|
|
this.http.post(`/api/Objects/PlanPlatform/FireForce/${this.selectedFireForce.id}`,formData).subscribe((data:any)=>{ |
|
|
|
|
// this.objectName = data.objectName
|
|
|
|
|
let obj = { |
|
|
|
|
objectName:data.objectName, |
|
|
|
|
fileName:data.fileName, |
|
|
|
@ -836,7 +798,6 @@ export class FireForceComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
this.AttachmentArr.push(obj) |
|
|
|
|
this.isMasklayer = false |
|
|
|
|
console.log('上传成功',data) |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
@ -846,7 +807,6 @@ export class FireForceComponent implements OnInit {
|
|
|
|
|
this.isMasklayerUploading = true |
|
|
|
|
let data = {filename: file.name} |
|
|
|
|
this.http.post(`/api/NewMultipartUpload/PlanPlatform/FireForce/${this.selectedFireForce.id}`,{},{params:data}).subscribe((data:any)=>{ //初始化分段上传
|
|
|
|
|
console.log('初始化分块上传成功',data) |
|
|
|
|
this.objectName = data.objectName |
|
|
|
|
this.uploadId = data.uploadId |
|
|
|
|
this.subsectionUploading() |
|
|
|
@ -986,7 +946,6 @@ export class FireForceComponent implements OnInit {
|
|
|
|
|
//删除图片
|
|
|
|
|
deletedFile:any = [] |
|
|
|
|
deleteFile(item,e){ |
|
|
|
|
console.log(this.AttachmentArr) |
|
|
|
|
e.stopPropagation() |
|
|
|
|
let isTrue = window.confirm('确定要删除该文件吗?') |
|
|
|
|
if(isTrue){ |
|
|
|
@ -1007,7 +966,6 @@ export class FireForceComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
//点击文件
|
|
|
|
|
clickFile(item){ |
|
|
|
|
// console.log(item)
|
|
|
|
|
let suffix = item.fileName.split('.')[item.fileName.split('.').length-1] |
|
|
|
|
if(suffix == 'png' || suffix == 'jpg' || suffix == 'JPG'){ |
|
|
|
|
let dom = document.getElementById(`viewerjs`) |
|
|
|
|