基础数据查询二次优化修改
This commit is contained in:
@@ -5,19 +5,7 @@
|
||||
<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="">
|
||||
<option value="">选择列名</option>
|
||||
<option value="aircraftTypeCode">机型代码</option>
|
||||
<option value="aircraftTypeName">机型名称</option>
|
||||
<option value="aircraftLength">飞机长度</option>
|
||||
<option value="aircraftWidth">翼展</option>
|
||||
<option value="aircraftHeight">机身高度</option>
|
||||
<option value="maxPassengers">最大乘客数</option>
|
||||
<option value="maxFreightWeight">最大货物重量</option>
|
||||
<option value="maxTakeoffWeight">最大起飞重量</option>
|
||||
<option value="maxAirbridges">最大廊桥数</option>
|
||||
<option value="aircrafttypegroupId">机型组</option>
|
||||
<option value="aircraftTypeCodeCaa">CAA码</option>
|
||||
<option value="aircraftTypeCodeIata">CAA码</option>
|
||||
<option value="aircraftTypeCodeIcao">ICAO码</option>
|
||||
<option *ngFor="let col of col_lists" [value]="col.col_code">{{col.col_chn}}</option>
|
||||
</select>
|
||||
<label class="radio-inline custom-radio nowrap mr-4">
|
||||
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
|
||||
@@ -29,12 +17,6 @@
|
||||
</label>
|
||||
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputEnter()" id="inputerInfo">
|
||||
</div>
|
||||
<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>
|
||||
<button type="button" class="btn btn-info mr-3">定制查询</button> -->
|
||||
<!-- <button type="button" class="btn btn-info mr-3">刷新</button> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="second-condition mb-3 row">
|
||||
@@ -43,9 +25,6 @@
|
||||
<select class="form-control" [(ngModel)]="filterItems.aircrafttypegroupId" (ngModelChange)="selectChange()" id="jgroup">
|
||||
<option value=""></option>
|
||||
<option *ngFor="let item of aircraftTypes" [value]="item.aircrafttypegroupId">{{item.aircrafttypegroupId}}</option>
|
||||
<!-- <option value="E">E-类飞机机型</option>
|
||||
<option value="T">T-类飞机机型</option>
|
||||
<option value="G">G-类飞机机型</option> -->
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -70,7 +49,6 @@
|
||||
<th>CAA码</th>
|
||||
<th>IATA码</th>
|
||||
<th>ICAO码</th>
|
||||
<!-- <th *ngFor="let airline_col of aircrafttype_lists">{{airline_col.COL_CN}}</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -90,7 +68,6 @@
|
||||
<td>{{aircraftType.aircraftTypeCodeCaa}}</td>
|
||||
<td>{{aircraftType.aircraftTypeCodeIata}}</td>
|
||||
<td>{{aircraftType.aircraftTypeCodeIcao}}</td>
|
||||
<!-- <td *ngFor="let airline_col of aircrafttype_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { HttpClientService } from '../../../services/http-client.service';
|
||||
import { BasicDataService } from '../../basic-data-service'
|
||||
import { HttpParams } from '@angular/common/http';
|
||||
import { BasicDataService } from '../../basic-data-service';
|
||||
|
||||
import * as $ from 'jquery';
|
||||
@Component({
|
||||
selector: 'app-aircraft-type',
|
||||
@@ -11,10 +10,25 @@ import * as $ from 'jquery';
|
||||
export class AircraftTypeComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private httpCilent: HttpClientService,
|
||||
private basicDataService: BasicDataService
|
||||
) { }
|
||||
|
||||
public col_lists = [
|
||||
{ col_code: 'aircraftTypeCode', col_chn: '机型代码' },
|
||||
{ col_code: 'aircraftTypeName', col_chn: '机型名称' },
|
||||
{ col_code: 'aircraftLength', col_chn: '飞机长度' },
|
||||
{ col_code: 'aircraftWidth', col_chn: '翼展' },
|
||||
{ col_code: 'aircraftHeight ', col_chn: '机身高度' },
|
||||
{ col_code: 'maxPassengers ', col_chn: '最大乘客数' },
|
||||
{ col_code: 'maxFreightWeight ', col_chn: '最大货物重量' },
|
||||
{ col_code: 'maxTakeoffWeight ', col_chn: '最大起飞重量' },
|
||||
{ col_code: 'maxAirbridges ', col_chn: '最大廊桥数' },
|
||||
{ col_code: 'aircrafttypegroupId ', col_chn: '机型组' },
|
||||
{ col_code: 'aircraftTypeCodeCaa ', col_chn: 'CAA码' },
|
||||
{ col_code: 'aircraftTypeCodeIata ', col_chn: 'IATA码' },
|
||||
{ col_code: 'aircraftTypeCodeIcao ', col_chn: 'ICAO码' },
|
||||
]
|
||||
|
||||
// 搜索条件
|
||||
SEARCH = ''; //手动输入条件
|
||||
FLT_POS = 1; //过滤还是定位
|
||||
@@ -28,13 +42,14 @@ public filterItems = {
|
||||
aircraftTypes: Array<any>;
|
||||
public row_state: any = { renderFlight: {} };
|
||||
public render_data: Array<object> = []; //显示数据,即需要显示的数据
|
||||
public return_data: Array<object> = []; //下拉框显示数据
|
||||
|
||||
ngOnInit() {
|
||||
this.aircraftTypes = this.basicDataService.aircraft_type;
|
||||
this.render_data = this.basicDataService.aircraft_type;
|
||||
this.basicDataService.aircraft_type_subject.subscribe(
|
||||
data => {
|
||||
this.aircraftTypes = data;
|
||||
this.render_data = this.aircraftTypes;
|
||||
this.render_data = data;
|
||||
}
|
||||
)
|
||||
/**
|
||||
@@ -59,20 +74,19 @@ selectRow(i) {
|
||||
///输入框回车事件
|
||||
inputEnter() {
|
||||
if (this.FLT_POS === 1) {
|
||||
this.inputFilter(this.aircraftTypes)
|
||||
this.selectChange()
|
||||
} else {
|
||||
this.inputFilter(this.aircraftTypes)
|
||||
this.inputPosition(this.aircraftTypes)
|
||||
this.inputPosition(this.render_data)
|
||||
}
|
||||
}
|
||||
|
||||
//下拉框选择筛选
|
||||
selectChange() {
|
||||
this.return_data = this.aircraftTypes.filter(item=>{
|
||||
this.render_data = this.aircraftTypes.filter(item => {
|
||||
let is_satis = true;
|
||||
for (const key in this.filterItems) {
|
||||
if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) {
|
||||
if (item[key] === this.filterItems[key]) {
|
||||
if (item[key] == this.filterItems[key]) {
|
||||
is_satis = true;
|
||||
continue;
|
||||
} else {
|
||||
@@ -83,7 +97,11 @@ selectChange() {
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
this.render_data = this.return_data;
|
||||
if (this.FLT_POS === 1) {
|
||||
this.inputFilter(this.render_data);
|
||||
} else {
|
||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
||||
}
|
||||
}
|
||||
|
||||
//输入框筛选
|
||||
@@ -91,27 +109,23 @@ inputFilter(filterData) {
|
||||
if (this.SEARCH) {
|
||||
if (this.SEL_COL) {
|
||||
let sel_col = this.SEL_COL;
|
||||
filterData = filterData.filter(item => {
|
||||
this.render_data = filterData.filter(item => {
|
||||
if (item[sel_col]) {
|
||||
if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
filterData = filterData.filter(item => {
|
||||
this.render_data = filterData.filter(item => {
|
||||
let is_satis = false;
|
||||
for (const key in item) {
|
||||
if (item.hasOwnProperty(key)) {
|
||||
if (item[key]) {
|
||||
if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (item[cols[i].col_code]) {
|
||||
if (item[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
is_satis = true;
|
||||
break;
|
||||
} else {
|
||||
@@ -119,24 +133,16 @@ inputFilter(filterData) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
is_satis = false;
|
||||
continue;
|
||||
} else {
|
||||
is_satis = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.render_data = filterData;
|
||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
||||
}
|
||||
}
|
||||
|
||||
positionArray: Array<any> = [];
|
||||
@@ -159,10 +165,10 @@ inputPosition(filterData) {
|
||||
});
|
||||
} else {
|
||||
filterData.forEach(element => {
|
||||
for (const key in element) {
|
||||
if (element.hasOwnProperty(key)) {
|
||||
if (element[key]) {
|
||||
if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (element[cols[i].col_code]) {
|
||||
if (element[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
transArray.push(element)
|
||||
break;
|
||||
} else {
|
||||
@@ -176,10 +182,6 @@ inputPosition(filterData) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -201,6 +203,9 @@ inputPosition(filterData) {
|
||||
}
|
||||
let tr = $(".selected");
|
||||
let objTr = tr[0];
|
||||
if (objTr) {
|
||||
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,14 +5,7 @@
|
||||
<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="">
|
||||
<option value="">选择列名</option>
|
||||
<option value="aircraftNumber">飞机号</option>
|
||||
<option value="maxPassengers">最大乘客数</option>
|
||||
<option value="maxFreightWeight">最大货物重量</option>
|
||||
<option value="maxTakeoffWeight">最大起飞重量</option>
|
||||
<option value="maxAirbridges">最大廊桥数</option>
|
||||
<option value="aircraftOwnerCode">机主航空公司</option>
|
||||
<option value="airlineName">航空公司</option>
|
||||
<option value="aircraftTypeName">机型</option>
|
||||
<option *ngFor="let col of col_lists" [value]="col.col_code">{{col.col_chn}}</option>
|
||||
</select>
|
||||
<label class="radio-inline custom-radio nowrap mr-4">
|
||||
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
|
||||
@@ -24,12 +17,6 @@
|
||||
</label>
|
||||
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputEnter()" id="inputerInfo">
|
||||
</div>
|
||||
<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>
|
||||
<button type="button" class="btn btn-info mr-3">定制查询</button> -->
|
||||
<!-- <button type="button" class="btn btn-info mr-3">刷新</button> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="second-condition mb-3 row">
|
||||
@@ -44,7 +31,7 @@
|
||||
<label for="aircraftTypeCode">机型: </label>
|
||||
<select class="form-control" [(ngModel)]="filterItems.aircraftTypeCode" (ngModelChange)="selectChange()" id="jx">
|
||||
<option value=""></option>
|
||||
<option *ngFor="let item of aircraftTypes" [value]="item.aircraftTypeCode">{{item.aircraftTypeName}}</option>
|
||||
<option *ngFor="let item of aircraftTypes" [value]="item.aircraftTypeCode">{{item.aircraftTypeCode}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -64,7 +51,6 @@
|
||||
<th>机主航空公司</th>
|
||||
<th>航空公司</th>
|
||||
<th>机型</th>
|
||||
<!-- <th *ngFor="let airline_col of aircraft_lists">{{airline_col.COL_CN}}</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -77,9 +63,8 @@
|
||||
<td>{{aircraft.maxTakeoffWeight}}</td>
|
||||
<td>{{aircraft.maxAirbridges}}</td>
|
||||
<td>{{aircraft.aircraftOwnerCode}}</td>
|
||||
<td>{{aircraft.airlineName}}</td>
|
||||
<td>{{aircraft.aircraftTypeName}}</td>
|
||||
<!-- <td *ngFor="let airline_col of aircraft_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
|
||||
<td>{{aircraft.airlineCode}}</td>
|
||||
<td>{{aircraft.aircraftTypeCode}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { HttpClientService } from '../../../services/http-client.service';
|
||||
import { BasicDataService } from '../../basic-data-service'
|
||||
import { HttpParams } from '@angular/common/http';
|
||||
import { BasicDataService } from '../../basic-data-service';
|
||||
|
||||
import * as $ from 'jquery';
|
||||
@Component({
|
||||
selector: 'app-aircraft',
|
||||
@@ -11,10 +10,20 @@ import * as $ from 'jquery';
|
||||
export class AircraftComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private httpCilent: HttpClientService,
|
||||
private basicDataService: BasicDataService
|
||||
) { }
|
||||
|
||||
public col_lists = [
|
||||
{ col_code: 'aircraftNumber', col_chn: '飞机号' },
|
||||
{ col_code: 'maxPassengers', col_chn: '最大乘客数' },
|
||||
{ col_code: 'maxFreightWeight', col_chn: '最大货物重量' },
|
||||
{ col_code: 'maxTakeoffWeight', col_chn: '最大起飞重量' },
|
||||
{ col_code: 'maxAirbridges', col_chn: '最大廊桥数' },
|
||||
{ col_code: 'aircraftOwnerCode', col_chn: '机主航空公司' },
|
||||
{ col_code: 'airlineCode', col_chn: '航空公司' },
|
||||
{ col_code: 'aircraftTypeCode', col_chn: '机型' }
|
||||
]
|
||||
|
||||
// 搜索条件
|
||||
SEARCH = ''; //手动输入条件
|
||||
FLT_POS = 1; //过滤还是定位
|
||||
@@ -30,31 +39,23 @@ aircraftTypes : Array<any>; //机型
|
||||
aircrafts: Array<any>;
|
||||
public row_state: any = { renderFlight: {} };
|
||||
public render_data: Array<object> = []; //显示数据,即需要显示的数据
|
||||
public return_data: Array<object> = []; //下拉框显示数据
|
||||
|
||||
ngOnInit() {
|
||||
this.airlines = this.basicDataService.airline;
|
||||
this.aircraftTypes = this.basicDataService.aircraft_type;
|
||||
this.aircrafts = this.basicDataService.aircraft;
|
||||
this.render_data = this.basicDataService.aircraft;
|
||||
this.basicDataService.aircraft_subject.subscribe(
|
||||
data => {
|
||||
this.aircrafts = data;
|
||||
this.render_data = this.aircrafts;
|
||||
if(this.aircraftTypes && this.aircraftTypes.length > 0){//机型列表数据转换
|
||||
this.basicDataTransHandle();
|
||||
}
|
||||
if(this.airlines && this.airlines.length > 0){//航空公司数据处理
|
||||
this.basicDataAirlinesHandle();
|
||||
}
|
||||
this.render_data = data;
|
||||
}
|
||||
)
|
||||
//航空公司
|
||||
this.airlines = this.basicDataService.airline;
|
||||
this.basicDataService.airline_subject.subscribe(
|
||||
data => {
|
||||
this.airlines = data;
|
||||
}
|
||||
)
|
||||
//机型
|
||||
this.aircraftTypes = this.basicDataService.aircraft_type;
|
||||
this.basicDataService.aircraft_type_subject.subscribe(
|
||||
data => {
|
||||
this.aircraftTypes = data;
|
||||
@@ -72,21 +73,6 @@ ngOnInit() {
|
||||
tableCont.addEventListener('scroll', scrollHandle);
|
||||
}
|
||||
|
||||
basicDataTransHandle() {
|
||||
this.render_data.forEach(item => {
|
||||
//机型数据转换处理
|
||||
let aircraftTypesLinkIndex = this.aircraftTypes.findIndex(val => val.aircraftTypeCode === item['aircraftTypeCode']);
|
||||
item['aircraftTypeName'] = this.aircraftTypes[aircraftTypesLinkIndex].aircraftTypeName;
|
||||
})
|
||||
}
|
||||
|
||||
basicDataAirlinesHandle() {
|
||||
this.render_data.forEach(item => {
|
||||
//航空公司数据处理
|
||||
let airlinesLinkIndex = this.airlines.findIndex(val => val.airlineCode === item['airlineCode']);
|
||||
item['airlineName'] = this.airlines[airlinesLinkIndex].airlineName;
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 选中某行
|
||||
* @param i
|
||||
@@ -98,20 +84,19 @@ selectRow(i) {
|
||||
//输入框回车事件
|
||||
inputEnter() {
|
||||
if (this.FLT_POS === 1) {
|
||||
this.inputFilter(this.aircrafts)
|
||||
this.selectChange()
|
||||
} else {
|
||||
this.inputFilter(this.aircrafts)
|
||||
this.inputPosition(this.aircrafts)
|
||||
this.inputPosition(this.render_data)
|
||||
}
|
||||
}
|
||||
|
||||
//下拉框选择筛选
|
||||
selectChange() {
|
||||
this.return_data = this.aircrafts.filter(item=>{
|
||||
this.render_data = this.aircrafts.filter(item => {
|
||||
let is_satis = true;
|
||||
for (const key in this.filterItems) {
|
||||
if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) {
|
||||
if (item[key] === this.filterItems[key]) {
|
||||
if (item[key] == this.filterItems[key]) {
|
||||
is_satis = true;
|
||||
continue;
|
||||
} else {
|
||||
@@ -122,7 +107,11 @@ selectChange() {
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
this.render_data = this.return_data;
|
||||
if (this.FLT_POS === 1) {
|
||||
this.inputFilter(this.render_data);
|
||||
} else {
|
||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
||||
}
|
||||
}
|
||||
|
||||
//输入框筛选
|
||||
@@ -130,27 +119,23 @@ inputFilter(filterData) {
|
||||
if (this.SEARCH) {
|
||||
if (this.SEL_COL) {
|
||||
let sel_col = this.SEL_COL;
|
||||
filterData = filterData.filter(item => {
|
||||
this.render_data = filterData.filter(item => {
|
||||
if (item[sel_col]) {
|
||||
if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
filterData = filterData.filter(item => {
|
||||
this.render_data = filterData.filter(item => {
|
||||
let is_satis = false;
|
||||
for (const key in item) {
|
||||
if (item.hasOwnProperty(key)) {
|
||||
if (item[key]) {
|
||||
if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (item[cols[i].col_code]) {
|
||||
if (item[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
is_satis = true;
|
||||
break;
|
||||
} else {
|
||||
@@ -158,24 +143,16 @@ inputFilter(filterData) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
is_satis = false;
|
||||
continue;
|
||||
} else {
|
||||
is_satis = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.render_data = filterData;
|
||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
||||
}
|
||||
}
|
||||
|
||||
positionArray: Array<any> = [];
|
||||
@@ -198,10 +175,10 @@ inputPosition(filterData) {
|
||||
});
|
||||
} else {
|
||||
filterData.forEach(element => {
|
||||
for (const key in element) {
|
||||
if (element.hasOwnProperty(key)) {
|
||||
if (element[key]) {
|
||||
if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (element[cols[i].col_code]) {
|
||||
if (element[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
transArray.push(element)
|
||||
break;
|
||||
} else {
|
||||
@@ -215,10 +192,6 @@ inputPosition(filterData) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -240,6 +213,9 @@ inputPosition(filterData) {
|
||||
}
|
||||
let tr = $(".selected");
|
||||
let objTr = tr[0];
|
||||
if (objTr) {
|
||||
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,15 +5,7 @@
|
||||
<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="">
|
||||
<option value="">选择列名</option>
|
||||
<option value="airlineCode">航空公司代码</option>
|
||||
<option value="airlineName">航空公司中文名</option>
|
||||
<option value="briefNameChn">中文简称</option>
|
||||
<option value="airlineNameEng">航空公司英文名</option>
|
||||
<option value="briefNameEng">英文简称</option>
|
||||
<option value="airlineCodeIata">IATA码</option>
|
||||
<option value="airlineCodeCaa">CAA码</option>
|
||||
<option value="airlineCodeIcao">ICAO码</option>
|
||||
<option value="parentAirlineId">上级母公司</option>
|
||||
<option *ngFor="let col of col_lists" [value]="col.col_code">{{col.col_chn}}</option>
|
||||
</select>
|
||||
<label class="radio-inline custom-radio nowrap mr-4">
|
||||
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
|
||||
@@ -25,14 +17,6 @@
|
||||
</label>
|
||||
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputEnter()" id="gl">
|
||||
</div>
|
||||
<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>
|
||||
<button type="button" class="btn btn-info mr-3">航空集团登记</button>
|
||||
<button type="button" class="btn btn-info mr-3">航空代理登记</button>
|
||||
<button type="button" class="btn btn-info mr-3">定制查询</button> -->
|
||||
<!-- <button type="button" class="btn btn-info mr-3">刷新</button> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="second-condition mb-3 row">
|
||||
@@ -68,7 +52,6 @@
|
||||
<th>CAA码</th>
|
||||
<th>ICAO码</th>
|
||||
<th>上级母公司</th>
|
||||
<!-- <th *ngFor="let airline_col of airline_lists">{{airline_col.COL_CN}}</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -84,7 +67,6 @@
|
||||
<td>{{airline.airlineCodeCaa}}</td>
|
||||
<td>{{airline.airlineCodeIcao}}</td>
|
||||
<td>{{airline.parentAirlineId}}</td>
|
||||
<!-- <td *ngFor="let airline_col of airline_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { HttpClientService } from '../../../services/http-client.service';
|
||||
import { BasicDataService } from '../../basic-data-service'
|
||||
import { HttpParams } from '@angular/common/http';
|
||||
import { BasicDataService } from '../../basic-data-service';
|
||||
import * as $ from 'jquery';
|
||||
@Component({
|
||||
selector: 'app-airline',
|
||||
@@ -11,10 +9,21 @@ import * as $ from 'jquery';
|
||||
export class AirlineComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private httpCilent: HttpClientService,
|
||||
private basicDataService: BasicDataService
|
||||
) { }
|
||||
|
||||
public col_lists = [
|
||||
{ col_code: 'airlineCode', col_chn: '航空公司代码' },
|
||||
{ col_code: 'airlineName', col_chn: '航空公司中文名' },
|
||||
{ col_code: 'briefNameChn', col_chn: '中文简称' },
|
||||
{ col_code: 'airlineNameEng', col_chn: '航空公司英文名' },
|
||||
{ col_code: 'briefNameEng', col_chn: '英文简称' },
|
||||
{ col_code: 'airlineCodeIata', col_chn: 'IATA码' },
|
||||
{ col_code: 'airlineCodeCaa', col_chn: 'CAA码' },
|
||||
{ col_code: 'airlineCodeIcao', col_chn: 'ICAO码' },
|
||||
{ col_code: 'parentAirlineId', col_chn: '上级母公司' },
|
||||
]
|
||||
|
||||
// 搜索条件
|
||||
SEARCH = ''; //手动输入条件
|
||||
FLT_POS = 1; //过滤还是定位
|
||||
@@ -23,7 +32,7 @@ SEL_COL = ''; //选择列名
|
||||
airlines: Array<any>;
|
||||
public row_state: any = { renderFlight: {} };
|
||||
public render_data: Array<object> = []; //显示数据,即需要显示的数据
|
||||
public return_data: Array<object> = []; //下拉框显示数据
|
||||
|
||||
//下拉框
|
||||
public filterItems = {
|
||||
airlineName: '',
|
||||
@@ -31,10 +40,11 @@ public filterItems = {
|
||||
}
|
||||
ngOnInit() {
|
||||
this.airlines = this.basicDataService.airline;
|
||||
this.render_data = this.basicDataService.airline;
|
||||
this.basicDataService.airline_subject.subscribe(
|
||||
data => {
|
||||
this.airlines = data;
|
||||
this.render_data = this.airlines;
|
||||
this.render_data = data;
|
||||
}
|
||||
)
|
||||
/**
|
||||
@@ -59,7 +69,7 @@ selectRow(i) {
|
||||
//输入框回车事件
|
||||
inputEnter() {
|
||||
if (this.FLT_POS === 1) {
|
||||
this.inputFilter(this.airlines)
|
||||
this.selectChange()
|
||||
} else {
|
||||
this.inputFilter(this.airlines)
|
||||
this.inputPosition(this.airlines)
|
||||
@@ -68,11 +78,11 @@ inputEnter() {
|
||||
|
||||
//下拉框选择筛选
|
||||
selectChange() {
|
||||
this.return_data = this.airlines.filter(item=>{
|
||||
this.render_data = this.airlines.filter(item => {
|
||||
let is_satis = true;
|
||||
for (const key in this.filterItems) {
|
||||
if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) {
|
||||
if (item[key] === this.filterItems[key]) {
|
||||
if (item[key] == this.filterItems[key]) {
|
||||
is_satis = true;
|
||||
continue;
|
||||
} else {
|
||||
@@ -83,7 +93,11 @@ selectChange() {
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
this.render_data = this.return_data;
|
||||
if (this.FLT_POS === 1) {
|
||||
this.inputFilter(this.render_data);
|
||||
} else {
|
||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
||||
}
|
||||
}
|
||||
|
||||
//输入框筛选
|
||||
@@ -91,27 +105,23 @@ inputFilter(filterData) {
|
||||
if (this.SEARCH) {
|
||||
if (this.SEL_COL) {
|
||||
let sel_col = this.SEL_COL;
|
||||
filterData = filterData.filter(item => {
|
||||
this.render_data = filterData.filter(item => {
|
||||
if (item[sel_col]) {
|
||||
if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
filterData = filterData.filter(item => {
|
||||
this.render_data = filterData.filter(item => {
|
||||
let is_satis = false;
|
||||
for (const key in item) {
|
||||
if (item.hasOwnProperty(key)) {
|
||||
if (item[key]) {
|
||||
if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (item[cols[i].col_code]) {
|
||||
if (item[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
is_satis = true;
|
||||
break;
|
||||
} else {
|
||||
@@ -119,24 +129,16 @@ inputFilter(filterData) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
is_satis = false;
|
||||
continue;
|
||||
} else {
|
||||
is_satis = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.render_data = filterData;
|
||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
||||
}
|
||||
}
|
||||
|
||||
positionArray: Array<any> = [];
|
||||
@@ -159,10 +161,10 @@ inputPosition(filterData) {
|
||||
});
|
||||
} else {
|
||||
filterData.forEach(element => {
|
||||
for (const key in element) {
|
||||
if (element.hasOwnProperty(key)) {
|
||||
if (element[key]) {
|
||||
if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (element[cols[i].col_code]) {
|
||||
if (element[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
transArray.push(element)
|
||||
break;
|
||||
} else {
|
||||
@@ -176,10 +178,6 @@ inputPosition(filterData) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -201,6 +199,9 @@ inputPosition(filterData) {
|
||||
}
|
||||
let tr = $(".selected");
|
||||
let objTr = tr[0];
|
||||
if (objTr) {
|
||||
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,16 +5,7 @@
|
||||
<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="">
|
||||
<option value="">选择列名</option>
|
||||
<option value="airportCode">机场代码</option>
|
||||
<option value="airportNameChn">机场中文名</option>
|
||||
<option value="briefNameChn">中文简称</option>
|
||||
<option value="airportNameEng">机场英文名</option>
|
||||
<option value="briefNameEng">英文简称</option>
|
||||
<option value="airportCodeIata">IATA码</option>
|
||||
<option value="airportCodeCaa">CAA码</option>
|
||||
<option value="airportCodeIcao">ICAO码</option>
|
||||
<option value="airportGroupId">机场集团</option>
|
||||
<option value="cityName">所在城市</option>
|
||||
<option *ngFor="let col of col_lists" [value]="col.col_code">{{col.col_chn}}</option>
|
||||
</select>
|
||||
<label class="radio-inline custom-radio nowrap mr-4">
|
||||
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
|
||||
@@ -26,13 +17,6 @@
|
||||
</label>
|
||||
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputEnter()" id="inputInfo">
|
||||
</div>
|
||||
<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>
|
||||
<button type="button" class="btn btn-info mr-3">机场集团管理</button>
|
||||
<button type="button" class="btn btn-info mr-3">定制查询</button> -->
|
||||
<!-- <button type="button" class="btn btn-info mr-3">刷新</button> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="second-condition mb-3 row">
|
||||
@@ -40,8 +24,6 @@
|
||||
<label for="airportGroupId">机场集团: </label>
|
||||
<select class="form-control" [(ngModel)]="filterItems.airportGroupId" (ngModelChange)="selectChange()" id="jt">
|
||||
<option value=""></option>
|
||||
<!-- <option value="GH">国内机场</option>
|
||||
<option value="CH">国际机场</option> -->
|
||||
<option *ngFor="let item of airports" [value]="item.airportGroupId">{{item.airportGroupId}}</option>
|
||||
</select>
|
||||
</div>
|
||||
@@ -49,9 +31,6 @@
|
||||
<label for="cityId">城市: </label>
|
||||
<select class="form-control" [(ngModel)]="filterItems.cityId" (ngModelChange)="selectChange()" id="city">
|
||||
<option value=""></option>
|
||||
<!-- <option value="GZ">广州</option>
|
||||
<option value="SH">上海</option>
|
||||
<option value="BJ">北京</option> -->
|
||||
<option *ngFor="let item of citys" [value]="item.cityId">{{item.cityNameChn}}</option>
|
||||
</select>
|
||||
</div>
|
||||
@@ -74,7 +53,6 @@
|
||||
<th>ICAO码</th>
|
||||
<th>机场集团</th>
|
||||
<th>所在城市</th>
|
||||
<!-- <th *ngFor="let airline_col of airport_lists">{{airline_col.COL_CN}}</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -90,8 +68,7 @@
|
||||
<td>{{airport.airportCodeCaa}}</td>
|
||||
<td>{{airport.airportCodeIcao}}</td>
|
||||
<td>{{airport.airportGroupId}}</td>
|
||||
<td>{{airport.cityName}}</td>
|
||||
<!-- <td *ngFor="let airline_col of airport_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
|
||||
<td>{{airport.cityId}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { HttpClientService } from '../../../services/http-client.service';
|
||||
import { HttpParams } from '@angular/common/http';
|
||||
import { BasicDataService } from '../../basic-data-service';
|
||||
import * as $ from 'jquery';
|
||||
import { BasicDataService } from '../../basic-data-service'
|
||||
|
||||
@Component({
|
||||
selector: 'app-airport',
|
||||
templateUrl: './airport.component.html',
|
||||
@@ -11,10 +10,22 @@ import { BasicDataService } from '../../basic-data-service'
|
||||
export class AirportComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private httpCilent: HttpClientService,
|
||||
private basicDataService: BasicDataService
|
||||
) { }
|
||||
|
||||
public col_lists = [
|
||||
{ col_code: 'airportCode', col_chn: '机场代码' },
|
||||
{ col_code: 'airportNameChn', col_chn: '机场中文名' },
|
||||
{ col_code: 'briefNameChn', col_chn: '中文简称' },
|
||||
{ col_code: 'airportNameEng', col_chn: '机场英文名' },
|
||||
{ col_code: 'briefNameEng', col_chn: '英文简称' },
|
||||
{ col_code: 'airportCodeIata', col_chn: 'IATA码' },
|
||||
{ col_code: 'airportCodeCaa', col_chn: 'CAA码' },
|
||||
{ col_code: 'airportCodeIcao', col_chn: 'ICAO码' },
|
||||
{ col_code: 'airportGroupId', col_chn: '机场集团' },
|
||||
{ col_code: 'cityId', col_chn: '所在城市' },
|
||||
]
|
||||
|
||||
// 搜索条件
|
||||
SEARCH = ''; //手动输入条件
|
||||
FLT_POS = 1; //过滤还是定位
|
||||
@@ -25,25 +36,22 @@ public filterItems = {
|
||||
airportGroupId: '',
|
||||
cityId: '',
|
||||
}
|
||||
|
||||
citys: Array<any>; //城市
|
||||
airports: Array<any>;
|
||||
public row_state: any = { renderFlight: {} };
|
||||
public render_data: Array<object> = []; //显示数据,即需要显示的数据
|
||||
public return_data: Array<object> = []; //下拉框显示数据
|
||||
|
||||
ngOnInit() {
|
||||
this.citys = this.basicDataService.city;
|
||||
this.airports = this.basicDataService.airport;
|
||||
this.render_data = this.basicDataService.airport;
|
||||
this.basicDataService.airport_subject.subscribe(
|
||||
data => {
|
||||
this.airports = data;
|
||||
this.render_data = this.airports;
|
||||
if(this.citys && this.citys.length > 0){//所在城市列表数据转换
|
||||
this.basicDataTransHandle();
|
||||
}
|
||||
this.render_data = data;
|
||||
}
|
||||
)
|
||||
//城市
|
||||
this.citys = this.basicDataService.city;
|
||||
this.basicDataService.city_subject.subscribe(
|
||||
data => {
|
||||
this.citys = data;
|
||||
@@ -60,13 +68,6 @@ ngOnInit() {
|
||||
tableCont.addEventListener('scroll', scrollHandle);
|
||||
}
|
||||
|
||||
//所在城市数据转换处理
|
||||
basicDataTransHandle() {
|
||||
this.render_data.forEach(item => {
|
||||
let citysLinkIndex = this.citys.findIndex(val => val.cityId === item['cityId']);
|
||||
item['cityName'] = this.citys[citysLinkIndex].cityNameChn;
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 选中某行
|
||||
@@ -79,20 +80,19 @@ selectRow(i) {
|
||||
//输入框回车事件
|
||||
inputEnter() {
|
||||
if (this.FLT_POS === 1) {
|
||||
this.inputFilter(this.airports)
|
||||
this.selectChange()
|
||||
} else {
|
||||
this.inputFilter(this.airports)
|
||||
this.inputPosition(this.airports)
|
||||
this.inputPosition(this.render_data)
|
||||
}
|
||||
}
|
||||
|
||||
//下拉框选择筛选
|
||||
selectChange() {
|
||||
this.return_data = this.airports.filter(item=>{
|
||||
this.render_data = this.airports.filter(item => {
|
||||
let is_satis = true;
|
||||
for (const key in this.filterItems) {
|
||||
if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) {
|
||||
if (item[key] === +this.filterItems[key] || item[key] === this.filterItems[key]) {
|
||||
if (item[key] == this.filterItems[key]) {
|
||||
is_satis = true;
|
||||
continue;
|
||||
} else {
|
||||
@@ -103,7 +103,11 @@ selectChange() {
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
this.render_data = this.return_data;
|
||||
if (this.FLT_POS === 1) {
|
||||
this.inputFilter(this.render_data);
|
||||
} else {
|
||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
||||
}
|
||||
}
|
||||
|
||||
//输入框筛选
|
||||
@@ -111,27 +115,23 @@ inputFilter(filterData) {
|
||||
if (this.SEARCH) {
|
||||
if (this.SEL_COL) {
|
||||
let sel_col = this.SEL_COL;
|
||||
filterData = filterData.filter(item => {
|
||||
this.render_data = filterData.filter(item => {
|
||||
if (item[sel_col]) {
|
||||
if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
filterData = filterData.filter(item => {
|
||||
let is_satis = false;
|
||||
for (const key in item) {
|
||||
if (item.hasOwnProperty(key)) {
|
||||
if (item[key]) {
|
||||
if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (item[cols[i].col_code]) {
|
||||
if (item[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
is_satis = true;
|
||||
break;
|
||||
} else {
|
||||
@@ -139,24 +139,16 @@ inputFilter(filterData) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
is_satis = false;
|
||||
continue;
|
||||
} else {
|
||||
is_satis = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.render_data = filterData;
|
||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
||||
}
|
||||
}
|
||||
|
||||
positionArray: Array<any> = [];
|
||||
@@ -179,10 +171,10 @@ inputPosition(filterData) {
|
||||
});
|
||||
} else {
|
||||
filterData.forEach(element => {
|
||||
for (const key in element) {
|
||||
if (element.hasOwnProperty(key)) {
|
||||
if (element[key]) {
|
||||
if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (element[cols[i].col_code]) {
|
||||
if (element[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
transArray.push(element)
|
||||
break;
|
||||
} else {
|
||||
@@ -196,10 +188,6 @@ inputPosition(filterData) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -221,6 +209,8 @@ inputPosition(filterData) {
|
||||
}
|
||||
let tr = $(".selected");
|
||||
let objTr = tr[0];
|
||||
if (objTr) {
|
||||
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { BasicDataPipesModule } from '../../pipes/basic-data-pipes/basic-data-pipes.module';
|
||||
|
||||
import { BasicDataComponent } from './basic-data.component';
|
||||
import { BasicDataRouting } from './basic-data-routing.module';
|
||||
import { CheckinGroupComponent } from './checkin-group/checkin-group.component';
|
||||
@@ -15,12 +19,13 @@ import { AircraftTypeComponent } from './aircraft-type/aircraft-type.component';
|
||||
import { AircraftComponent } from './aircraft/aircraft.component';
|
||||
import { TerminalAreaComponent } from './terminal-area/terminal-area.component';
|
||||
import { AirlineComponent } from './airline/airline.component';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
BasicDataRouting,
|
||||
FormsModule
|
||||
FormsModule,
|
||||
BasicDataPipesModule
|
||||
],
|
||||
declarations: [
|
||||
BasicDataComponent,
|
||||
|
||||
@@ -5,10 +5,7 @@
|
||||
<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="">
|
||||
<option value="">选择列名</option>
|
||||
<option value="carouselCode">行李转盘代码</option>
|
||||
<option value="carouselName">行李转盘名称</option>
|
||||
<option value="terminalAreaName">航站楼区域</option>
|
||||
<option value="carouselStatus">资源状态</option>
|
||||
<option *ngFor="let col of col_lists" [value]="col.col_code">{{col.col_chn}}</option>
|
||||
</select>
|
||||
<label class="radio-inline custom-radio nowrap mr-4">
|
||||
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
|
||||
@@ -20,29 +17,22 @@
|
||||
</label>
|
||||
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter)="inputEnter()" id="inputerInfo">
|
||||
</div>
|
||||
<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> -->
|
||||
<!-- <button type="button" class="btn btn-info mr-3">刷新</button> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="second-condition mb-3 row">
|
||||
<div class="input-container mr-4">
|
||||
<label for="terminalAreaCode">所属航站楼区域: </label>
|
||||
<select class="form-control" [(ngModel)]="filterItems.terminalAreaCode" (ngModelChange)="selectChange()" id="qy">
|
||||
<select class="form-control" [(ngModel)]="filterItems.terminalAreaCode" (ngModelChange)="selectChange()"
|
||||
id="qy">
|
||||
<option value=""></option>
|
||||
<option *ngFor="let item of terminalAreas" [value]="item.terminalAreaCode">{{item.terminalAreaName}}</option>
|
||||
<!-- <option value="GH">国内区域</option>
|
||||
<option value="CH">国际区域</option>
|
||||
<option value="QT">其他区域</option> -->
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-container mr-4">
|
||||
<label for="carouselStatus">资源状态: </label>
|
||||
<select class="form-control" [(ngModel)]="filterItems.carouselStatus" (ngModelChange)="selectChange()" id="zy">
|
||||
<select class="form-control" [(ngModel)]="filterItems.carouselStatus" (ngModelChange)="selectChange()"
|
||||
id="zy">
|
||||
<option value=""></option>
|
||||
<!-- <option *ngFor="let item of carousels" [value]="item.carouselStatus" >{{item.carouselStatus}}</option> -->
|
||||
<option value="0">可用</option>
|
||||
<option value="1">在用</option>
|
||||
<option value="2">锁定</option>
|
||||
@@ -63,18 +53,15 @@
|
||||
<th>行李转盘名称</th>
|
||||
<th>航站楼区域</th>
|
||||
<th>资源状态</th>
|
||||
<!-- <th *ngFor="let airline_col of carousel_lists">{{airline_col.COL_CN}}</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let carousel of render_data;let i = index" (click)="selectRow(carousel)"
|
||||
[ngClass]="{'selected':row_state===carousel}">
|
||||
<tr *ngFor="let carousel of render_data;let i = index" (click)="selectRow(carousel)" [ngClass]="{'selected':row_state===carousel}">
|
||||
<td>{{i+1}}</td>
|
||||
<td>{{carousel.carouselCode}}</td>
|
||||
<td>{{carousel.carouselName}}</td>
|
||||
<td>{{carousel.terminalAreaName}}</td>
|
||||
<td>{{carousel.terminalAreaCode|terminalArea}}</td>
|
||||
<td>{{carousel.carouselStatus}}</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> -->
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { HttpClientService } from '../../../services/http-client.service';
|
||||
import { BasicDataService } from '../../basic-data-service'
|
||||
import { HttpParams } from '@angular/common/http';
|
||||
import * as $ from 'jquery';
|
||||
|
||||
@Component({
|
||||
@@ -12,14 +10,21 @@ import * as $ from 'jquery';
|
||||
export class CarouselComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private httpCilent: HttpClientService,
|
||||
private basicDataService: BasicDataService
|
||||
) { }
|
||||
|
||||
public col_lists = [
|
||||
{ col_code: 'carouselCode', col_chn: '行李转盘代码' },
|
||||
{ col_code: 'carouselName', col_chn: '行李转盘名称' },
|
||||
{ col_code: 'terminalAreaCode', col_chn: '航站楼区域' },
|
||||
{ col_code: 'carouselStatus', col_chn: '资源状态' },
|
||||
]
|
||||
|
||||
// 搜索条件
|
||||
SEARCH = ''; //手动输入条件
|
||||
FLT_POS = 1; //过滤还是定位
|
||||
SEL_COL = ''; //选择列名
|
||||
|
||||
//下拉框
|
||||
public filterItems = {
|
||||
terminalAreaCode: '',
|
||||
@@ -27,49 +32,25 @@ public filterItems = {
|
||||
}
|
||||
terminalAreas: Array<any>; //所属航站楼区域
|
||||
carousels: Array<any>;
|
||||
|
||||
public row_state: any = { renderFlight: {} };
|
||||
public render_data: Array<object> = []; //显示数据,即需要显示的数据
|
||||
public return_data: Array<object> = []; //下拉框显示数据
|
||||
|
||||
ngOnInit() {
|
||||
this.terminalAreas = this.basicDataService.terminal_area;
|
||||
this.carousels = this.basicDataService.carousel;
|
||||
this.render_data = this.basicDataService.carousel;
|
||||
this.basicDataService.carousel_subject.subscribe(
|
||||
data => {
|
||||
this.carousels = data;
|
||||
this.render_data = this.carousels;
|
||||
if(this.terminalAreas && this.terminalAreas.length > 0){//所属航站楼区域数据显示处理
|
||||
this.terminalAreasHandle();
|
||||
this.render_data = data;
|
||||
}
|
||||
this.render_data.forEach(element => {//资源状态列表显示数据转换
|
||||
if (element['carouselStatus'] == '0') {
|
||||
element['carouselStatus'] = '可用'
|
||||
return element['carouselStatus'];
|
||||
}
|
||||
if(element['carouselStatus'] == '1'){
|
||||
element['carouselStatus'] = '在用'
|
||||
return element['carouselStatus'];
|
||||
}
|
||||
if(element['carouselStatus'] == '2'){
|
||||
element['carouselStatus'] = '锁定'
|
||||
return element['carouselStatus'];
|
||||
}
|
||||
if(element['carouselStatus'] == '3'){
|
||||
element['carouselStatus'] = '禁用'
|
||||
return element['carouselStatus'];
|
||||
}
|
||||
if(element['carouselStatus'] == '4'){
|
||||
element['carouselStatus'] = '预分'
|
||||
return element['carouselStatus'];
|
||||
}
|
||||
});
|
||||
}
|
||||
)
|
||||
//所属航站楼区域
|
||||
this.terminalAreas = this.basicDataService.terminal_area;
|
||||
);
|
||||
this.basicDataService.terminal_area_subject.subscribe(
|
||||
data => {
|
||||
this.terminalAreas = data;
|
||||
}
|
||||
)
|
||||
);
|
||||
/**
|
||||
* 固定表头
|
||||
*/
|
||||
@@ -81,14 +62,6 @@ ngOnInit() {
|
||||
tableCont.addEventListener('scroll', scrollHandle);
|
||||
}
|
||||
|
||||
//所属航站楼区域数据转换处理
|
||||
terminalAreasHandle() {
|
||||
this.render_data.forEach(item => {
|
||||
let terminalAreasLinkIndex = this.terminalAreas.findIndex(val => val.terminalAreaCode === item['terminalAreaCode']);
|
||||
item['terminalAreaName'] = this.terminalAreas[terminalAreasLinkIndex].terminalAreaName;
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 选中某行
|
||||
* @param i
|
||||
@@ -100,35 +73,19 @@ selectRow(i) {
|
||||
//输入框回车事件
|
||||
inputEnter() {
|
||||
if (this.FLT_POS === 1) {
|
||||
this.inputFilter(this.carousels)
|
||||
this.selectChange()
|
||||
} else {
|
||||
this.inputFilter(this.carousels)
|
||||
this.inputPosition(this.carousels)
|
||||
this.inputPosition(this.render_data)
|
||||
}
|
||||
}
|
||||
|
||||
//下拉框选择筛选
|
||||
selectChange() {
|
||||
this.return_data = this.carousels.filter(item=>{
|
||||
this.render_data = this.carousels.filter(item => {
|
||||
let is_satis = true;
|
||||
if (item['carouselStatus'] == '可用') {
|
||||
item['carouselStatus'] = '0'
|
||||
}
|
||||
if(item['carouselStatus'] == '在用'){
|
||||
item['carouselStatus'] = '1'
|
||||
}
|
||||
if(item['carouselStatus'] == '锁定'){
|
||||
item['carouselStatus'] = '2'
|
||||
}
|
||||
if(item['carouselStatus'] == '禁用'){
|
||||
item['carouselStatus'] = '3'
|
||||
}
|
||||
if(item['carouselStatus'] == '预分'){
|
||||
item['carouselStatus'] = '4'
|
||||
}
|
||||
for (const key in this.filterItems) {
|
||||
if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) {
|
||||
if (item[key] === +this.filterItems[key] || item[key] === this.filterItems[key]) {
|
||||
if (item[key] == this.filterItems[key]) {
|
||||
is_satis = true;
|
||||
continue;
|
||||
} else {
|
||||
@@ -139,29 +96,12 @@ selectChange() {
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
this.return_data.forEach(element => {//资源状态列表显示数据转换
|
||||
if (element['carouselStatus'] == '0') {
|
||||
element['carouselStatus'] = '可用'
|
||||
return element['carouselStatus'];
|
||||
if (this.FLT_POS === 1) {
|
||||
this.inputFilter(this.render_data);
|
||||
} else {
|
||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
||||
}
|
||||
if(element['carouselStatus'] == '1'){
|
||||
element['carouselStatus'] = '在用'
|
||||
return element['carouselStatus'];
|
||||
}
|
||||
if(element['carouselStatus'] == '2'){
|
||||
element['carouselStatus'] = '锁定'
|
||||
return element['carouselStatus'];
|
||||
}
|
||||
if(element['carouselStatus'] == '3'){
|
||||
element['carouselStatus'] = '禁用'
|
||||
return element['carouselStatus'];
|
||||
}
|
||||
if(element['carouselStatus'] == '4'){
|
||||
element['carouselStatus'] = '预分'
|
||||
return element['carouselStatus'];
|
||||
}
|
||||
});
|
||||
this.render_data = this.return_data;
|
||||
|
||||
}
|
||||
|
||||
//输入框筛选
|
||||
@@ -169,27 +109,23 @@ inputFilter(filterData) {
|
||||
if (this.SEARCH) {
|
||||
if (this.SEL_COL) {
|
||||
let sel_col = this.SEL_COL;
|
||||
filterData = filterData.filter(item => {
|
||||
this.render_data = filterData.filter(item => {
|
||||
if (item[sel_col]) {
|
||||
if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
filterData = filterData.filter(item => {
|
||||
this.render_data = filterData.filter(item => {
|
||||
let is_satis = false;
|
||||
for (const key in item) {
|
||||
if (item.hasOwnProperty(key)) {
|
||||
if (item[key]) {
|
||||
if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (item[cols[i].col_code]) {
|
||||
if (item[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
is_satis = true;
|
||||
break;
|
||||
} else {
|
||||
@@ -197,24 +133,16 @@ inputFilter(filterData) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
is_satis = false;
|
||||
continue;
|
||||
} else {
|
||||
is_satis = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.render_data = filterData;
|
||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
||||
}
|
||||
}
|
||||
|
||||
positionArray: Array<any> = [];
|
||||
@@ -237,10 +165,10 @@ inputPosition(filterData) {
|
||||
});
|
||||
} else {
|
||||
filterData.forEach(element => {
|
||||
for (const key in element) {
|
||||
if (element.hasOwnProperty(key)) {
|
||||
if (element[key]) {
|
||||
if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (element[cols[i].col_code]) {
|
||||
if (element[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
transArray.push(element)
|
||||
break;
|
||||
} else {
|
||||
@@ -254,10 +182,6 @@ inputPosition(filterData) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -279,6 +203,9 @@ inputPosition(filterData) {
|
||||
}
|
||||
let tr = $(".selected");
|
||||
let objTr = tr[0];
|
||||
if (objTr) {
|
||||
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,11 +5,7 @@
|
||||
<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="">
|
||||
<option value="">选择列名</option>
|
||||
<option value="checkindeskCode">值机柜台代码</option>
|
||||
<option value="checkindeskName">值机柜台名称</option>
|
||||
<option value="checkinGroupName">值机岛</option>
|
||||
<option value="chutName">行李传送带</option>
|
||||
<option value="terminalAreaName">航站楼区域</option>
|
||||
<option *ngFor="let col of col_lists" [value]="col.col_code">{{col.col_chn}}</option>
|
||||
</select>
|
||||
<label class="radio-inline custom-radio nowrap mr-4">
|
||||
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
|
||||
@@ -21,11 +17,6 @@
|
||||
</label>
|
||||
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputEnter()" id="inputerInfo">
|
||||
</div>
|
||||
<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> -->
|
||||
<!-- <button type="button" class="btn btn-info mr-3">刷新</button> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="second-condition mb-3 row">
|
||||
@@ -34,9 +25,6 @@
|
||||
<select class="form-control" [(ngModel)]="filterItems.terminalAreaCode" (ngModelChange)="selectChange()" id="qy">
|
||||
<option value=""></option>
|
||||
<option *ngFor="let items of terminalAreas" [value]="items.terminalAreaCode">{{items.terminalAreaName}}</option>
|
||||
<!-- <option value="GH">国内区域</option>
|
||||
<option value="CH">国外区域</option>
|
||||
<option value="QH">其他区域</option> -->
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-container mr-4">
|
||||
@@ -44,9 +32,6 @@
|
||||
<select class="form-control" [(ngModel)]="filterItems.checkinGroupCode" (ngModelChange)="selectChange()" id="zjd">
|
||||
<option value=""></option>
|
||||
<option *ngFor="let items of checkinGroups" [value]="items.checkinGroupCode">{{items.checkinGroupName}}</option>
|
||||
<!-- <option value="A">A岛</option>
|
||||
<option value="B">B岛</option>
|
||||
<option value="C">C岛</option> -->
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-container mr-4">
|
||||
@@ -54,9 +39,6 @@
|
||||
<select class="form-control" [(ngModel)]="filterItems.chutCode" (ngModelChange)="selectChange()" id="xl">
|
||||
<option value=""></option>
|
||||
<option *ngFor="let items of chuts" [value]="items.chutCode">{{items.chutName}}</option>
|
||||
<!-- <option value="X">X行李</option>
|
||||
<option value="Z">Z行李</option>
|
||||
<option value="Y">Y行李</option> -->
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -73,7 +55,6 @@
|
||||
<th>值机岛</th>
|
||||
<th>行李传送带</th>
|
||||
<th>航站楼区域</th>
|
||||
<!-- <th *ngFor="let airline_col of checkindesk_lists">{{airline_col.COL_CN}}</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -82,10 +63,9 @@
|
||||
<td>{{i+1}}</td>
|
||||
<td>{{checkinDesk.checkindeskCode}}</td>
|
||||
<td>{{checkinDesk.checkindeskName}}</td>
|
||||
<td>{{checkinDesk.checkinGroupName}}</td>
|
||||
<td>{{checkinDesk.chutName}}</td>
|
||||
<td>{{checkinDesk.terminalAreaName}}</td>
|
||||
<!-- <td *ngFor="let airline_col of checkindesk_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
|
||||
<td>{{checkinDesk.checkinGroupCode}}</td>
|
||||
<td>{{checkinDesk.chutCode}}</td>
|
||||
<td>{{checkinDesk.terminalAreaCode|terminalArea}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { HttpClientService } from '../../../services/http-client.service';
|
||||
import { BasicDataService } from '../../basic-data-service'
|
||||
import { HttpParams } from '@angular/common/http';
|
||||
import { BasicDataService } from '../../basic-data-service';
|
||||
import * as $ from 'jquery';
|
||||
@Component({
|
||||
selector: 'app-checkin-desk',
|
||||
@@ -11,10 +9,17 @@ import * as $ from 'jquery';
|
||||
export class CheckinDeskComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private httpCilent: HttpClientService,
|
||||
private basicDataService: BasicDataService
|
||||
) { }
|
||||
|
||||
public col_lists = [
|
||||
{ col_code: 'checkindeskCode', col_chn: '值机柜台代码' },
|
||||
{ col_code: 'checkindeskName', col_chn: '值机柜台名称' },
|
||||
{ col_code: 'checkinGroupCode', col_chn: '值机岛' },
|
||||
{ col_code: 'chutCode', col_chn: '行李传送带' },
|
||||
{ col_code: 'terminalAreaCode', col_chn: '航站楼区域' },
|
||||
]
|
||||
|
||||
// 搜索条件
|
||||
SEARCH = ''; //手动输入条件
|
||||
FLT_POS = 1; //过滤还是定位
|
||||
@@ -33,40 +38,30 @@ chuts : Array<any>; //行李传送带
|
||||
checkinDesks: Array<any>;
|
||||
public row_state: any = { renderFlight: {} };
|
||||
public render_data: Array<object> = []; //显示数据,即需要显示的数据
|
||||
public return_data: Array<object> = []; //下拉框显示数据
|
||||
|
||||
ngOnInit() {
|
||||
this.terminalAreas = this.basicDataService.terminal_area;
|
||||
this.checkinGroups = this.basicDataService.checkin_group;
|
||||
this.chuts = this.basicDataService.chut;
|
||||
this.checkinDesks = this.basicDataService.checkin_desk;
|
||||
this.render_data = this.basicDataService.checkin_desk;
|
||||
|
||||
this.basicDataService.checkin_desk_subject.subscribe(
|
||||
data => {
|
||||
this.checkinDesks = data;
|
||||
this.render_data = this.checkinDesks;
|
||||
if(this.terminalAreas && this.terminalAreas.length>0){//所属航站楼区域数据转换处理
|
||||
this.terminalAreasHandle();
|
||||
}
|
||||
if(this.checkinGroups && this.checkinGroups.length>0){//值机岛数据转换处理
|
||||
this.checkinGroupsHandle();
|
||||
}
|
||||
if(this.checkinGroups && this.checkinGroups.length>0){//行李传送带数据转换处理
|
||||
this.chutsHandle();
|
||||
}
|
||||
this.render_data = data;
|
||||
}
|
||||
)
|
||||
//所属航站楼区域
|
||||
this.terminalAreas = this.basicDataService.terminal_area;
|
||||
this.basicDataService.terminal_area_subject.subscribe(
|
||||
data => {
|
||||
this.terminalAreas = data;
|
||||
}
|
||||
)
|
||||
//值机岛
|
||||
this.checkinGroups = this.basicDataService.checkin_group;
|
||||
this.basicDataService.checkin_group_subject.subscribe(
|
||||
data => {
|
||||
this.checkinGroups = data;
|
||||
}
|
||||
)
|
||||
//行李传送带
|
||||
this.chuts = this.basicDataService.chut;
|
||||
this.basicDataService.chut_subject.subscribe(
|
||||
data => {
|
||||
this.chuts = data;
|
||||
@@ -83,36 +78,6 @@ ngOnInit() {
|
||||
tableCont.addEventListener('scroll', scrollHandle);
|
||||
}
|
||||
|
||||
//所属航站楼区域数据转换处理
|
||||
terminalAreasHandle() {
|
||||
this.render_data.forEach(item => {
|
||||
let terminalAreasLinkIndex = this.terminalAreas.findIndex(val => val.terminalAreaCode === item['terminalAreaCode']);
|
||||
item['terminalAreaName'] = this.terminalAreas[terminalAreasLinkIndex].terminalAreaName;
|
||||
})
|
||||
}
|
||||
|
||||
//值机岛数据转换处理
|
||||
checkinGroupsHandle() {
|
||||
this.render_data.forEach(item => {
|
||||
let checkinGroupsLinkIndex = this.checkinGroups.findIndex(val => val.checkinGroupCode === item['checkinGroupCode']);
|
||||
let checkinGroups = this.checkinGroups[checkinGroupsLinkIndex].checkinGroupName
|
||||
if(checkinGroups !=null){
|
||||
item['checkinGroupName'] = checkinGroups;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//行李传送带数据转换处理
|
||||
chutsHandle() {
|
||||
this.render_data.forEach(item => {
|
||||
let chutsLinkIndex = this.chuts.findIndex(val => val.chutCode === item['chutCode']);
|
||||
let chuts = this.chuts[chutsLinkIndex].chutName
|
||||
if(chuts !=null && chuts !=""){
|
||||
item['chutName'] = chuts;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 选中某行
|
||||
* @param i
|
||||
@@ -124,20 +89,19 @@ selectRow(i) {
|
||||
//输入框回车事件
|
||||
inputEnter() {
|
||||
if (this.FLT_POS === 1) {
|
||||
this.inputFilter(this.checkinDesks)
|
||||
this.selectChange()
|
||||
} else {
|
||||
this.inputFilter(this.checkinDesks)
|
||||
this.inputPosition(this.checkinDesks)
|
||||
this.inputPosition(this.render_data)
|
||||
}
|
||||
}
|
||||
|
||||
//下拉框选择筛选
|
||||
selectChange() {
|
||||
this.return_data = this.checkinDesks.filter(item=>{
|
||||
this.render_data = this.checkinDesks.filter(item => {
|
||||
let is_satis = true;
|
||||
for (const key in this.filterItems) {
|
||||
if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) {
|
||||
if (item[key] === this.filterItems[key]) {
|
||||
if (item[key] == this.filterItems[key]) {
|
||||
is_satis = true;
|
||||
continue;
|
||||
} else {
|
||||
@@ -148,7 +112,11 @@ selectChange() {
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
this.render_data = this.return_data;
|
||||
if (this.FLT_POS === 1) {
|
||||
this.inputFilter(this.render_data);
|
||||
} else {
|
||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
||||
}
|
||||
}
|
||||
|
||||
//输入框筛选
|
||||
@@ -156,27 +124,23 @@ inputFilter(filterData) {
|
||||
if (this.SEARCH) {
|
||||
if (this.SEL_COL) {
|
||||
let sel_col = this.SEL_COL;
|
||||
filterData = filterData.filter(item => {
|
||||
this.render_data = filterData.filter(item => {
|
||||
if (item[sel_col]) {
|
||||
if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
filterData = filterData.filter(item => {
|
||||
this.render_data = filterData.filter(item => {
|
||||
let is_satis = false;
|
||||
for (const key in item) {
|
||||
if (item.hasOwnProperty(key)) {
|
||||
if (item[key]) {
|
||||
if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (item[cols[i].col_code]) {
|
||||
if (item[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
is_satis = true;
|
||||
break;
|
||||
} else {
|
||||
@@ -184,24 +148,16 @@ inputFilter(filterData) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
is_satis = false;
|
||||
continue;
|
||||
} else {
|
||||
is_satis = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.render_data = filterData;
|
||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
||||
}
|
||||
}
|
||||
|
||||
positionArray: Array<any> = [];
|
||||
@@ -224,10 +180,10 @@ inputPosition(filterData) {
|
||||
});
|
||||
} else {
|
||||
filterData.forEach(element => {
|
||||
for (const key in element) {
|
||||
if (element.hasOwnProperty(key)) {
|
||||
if (element[key]) {
|
||||
if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (element[cols[i].col_code]) {
|
||||
if (element[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
transArray.push(element)
|
||||
break;
|
||||
} else {
|
||||
@@ -241,10 +197,6 @@ inputPosition(filterData) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -266,6 +218,9 @@ inputPosition(filterData) {
|
||||
}
|
||||
let tr = $(".selected");
|
||||
let objTr = tr[0];
|
||||
if (objTr) {
|
||||
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
<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="">
|
||||
<option value="">选择列名</option>
|
||||
<option value="checkinGroupCode">值机岛代码</option>
|
||||
<option value="checkinGroupName">值机岛名称</option>
|
||||
<option *ngFor="let col of col_lists" [value]="col.col_code">{{col.col_chn}}</option>
|
||||
</select>
|
||||
<label class="radio-inline custom-radio nowrap mr-4">
|
||||
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
|
||||
@@ -18,11 +17,6 @@
|
||||
</label>
|
||||
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputEnter()" id="inputerInfo">
|
||||
</div>
|
||||
<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> -->
|
||||
<!-- <button type="button" class="btn btn-info mr-3">刷新</button> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -34,7 +28,6 @@
|
||||
<th>序号</th>
|
||||
<th>值机岛代码</th>
|
||||
<th>值机岛名称</th>
|
||||
<!-- th *ngFor="let airline_col of col_lists">{{airline_col.COL_CN}}</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -43,7 +36,6 @@
|
||||
<td>{{i+1}}</td>
|
||||
<td>{{checkinGroup.checkinGroupCode}}</td>
|
||||
<td>{{checkinGroup.checkinGroupName}}</td>
|
||||
<!-- <td *ngFor="let airline_col of col_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -9,16 +9,6 @@
|
||||
padding: 10px 20px;
|
||||
.search-filter {
|
||||
padding: 0 15px;
|
||||
.first-condition {
|
||||
.line-operator-right {
|
||||
text-align: right;
|
||||
padding: 0;
|
||||
.btn-info {
|
||||
background-color: rgb(122, 156, 204);
|
||||
border-color: rgb(122, 156, 204);
|
||||
}
|
||||
}
|
||||
}
|
||||
.input-container {
|
||||
padding: 0;
|
||||
> .form-control {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { HttpClientService } from '../../../services/http-client.service';
|
||||
import { HttpParams } from '@angular/common/http';
|
||||
import { BasicDataService } from '../../basic-data-service';
|
||||
|
||||
import * as $ from 'jquery';
|
||||
import { BasicDataService } from '../../basic-data-service'
|
||||
|
||||
@Component({
|
||||
selector: 'app-checkin-group',
|
||||
templateUrl: './checkin-group.component.html',
|
||||
@@ -11,30 +11,31 @@ import { BasicDataService } from '../../basic-data-service'
|
||||
export class CheckinGroupComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private httpCilent: HttpClientService,
|
||||
private basicDataService: BasicDataService
|
||||
) { }
|
||||
|
||||
public col_lists = [
|
||||
{ col_code: 'checkinGroupCode', col_chn: '值机岛代码' },
|
||||
{ col_code: 'checkinGroupName', col_chn: '值机岛名称' }
|
||||
]
|
||||
|
||||
// 搜索条件
|
||||
SEARCH = ''; //手动输入条件
|
||||
FLT_POS = 1; //过滤还是定位
|
||||
SEL_COL = ''; //选择列名
|
||||
|
||||
//下拉框
|
||||
public filterItems = {
|
||||
|
||||
}
|
||||
|
||||
checkinGroups : Array<any>;
|
||||
public row_state: any = { renderFlight: {} };
|
||||
checkinGroups: Array<any> = [];
|
||||
public render_data: Array<object> = []; //显示数据,即需要显示的数据
|
||||
public return_data: Array<object> = []; //下拉框显示数据
|
||||
|
||||
public row_state: any = {};
|
||||
|
||||
ngOnInit() {
|
||||
this.checkinGroups = this.basicDataService.checkin_group;
|
||||
this.render_data = this.basicDataService.checkin_group;
|
||||
this.basicDataService.checkin_group_subject.subscribe(
|
||||
data => {
|
||||
this.checkinGroups = data;
|
||||
this.render_data = this.checkinGroups;
|
||||
this.render_data = data;
|
||||
}
|
||||
)
|
||||
/**
|
||||
@@ -61,57 +62,33 @@ inputEnter() {
|
||||
if (this.FLT_POS === 1) {
|
||||
this.inputFilter(this.checkinGroups)
|
||||
} else {
|
||||
this.inputFilter(this.checkinGroups)
|
||||
this.inputPosition(this.checkinGroups)
|
||||
this.inputPosition(this.render_data)
|
||||
}
|
||||
}
|
||||
|
||||
//下拉框选择筛选
|
||||
selectChange() {
|
||||
this.return_data = this.checkinGroups.filter(item=>{
|
||||
let is_satis = true;
|
||||
for (const key in this.filterItems) {
|
||||
if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) {
|
||||
if (item[key] === this.filterItems[key]) {
|
||||
is_satis = true;
|
||||
continue;
|
||||
} else {
|
||||
is_satis = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
this.render_data = this.return_data;
|
||||
}
|
||||
|
||||
//输入框筛选
|
||||
inputFilter(filterData) {
|
||||
if (this.SEARCH) {
|
||||
if (this.SEL_COL) {
|
||||
let sel_col = this.SEL_COL;
|
||||
filterData = filterData.filter(item => {
|
||||
this.render_data = filterData.filter(item => {
|
||||
if (item[sel_col]) {
|
||||
if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
filterData = filterData.filter(item => {
|
||||
this.render_data = filterData.filter(item => {
|
||||
let is_satis = false;
|
||||
for (const key in item) {
|
||||
if (item.hasOwnProperty(key)) {
|
||||
if (item[key]) {
|
||||
if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (item[cols[i].col_code]) {
|
||||
if (item[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
is_satis = true;
|
||||
break;
|
||||
} else {
|
||||
@@ -119,24 +96,16 @@ inputFilter(filterData) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
is_satis = false;
|
||||
continue;
|
||||
} else {
|
||||
is_satis = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.render_data = filterData;
|
||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
||||
}
|
||||
}
|
||||
|
||||
positionArray: Array<any> = [];
|
||||
@@ -159,10 +128,10 @@ inputPosition(filterData) {
|
||||
});
|
||||
} else {
|
||||
filterData.forEach(element => {
|
||||
for (const key in element) {
|
||||
if (element.hasOwnProperty(key)) {
|
||||
if (element[key]) {
|
||||
if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (element[cols[i].col_code]) {
|
||||
if (element[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
transArray.push(element)
|
||||
break;
|
||||
} else {
|
||||
@@ -176,10 +145,6 @@ inputPosition(filterData) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -201,6 +166,9 @@ inputPosition(filterData) {
|
||||
}
|
||||
let tr = $(".selected");
|
||||
let objTr = tr[0];
|
||||
if (objTr) {
|
||||
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
<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="">
|
||||
<option value="">选择列名</option>
|
||||
<option value="chutCode">行李传送带代码</option>
|
||||
<option value="chutName">行李传送带名称</option>
|
||||
<option *ngFor="let col of col_lists" [value]="col.col_code">{{col.col_chn}}</option>
|
||||
</select>
|
||||
<label class="radio-inline custom-radio nowrap mr-4">
|
||||
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
|
||||
@@ -18,11 +17,6 @@
|
||||
</label>
|
||||
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputEnter()" id="inputerInfo">
|
||||
</div>
|
||||
<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> -->
|
||||
<!-- <button type="button" class="btn btn-info mr-3">刷新</button> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -34,7 +28,6 @@
|
||||
<th>序号</th>
|
||||
<th>行李传送带代码</th>
|
||||
<th>行李传送带名称</th>
|
||||
<!-- <th *ngFor="let airline_col of chut_lists">{{airline_col.COL_CN}}</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -43,7 +36,6 @@
|
||||
<td>{{i+1}}</td>
|
||||
<td>{{chut.chutCode}}</td>
|
||||
<td>{{chut.chutName}}</td>
|
||||
<!-- <td *ngFor="let airline_col of chut_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { HttpClientService } from '../../../services/http-client.service';
|
||||
import { BasicDataService } from '../../basic-data-service'
|
||||
import { HttpParams } from '@angular/common/http';
|
||||
import * as $ from 'jquery';
|
||||
|
||||
@Component({
|
||||
selector: 'app-chut',
|
||||
templateUrl: './chut.component.html',
|
||||
@@ -11,30 +10,30 @@ import * as $ from 'jquery';
|
||||
export class ChutComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private httpCilent: HttpClientService,
|
||||
private basicDataService: BasicDataService
|
||||
) { }
|
||||
|
||||
public col_lists = [
|
||||
{ col_code: 'chutCode', col_chn: '行李传送带代码' },
|
||||
{ col_code: 'chutName', col_chn: '行李传送带名称' }
|
||||
]
|
||||
|
||||
// 搜索条件
|
||||
SEARCH = ''; //手动输入条件
|
||||
FLT_POS = 1; //过滤还是定位
|
||||
SEL_COL = ''; //选择列名
|
||||
|
||||
//下拉框
|
||||
public filterItems = {
|
||||
|
||||
}
|
||||
|
||||
chuts: Array<any>;
|
||||
public row_state: any = { renderFlight: {} };
|
||||
public render_data: Array<object> = []; //显示数据,即需要显示的数据
|
||||
public return_data: Array<object> = []; //下拉框显示数据
|
||||
|
||||
ngOnInit() {
|
||||
this.chuts = this.basicDataService.chut;
|
||||
this.render_data = this.basicDataService.chut;
|
||||
this.basicDataService.chut_subject.subscribe(
|
||||
data => {
|
||||
this.chuts = data;
|
||||
this.render_data = this.chuts;
|
||||
this.render_data = data;
|
||||
}
|
||||
)
|
||||
/**
|
||||
@@ -61,57 +60,32 @@ inputEnter() {
|
||||
if (this.FLT_POS === 1) {
|
||||
this.inputFilter(this.chuts)
|
||||
} else {
|
||||
this.inputFilter(this.chuts)
|
||||
this.inputPosition(this.chuts)
|
||||
this.inputPosition(this.render_data)
|
||||
}
|
||||
}
|
||||
|
||||
//下拉框选择筛选
|
||||
selectChange() {
|
||||
this.return_data = this.chuts.filter(item=>{
|
||||
let is_satis = true;
|
||||
for (const key in this.filterItems) {
|
||||
if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) {
|
||||
if (item[key] === this.filterItems[key]) {
|
||||
is_satis = true;
|
||||
continue;
|
||||
} else {
|
||||
is_satis = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
this.render_data = this.return_data;
|
||||
}
|
||||
|
||||
//输入框筛选
|
||||
inputFilter(filterData) {
|
||||
if (this.SEARCH) {
|
||||
if (this.SEL_COL) {
|
||||
let sel_col = this.SEL_COL;
|
||||
filterData = filterData.filter(item => {
|
||||
this.render_data = filterData.filter(item => {
|
||||
if (item[sel_col]) {
|
||||
if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
filterData = filterData.filter(item => {
|
||||
this.render_data = filterData.filter(item => {
|
||||
let is_satis = false;
|
||||
for (const key in item) {
|
||||
if (item.hasOwnProperty(key)) {
|
||||
if (item[key]) {
|
||||
if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (item[cols[i].col_code]) {
|
||||
if (item[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
is_satis = true;
|
||||
break;
|
||||
} else {
|
||||
@@ -119,24 +93,16 @@ inputFilter(filterData) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
is_satis = false;
|
||||
continue;
|
||||
} else {
|
||||
is_satis = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.render_data = filterData;
|
||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
||||
}
|
||||
}
|
||||
|
||||
positionArray: Array<any> = [];
|
||||
@@ -159,10 +125,10 @@ inputPosition(filterData) {
|
||||
});
|
||||
} else {
|
||||
filterData.forEach(element => {
|
||||
for (const key in element) {
|
||||
if (element.hasOwnProperty(key)) {
|
||||
if (element[key]) {
|
||||
if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (element[cols[i].col_code]) {
|
||||
if (element[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
transArray.push(element)
|
||||
break;
|
||||
} else {
|
||||
@@ -176,10 +142,6 @@ inputPosition(filterData) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -201,6 +163,9 @@ inputPosition(filterData) {
|
||||
}
|
||||
let tr = $(".selected");
|
||||
let objTr = tr[0];
|
||||
if (objTr) {
|
||||
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,10 +5,7 @@
|
||||
<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="">
|
||||
<option value="">选择列名</option>
|
||||
<option value="cityCode">城市代码</option>
|
||||
<option value="cityNameChn">城市中文名</option>
|
||||
<option value="cityNameEng">城市英文名</option>
|
||||
<option value="countryId">所在国家</option>
|
||||
<option *ngFor="let col of col_lists" [value]="col.col_code">{{col.col_chn}}</option>
|
||||
</select>
|
||||
<label class="radio-inline custom-radio nowrap mr-4">
|
||||
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
|
||||
@@ -20,49 +17,22 @@
|
||||
</label>
|
||||
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter)="inputEnter()" id="inputerInfo">
|
||||
</div>
|
||||
<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>
|
||||
<button type="button" class="btn btn-info mr-3">国家登记</button>
|
||||
<button type="button" class="btn btn-info mr-3">洲/地区登记</button>
|
||||
<button type="button" class="btn btn-info mr-3">定制查询</button> -->
|
||||
<!-- <button type="button" class="btn btn-info mr-3">刷新</button> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="second-condition mb-3 row">
|
||||
<!-- <div class="input-container mr-4">
|
||||
<label for="">洲/地区: </label>
|
||||
<select class="form-control">
|
||||
<option value=""></option>
|
||||
</select>
|
||||
</div> -->
|
||||
<div class="input-container mr-4">
|
||||
<label for="countryId">国家: </label>
|
||||
<select class="form-control" [(ngModel)]="filterItems.countryId" (ngModelChange)="selectChange()" id="citry">
|
||||
<select class="form-control" [(ngModel)]="filterItems.countryId" (ngModelChange)="selectChange()"
|
||||
id="citry">
|
||||
<option value=""></option>
|
||||
<option *ngFor="let item of citys" [value]="item.countryId">{{item.countryId}}</option>
|
||||
<!-- <option value="ZG">中国</option>
|
||||
<option value="MG">美国</option>
|
||||
<option value="YG">英国</option> -->
|
||||
</select>
|
||||
</div>
|
||||
<div class="third-condition row">
|
||||
<!-- <label class="radio-inline custom-checkbox nowrap checkInfo mr-4">
|
||||
<input type="checkbox">
|
||||
<span>洲/地区-国家关联</span>
|
||||
</label> -->
|
||||
<label class="radio-inline custom-checkbox nowrap checkInfo mr-4">
|
||||
<input type="checkbox">
|
||||
<span>国家-城市关联</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="airline-table">
|
||||
<div id="table-container" class="table-container">
|
||||
<!-- <div id="divFieldset_title" class="divFieldseTitle">城市</div> -->
|
||||
<table id="table" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -71,18 +41,15 @@
|
||||
<th>城市中文名</th>
|
||||
<th>城市英文名</th>
|
||||
<th>所在国家</th>
|
||||
<!-- <th *ngFor="let airline_col of city_lists">{{airline_col.COL_CN}}</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let city of render_data;let i = index" (click)="selectRow(city)"
|
||||
[ngClass]="{'selected':row_state===city}">
|
||||
<tr *ngFor="let city of render_data;let i = index" (click)="selectRow(city)" [ngClass]="{'selected':row_state===city}">
|
||||
<td>{{i+1}}</td>
|
||||
<td>{{city.cityCode}}</td>
|
||||
<td>{{city.cityNameChn}}</td>
|
||||
<td>{{city.cityNameEng}}</td>
|
||||
<td>{{city.countryId}}</td>
|
||||
<!-- <td *ngFor="let airline_col of city_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { HttpClientService } from '../../../services/http-client.service';
|
||||
import { BasicDataService } from '../../basic-data-service'
|
||||
import { HttpParams } from '@angular/common/http';
|
||||
|
||||
import { BasicDataService } from '../../basic-data-service';
|
||||
import * as $ from 'jquery';
|
||||
@Component({
|
||||
selector: 'app-city',
|
||||
@@ -11,10 +10,16 @@ import * as $ from 'jquery';
|
||||
export class CityComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private httpCilent: HttpClientService,
|
||||
private basicDataService: BasicDataService
|
||||
) { }
|
||||
|
||||
public col_lists = [
|
||||
{ col_code: 'cityCode', col_chn: '城市代码' },
|
||||
{ col_code: 'cityNameChn', col_chn: '城市中文名' },
|
||||
{ col_code: 'cityNameEng', col_chn: '城市英文名' },
|
||||
{ col_code: 'countryId', col_chn: '所在国家' },
|
||||
];
|
||||
|
||||
// 搜索条件
|
||||
SEARCH = ''; //手动输入条件
|
||||
FLT_POS = 1; //过滤还是定位
|
||||
@@ -28,13 +33,14 @@ public filterItems = {
|
||||
citys: Array<any>;
|
||||
public row_state: any = { renderFlight: {} };
|
||||
public render_data: Array<object> = []; //显示数据,即需要显示的数据
|
||||
public return_data: Array<object> = []; //下拉框显示数据
|
||||
|
||||
ngOnInit() {
|
||||
this.citys = this.basicDataService.city;
|
||||
this.render_data = this.basicDataService.city;
|
||||
this.basicDataService.city_subject.subscribe(
|
||||
data => {
|
||||
this.citys = data;
|
||||
this.render_data = this.citys;
|
||||
this.render_data = data;
|
||||
}
|
||||
)
|
||||
/**
|
||||
@@ -59,20 +65,19 @@ selectRow(i) {
|
||||
//输入框回车事件
|
||||
inputEnter() {
|
||||
if (this.FLT_POS === 1) {
|
||||
this.inputFilter(this.citys)
|
||||
this.selectChange()
|
||||
} else {
|
||||
this.inputFilter(this.citys)
|
||||
this.inputPosition(this.citys)
|
||||
this.inputPosition(this.render_data)
|
||||
}
|
||||
}
|
||||
|
||||
//下拉框选择筛选
|
||||
selectChange() {
|
||||
this.return_data = this.citys.filter(item=>{
|
||||
this.render_data = this.citys.filter(item => {
|
||||
let is_satis = true;
|
||||
for (const key in this.filterItems) {
|
||||
if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) {
|
||||
if (item[key] === this.filterItems[key]) {
|
||||
if (item[key] == this.filterItems[key]) {
|
||||
is_satis = true;
|
||||
continue;
|
||||
} else {
|
||||
@@ -83,7 +88,11 @@ selectChange() {
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
this.render_data = this.return_data;
|
||||
if (this.FLT_POS === 1) {
|
||||
this.inputFilter(this.render_data);
|
||||
} else {
|
||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
||||
}
|
||||
}
|
||||
|
||||
//输入框筛选
|
||||
@@ -91,27 +100,23 @@ inputFilter(filterData) {
|
||||
if (this.SEARCH) {
|
||||
if (this.SEL_COL) {
|
||||
let sel_col = this.SEL_COL;
|
||||
filterData = filterData.filter(item => {
|
||||
this.render_data = filterData.filter(item => {
|
||||
if (item[sel_col]) {
|
||||
if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
filterData = filterData.filter(item => {
|
||||
this.render_data = filterData.filter(item => {
|
||||
let is_satis = false;
|
||||
for (const key in item) {
|
||||
if (item.hasOwnProperty(key)) {
|
||||
if (item[key]) {
|
||||
if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (item[cols[i].col_code]) {
|
||||
if (item[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
is_satis = true;
|
||||
break;
|
||||
} else {
|
||||
@@ -119,24 +124,16 @@ inputFilter(filterData) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
is_satis = false;
|
||||
continue;
|
||||
} else {
|
||||
is_satis = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.render_data = filterData;
|
||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
||||
}
|
||||
}
|
||||
|
||||
positionArray: Array<any> = [];
|
||||
@@ -159,10 +156,10 @@ inputPosition(filterData) {
|
||||
});
|
||||
} else {
|
||||
filterData.forEach(element => {
|
||||
for (const key in element) {
|
||||
if (element.hasOwnProperty(key)) {
|
||||
if (element[key]) {
|
||||
if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (element[cols[i].col_code]) {
|
||||
if (element[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
transArray.push(element)
|
||||
break;
|
||||
} else {
|
||||
@@ -176,10 +173,6 @@ inputPosition(filterData) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -201,6 +194,9 @@ inputPosition(filterData) {
|
||||
}
|
||||
let tr = $(".selected");
|
||||
let objTr = tr[0];
|
||||
if (objTr) {
|
||||
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,11 +5,7 @@
|
||||
<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="">
|
||||
<option value="">选择列名</option>
|
||||
<option value="gateCode">登机门代码</option>
|
||||
<option value="gateName">登机门名称</option>
|
||||
<option value="terminalAreaName">航站楼区域</option>
|
||||
<option value="gateStatus">资源状态</option>
|
||||
<!-- <option *ngFor="let items of gates" [value]="items.titleInfo">{{items.titleInfo}}</option> -->
|
||||
<option *ngFor="let col of col_lists" [value]="col.col_code">{{col.col_chn}}</option>
|
||||
</select>
|
||||
<label class="radio-inline custom-radio nowrap mr-4">
|
||||
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
|
||||
@@ -21,24 +17,21 @@
|
||||
</label>
|
||||
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter)="inputEnter()" id="inputerInfo">
|
||||
</div>
|
||||
<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> -->
|
||||
<!-- <button type="button" class="btn btn-info mr-3">刷新</button> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="second-condition mb-3 row">
|
||||
<div class="input-container mr-4">
|
||||
<label for="terminalAreaCode">所属航站楼区域: </label>
|
||||
<select class="form-control" [(ngModel)]="filterItems.terminalAreaCode" (ngModelChange)="selectChange()" id="qy">
|
||||
<select class="form-control" [(ngModel)]="filterItems.terminalAreaCode" (ngModelChange)="selectChange()"
|
||||
id="qy">
|
||||
<option value=""></option>
|
||||
<option *ngFor="let items of terminalAreas" [value]="items.terminalAreaCode">{{items.terminalAreaName}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-container mr-4">
|
||||
<label for="gateStatus">资源状态: </label>
|
||||
<select class="form-control" [(ngModel)]="filterItems.gateStatus" (ngModelChange)="selectChange()" id="zy">
|
||||
<select class="form-control" [(ngModel)]="filterItems.gateStatus" (ngModelChange)="selectChange()"
|
||||
id="zy">
|
||||
<option value=""></option>
|
||||
<option value="0">可用</option>
|
||||
<option value="1">在用</option>
|
||||
@@ -61,18 +54,15 @@
|
||||
<th>登机门名称</th>
|
||||
<th>航站楼区域</th>
|
||||
<th>资源状态</th>
|
||||
<!-- <th *ngFor="let airline_col of gate_lists">{{airline_col.COL_CN}}</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let gate of render_data;let i = index" (click)="selectRow(gate)"
|
||||
[ngClass]="{'selected':row_state===gate}">
|
||||
<tr *ngFor="let gate of render_data;let i = index" (click)="selectRow(gate)" [ngClass]="{'selected':row_state===gate}">
|
||||
<td>{{i+1}}</td>
|
||||
<td>{{gate.gateCode}}</td>
|
||||
<td>{{gate.gateName}}</td>
|
||||
<td>{{gate.terminalAreaName}}</td>
|
||||
<td>{{gate.terminalAreaCode|terminalArea}}</td>
|
||||
<td>{{gate.gateStatus}}</td>
|
||||
<!-- <td *ngFor="let airline_col of gate_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { HttpClientService } from '../../../services/http-client.service';
|
||||
import { BasicDataService } from '../../basic-data-service'
|
||||
import { HttpParams } from '@angular/common/http';
|
||||
import * as $ from 'jquery';
|
||||
@Component({
|
||||
selector: 'app-gate',
|
||||
@@ -11,10 +9,16 @@ import * as $ from 'jquery';
|
||||
export class GateComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private httpCilent: HttpClientService,
|
||||
private basicDataService: BasicDataService
|
||||
) { }
|
||||
|
||||
public col_lists = [
|
||||
{ col_code: 'gateCode', col_chn: '登机门代码' },
|
||||
{ col_code: 'gateName', col_chn: '登机门名称' },
|
||||
{ col_code: 'terminalAreaCode', col_chn: '航站楼区域' },
|
||||
{ col_code: 'gateStatus', col_chn: '资源状态' },
|
||||
]
|
||||
|
||||
// 搜索条件
|
||||
SEARCH = ''; //手动输入条件
|
||||
FLT_POS = 1; //过滤还是定位
|
||||
@@ -27,48 +31,22 @@ public filterItems = {
|
||||
}
|
||||
terminalAreas: Array<any>; //所属航站楼区域
|
||||
gates: Array<any>;
|
||||
|
||||
public row_state: any = { renderFlight: {} };
|
||||
public render_data: Array<object> = []; //显示数据,即需要显示的数据
|
||||
public return_data: Array<object> = []; //下拉框显示数据
|
||||
|
||||
ngOnInit() {
|
||||
this.terminalAreas = this.basicDataService.terminal_area;
|
||||
this.gates = this.basicDataService.gate;
|
||||
this.render_data = this.basicDataService.gate;
|
||||
this.basicDataService.gate_subject.subscribe(
|
||||
data => {
|
||||
this.gates = data;
|
||||
this.render_data = this.gates;
|
||||
if(this.terminalAreas && this.terminalAreas.length > 0){//所属航站楼区域数据显示处理
|
||||
this.terminalAreasHandle();
|
||||
}
|
||||
this.render_data.forEach(element => {//资源状态列表显示数据转换
|
||||
if (element['gateStatus'] == '0') {
|
||||
element['gateStatus'] = '可用'
|
||||
return element['gateStatus'];
|
||||
}
|
||||
if(element['gateStatus'] == '1'){
|
||||
element['gateStatus'] = '在用'
|
||||
return element['gateStatus'];
|
||||
}
|
||||
if(element['gateStatus'] == '2'){
|
||||
element['gateStatus'] = '锁定'
|
||||
return element['gateStatus'];
|
||||
}
|
||||
if(element['gateStatus'] == '3'){
|
||||
element['gateStatus'] = '禁用'
|
||||
return element['gateStatus'];
|
||||
}
|
||||
if(element['gateStatus'] == '4'){
|
||||
element['gateStatus'] = '预分'
|
||||
return element['gateStatus'];
|
||||
}
|
||||
});
|
||||
this.render_data = data;
|
||||
}
|
||||
)
|
||||
//所属航站楼区域
|
||||
this.terminalAreas = this.basicDataService.terminal_area;
|
||||
this.basicDataService.terminal_area_subject.subscribe(
|
||||
data=>{
|
||||
this.terminalAreas = data;
|
||||
}
|
||||
data => this.terminalAreas = data
|
||||
)
|
||||
/**
|
||||
* 固定表头
|
||||
@@ -81,13 +59,6 @@ ngOnInit() {
|
||||
tableCont.addEventListener('scroll', scrollHandle);
|
||||
}
|
||||
|
||||
//所属航站楼区域数据转换处理
|
||||
terminalAreasHandle() {
|
||||
this.render_data.forEach(item => {
|
||||
let terminalAreasLinkIndex = this.terminalAreas.findIndex(val => val.terminalAreaCode === item['terminalAreaCode']);
|
||||
item['terminalAreaName'] = this.terminalAreas[terminalAreasLinkIndex].terminalAreaName;
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 选中某行
|
||||
@@ -100,35 +71,19 @@ selectRow(i) {
|
||||
//输入框回车事件
|
||||
inputEnter() {
|
||||
if (this.FLT_POS === 1) {
|
||||
this.inputFilter(this.gates)
|
||||
this.selectChange()
|
||||
} else {
|
||||
this.inputFilter(this.gates)
|
||||
this.inputPosition(this.gates)
|
||||
this.inputPosition(this.render_data)
|
||||
}
|
||||
}
|
||||
|
||||
//下拉框选择筛选
|
||||
selectChange() {
|
||||
this.return_data = this.gates.filter(item=>{
|
||||
this.render_data = this.gates.filter(item => {
|
||||
let is_satis = true;
|
||||
if (item['gateStatus'] == '可用') {
|
||||
item['gateStatus'] = '0'
|
||||
}
|
||||
if(item['gateStatus'] == '在用'){
|
||||
item['gateStatus'] = '1'
|
||||
}
|
||||
if(item['gateStatus'] == '锁定'){
|
||||
item['gateStatus'] = '2'
|
||||
}
|
||||
if(item['gateStatus'] == '禁用'){
|
||||
item['gateStatus'] = '3'
|
||||
}
|
||||
if(item['gateStatus'] == '预分'){
|
||||
item['gateStatus'] = '4'
|
||||
}
|
||||
for (const key in this.filterItems) {
|
||||
if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) {
|
||||
if (item[key] === +this.filterItems[key] || item[key] === this.filterItems[key]) {
|
||||
if (item[key] == this.filterItems[key]) {
|
||||
is_satis = true;
|
||||
continue;
|
||||
} else {
|
||||
@@ -139,29 +94,11 @@ selectChange() {
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
this.return_data.forEach(element => {//资源状态列表显示数据转换
|
||||
if (element['gateStatus'] == '0') {
|
||||
element['gateStatus'] = '可用'
|
||||
return element['gateStatus'];
|
||||
if (this.FLT_POS === 1) {
|
||||
this.inputFilter(this.render_data);
|
||||
} else {
|
||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
||||
}
|
||||
if(element['gateStatus'] == '1'){
|
||||
element['gateStatus'] = '在用'
|
||||
return element['gateStatus'];
|
||||
}
|
||||
if(element['gateStatus'] == '2'){
|
||||
element['gateStatus'] = '锁定'
|
||||
return element['gateStatus'];
|
||||
}
|
||||
if(element['gateStatus'] == '3'){
|
||||
element['gateStatus'] = '禁用'
|
||||
return element['gateStatus'];
|
||||
}
|
||||
if(element['gateStatus'] = '4'){
|
||||
element['gateStatus'] = '预分'
|
||||
return element['gateStatus'];
|
||||
}
|
||||
});
|
||||
this.render_data = this.return_data;
|
||||
}
|
||||
|
||||
//输入框筛选
|
||||
@@ -169,27 +106,22 @@ inputFilter(filterData) {
|
||||
if (this.SEARCH) {
|
||||
if (this.SEL_COL) {
|
||||
let sel_col = this.SEL_COL;
|
||||
filterData = filterData.filter(item => {
|
||||
this.render_data = filterData.filter(item => {
|
||||
if (item[sel_col]) {
|
||||
if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
filterData = filterData.filter(item => {
|
||||
this.render_data = filterData.filter(item => {
|
||||
let is_satis = false;
|
||||
for (const key in item) {
|
||||
if (item.hasOwnProperty(key)) {
|
||||
if (item[key]) {
|
||||
if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (item[cols[i].col_code]) {
|
||||
if (item[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
is_satis = true;
|
||||
break;
|
||||
} else {
|
||||
@@ -197,24 +129,16 @@ inputFilter(filterData) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
is_satis = false;
|
||||
continue;
|
||||
} else {
|
||||
is_satis = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.render_data = filterData;
|
||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
||||
}
|
||||
}
|
||||
|
||||
positionArray: Array<any> = [];
|
||||
@@ -237,10 +161,10 @@ inputPosition(filterData) {
|
||||
});
|
||||
} else {
|
||||
filterData.forEach(element => {
|
||||
for (const key in element) {
|
||||
if (element.hasOwnProperty(key)) {
|
||||
if (element[key]) {
|
||||
if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (element[cols[i].col_code]) {
|
||||
if (element[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
transArray.push(element)
|
||||
break;
|
||||
} else {
|
||||
@@ -254,10 +178,6 @@ inputPosition(filterData) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -279,6 +199,9 @@ inputPosition(filterData) {
|
||||
}
|
||||
let tr = $(".selected");
|
||||
let objTr = tr[0];
|
||||
if (objTr) {
|
||||
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,11 +5,7 @@
|
||||
<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="">
|
||||
<option value="">选择列名</option>
|
||||
<option value="standCode">机位代码</option>
|
||||
<option value="standName">机位名称</option>
|
||||
<option value="standType">机位类型</option>
|
||||
<option value="standStatus">资源状态</option>
|
||||
<option value="terminalAreaName">航站楼区域</option>
|
||||
<option *ngFor="let col of col_lists" [value]="col.col_code">{{col.col_chn}}</option>
|
||||
</select>
|
||||
<label class="radio-inline custom-radio nowrap mr-4">
|
||||
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
|
||||
@@ -21,11 +17,6 @@
|
||||
</label>
|
||||
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputEnter()" id="inputerInfo">
|
||||
</div>
|
||||
<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> -->
|
||||
<!-- <button type="button" class="btn btn-info mr-3">刷新</button> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="second-condition mb-3 row">
|
||||
@@ -34,9 +25,6 @@
|
||||
<select class="form-control" [(ngModel)]="filterItems.terminalAreaCode" (ngModelChange)="selectChange()" id="qy">
|
||||
<option value=""></option>
|
||||
<option *ngFor="let items of terminalAreas" [value]="items.terminalAreaCode">{{items.terminalAreaName}}</option>
|
||||
<!-- <option value="GH">国内区域</option>
|
||||
<option value="CH">国际区域</option>
|
||||
<option value="QH">其他区域</option> -->
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-container mr-4">
|
||||
@@ -77,7 +65,6 @@
|
||||
<th>机位类型</th>
|
||||
<th>资源状态</th>
|
||||
<th>航站楼区域</th>
|
||||
<!-- <th *ngFor="let airline_col of stand_lists">{{airline_col.COL_CN}}</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -88,8 +75,7 @@
|
||||
<td>{{stand.standName}}</td>
|
||||
<td>{{stand.standType}}</td>
|
||||
<td>{{stand.standStatus}}</td>
|
||||
<td>{{stand.terminalAreaName}}</td>
|
||||
<!-- <td *ngFor="let airline_col of stand_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
|
||||
<td>{{stand.terminalAreaCode|terminalArea}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { HttpClientService } from '../../../services/http-client.service';
|
||||
import { BasicDataService } from '../../basic-data-service'
|
||||
import { HttpParams } from '@angular/common/http';
|
||||
import { BasicDataService } from '../../basic-data-service';
|
||||
|
||||
import * as $ from 'jquery';
|
||||
@Component({
|
||||
selector: 'app-stand',
|
||||
@@ -11,10 +10,17 @@ import * as $ from 'jquery';
|
||||
export class StandComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private httpCilent: HttpClientService,
|
||||
private basicDataService: BasicDataService
|
||||
) { }
|
||||
|
||||
public col_lists = [
|
||||
{ col_code: 'standCode', col_chn: '机位代码' },
|
||||
{ col_code: 'standName', col_chn: '机位名称' },
|
||||
{ col_code: 'standType', col_chn: '机位类型' },
|
||||
{ col_code: 'standStatus', col_chn: '资源状态' },
|
||||
{ col_code: 'terminalAreaCode', col_chn: '航站楼区域' },
|
||||
]
|
||||
|
||||
// 搜索条件
|
||||
SEARCH = ''; //手动输入条件
|
||||
FLT_POS = 1; //过滤还是定位
|
||||
@@ -31,64 +37,17 @@ terminalAreas : Array<any>; //所属航站楼区域
|
||||
stands: Array<any>;
|
||||
public row_state: any = { renderFlight: {} };
|
||||
public render_data: Array<object> = []; //显示数据,即需要显示的数据
|
||||
public return_data: Array<object> = []; //下拉框显示数据
|
||||
|
||||
ngOnInit() {
|
||||
this.terminalAreas = this.basicDataService.terminal_area;
|
||||
this.stands = this.basicDataService.stand;
|
||||
this.render_data = this.basicDataService.stand;
|
||||
this.basicDataService.stand_subject.subscribe(
|
||||
data => {
|
||||
this.stands = data;
|
||||
this.render_data = this.stands;
|
||||
if(this.terminalAreas && this.terminalAreas.length>0){//所属航站楼区域数据转换处理
|
||||
this.terminalAreasHandle();
|
||||
}
|
||||
this.render_data.forEach(element => {//机位类型列表显示数据转换
|
||||
if (element['standType'] == 'bridge') {
|
||||
element['standType'] = '靠桥机位'
|
||||
return element['standType'];
|
||||
}
|
||||
if(element['standType'] == 'remote'){
|
||||
element['standType'] = '远机位'
|
||||
return element['standType'];
|
||||
}
|
||||
if(element['standType'] == 'near'){
|
||||
element['standType'] = '近机位'
|
||||
return element['standType'];
|
||||
}
|
||||
if(element['standType'] == 'night'){
|
||||
element['standType'] = '过夜机位'
|
||||
return element['standType'];
|
||||
}
|
||||
if(element['standType'] == 'specific'){
|
||||
element['standType'] = '专机位'
|
||||
return element['standType'];
|
||||
}
|
||||
});
|
||||
this.render_data.forEach(element => {//资源状态列表显示数据转换
|
||||
if (element['standStatus'] == '0') {
|
||||
element['standStatus'] = '可用'
|
||||
return element['standStatus'];
|
||||
}
|
||||
if(element['standStatus'] == '1'){
|
||||
element['standStatus'] = '在用'
|
||||
return element['standStatus'];
|
||||
}
|
||||
if(element['standStatus'] == '2'){
|
||||
element['standStatus'] = '锁定'
|
||||
return element['standStatus'];
|
||||
}
|
||||
if(element['standStatus'] == '3'){
|
||||
element['standStatus'] = '禁用'
|
||||
return element['standStatus'];
|
||||
}
|
||||
if(element['standStatus'] == '4'){
|
||||
element['standStatus'] = '预分'
|
||||
return element['standStatus'];
|
||||
}
|
||||
});
|
||||
this.render_data = data;
|
||||
}
|
||||
)
|
||||
//所属航站楼区域
|
||||
this.terminalAreas = this.basicDataService.terminal_area;
|
||||
this.basicDataService.terminal_area_subject.subscribe(
|
||||
data => {
|
||||
this.terminalAreas = data;
|
||||
@@ -105,21 +64,12 @@ ngOnInit() {
|
||||
tableCont.addEventListener('scroll', scrollHandle);
|
||||
}
|
||||
|
||||
//所属航站楼区域数据转换处理
|
||||
terminalAreasHandle() {
|
||||
this.render_data.forEach(item => {
|
||||
let terminalAreasLinkIndex = this.terminalAreas.findIndex(val => val.terminalAreaCode === item['terminalAreaCode']);
|
||||
item['terminalAreaName'] = this.terminalAreas[terminalAreasLinkIndex].terminalAreaName;
|
||||
})
|
||||
}
|
||||
|
||||
//输入框回车事件
|
||||
inputEnter() {
|
||||
if (this.FLT_POS === 1) {
|
||||
this.inputFilter(this.stands)
|
||||
this.selectChange()
|
||||
} else {
|
||||
this.inputFilter(this.stands)
|
||||
this.inputPosition(this.stands)
|
||||
this.inputPosition(this.render_data)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,43 +83,11 @@ selectRow(i) {
|
||||
|
||||
//下拉框选择筛选
|
||||
selectChange() {
|
||||
this.return_data = this.stands.filter(item=>{
|
||||
this.render_data = this.stands.filter(item => {
|
||||
let is_satis = true;
|
||||
//资源状态
|
||||
if (item['standStatus'] == '可用') {
|
||||
item['standStatus'] = '0'
|
||||
}
|
||||
if(item['standStatus'] == '在用'){
|
||||
item['standStatus'] = '1'
|
||||
}
|
||||
if(item['standStatus'] == '锁定'){
|
||||
item['standStatus'] = '2'
|
||||
}
|
||||
if(item['standStatus'] == '禁用'){
|
||||
item['standStatus'] = '3'
|
||||
}
|
||||
if(item['standStatus'] == '预分'){
|
||||
item['standStatus'] = '4'
|
||||
}
|
||||
//机位类型
|
||||
if (item['standType'] == '靠桥机位') {
|
||||
item['standType'] = 'bridge'
|
||||
}
|
||||
if(item['standType'] == '远机位'){
|
||||
item['standType'] = 'remote'
|
||||
}
|
||||
if(item['standType'] == '近机位'){
|
||||
item['standType'] = 'near'
|
||||
}
|
||||
if(item['standType'] == '过夜机位'){
|
||||
item['standType'] = 'night'
|
||||
}
|
||||
if(item['standType'] == '专机位'){
|
||||
item['standType'] = 'specific'
|
||||
}
|
||||
for (const key in this.filterItems) {
|
||||
if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) {
|
||||
if (item[key] === +this.filterItems[key] || item[key] === this.filterItems[key]) {
|
||||
if (item[key] == this.filterItems[key]) {
|
||||
is_satis = true;
|
||||
continue;
|
||||
} else {
|
||||
@@ -180,51 +98,11 @@ selectChange() {
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
this.return_data.forEach(element => { //机位类型列表显示数据转换
|
||||
if (element['standType'] == 'bridge') {
|
||||
element['standType'] = '靠桥机位'
|
||||
return element['standType'];
|
||||
if (this.FLT_POS === 1) {
|
||||
this.inputFilter(this.render_data);
|
||||
} else {
|
||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
||||
}
|
||||
if(element['standType'] == 'remote'){
|
||||
element['standType'] = '远机位'
|
||||
return element['standType'];
|
||||
}
|
||||
if(element['standType'] == 'near'){
|
||||
element['standType'] = '近机位'
|
||||
return element['standType'];
|
||||
}
|
||||
if(element['standType'] == 'night'){
|
||||
element['standType'] = '过夜机位'
|
||||
return element['standType'];
|
||||
}
|
||||
if(element['standType'] == 'specific'){
|
||||
element['standType'] = '专机位'
|
||||
return element['standType'];
|
||||
}
|
||||
});
|
||||
this.return_data.forEach(element => { //资源状态列表显示数据转换
|
||||
if (element['standStatus'] == '0') {
|
||||
element['standStatus'] = '可用'
|
||||
return element['standStatus'];
|
||||
}
|
||||
if(element['standStatus'] == '1'){
|
||||
element['standStatus'] = '在用'
|
||||
return element['standStatus'];
|
||||
}
|
||||
if(element['standStatus'] == '2'){
|
||||
element['standStatus'] = '锁定'
|
||||
return element['standStatus'];
|
||||
}
|
||||
if(element['standStatus'] == '3'){
|
||||
element['standStatus'] = '禁用'
|
||||
return element['standStatus'];
|
||||
}
|
||||
if(element['standStatus'] == '4'){
|
||||
element['standStatus'] = '预分'
|
||||
return element['standStatus'];
|
||||
}
|
||||
});
|
||||
this.render_data = this.return_data;
|
||||
}
|
||||
|
||||
//输入框筛选
|
||||
@@ -232,27 +110,23 @@ inputFilter(filterData) {
|
||||
if (this.SEARCH) {
|
||||
if (this.SEL_COL) {
|
||||
let sel_col = this.SEL_COL;
|
||||
filterData = filterData.filter(item => {
|
||||
this.render_data = filterData.filter(item => {
|
||||
if (item[sel_col]) {
|
||||
if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
filterData = filterData.filter(item => {
|
||||
this.render_data = filterData.filter(item => {
|
||||
let is_satis = false;
|
||||
for (const key in item) {
|
||||
if (item.hasOwnProperty(key)) {
|
||||
if (item[key]) {
|
||||
if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (item[cols[i].col_code]) {
|
||||
if (item[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
is_satis = true;
|
||||
break;
|
||||
} else {
|
||||
@@ -260,24 +134,16 @@ inputFilter(filterData) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
is_satis = false;
|
||||
continue;
|
||||
} else {
|
||||
is_satis = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.render_data = filterData;
|
||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
||||
}
|
||||
}
|
||||
|
||||
positionArray: Array<any> = [];
|
||||
@@ -300,10 +166,10 @@ inputPosition(filterData) {
|
||||
});
|
||||
} else {
|
||||
filterData.forEach(element => {
|
||||
for (const key in element) {
|
||||
if (element.hasOwnProperty(key)) {
|
||||
if (element[key]) {
|
||||
if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (element[cols[i].col_code]) {
|
||||
if (element[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
transArray.push(element)
|
||||
break;
|
||||
} else {
|
||||
@@ -317,10 +183,6 @@ inputPosition(filterData) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -342,6 +204,9 @@ inputPosition(filterData) {
|
||||
}
|
||||
let tr = $(".selected");
|
||||
let objTr = tr[0];
|
||||
if (objTr) {
|
||||
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
<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="">
|
||||
<option value="">选择列名</option>
|
||||
<option value="terminalAreaCode">航站楼区域代码</option>
|
||||
<option value="terminalAreaName">航站楼区域名称</option>
|
||||
<option *ngFor="let col of col_lists" [value]="col.col_code">{{col.col_chn}}</option>
|
||||
</select>
|
||||
<label class="radio-inline custom-radio nowrap mr-4">
|
||||
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
|
||||
@@ -18,11 +17,6 @@
|
||||
</label>
|
||||
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputEnter()" id="inputerInfo">
|
||||
</div>
|
||||
<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> -->
|
||||
<!-- <button type="button" class="btn btn-info mr-3">刷新</button> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -34,7 +28,6 @@
|
||||
<th>序号</th>
|
||||
<th>航站楼区域代码</th>
|
||||
<th>航站楼区域名称</th>
|
||||
<!-- <th *ngFor="let airline_col of terminalarea_lists">{{airline_col.COL_CN}}</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -43,7 +36,6 @@
|
||||
<td>{{i+1}}</td>
|
||||
<td>{{terminalArea.terminalAreaCode}}</td>
|
||||
<td>{{terminalArea.terminalAreaName}}</td>
|
||||
<!-- <td *ngFor="let airline_col of terminalarea_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { HttpClientService } from '../../../services/http-client.service';
|
||||
import { BasicDataService } from '../../basic-data-service'
|
||||
import { HttpParams } from '@angular/common/http';
|
||||
import { BasicDataService } from '../../basic-data-service';
|
||||
import * as $ from 'jquery';
|
||||
@Component({
|
||||
selector: 'app-terminal-area',
|
||||
@@ -11,30 +9,31 @@ import * as $ from 'jquery';
|
||||
export class TerminalAreaComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private httpCilent: HttpClientService,
|
||||
private basicDataService: BasicDataService
|
||||
) { }
|
||||
|
||||
public col_lists = [
|
||||
{ col_code: 'terminalAreaCode', col_chn: '航站楼区域代码' },
|
||||
{ col_code: 'terminalAreaName', col_chn: '航站楼区域名称' }
|
||||
];
|
||||
|
||||
// 搜索条件
|
||||
SEARCH = ''; //手动输入条件
|
||||
FLT_POS = 1; //过滤还是定位
|
||||
SEL_COL = ''; //选择列名
|
||||
|
||||
//下拉框
|
||||
public filterItems = {
|
||||
|
||||
}
|
||||
|
||||
terminalAreas: Array<any>;
|
||||
public row_state: any = { renderFlight: {} };
|
||||
public render_data: Array<object> = []; //显示数据,即需要显示的数据
|
||||
public return_data: Array<object> = []; //下拉框显示数据
|
||||
|
||||
ngOnInit() {
|
||||
this.terminalAreas = this.basicDataService.terminal_area;
|
||||
this.render_data = this.basicDataService.terminal_area;
|
||||
this.basicDataService.terminal_area_subject.subscribe(
|
||||
data => {
|
||||
this.terminalAreas = data;
|
||||
this.render_data = this.terminalAreas;
|
||||
this.render_data = data;
|
||||
}
|
||||
)
|
||||
/**
|
||||
@@ -61,57 +60,33 @@ inputEnter() {
|
||||
if (this.FLT_POS === 1) {
|
||||
this.inputFilter(this.terminalAreas)
|
||||
} else {
|
||||
this.inputFilter(this.terminalAreas)
|
||||
this.inputPosition(this.terminalAreas)
|
||||
this.inputPosition(this.render_data)
|
||||
}
|
||||
}
|
||||
|
||||
//下拉框选择筛选
|
||||
selectChange() {
|
||||
this.return_data = this.terminalAreas.filter(item=>{
|
||||
let is_satis = true;
|
||||
for (const key in this.filterItems) {
|
||||
if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) {
|
||||
if (item[key] === this.filterItems[key]) {
|
||||
is_satis = true;
|
||||
continue;
|
||||
} else {
|
||||
is_satis = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
this.render_data = this.return_data;
|
||||
}
|
||||
|
||||
//输入框筛选
|
||||
inputFilter(filterData) {
|
||||
if (this.SEARCH) {
|
||||
if (this.SEL_COL) {
|
||||
let sel_col = this.SEL_COL;
|
||||
filterData = filterData.filter(item => {
|
||||
this.render_data = filterData.filter(item => {
|
||||
if (item[sel_col]) {
|
||||
if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
filterData = filterData.filter(item => {
|
||||
this.render_data = filterData.filter(item => {
|
||||
let is_satis = false;
|
||||
for (const key in item) {
|
||||
if (item.hasOwnProperty(key)) {
|
||||
if (item[key]) {
|
||||
if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (item[cols[i].col_code]) {
|
||||
if (item[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
is_satis = true;
|
||||
break;
|
||||
} else {
|
||||
@@ -119,24 +94,16 @@ inputFilter(filterData) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
is_satis = false;
|
||||
continue;
|
||||
} else {
|
||||
is_satis = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.render_data = filterData;
|
||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
||||
}
|
||||
}
|
||||
|
||||
positionArray: Array<any> = [];
|
||||
@@ -159,10 +126,10 @@ inputPosition(filterData) {
|
||||
});
|
||||
} else {
|
||||
filterData.forEach(element => {
|
||||
for (const key in element) {
|
||||
if (element.hasOwnProperty(key)) {
|
||||
if (element[key]) {
|
||||
if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (element[cols[i].col_code]) {
|
||||
if (element[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
transArray.push(element)
|
||||
break;
|
||||
} else {
|
||||
@@ -176,10 +143,6 @@ inputPosition(filterData) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -201,6 +164,9 @@ inputPosition(filterData) {
|
||||
}
|
||||
let tr = $(".selected");
|
||||
let objTr = tr[0];
|
||||
if (objTr) {
|
||||
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
<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="">
|
||||
<option value="">选择列名</option>
|
||||
<option value="terminalCode">航站楼代码</option>
|
||||
<option value="terminalName">航站楼名称</option>
|
||||
<option *ngFor="let col of col_lists" [value]="col.col_code">{{col.col_chn}}</option>
|
||||
</select>
|
||||
<label class="radio-inline custom-radio nowrap mr-4">
|
||||
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
|
||||
@@ -18,11 +17,6 @@
|
||||
</label>
|
||||
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputEnter()" id="inputerInfo">
|
||||
</div>
|
||||
<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> -->
|
||||
<!-- <button type="button" class="btn btn-info mr-3">刷新</button> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -34,7 +28,6 @@
|
||||
<th>序号</th>
|
||||
<th>航站楼代码</th>
|
||||
<th>航站楼名称</th>
|
||||
<!-- <th *ngFor="let airline_col of terminal_lists">{{airline_col.COL_CN}}</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -43,7 +36,6 @@
|
||||
<td>{{i+1}}</td>
|
||||
<td>{{terminal.terminalCode}}</td>
|
||||
<td>{{terminal.terminalName}}</td>
|
||||
<!-- <td *ngFor="let airline_col of terminal_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { HttpClientService } from '../../../services/http-client.service';
|
||||
import { BasicDataService } from '../../basic-data-service'
|
||||
import { HttpParams } from '@angular/common/http';
|
||||
import * as $ from 'jquery';
|
||||
|
||||
@Component({
|
||||
selector: 'app-terminal',
|
||||
templateUrl: './terminal.component.html',
|
||||
@@ -11,30 +10,30 @@ import * as $ from 'jquery';
|
||||
export class TerminalComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private httpCilent: HttpClientService,
|
||||
private basicDataService: BasicDataService
|
||||
) { }
|
||||
|
||||
public col_lists = [
|
||||
{ col_code: 'terminalCode', col_chn: '航站楼代码' },
|
||||
{ col_code: 'terminalName', col_chn: '航站楼名称' }
|
||||
]
|
||||
|
||||
// 搜索条件
|
||||
SEARCH = ''; //手动输入条件
|
||||
FLT_POS = 1; //过滤还是定位
|
||||
SEL_COL = ''; //选择列名
|
||||
|
||||
//下拉框
|
||||
public filterItems = {
|
||||
|
||||
}
|
||||
|
||||
terminals: Array<any>;
|
||||
public row_state: any = { renderFlight: {} };
|
||||
public render_data: Array<object> = []; //显示数据,即需要显示的数据
|
||||
public return_data: Array<object> = []; //下拉框显示数据
|
||||
|
||||
ngOnInit() {
|
||||
this.terminals = this.basicDataService.terminal;
|
||||
this.render_data = this.basicDataService.terminal;
|
||||
this.basicDataService.terminal_subject.subscribe(
|
||||
data => {
|
||||
this.terminals = data;
|
||||
this.render_data = this.terminals;
|
||||
this.render_data = data;
|
||||
}
|
||||
)
|
||||
/**
|
||||
@@ -61,57 +60,33 @@ inputEnter() {
|
||||
if (this.FLT_POS === 1) {
|
||||
this.inputFilter(this.terminals)
|
||||
} else {
|
||||
this.inputFilter(this.terminals)
|
||||
this.inputPosition(this.terminals)
|
||||
this.inputPosition(this.render_data)
|
||||
}
|
||||
}
|
||||
|
||||
//下拉框选择筛选
|
||||
selectChange() {
|
||||
this.return_data = this.terminals.filter(item=>{
|
||||
let is_satis = true;
|
||||
for (const key in this.filterItems) {
|
||||
if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) {
|
||||
if (item[key] === this.filterItems[key]) {
|
||||
is_satis = true;
|
||||
continue;
|
||||
} else {
|
||||
is_satis = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
this.render_data = this.return_data;
|
||||
}
|
||||
|
||||
//输入框筛选
|
||||
inputFilter(filterData) {
|
||||
if (this.SEARCH) {
|
||||
if (this.SEL_COL) {
|
||||
let sel_col = this.SEL_COL;
|
||||
filterData = filterData.filter(item => {
|
||||
this.render_data = filterData.filter(item => {
|
||||
if (item[sel_col]) {
|
||||
if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
filterData = filterData.filter(item => {
|
||||
this.render_data = filterData.filter(item => {
|
||||
let is_satis = false;
|
||||
for (const key in item) {
|
||||
if (item.hasOwnProperty(key)) {
|
||||
if (item[key]) {
|
||||
if (item[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (item[cols[i].col_code]) {
|
||||
if (item[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
is_satis = true;
|
||||
break;
|
||||
} else {
|
||||
@@ -119,24 +94,16 @@ inputFilter(filterData) {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
if (this.SEARCH) {
|
||||
is_satis = false;
|
||||
continue;
|
||||
} else {
|
||||
is_satis = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.render_data = filterData;
|
||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
||||
}
|
||||
}
|
||||
|
||||
positionArray: Array<any> = [];
|
||||
@@ -159,10 +126,10 @@ inputPosition(filterData) {
|
||||
});
|
||||
} else {
|
||||
filterData.forEach(element => {
|
||||
for (const key in element) {
|
||||
if (element.hasOwnProperty(key)) {
|
||||
if (element[key]) {
|
||||
if (element[key].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
let cols = this.col_lists;
|
||||
for (let i = 0; i < cols.length; i++) {
|
||||
if (element[cols[i].col_code]) {
|
||||
if (element[cols[i].col_code].toString().match(new RegExp(this.SEARCH, 'i'))) {
|
||||
transArray.push(element)
|
||||
break;
|
||||
} else {
|
||||
@@ -176,10 +143,6 @@ inputPosition(filterData) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -201,6 +164,8 @@ inputPosition(filterData) {
|
||||
}
|
||||
let tr = $(".selected");
|
||||
let objTr = tr[0];
|
||||
if (objTr) {
|
||||
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ import { CommonModule } from '@angular/common';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { NgZorroAntdModule } from 'ng-zorro-antd'
|
||||
|
||||
import { PipesModule } from '../../pipes/pipes.module';
|
||||
import { MainComponent } from './main.component';
|
||||
import { MainRoutingModule } from './main-routing.module';
|
||||
import { RelatedTabComponent } from './related-tab/related-tab.component';
|
||||
@@ -18,7 +17,6 @@ import { SpecialTabComponent } from './special-tab/special-tab.component';
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
NgZorroAntdModule,
|
||||
PipesModule,
|
||||
MainRoutingModule
|
||||
],
|
||||
declarations: [
|
||||
|
||||
@@ -18,7 +18,7 @@ import { filter } from 'rxjs/operators';
|
||||
})
|
||||
export class PagesComponent implements OnInit {
|
||||
public menuClose: boolean = false;
|
||||
public isSpinning: any = true;
|
||||
public isSpinning: any = false;
|
||||
menuData = [
|
||||
{
|
||||
"name": "航班动态",
|
||||
|
||||
+5
-5
@@ -75,8 +75,8 @@ export class DepartmentManagementComponent implements OnInit {
|
||||
treeSave(){
|
||||
if(this.treeSelectedChild){
|
||||
this.orgSeleted=this.treeSelectedChild;
|
||||
this.visible = false;
|
||||
this.orgSeletedBtn=false;
|
||||
// this.visible = false;
|
||||
// this.orgSeletedBtn=false;
|
||||
}else{
|
||||
//如果没有选择机构,提示请选择机构
|
||||
this.message.create('warning', `请选择所属机构!`,{ nzDuration: 2000 });
|
||||
@@ -85,15 +85,15 @@ export class DepartmentManagementComponent implements OnInit {
|
||||
//打开机构树抽屉
|
||||
open(): void {
|
||||
this.treeSelectedChild='';
|
||||
this.visible = true;
|
||||
// this.visible = true;
|
||||
}
|
||||
//关闭机构选择页面
|
||||
close(): void {
|
||||
this.visible = false;
|
||||
// this.visible = false;
|
||||
}
|
||||
//删除机构标签
|
||||
tagClose(event){
|
||||
this.orgSeletedBtn=true;
|
||||
// this.orgSeletedBtn=true;
|
||||
this.orgSeleted='';
|
||||
}
|
||||
//修改时查询该系统下的所有用户
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { BasicDataPipesModule } from './basic-data-pipes.module';
|
||||
|
||||
describe('BasicDataPipesModule', () => {
|
||||
let basicDataPipesModule: BasicDataPipesModule;
|
||||
|
||||
beforeEach(() => {
|
||||
basicDataPipesModule = new BasicDataPipesModule();
|
||||
});
|
||||
|
||||
it('should create an instance', () => {
|
||||
expect(basicDataPipesModule).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,13 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TerminalAreaPipe } from './terminal-area.pipe';
|
||||
import { GateStatusPipe } from './gate-status.pipe';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule
|
||||
],
|
||||
declarations: [TerminalAreaPipe, GateStatusPipe],
|
||||
exports: [TerminalAreaPipe, GateStatusPipe]
|
||||
})
|
||||
export class BasicDataPipesModule { }
|
||||
@@ -0,0 +1,8 @@
|
||||
import { GateStatusPipe } from './gate-status.pipe';
|
||||
|
||||
describe('GateStatusPipe', () => {
|
||||
it('create an instance', () => {
|
||||
const pipe = new GateStatusPipe();
|
||||
expect(pipe).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,17 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
|
||||
@Pipe({
|
||||
name: 'gateStatus'
|
||||
})
|
||||
export class GateStatusPipe implements PipeTransform {
|
||||
|
||||
transform(value: any, args?: any): any {
|
||||
if(value){
|
||||
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import { TerminalAreaPipe } from './terminal-area.pipe';
|
||||
|
||||
describe('TerminalAreaPipe', () => {
|
||||
it('create an instance', () => {
|
||||
const pipe = new TerminalAreaPipe();
|
||||
expect(pipe).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,22 @@
|
||||
import { Pipe, PipeTransform, OnInit } from '@angular/core';
|
||||
import { BasicDataService } from '../../pages/basic-data-service';
|
||||
|
||||
@Pipe({
|
||||
name: 'terminalArea'
|
||||
})
|
||||
export class TerminalAreaPipe implements PipeTransform {
|
||||
constructor(
|
||||
private basicDataService: BasicDataService
|
||||
) { }
|
||||
|
||||
transform(value: any, args?: any): any {
|
||||
let terminal_area = this.basicDataService.terminal_area.find(val => val.terminalAreaCode === value)
|
||||
if (terminal_area) {
|
||||
return terminal_area.terminalAreaName
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
|
||||
@NgModule({
|
||||
imports: [],
|
||||
declarations: [
|
||||
],
|
||||
exports: [
|
||||
]
|
||||
})
|
||||
|
||||
export class PipesModule { }
|
||||
Reference in New Issue
Block a user