Browse Source

搜索框下拉整理..part

上海一张图
赵旭 4 years ago
parent
commit
bcf0ec6e1d
  1. 3
      src/app/data-collection/data-collection.module.ts
  2. 37
      src/modules/map/declare/KeDaSearch/keDaSearch.ts
  3. 0
      src/modules/map/declare/component/SearchDownListPlugins/SearchDownList.html
  4. 0
      src/modules/map/declare/component/SearchDownListPlugins/SearchDownList.scss
  5. 39
      src/modules/map/declare/component/SearchDownListPlugins/SearchDownList.ts
  6. 3
      src/modules/map/declare/keda-map.ts

3
src/app/data-collection/data-collection.module.ts

@ -47,10 +47,9 @@ import { AddWater, WaterCollectionComponent } from './water-collection/water-col
import { AddFireForce, FireForceComponent, ViewDetails } from './fire-force/fire-force.component'; import { AddFireForce, FireForceComponent, ViewDetails } from './fire-force/fire-force.component';
import { AddLinkageForce, LinkageForcesComponent, ViewDetails2 } from './linkage-forces/linkage-forces.component'; import { AddLinkageForce, LinkageForcesComponent, ViewDetails2 } from './linkage-forces/linkage-forces.component';
import { NzTreeModule } from 'ng-zorro-antd/tree'; import { NzTreeModule } from 'ng-zorro-antd/tree';
import { KedaSearchComponent } from '@src/modules/map/declare/KeDaSearch/keDaSearch';
@NgModule({ @NgModule({
declarations: [WaterCollectionComponent, FireForceComponent, LinkageForcesComponent,AddWater,AddFireForce,ViewDetails,AddLinkageForce,ViewDetails2,KedaSearchComponent], declarations: [WaterCollectionComponent, FireForceComponent, LinkageForcesComponent, AddWater, AddFireForce, ViewDetails, AddLinkageForce, ViewDetails2],
imports: [ imports: [
CommonModule, CommonModule,
A11yModule, A11yModule,

37
src/modules/map/declare/KeDaSearch/keDaSearch.ts

@ -1,37 +0,0 @@
import { Component, OnInit, Inject } from '@angular/core';
import { AutocompleteSelect } from '../map';
@Component({
selector: 'keDa-Search',
templateUrl: './keDaSearch.html',
styleUrls: ['./keDaSearch.scss']
})
export class KedaSearchComponent {
constructor() { }
static instance: KedaSearchComponent
public searchList:AutocompleteSelect[] = []; //list
public leftCss:string = '0px';
public topCss:string = '0px';
public minWidthCss:string = '0px';
ngOnInit(): void {
KedaSearchComponent.instance = this
}
// input 添加监听事件
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
}
select(e) {
console.log(e)
}
}

0
src/modules/map/declare/KeDaSearch/keDaSearch.html → src/modules/map/declare/component/SearchDownListPlugins/SearchDownList.html

0
src/modules/map/declare/KeDaSearch/keDaSearch.scss → src/modules/map/declare/component/SearchDownListPlugins/SearchDownList.scss

39
src/modules/map/declare/component/SearchDownListPlugins/SearchDownList.ts

@ -0,0 +1,39 @@
import { Component, OnInit, Inject } from '@angular/core';
import { AutocompleteSelect } from '../../map';
@Component({
selector: 'SearchDownList',
templateUrl: './SearchDownList.html',
styleUrls: ['./SearchDownList.scss']
})
export class SearchDownList implements OnInit {
private $input;
constructor(inputListenId: string) {
this.$input = document.getElementById(inputListenId);
}
public searchList: AutocompleteSelect[] = []; //list
public leftCss: string = '0px';
public topCss: string = '0px';
public minWidthCss: string = '0px';
ngOnInit(): void {
}
// input 添加监听事件
addDOMEvent() {
let input = document.getElementById(id)
let DOM = input.getBoundingClientRect()
// this.left = DOM.left
// this.top = DOM.top + DOM.height + 2
// this.minWidth = DOM.width
}
select(e) {
console.log(e)
}
watch() {
//TODO:修改leftCss ,topCss
}
}

3
src/modules/map/declare/keda-map.ts

@ -1,6 +1,5 @@
import { AutocompleteSearchCallback, AutocompleteSelectCallback, HtmlRender, IAutocomplete, ICircle, IDriving, IInfoWindow, ILayer, ILngLat, IMap, IMapOptions, IMarker, IMarkerCluster, IMarkOptions, IMouseTool, IPixel, IPlaceSearch, IRenderClusterMarker, ISelf, ITileLayer, PixelRender, PlaceSearchCallback } from './map' import { AutocompleteSearchCallback, AutocompleteSelectCallback, HtmlRender, IAutocomplete, ICircle, IDriving, IInfoWindow, ILayer, ILngLat, IMap, IMapOptions, IMarker, IMarkerCluster, IMarkOptions, IMouseTool, IPixel, IPlaceSearch, IRenderClusterMarker, ISelf, ITileLayer, PixelRender, PlaceSearchCallback } from './map'
import * as ObjectID from 'bson-objectid'; import * as ObjectID from 'bson-objectid';
import { KedaSearchComponent } from './KeDaSearch/keDaSearch';
declare var KMap: any; declare var KMap: any;
class KedaBasic implements ISelf { class KedaBasic implements ISelf {
@ -316,7 +315,7 @@ export class KedaAutocomplete extends KedaBasic implements IAutocomplete { //Aut
super(); super();
this.component = component this.component = component
if (options && options.input != undefined) { //绑定input框搜索事件 if (options && options.input != undefined) { //绑定input框搜索事件
KedaSearchComponent.instance.addDOMEvent(options.input) //KedaSearchComponent.instance.addDOMEvent(options.input)
} }
} }
on(eventName: string, callback: AutocompleteSelectCallback) { on(eventName: string, callback: AutocompleteSelectCallback) {

Loading…
Cancel
Save