diff --git a/src/app/key-unit/basicinfo/basicinfo.component.ts b/src/app/key-unit/basicinfo/basicinfo.component.ts index fabab38..0bd7844 100644 --- a/src/app/key-unit/basicinfo/basicinfo.component.ts +++ b/src/app/key-unit/basicinfo/basicinfo.component.ts @@ -19,6 +19,7 @@ import * as _ from 'lodash'; import Swiper from 'swiper'; import { LookMaster } from './lookmaster.component' import { ActivatedRoute } from '@angular/router'; +import { TabbarAndScoreService } from 'src/app/http-interceptors/tabbar-and-score.service'; declare var AMap: any; @Component({ @@ -81,7 +82,7 @@ export class BasicinfoComponent implements OnInit { buildingCustomData:any //存储当前建筑的自定义信息 allunittype: any //所有单位类型 allorganizing:any = [] //所有组织机构 - constructor(private route:ActivatedRoute,private elementRef: ElementRef,public renderer2: Renderer2,private http: HttpClient, private tree: TreeService, private sanitizer: DomSanitizer, public dialog: MatDialog,public snackBar: MatSnackBar) { } + constructor(private tabbarService: TabbarAndScoreService,private route:ActivatedRoute,private elementRef: ElementRef,public renderer2: Renderer2,private http: HttpClient, private tree: TreeService, private sanitizer: DomSanitizer, public dialog: MatDialog,public snackBar: MatSnackBar) { } houses: any = [] //存储当前单位的建筑信息 unitId : any //当前单位id @@ -410,7 +411,7 @@ export class BasicinfoComponent implements OnInit { async data => { if(data){ this.houses.push(data) - // console.log('新增了',this.houses) + this.tabbarService.sendMessage('changeScore');//通知服务改变分数 } } ); @@ -823,9 +824,9 @@ export class BasicinfoComponent implements OnInit { config.duration = 3000 this.snackBar.open('删除成功','确定',config); this.houses.splice(this.houses.findIndex(items=>items==item),1) - let obj ={index:key} this.selectedTabChange(obj) + this.tabbarService.sendMessage('changeScore');//通知服务改变分数 }) } } @@ -884,13 +885,16 @@ export class BasicinfoComponent implements OnInit { companyId : this.unitId }}).subscribe(data=>{//首先创建建筑成功了,需要刷出当前建筑类型的模板 // alert('创建主体建筑成功') + this.tabbarService.sendMessage('changeScore');//通知服务改变分数 this.getUnitAllBuildings() }) + this.tabbarService.sendMessage('changeScore');//通知服务改变分数 }else{ const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 this.snackBar.open('保存成功','确定',config); + this.tabbarService.sendMessage('changeScore');//通知服务改变分数 } }), err=>{ @@ -1056,12 +1060,14 @@ export class BasicinfoComponent implements OnInit { config.verticalPosition = 'top'; config.duration = 3000 this.snackBar.open('建筑信息保存成功','确定',config); + this.tabbarService.sendMessage('changeScore');//通知服务改变分数 }, err=>{ const config = new MatSnackBarConfig(); config.verticalPosition = 'top'; config.duration = 3000 - this.snackBar.open('请检查输入数据是否有误','确定',config); + this.snackBar.open('建筑信息保存失败','确定',config); + this.tabbarService.sendMessage('changeScore');//通知服务改变分数 }) //保存建筑自定义信息 @@ -1070,7 +1076,7 @@ export class BasicinfoComponent implements OnInit { companyId :this.unitId, buildingId:item.id }}).subscribe(data=>{ - + this.tabbarService.sendMessage('changeScore');//通知服务改变分数 }) }else{ item.customData.customProperties = [] @@ -1078,7 +1084,7 @@ export class BasicinfoComponent implements OnInit { companyId :this.unitId, buildingId:item.id }}).subscribe(data=>{ - + this.tabbarService.sendMessage('changeScore');//通知服务改变分数 }) }