行李转盘过滤及精确筛选
This commit is contained in:
@@ -3,18 +3,18 @@
|
|||||||
<div class="search-filter mb-3">
|
<div class="search-filter mb-3">
|
||||||
<div class="first-condition row">
|
<div class="first-condition row">
|
||||||
<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" name="" id="">
|
<select class="mr-4 form-control" [(ngModel)]="SEL_COL" name="" id="">
|
||||||
<option value="">选择列名</option>
|
<option value="">选择列名</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)]="filterItems.FLT_POS" [value]="1" name="filter-position">
|
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
|
||||||
<span>过滤</span>
|
<span>过滤</span>
|
||||||
</label>
|
</label>
|
||||||
<label class="radio-inline custom-radio nowrap mr-4">
|
<label class="radio-inline custom-radio nowrap mr-4">
|
||||||
<input type="radio" [(ngModel)]="filterItems.FLT_POS" [value]="2" name="filter-position">
|
<input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position">
|
||||||
<span>查找定位</span>
|
<span>查找定位</span>
|
||||||
</label>
|
</label>
|
||||||
<input class="form-control" [(ngModel)]="filterItems.SEARCH" type="text">
|
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputFliter()">
|
||||||
</div>
|
</div>
|
||||||
<div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1">
|
<div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1">
|
||||||
<!-- <button type="button" class="btn btn-info mr-3">行李转盘编辑</button>
|
<!-- <button type="button" class="btn btn-info mr-3">行李转盘编辑</button>
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr *ngFor="let airline_row of render_data;let i = index" (click)="selectRow($event,i)"
|
<tr *ngFor="let airline_row of render_data;let i = index" (click)="selectRow(i)"
|
||||||
[ngClass]="{'active':row_state===i}">
|
[ngClass]="{'active':row_state===i}">
|
||||||
<td>{{i+1}}</td>
|
<td>{{i+1}}</td>
|
||||||
<td *ngFor="let airline_col of carousel_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td>
|
<td *ngFor="let airline_col of carousel_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td>
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ public carousel_lists: Array<object>; //列数据
|
|||||||
|
|
||||||
public row_state: number;
|
public row_state: number;
|
||||||
|
|
||||||
|
|
||||||
public TOP_1 = 1000000000000;
|
public TOP_1 = 1000000000000;
|
||||||
public TOP_2 = 2000000000000;
|
public TOP_2 = 2000000000000;
|
||||||
public TOP_3 = 3000000000000;
|
public TOP_3 = 3000000000000;
|
||||||
@@ -40,41 +39,25 @@ public TOP_12 = 12000000000000;
|
|||||||
public TOP_13 = 13000000000000;
|
public TOP_13 = 13000000000000;
|
||||||
public TOP_14 = 14000000000000;
|
public TOP_14 = 14000000000000;
|
||||||
|
|
||||||
|
// 搜索条件
|
||||||
|
SEARCH = ''; //手动输入条件
|
||||||
|
FLT_POS = 1; //过滤还是定位
|
||||||
|
SEL_COL = ''; //选择列名
|
||||||
|
|
||||||
public filterItems = {
|
public filterItems = {
|
||||||
SEARCH: '', //手动输入条件
|
|
||||||
FLT_POS: 1, //过滤还是定位
|
|
||||||
/* ALCD: '', //航空公司
|
|
||||||
FLIN: '', //航线类别
|
|
||||||
FLTY: '', //航班类别
|
|
||||||
MVIN: '', //到达/出发
|
|
||||||
TRML: '', //航站楼
|
|
||||||
FHAG: '', //机坪代理
|
|
||||||
MHAG: '', //维护代理
|
|
||||||
PHAG: '', //旅客代理 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public formatter = {
|
public formatter = {
|
||||||
'MVIN': {
|
|
||||||
'A': '到达',
|
|
||||||
'D': '出发',
|
|
||||||
'DF': '其他'
|
|
||||||
},
|
|
||||||
'FLIN': {
|
|
||||||
'D': '国内',
|
|
||||||
'I': '国际',
|
|
||||||
'M': '混合',
|
|
||||||
'R': '地区',
|
|
||||||
'DF': '其他'
|
|
||||||
},
|
|
||||||
'SODT': dateFormatter,
|
'SODT': dateFormatter,
|
||||||
'ESTT': dateFormatter,
|
'ESTT': dateFormatter,
|
||||||
'ACTT': dateFormatter
|
'ACTT': dateFormatter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
selectRow($event, i) {
|
selectRow(i) {
|
||||||
this.row_state = i;
|
this.row_state = i;
|
||||||
alert(i)
|
this.changeDetectorRef.detectChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
getColor(col_CODE) {
|
getColor(col_CODE) {
|
||||||
@@ -127,16 +110,16 @@ ngOnInit() {
|
|||||||
let key = this.carousel_lists[i]['COL_CODE']
|
let key = this.carousel_lists[i]['COL_CODE']
|
||||||
if (this.formatter.hasOwnProperty(key)) {
|
if (this.formatter.hasOwnProperty(key)) {
|
||||||
if (typeof (this.formatter[key]) === 'function') {
|
if (typeof (this.formatter[key]) === 'function') {
|
||||||
render_flight[key] = this.formatter[key](row_flights['preFlight'][key], 1) + '/' + this.formatter[key](row_flights['reaFlight'][key], 1);
|
render_flight[key] = (row_flights['preFlight'][key] === row_flights['reaFlight'][key]) ? (this.formatter[key](row_flights['preFlight'][key], 1)) : (this.formatter[key](row_flights['preFlight'][key], 1) + '/' + this.formatter[key](row_flights['reaFlight'][key], 1));
|
||||||
render_pre_flight[key] = this.formatter[key](row_flights['preFlight'][key], 1);
|
render_pre_flight[key] = this.formatter[key](row_flights['preFlight'][key], 1);
|
||||||
render_rea_flight[key] = this.formatter[key](row_flights['reaFlight'][key], 1);
|
render_rea_flight[key] = this.formatter[key](row_flights['reaFlight'][key], 1);
|
||||||
} else {
|
} else {
|
||||||
render_flight[key] = this.formatter[key][row_flights['preFlight'][key]] + '/' + this.formatter[key][row_flights['reaFlight'][key]];
|
render_flight[key] = (row_flights['preFlight'][key] === row_flights['reaFlight'][key]) ? (this.formatter[key][row_flights['preFlight'][key]]) : (this.formatter[key][row_flights['preFlight'][key]] + '/' + this.formatter[key][row_flights['reaFlight'][key]]);
|
||||||
render_pre_flight[key] = this.formatter[key][row_flights['preFlight'][key]];
|
render_pre_flight[key] = this.formatter[key][row_flights['preFlight'][key]];
|
||||||
render_rea_flight[key] = this.formatter[key][row_flights['reaFlight'][key]];
|
render_rea_flight[key] = this.formatter[key][row_flights['reaFlight'][key]];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
render_flight[key] = row_flights['preFlight'][key] + '/' + row_flights['reaFlight'][key];
|
render_flight[key] = (row_flights['preFlight'][key] === row_flights['reaFlight'][key]) ? (row_flights['preFlight'][key]) : (row_flights['preFlight'][key] + '/' + row_flights['reaFlight'][key]);
|
||||||
render_pre_flight[key] = row_flights['preFlight'][key];
|
render_pre_flight[key] = row_flights['preFlight'][key];
|
||||||
render_rea_flight[key] = row_flights['reaFlight'][key];
|
render_rea_flight[key] = row_flights['reaFlight'][key];
|
||||||
}
|
}
|
||||||
@@ -247,19 +230,127 @@ public sequence(flight) {
|
|||||||
return this.TOP_14
|
return this.TOP_14
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
inputFliter() {
|
||||||
* 过滤机定位
|
let filterItems = this.filterItems;
|
||||||
* @param filterItems
|
let combined_data = this.combined_data;
|
||||||
* @return
|
let filter_data = [];
|
||||||
*/
|
|
||||||
|
let sel_col = this.SEL_COL;
|
||||||
|
|
||||||
|
if (this.FLT_POS === 1) { //过滤
|
||||||
|
//手动输入框筛选
|
||||||
|
if(sel_col){
|
||||||
|
combined_data.forEach(item=>{
|
||||||
|
if(item['renderFlight'][sel_col]){
|
||||||
|
if (item['renderFlight'][sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||||
|
filter_data.push(Object.assign({}, item))
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if(!this.SEARCH){
|
||||||
|
filter_data.push(Object.assign({}, item))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
combined_data.forEach(item => {
|
||||||
|
for (const key in item['renderFlight']) {
|
||||||
|
if (item['renderFlight'].hasOwnProperty(key)) {
|
||||||
|
if (item['renderFlight'][key]) {
|
||||||
|
if (item['renderFlight'][key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||||
|
filter_data.push(Object.assign({}, item))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//下拉框筛选
|
||||||
|
filter_data = filter_data.filter(item => {
|
||||||
|
if (this.isArriFlight(item)) {
|
||||||
|
let is_satis = true;
|
||||||
|
for (const key in filterItems) {
|
||||||
|
if (filterItems.hasOwnProperty(key) && filterItems[key]) {
|
||||||
|
if (item['preFlight'][key] === filterItems[key]) {
|
||||||
|
is_satis = true;
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
is_satis = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return is_satis;
|
||||||
|
} else if (this.isDeptFlight(item)) {
|
||||||
|
let is_satis = true;
|
||||||
|
for (const key in filterItems) {
|
||||||
|
if (filterItems.hasOwnProperty(key) && filterItems[key]) {
|
||||||
|
if (item['reaFlight'][key] === filterItems[key]) {
|
||||||
|
is_satis = true;
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
is_satis = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return is_satis;
|
||||||
|
} else {
|
||||||
|
let pre_satis = true;
|
||||||
|
let rea_satis = true;
|
||||||
|
for (const key in filterItems) {
|
||||||
|
if (filterItems.hasOwnProperty(key) && filterItems[key]) {
|
||||||
|
if (item['preFlight'][key] === filterItems[key]) {
|
||||||
|
pre_satis = true;
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
pre_satis = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (const key in filterItems) {
|
||||||
|
if (filterItems.hasOwnProperty(key) && filterItems[key]) {
|
||||||
|
if (item['reaFlight'][key] === filterItems[key]) {
|
||||||
|
rea_satis = true;
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
rea_satis = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(pre_satis&&!rea_satis){
|
||||||
|
item['renderFlight'] = item['renderPreFlight'];
|
||||||
|
return pre_satis;
|
||||||
|
}else if(!pre_satis&&rea_satis){
|
||||||
|
item['renderFlight'] = item['renderReaFlight'];
|
||||||
|
return rea_satis;
|
||||||
|
}else if(pre_satis&&rea_satis){
|
||||||
|
return pre_satis&&rea_satis;
|
||||||
|
}else{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
this.render_data = filter_data;
|
||||||
|
|
||||||
|
} else { //定位
|
||||||
|
|
||||||
fliter(filterItems, render_data) {
|
|
||||||
if(filterItems.FLT_POS===1){
|
|
||||||
//过滤
|
|
||||||
}else{
|
|
||||||
//定位
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.changeDetectorRef.detectChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取航班实际时间
|
* 获取航班实际时间
|
||||||
* @param flight
|
* @param flight
|
||||||
|
|||||||
Reference in New Issue
Block a user