ace-component
Version:
ace-components for ewms
69 lines (55 loc) • 1.6 kB
text/typescript
import { Component, OnInit, ViewEncapsulation, Input, Output, EventEmitter } from '@angular/core';
import dropdownSelect from './dropdownSelect.min.js';
export class AceSearchComponent implements OnInit {
target: any;
ajaxUrl: any;
ajax: any;
selectData: any;
multiple: any;
width: any;
visCount:any;
pageSize:any;
private response: any;
private value:any;
render = new EventEmitter();
optionClick = new EventEmitter();
constructor() { }
ngOnInit() {
var self = this;
var multipleSetSelect = new dropdownSelect(this.target, {
multiple: this.multiple,
width: this.width,
visCount:this.visCount,
pageSize:this.pageSize,
noDataText: '按enter键搜索',
notFoundText: '无匹配记录',
onOptionClick: function (value) {
self.value = value;
self.optionChange();
},
ajaxUrl: this.ajaxUrl,
ajax: this.ajax,
afterFetch: function (res) {
self.response = res;
self.increase();
setTimeout(function () {
multipleSetSelect.setDropdown(self.selectData);
})
}
});
}
increase() {
this.render.emit(this.response);
}
optionChange(){
this.optionClick.emit(this.value);
}
}