Browse Source

[完善]去除被动监听事件警告,清除打印信息

zhuzhou
邵佳豪 4 years ago
parent
commit
0e14291321
  1. 5
      package-lock.json
  2. 1
      package.json
  3. 44
      src/app/data-collection/fire-force/fire-force.component.ts
  4. 41
      src/app/data-collection/linkage-forces/linkage-forces.component.ts
  5. 29
      src/app/data-collection/water-collection/water-collection.component.ts
  6. 2
      src/main.ts

5
package-lock.json generated

@ -7152,6 +7152,11 @@
"ip-regex": "^2.1.0" "ip-regex": "^2.1.0"
} }
}, },
"default-passive-events": {
"version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/default-passive-events/download/default-passive-events-2.0.0.tgz",
"integrity": "sha1-ebGqZ77LqrOLcYRptUgP75Ltpkk="
},
"default-require-extensions": { "default-require-extensions": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npm.taobao.org/default-require-extensions/download/default-require-extensions-2.0.0.tgz", "resolved": "https://registry.npm.taobao.org/default-require-extensions/download/default-require-extensions-2.0.0.tgz",

1
package.json

@ -29,6 +29,7 @@
"cesium": "^1.64.0", "cesium": "^1.64.0",
"crypto-js": "^4.0.0", "crypto-js": "^4.0.0",
"date-fns": "^2.9.0", "date-fns": "^2.9.0",
"default-passive-events": "^2.0.0",
"e-ngx-cesium": "^6.3.2", "e-ngx-cesium": "^6.3.2",
"echarts": "^4.6.0", "echarts": "^4.6.0",
"firebase": "^7.6.2", "firebase": "^7.6.2",

44
src/app/data-collection/fire-force/fire-force.component.ts

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

41
src/app/data-collection/linkage-forces/linkage-forces.component.ts

@ -68,10 +68,8 @@ export class LinkageForcesComponent implements OnInit {
PageSize : 999999, PageSize : 999999,
LinkageForceTypes:LinkageForceTypes LinkageForceTypes:LinkageForceTypes
} }
console.log('4444',LinkageForceTypes)
if(LinkageForceTypes.length != 0){//如果勾选了checkbox if(LinkageForceTypes.length != 0){//如果勾选了checkbox
this.http.get('/api/LinkageForces',{params:params}).subscribe((data:any) => { this.http.get('/api/LinkageForces',{params:params}).subscribe((data:any) => {
console.log('所有力量',data)
this.createMarker(data.items) this.createMarker(data.items)
}) })
}else{ }else{
@ -219,7 +217,6 @@ export class LinkageForcesComponent implements OnInit {
PageNumber : this.PageNumber, PageNumber : this.PageNumber,
} }
this.http.get('/api/LinkageForces',{params:params}).subscribe((data:any) => { this.http.get('/api/LinkageForces',{params:params}).subscribe((data:any) => {
console.log('所有消防力量列表',data)
this.dataLength = data.totalCount this.dataLength = data.totalCount
this.allLinkageForceObj = data this.allLinkageForceObj = data
}) })
@ -237,10 +234,7 @@ export class LinkageForcesComponent implements OnInit {
if(this.newPositionMarker){ if(this.newPositionMarker){
this.map.remove(this.newPositionMarker); this.map.remove(this.newPositionMarker);
} }
console.log('当前点击的li',item)
if(item.location && item.location.x){//如果已经标注单位坐标 if(item.location && item.location.x){//如果已经标注单位坐标
console.log('开始标注')
this.map.setCenter([item.location.x,item.location.y]); this.map.setCenter([item.location.x,item.location.y]);
this.newPositionMarker = new AMap.Marker({ this.newPositionMarker = new AMap.Marker({
position: [item.location.x,item.location.y], position: [item.location.x,item.location.y],
@ -385,7 +379,6 @@ export class LinkageForcesComponent implements OnInit {
data=>{ data=>{
if(typeof data === 'number' && !isNaN(data)){ if(typeof data === 'number' && !isNaN(data)){
this.clearData() this.clearData()
console.log('清空了',this.LinkageForceDetailInfo)
this.LinkageForceDetailInfo.linkageForceType = data this.LinkageForceDetailInfo.linkageForceType = data
this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null
this.map.setCity('上海市'); this.map.setCity('上海市');
@ -405,7 +398,7 @@ export class LinkageForcesComponent implements OnInit {
if(this.deletedFile.length != 0){ if(this.deletedFile.length != 0){
this.deletedFile.forEach(item => { this.deletedFile.forEach(item => {
this.http.delete(`/api/Objects/PlanPlatform/${item.objectName}`).subscribe(data=>{ this.http.delete(`/api/Objects/PlanPlatform/${item.objectName}`).subscribe(data=>{
console.log('删除原文件成功') // console.log('删除原文件成功')
}) })
}); });
} }
@ -422,19 +415,15 @@ export class LinkageForcesComponent implements OnInit {
let body = this.LinkageForceDetailInfo let body = this.LinkageForceDetailInfo
if(this.LinkageForceDetailInfo.id){ if(this.LinkageForceDetailInfo.id){
this.http.put(`/api/LinkageForces/${this.LinkageForceDetailInfo.id}`,body).subscribe((data:any) =>{ this.http.put(`/api/LinkageForces/${this.LinkageForceDetailInfo.id}`,body).subscribe((data:any) =>{
console.log('修改成功',data)
this.isMasklayer = false this.isMasklayer = false
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);
// this.LinkageForceDetailInfo.id = data.id
this.getAllFireForce() this.getAllFireForce()
}) })
}else{ }else{
this.http.post('/api/LinkageForces',body).subscribe((data:any) =>{ this.http.post('/api/LinkageForces',body).subscribe((data:any) =>{
console.log('创建成功',data)
this.isMasklayer = false this.isMasklayer = false
let config = new MatSnackBarConfig(); let config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
@ -450,8 +439,6 @@ export class LinkageForcesComponent implements OnInit {
//关闭 //关闭
close(){ close(){
this.LinkageForceDetailInfo={} this.LinkageForceDetailInfo={}
// this.LinkageForceDetailInfo.id = null
console.log(this.LinkageForceDetailInfo)
this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null
} }
map:any map:any
@ -487,21 +474,6 @@ export class LinkageForcesComponent 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 // isGisTopBox:boolean = false //
@ -514,15 +486,11 @@ export class LinkageForcesComponent implements OnInit {
this.isGisTopBox = true this.isGisTopBox = true
this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null
let center let center
console.log(789,this.atLastPositionLngLat)
if(this.newPositionMarker && this.atLastPositionLngLat.x){//如果已经标注单位坐标 if(this.newPositionMarker && this.atLastPositionLngLat.x){//如果已经标注单位坐标
console.log(1)
center = [this.atLastPositionLngLat.x, this.atLastPositionLngLat.y] center = [this.atLastPositionLngLat.x, this.atLastPositionLngLat.y]
}else if(this.newPositionMarker && !this.atLastPositionLngLat.x && this.LinkageForceDetailInfo.location && this.LinkageForceDetailInfo.location.x){ }else if(this.newPositionMarker && !this.atLastPositionLngLat.x && this.LinkageForceDetailInfo.location && this.LinkageForceDetailInfo.location.x){
console.log(2)
center = [this.LinkageForceDetailInfo.location.x, this.LinkageForceDetailInfo.location.y] center = [this.LinkageForceDetailInfo.location.x, this.LinkageForceDetailInfo.location.y]
}else{ }else{
console.log(3)
center = this.map.getCenter(); //获取当前地图中心位置 center = this.map.getCenter(); //获取当前地图中心位置
} }
this.newPositionMarker = new AMap.Marker({ this.newPositionMarker = new AMap.Marker({
@ -585,7 +553,6 @@ export class LinkageForcesComponent implements OnInit {
isMasklayerUploading:boolean = false//上传进度条遮罩层是否打开 isMasklayerUploading:boolean = false//上传进度条遮罩层是否打开
isMasklayerDownload:boolean = false//下载进度条遮罩层是否打开 isMasklayerDownload:boolean = false//下载进度条遮罩层是否打开
uploadAttachment(e){ uploadAttachment(e){
console.log('选择的文件',e)
this.file = e.target.files[0] || null //上传的文件 this.file = e.target.files[0] || null //上传的文件
let file = e.target.files[0] || null //获取上传的文件 let file = e.target.files[0] || null //获取上传的文件
let fileSize = file.size || null //上传文件的总大小 let fileSize = file.size || null //上传文件的总大小
@ -593,7 +560,6 @@ export class LinkageForcesComponent implements OnInit {
if (file && fileSize<=shardSize) { //上传文件<=5MB时 if (file && fileSize<=shardSize) { //上传文件<=5MB时
this.isMasklayer = true this.isMasklayer = true
console.log('file',this.file)
let formData = new FormData() let formData = new FormData()
formData.append("file",file) formData.append("file",file)
//this.selectedFireForce.id 选择的组织机构的id //this.selectedFireForce.id 选择的组织机构的id
@ -606,7 +572,6 @@ export class LinkageForcesComponent implements OnInit {
} }
this.AttachmentArr.push(obj) this.AttachmentArr.push(obj)
this.isMasklayer = false this.isMasklayer = false
console.log('上传成功',data)
let config = new MatSnackBarConfig(); let config = new MatSnackBarConfig();
config.verticalPosition = 'top'; config.verticalPosition = 'top';
config.duration = 3000 config.duration = 3000
@ -616,7 +581,6 @@ export class LinkageForcesComponent implements OnInit {
this.isMasklayerUploading = true this.isMasklayerUploading = true
let data = {filename: file.name} let data = {filename: file.name}
this.http.post(`/api/NewMultipartUpload/PlanPlatform/LinkageForce/${this.LinkageForceDetailInfo.id}`,{},{params:data}).subscribe((data:any)=>{ //初始化分段上传 this.http.post(`/api/NewMultipartUpload/PlanPlatform/LinkageForce/${this.LinkageForceDetailInfo.id}`,{},{params:data}).subscribe((data:any)=>{ //初始化分段上传
console.log('初始化分块上传成功',data)
this.objectName = data.objectName this.objectName = data.objectName
this.uploadId = data.uploadId this.uploadId = data.uploadId
this.subsectionUploading() this.subsectionUploading()
@ -756,7 +720,6 @@ export class LinkageForcesComponent implements OnInit {
//删除图片 //删除图片
deletedFile:any = [] deletedFile:any = []
deleteFile(item,e){ deleteFile(item,e){
console.log(this.AttachmentArr)
e.stopPropagation() e.stopPropagation()
let isTrue = window.confirm('确定要删除该文件吗?') let isTrue = window.confirm('确定要删除该文件吗?')
if(isTrue){ if(isTrue){
@ -777,10 +740,8 @@ export class LinkageForcesComponent implements OnInit {
//点击文件 //点击文件
clickFile(item){ clickFile(item){
console.log(item)
let suffix = item.fileName.split('.')[item.fileName.split('.').length-1] let suffix = item.fileName.split('.')[item.fileName.split('.').length-1]
if(suffix == 'png' || suffix == 'jpg' || suffix == 'JPG'){ if(suffix == 'png' || suffix == 'jpg' || suffix == 'JPG'){
console.log('这是图片')
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")

29
src/app/data-collection/water-collection/water-collection.component.ts

@ -167,12 +167,10 @@ export class WaterCollectionComponent implements OnInit {
this.http.get('/api/WaterSources',{params:params}).subscribe((data:any) => { this.http.get('/api/WaterSources',{params:params}).subscribe((data:any) => {
this.addWaterListData = data this.addWaterListData = data
this.dataLength = data.totalCount this.dataLength = data.totalCount
console.log('所有水源',data)
}) })
} }
//搜索 //搜索
searchList(){ searchList(){
console.log(this.searchForm)
this.getAllWaterData() this.getAllWaterData()
} }
//分页事件 //分页事件
@ -200,7 +198,7 @@ export class WaterCollectionComponent implements OnInit {
//点击水源列表 //点击水源列表
selectedLiIndex:any selectedLiIndex:any
clickWaterLi(item,index){ clickWaterLi(item,index){
console.log(item) // console.log(item)
if(this.selectedLiIndex != index){ if(this.selectedLiIndex != index){
this.selectedLiIndex = index this.selectedLiIndex = index
this.clearData() this.clearData()
@ -214,8 +212,6 @@ export class WaterCollectionComponent implements OnInit {
this.map.remove(this.newPositionMarker); this.map.remove(this.newPositionMarker);
} }
if(item.location.x){//如果已经标注单位坐标 if(item.location.x){//如果已经标注单位坐标
console.log('开始标注')
this.map.setCenter([item.location.x,item.location.y]); this.map.setCenter([item.location.x,item.location.y]);
this.newPositionMarker = new AMap.Marker({ this.newPositionMarker = new AMap.Marker({
position: [item.location.x,item.location.y], position: [item.location.x,item.location.y],
@ -473,21 +469,6 @@ export class WaterCollectionComponent 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 // isGisTopBox:boolean = false //
@ -501,13 +482,10 @@ export class WaterCollectionComponent implements OnInit {
this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null
let center let center
if(this.newPositionMarker && this.atLastPositionLngLat.x){//如果已经标注单位坐标 if(this.newPositionMarker && this.atLastPositionLngLat.x){//如果已经标注单位坐标
console.log(1)
center = [this.atLastPositionLngLat.x, this.atLastPositionLngLat.y] center = [this.atLastPositionLngLat.x, this.atLastPositionLngLat.y]
}else if(this.newPositionMarker && !this.atLastPositionLngLat.x && this.waterData.location.x){ }else if(this.newPositionMarker && !this.atLastPositionLngLat.x && this.waterData.location.x){
console.log(2)
center = [this.waterData.location.x, this.waterData.location.y] center = [this.waterData.location.x, this.waterData.location.y]
}else{ }else{
console.log(3)
center = this.map.getCenter(); //获取当前地图中心位置 center = this.map.getCenter(); //获取当前地图中心位置
} }
this.newPositionMarker = new AMap.Marker({ this.newPositionMarker = new AMap.Marker({
@ -579,12 +557,7 @@ export class AddWater {
selecteAddType(item,key){ selecteAddType(item,key){
this.selectedWaterTypeIndex = key this.selectedWaterTypeIndex = key
} }
ngOnInit(): void {
}
confirm(){ confirm(){
console.log(this.selectedWaterTypeIndex)
this.dialogRef.close(this.selectedWaterTypeIndex) this.dialogRef.close(this.selectedWaterTypeIndex)
} }

2
src/main.ts

@ -3,7 +3,7 @@ import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app/app.module'; import { AppModule } from './app/app.module';
import { environment } from './environments/environment'; import { environment } from './environments/environment';
import 'default-passive-events'
if (environment.production) { if (environment.production) {
enableProdMode(); enableProdMode();
} }

Loading…
Cancel
Save