Browse Source

[完善]单位位置标注增加搜索功能

dev
邵佳豪 4 years ago
parent
commit
64d9fce268
  1. 6
      src/app/key-unit/basicinfo/basicinfo.component.ts
  2. 4
      src/app/key-unit/key-unit-management/key-unit-management.component.html
  3. 2
      src/app/pages/login/login.component.scss

6
src/app/key-unit/basicinfo/basicinfo.component.ts

@ -127,12 +127,12 @@ export class BasicinfoComponent implements OnInit {
search(){ search(){
this.placeSearch.search(this.searchTitle, (status, result) => { this.placeSearch.search(this.searchTitle, (status, result) => {
// 搜索成功时,result即是对应的匹配数据 // 搜索成功时,result即是对应的匹配数据
console.log(146,this.searchTitle)
console.log(147,result)
if(result.info == "OK"){ if(result.info == "OK"){
this.newPositionMarker.setPosition([result.poiList.pois[0].location.lng,result.poiList.pois[0].location.lat]) this.newPositionMarker.setPosition([result.poiList.pois[0].location.lng,result.poiList.pois[0].location.lat])
this.markerPosition2 = {x: result.poiList.pois[0].location.lng, y: result.poiList.pois[0].location.lat} this.markerPosition2 = {x: result.poiList.pois[0].location.lng, y: result.poiList.pois[0].location.lat}
this.map.setCenter([result.poiList.pois[0].location.lng,result.poiList.pois[0].location.lat]); //设置地图中心点 this.map.setCenter([result.poiList.pois[0].location.lng,result.poiList.pois[0].location.lat]); //设置地图中心点
}else{
alert('查询不到输入地址信息')
} }
}) })
@ -1219,7 +1219,7 @@ export class BasicinfoComponent implements OnInit {
if(invalid){ if(invalid){
const config = new MatSnackBarConfig(); const 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{
sessionStorage.setItem('buildingTypeId',value.unittype) sessionStorage.setItem('buildingTypeId',value.unittype)

4
src/app/key-unit/key-unit-management/key-unit-management.component.html

@ -15,7 +15,7 @@
<mat-form-field class="example-full-width"> <mat-form-field class="example-full-width">
<input (click)="stopclose($event)" readonly matInput placeholder="请选择消防救援站" autocomplete="off" [(ngModel)]="js" name="js" (focus)="openorganizationbox()"> <input (click)="stopclose($event)" readonly matInput placeholder="请选择消防救援站" autocomplete="off" [(ngModel)]="js" name="js" (focus)="openorganizationbox()">
</mat-form-field> </mat-form-field>
<mat-checkbox style="margin-left: 6px;" [(ngModel)]="jscheck" name="jscheck">包含下级</mat-checkbox> <mat-checkbox color="primary" style="margin-left: 6px;" [(ngModel)]="jscheck" name="jscheck">包含下级</mat-checkbox>
<div class="organizationbox" *ngIf="isorganizationbox"> <div class="organizationbox" *ngIf="isorganizationbox">
<div (click)="closediv()" class="closediv"><mat-icon>clear</mat-icon></div> <div (click)="closediv()" class="closediv"><mat-icon>clear</mat-icon></div>
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl"> <mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
@ -94,7 +94,7 @@
<th mat-header-cell *matHeaderCellDef> <th mat-header-cell *matHeaderCellDef>
</th> </th>
<td mat-cell *matCellDef="let element"> <td mat-cell *matCellDef="let element">
<mat-checkbox (change)="checkChange($event,element)"></mat-checkbox> <mat-checkbox color="primary" (change)="checkChange($event,element)"></mat-checkbox>
</td> </td>
</ng-container> </ng-container>
<ng-container matColumnDef="Follow"> <ng-container matColumnDef="Follow">

2
src/app/pages/login/login.component.scss

@ -12,7 +12,7 @@
-moz-background-size:100% 100%; -moz-background-size:100% 100%;
.text { .text {
padding-top: 3%; padding-top: 3%;
margin-left: 8%; margin-left: 6%;
width: 53%; width: 53%;
} }
} }

Loading…
Cancel
Save