From 631121fb2686428c64fe5f615dca453e42408041 Mon Sep 17 00:00:00 2001 From: anxinCPF <1105965053@qq.com> Date: Fri, 25 Jun 2021 17:18:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=81=E8=A3=85=E6=8E=A5=E5=8F=A3=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/data-collection/data-collection.module.ts | 3 ++- .../fire-force/fire-force.component.ts | 4 ++-- .../linkage-forces/linkage-forces.component.ts | 4 ++-- .../water-collection/water-collection.component.ts | 4 ++-- .../gis-labeling/gis-labeling.component.ts | 2 +- src/app/key-unit/basicinfo/basicinfo.component.ts | 4 ++-- src/app/key-unit/router-gis/router-gis.component.ts | 2 +- src/modules/map/declare/KeDaSearch/keDaSearch.html | 2 +- src/modules/map/declare/KeDaSearch/keDaSearch.ts | 12 ++++++------ 9 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/app/data-collection/data-collection.module.ts b/src/app/data-collection/data-collection.module.ts index 50060c8..c51c102 100644 --- a/src/app/data-collection/data-collection.module.ts +++ b/src/app/data-collection/data-collection.module.ts @@ -47,9 +47,10 @@ import { AddWater, WaterCollectionComponent } from './water-collection/water-col import { AddFireForce, FireForceComponent, ViewDetails } from './fire-force/fire-force.component'; import { AddLinkageForce, LinkageForcesComponent, ViewDetails2 } from './linkage-forces/linkage-forces.component'; import { NzTreeModule } from 'ng-zorro-antd/tree'; +import { KedaSearchComponent } from '@src/modules/map/declare/KeDaSearch/keDaSearch'; @NgModule({ - declarations: [WaterCollectionComponent, FireForceComponent, LinkageForcesComponent,AddWater,AddFireForce,ViewDetails,AddLinkageForce,ViewDetails2], + declarations: [WaterCollectionComponent, FireForceComponent, LinkageForcesComponent,AddWater,AddFireForce,ViewDetails,AddLinkageForce,ViewDetails2,KedaSearchComponent], imports: [ CommonModule, A11yModule, diff --git a/src/app/data-collection/fire-force/fire-force.component.ts b/src/app/data-collection/fire-force/fire-force.component.ts index d4ace7c..a9247fc 100644 --- a/src/app/data-collection/fire-force/fire-force.component.ts +++ b/src/app/data-collection/fire-force/fire-force.component.ts @@ -822,8 +822,8 @@ export class FireForceComponent implements OnInit { var autoOptions = { input: "tipinput" }; - let auto = MapFactory.AutocompleteInstance(autoOptions); - this.placeSearch = MapFactory.PlaceSearchInstance(); //构造地点查询类 + let auto = MapFactory.AutocompleteInstance(autoOptions,this); + this.placeSearch = MapFactory.PlaceSearchInstance(this); //构造地点查询类 auto.on("select", (e)=>{ this.newPositionMarker.setPosition([e.poi.location.lng,e.poi.location.lat]) this.positionLngLat = {x: e.poi.location.lng, y: e.poi.location.lat} diff --git a/src/app/data-collection/linkage-forces/linkage-forces.component.ts b/src/app/data-collection/linkage-forces/linkage-forces.component.ts index a241059..f9282f9 100644 --- a/src/app/data-collection/linkage-forces/linkage-forces.component.ts +++ b/src/app/data-collection/linkage-forces/linkage-forces.component.ts @@ -543,8 +543,8 @@ export class LinkageForcesComponent implements OnInit { var autoOptions = { input: "tipinput" }; - let auto = MapFactory.AutocompleteInstance(autoOptions); - this.placeSearch = MapFactory.PlaceSearchInstance(); //构造地点查询类 + let auto = MapFactory.AutocompleteInstance(autoOptions,this); + this.placeSearch = MapFactory.PlaceSearchInstance(this); //构造地点查询类 auto.on("select", (e)=>{ this.newPositionMarker.setPosition([e.poi.location.lng,e.poi.location.lat]) this.positionLngLat = {x: e.poi.location.lng, y: e.poi.location.lat} diff --git a/src/app/data-collection/water-collection/water-collection.component.ts b/src/app/data-collection/water-collection/water-collection.component.ts index fdff149..3fe5cf9 100644 --- a/src/app/data-collection/water-collection/water-collection.component.ts +++ b/src/app/data-collection/water-collection/water-collection.component.ts @@ -547,8 +547,8 @@ export class WaterCollectionComponent implements OnInit { var autoOptions = { input: "tipinput" }; - let auto = MapFactory.AutocompleteInstance(autoOptions); - this.placeSearch = MapFactory.PlaceSearchInstance(); //构造地点查询类 + let auto = MapFactory.AutocompleteInstance(autoOptions,this); + this.placeSearch = MapFactory.PlaceSearchInstance(this); //构造地点查询类 auto.on("select", (e)=>{ this.newPositionMarker.setPosition([e.poi.location.lng,e.poi.location.lat]) this.positionLngLat = {x: e.poi.location.lng, y: e.poi.location.lat} diff --git a/src/app/gis-management/gis-labeling/gis-labeling.component.ts b/src/app/gis-management/gis-labeling/gis-labeling.component.ts index 5b4bb45..6966c5a 100644 --- a/src/app/gis-management/gis-labeling/gis-labeling.component.ts +++ b/src/app/gis-management/gis-labeling/gis-labeling.component.ts @@ -1338,7 +1338,7 @@ export class GisLabelingComponent implements OnInit { var autoOptions = { city: info.city } let keywords e == 0 ? keywords = that.routeStart : keywords = that.routeEnd - var autoComplete = MapFactory.AutocompleteInstance(autoOptions); + var autoComplete = MapFactory.AutocompleteInstance(autoOptions,that); autoComplete.search(keywords, function (status, result) { if (result && result.tips && result.tips.length) { //搜索到数据时 that._ngZone.run(() => { diff --git a/src/app/key-unit/basicinfo/basicinfo.component.ts b/src/app/key-unit/basicinfo/basicinfo.component.ts index ba177a4..31b79fb 100644 --- a/src/app/key-unit/basicinfo/basicinfo.component.ts +++ b/src/app/key-unit/basicinfo/basicinfo.component.ts @@ -175,8 +175,8 @@ export class BasicinfoComponent implements OnInit { var autoOptions = { input: "tipinput" }; - var auto = MapFactory.AutocompleteInstance(autoOptions); - this.placeSearch = MapFactory.PlaceSearchInstance(); //构造地点查询类 + var auto = MapFactory.AutocompleteInstance(autoOptions,this); + this.placeSearch = MapFactory.PlaceSearchInstance(this); //构造地点查询类 auto.on("select", (e) => { this.newPositionMarker.setPosition([e.poi.location.lng, e.poi.location.lat]) this.markerPosition2 = { x: e.poi.location.lng, y: e.poi.location.lat } diff --git a/src/app/key-unit/router-gis/router-gis.component.ts b/src/app/key-unit/router-gis/router-gis.component.ts index eff2346..afd08ec 100644 --- a/src/app/key-unit/router-gis/router-gis.component.ts +++ b/src/app/key-unit/router-gis/router-gis.component.ts @@ -126,7 +126,7 @@ export class RouterGISComponent implements OnInit { var autoOptions = {city: info.city} let keywords e == 0 ? keywords = that.routeStart : keywords = that.routeEnd - var autoComplete = MapFactory.AutocompleteInstance(autoOptions); + var autoComplete = MapFactory.AutocompleteInstance(autoOptions,that); autoComplete.search(keywords, function(status, result) { if (result && result.tips && result.tips.length) { //搜索到数据时 that._ngZone.run(()=>{ diff --git a/src/modules/map/declare/KeDaSearch/keDaSearch.html b/src/modules/map/declare/KeDaSearch/keDaSearch.html index 30bf74b..3af98ee 100644 --- a/src/modules/map/declare/KeDaSearch/keDaSearch.html +++ b/src/modules/map/declare/KeDaSearch/keDaSearch.html @@ -1,3 +1,3 @@ -
+
{{item.name}}
\ No newline at end of file diff --git a/src/modules/map/declare/KeDaSearch/keDaSearch.ts b/src/modules/map/declare/KeDaSearch/keDaSearch.ts index c1ea893..e7676e6 100644 --- a/src/modules/map/declare/KeDaSearch/keDaSearch.ts +++ b/src/modules/map/declare/KeDaSearch/keDaSearch.ts @@ -13,9 +13,9 @@ export class KedaSearchComponent { constructor() { } static instance: KedaSearchComponent public searchList:AutocompleteSelect[] = []; //list - public left:number = 0 - public top:number = 0 - public minWidth:number = 0 + public leftCss:string = '0px'; + public topCss:string = '0px'; + public minWidthCss:string = '0px'; ngOnInit(): void { KedaSearchComponent.instance = this @@ -25,9 +25,9 @@ export class KedaSearchComponent { addDOMEvent (id:string) { let input = document.getElementById(id) let DOM = input.getBoundingClientRect() - this.left = DOM.left - this.top = DOM.top + DOM.height + 2 - this.minWidth = DOM.width + // this.left = DOM.left + // this.top = DOM.top + DOM.height + 2 + // this.minWidth = DOM.width } select(e) {