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"
}
},
"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": {
"version": "2.0.0",
"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",
"crypto-js": "^4.0.0",
"date-fns": "^2.9.0",
"default-passive-events": "^2.0.0",
"e-ngx-cesium": "^6.3.2",
"echarts": "^4.6.0",
"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,
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`)

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

@ -68,10 +68,8 @@ export class LinkageForcesComponent implements OnInit {
PageSize : 999999,
LinkageForceTypes:LinkageForceTypes
}
console.log('4444',LinkageForceTypes)
if(LinkageForceTypes.length != 0){//如果勾选了checkbox
this.http.get('/api/LinkageForces',{params:params}).subscribe((data:any) => {
console.log('所有力量',data)
this.createMarker(data.items)
})
}else{
@ -219,7 +217,6 @@ export class LinkageForcesComponent implements OnInit {
PageNumber : this.PageNumber,
}
this.http.get('/api/LinkageForces',{params:params}).subscribe((data:any) => {
console.log('所有消防力量列表',data)
this.dataLength = data.totalCount
this.allLinkageForceObj = data
})
@ -237,10 +234,7 @@ export class LinkageForcesComponent implements OnInit {
if(this.newPositionMarker){
this.map.remove(this.newPositionMarker);
}
console.log('当前点击的li',item)
if(item.location && item.location.x){//如果已经标注单位坐标
console.log('开始标注')
this.map.setCenter([item.location.x,item.location.y]);
this.newPositionMarker = new AMap.Marker({
position: [item.location.x,item.location.y],
@ -385,7 +379,6 @@ export class LinkageForcesComponent implements OnInit {
data=>{
if(typeof data === 'number' && !isNaN(data)){
this.clearData()
console.log('清空了',this.LinkageForceDetailInfo)
this.LinkageForceDetailInfo.linkageForceType = data
this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null
this.map.setCity('上海市');
@ -405,7 +398,7 @@ export class LinkageForcesComponent implements OnInit {
if(this.deletedFile.length != 0){
this.deletedFile.forEach(item => {
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
if(this.LinkageForceDetailInfo.id){
this.http.put(`/api/LinkageForces/${this.LinkageForceDetailInfo.id}`,body).subscribe((data:any) =>{
console.log('修改成功',data)
this.isMasklayer = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
this.snackBar.open('修改成功','确定',config);
// this.LinkageForceDetailInfo.id = data.id
this.getAllFireForce()
})
}else{
this.http.post('/api/LinkageForces',body).subscribe((data:any) =>{
console.log('创建成功',data)
this.isMasklayer = false
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
@ -450,8 +439,6 @@ export class LinkageForcesComponent implements OnInit {
//关闭
close(){
this.LinkageForceDetailInfo={}
// this.LinkageForceDetailInfo.id = null
console.log(this.LinkageForceDetailInfo)
this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null
}
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 //
@ -514,15 +486,11 @@ export class LinkageForcesComponent 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.LinkageForceDetailInfo.location && this.LinkageForceDetailInfo.location.x){
console.log(2)
center = [this.LinkageForceDetailInfo.location.x, this.LinkageForceDetailInfo.location.y]
}else{
console.log(3)
center = this.map.getCenter(); //获取当前地图中心位置
}
this.newPositionMarker = new AMap.Marker({
@ -585,7 +553,6 @@ export class LinkageForcesComponent 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 //上传文件的总大小
@ -593,7 +560,6 @@ export class LinkageForcesComponent 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
@ -606,7 +572,6 @@ export class LinkageForcesComponent implements OnInit {
}
this.AttachmentArr.push(obj)
this.isMasklayer = false
console.log('上传成功',data)
let config = new MatSnackBarConfig();
config.verticalPosition = 'top';
config.duration = 3000
@ -616,7 +581,6 @@ export class LinkageForcesComponent implements OnInit {
this.isMasklayerUploading = true
let data = {filename: file.name}
this.http.post(`/api/NewMultipartUpload/PlanPlatform/LinkageForce/${this.LinkageForceDetailInfo.id}`,{},{params:data}).subscribe((data:any)=>{ //初始化分段上传
console.log('初始化分块上传成功',data)
this.objectName = data.objectName
this.uploadId = data.uploadId
this.subsectionUploading()
@ -756,7 +720,6 @@ export class LinkageForcesComponent implements OnInit {
//删除图片
deletedFile:any = []
deleteFile(item,e){
console.log(this.AttachmentArr)
e.stopPropagation()
let isTrue = window.confirm('确定要删除该文件吗?')
if(isTrue){
@ -777,10 +740,8 @@ export class LinkageForcesComponent implements OnInit {
//点击文件
clickFile(item){
console.log(item)
let suffix = item.fileName.split('.')[item.fileName.split('.').length-1]
if(suffix == 'png' || suffix == 'jpg' || suffix == 'JPG'){
console.log('这是图片')
let dom = document.getElementById(`viewerjs`)
let pObjs = dom.childNodes;
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.addWaterListData = data
this.dataLength = data.totalCount
console.log('所有水源',data)
})
}
//搜索
searchList(){
console.log(this.searchForm)
this.getAllWaterData()
}
//分页事件
@ -200,7 +198,7 @@ export class WaterCollectionComponent implements OnInit {
//点击水源列表
selectedLiIndex:any
clickWaterLi(item,index){
console.log(item)
// console.log(item)
if(this.selectedLiIndex != index){
this.selectedLiIndex = index
this.clearData()
@ -214,8 +212,6 @@ export class WaterCollectionComponent implements OnInit {
this.map.remove(this.newPositionMarker);
}
if(item.location.x){//如果已经标注单位坐标
console.log('开始标注')
this.map.setCenter([item.location.x,item.location.y]);
this.newPositionMarker = new AMap.Marker({
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 //
@ -501,13 +482,10 @@ export class WaterCollectionComponent implements OnInit {
this.newPositionMarker ? this.map.remove(this.newPositionMarker) : null
let center
if(this.newPositionMarker && this.atLastPositionLngLat.x){//如果已经标注单位坐标
console.log(1)
center = [this.atLastPositionLngLat.x, this.atLastPositionLngLat.y]
}else if(this.newPositionMarker && !this.atLastPositionLngLat.x && this.waterData.location.x){
console.log(2)
center = [this.waterData.location.x, this.waterData.location.y]
}else{
console.log(3)
center = this.map.getCenter(); //获取当前地图中心位置
}
this.newPositionMarker = new AMap.Marker({
@ -579,12 +557,7 @@ export class AddWater {
selecteAddType(item,key){
this.selectedWaterTypeIndex = key
}
ngOnInit(): void {
}
confirm(){
console.log(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 { environment } from './environments/environment';
import 'default-passive-events'
if (environment.production) {
enableProdMode();
}

Loading…
Cancel
Save