城市选择列名数据绑定及查找定位数据过滤筛选

This commit is contained in:
714943302@qq.com
2018-11-23 13:45:06 +08:00
parent e176b8c245
commit 8e3253ca0f
2 changed files with 14 additions and 1 deletions
@@ -5,6 +5,10 @@
<div class="line-operator-left input-container mb-3 col-xlg-8 col-mlg-8 col-xl-8 col-lg-10"> <div class="line-operator-left input-container mb-3 col-xlg-8 col-mlg-8 col-xl-8 col-lg-10">
<select class="mr-4 form-control" [(ngModel)]="SEL_COL" name="" id=""> <select class="mr-4 form-control" [(ngModel)]="SEL_COL" name="" id="">
<option value="">选择列名</option> <option value="">选择列名</option>
<option value="cityCode">城市代码</option>
<option value="cityNameChn">城市中文名</option>
<option value="cityNameEng">城市英文名</option>
<option value="countryId">所在国家</option>
</select> </select>
<label class="radio-inline custom-radio nowrap mr-4"> <label class="radio-inline custom-radio nowrap mr-4">
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position"> <input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
@@ -73,7 +77,8 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let city of render_data;let i = index"> <tr *ngFor="let city of render_data;let i = index" (click)="selectRow(city)"
[ngClass]="{'selected':row_state===city}">
<td>{{i+1}}</td> <td>{{i+1}}</td>
<td>{{city.cityCode}}</td> <td>{{city.cityCode}}</td>
<td>{{city.cityNameChn}}</td> <td>{{city.cityNameChn}}</td>
@@ -48,6 +48,14 @@ ngOnInit() {
tableCont.addEventListener('scroll',scrollHandle); tableCont.addEventListener('scroll',scrollHandle);
} }
/**
* 选中某行
* @param i
*/
selectRow(i) {
this.row_state = i;
}
//输入框回车事件 //输入框回车事件
inputEnter() { inputEnter() {
if (this.FLT_POS === 1) { if (this.FLT_POS === 1) {