Merge branch 'develop-3'

This commit is contained in:
zhouyuejun
2018-12-03 11:30:45 +08:00
38 changed files with 2977 additions and 985 deletions
@@ -5,6 +5,19 @@
<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>
</select>
<label class="radio-inline custom-radio nowrap mr-4">
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
@@ -20,7 +33,7 @@
<!-- <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>
@@ -61,7 +74,8 @@
</tr>
</thead>
<tbody>
<tr *ngFor="let aircraftType of render_data;let i = index">
<tr *ngFor="let aircraftType of render_data;let i = index" (click)="selectRow(aircraftType)"
[ngClass]="{'selected':row_state===aircraftType}">
<td>{{i+1}}</td>
<td>{{aircraftType.aircraftTypeCode}}</td>
<td>{{aircraftType.aircraftTypeName}}</td>
@@ -48,13 +48,21 @@ ngOnInit() {
tableCont.addEventListener('scroll',scrollHandle);
}
/**
* 选中某行
* @param i
*/
selectRow(i) {
this.row_state = i;
}
///输入框回车事件
inputEnter() {
if (this.FLT_POS === 1) {
this.inputFilter(this.aircraftTypes)
} else {
this.inputFilter(this.aircraftTypes)
// this.inputPosition(this.render_data)
this.inputPosition(this.aircraftTypes)
}
}
@@ -191,5 +199,8 @@ inputPosition(filterData) {
} else {
alert('没有搜索到相关数据');
}
let tr = $(".selected");
let objTr = tr[0];
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
}
}
@@ -5,6 +5,14 @@
<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>
</select>
<label class="radio-inline custom-radio nowrap mr-4">
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
@@ -20,26 +28,23 @@
<!-- <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" (click)="clearFiter()">刷新</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="">航空公司:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="aircrafts" (ngModelChange)="selectChange()" id="airlineCompany">
<label for="airlineCode">航空公司:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.airlineCode" (ngModelChange)="selectChange()" id="airlineCompany">
<option value=""></option>
<option value="GH">海南航空公司</option>
<option value="CH">国外航空公司</option>
<option *ngFor="let item of airlines" [value]="item.airlineCode">{{item.airlineName}}</option>
</select>
</div>
<div class="input-container mr-4">
<label for="">机型:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="aircrafts" (ngModelChange)="selectChange()" id="jx">
<label for="aircraftTypeCode">机型:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.aircraftTypeCode" (ngModelChange)="selectChange()" id="jx">
<option value=""></option>
<option value="A">A306</option>
<option value="B">B252</option>
<option value="C">C256</option>
<option *ngFor="let item of aircraftTypes" [value]="item.aircraftTypeCode">{{item.aircraftTypeName}}</option>
</select>
</div>
</div>
@@ -63,7 +68,8 @@
</tr>
</thead>
<tbody>
<tr *ngFor="let aircraft of aircrafts;let i = index">
<tr *ngFor="let aircraft of render_data;let i = index" (click)="selectRow(aircraft)"
[ngClass]="{'selected':row_state===aircraft}">
<td>{{i+1}}</td>
<td>{{aircraft.aircraftNumber}}</td>
<td>{{aircraft.maxPassengers}}</td>
@@ -71,8 +77,8 @@
<td>{{aircraft.maxTakeoffWeight}}</td>
<td>{{aircraft.maxAirbridges}}</td>
<td>{{aircraft.aircraftOwnerCode}}</td>
<td>{{aircraft.airlineCode}}</td>
<td>{{aircraft.aircraftTypeCode}}</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> -->
</tr>
</tbody>
@@ -20,17 +20,47 @@ SEARCH = ''; //手动输入条件
FLT_POS = 1; //过滤还是定位
SEL_COL = ''; //选择列名
//下拉框
public filterItems = {
airlineCode:'',
aircraftTypeCode:'',
}
airlines : Array<any>; //航空公司
aircraftTypes : Array<any>; //机型
aircrafts : Array<any>;
public row_state: any = { renderFlight: {} };
public render_data: Array<object> = []; //显示数据,即需要显示的数据
public return_data: Array<object> = []; //下拉框显示数据
ngOnInit() {
this.aircrafts = 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.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;
}
)
/**
* 固定表头
*/
@@ -42,113 +72,61 @@ ngOnInit() {
tableCont.addEventListener('scroll',scrollHandle);
}
//刷新
clearFiter(){
$("#inputerInfo").val(""); //清空过滤或查找定位文本框
$("#airlineCompany").val(""); //清空航空公司
$("#jx").val(""); //清空机型
this.ngOnInit();
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
*/
selectRow(i) {
this.row_state = i;
}
//输入框回车事件
inputEnter() {
if (this.FLT_POS === 1) {
this.selectChange()
} else {
this.selectChange()
this.inputPosition(this.render_data)
}
if (this.FLT_POS === 1) {
this.inputFilter(this.aircrafts)
} else {
this.inputFilter(this.aircrafts)
this.inputPosition(this.aircrafts)
}
}
//下拉框选择筛选
selectChange() {
let filter_data = [];
let filteraircrafts = this.render_data;
this.render_data.forEach(item => {
filter_data.push(Object.assign({}, item));
})
if (this.FLT_POS === 1) {
this.inputFilter(filter_data);
} else {
this.aircrafts = filter_data;
this.row_state = this.aircrafts.length > 0 ? this.aircrafts[0] : { renderFlight: {} };
}
//下拉框筛选
filter_data = filter_data.filter(item => {
if (item) {
this.return_data = this.aircrafts.filter(item=>{
let is_satis = true;
for (const key in filteraircrafts) {
if (filteraircrafts.hasOwnProperty(key) && filteraircrafts[key]) {
if (item[key] === filteraircrafts[key]) {
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;
} else if (item) {
let is_satis = true;
for (const key in filteraircrafts) {
if (filteraircrafts.hasOwnProperty(key) && filteraircrafts[key]) {
if (item[key] === filteraircrafts[key]) {
is_satis = true;
continue;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else {
let pre_satis = true;
let rea_satis = true;
for (const key in filteraircrafts) {
if (filteraircrafts.hasOwnProperty(key) && filteraircrafts[key]) {
if (item[key] === filteraircrafts[key]) {
pre_satis = true;
continue;
} else {
pre_satis = false;
break;
}
}
}
for (const key in filteraircrafts) {
if (filteraircrafts.hasOwnProperty(key) && filteraircrafts[key]) {
if (item[key] === filteraircrafts[key]) {
rea_satis = true;
continue;
} else {
rea_satis = false;
break;
}
}
}
if (pre_satis && !rea_satis) {
item = item;
return pre_satis;
} else if (!pre_satis && rea_satis) {
item = item;
return rea_satis;
} else if (pre_satis && rea_satis) {
return pre_satis && rea_satis;
} else {
return false;
}
}
})
}
this.render_data = this.return_data;
}
//输入框筛选
inputFilter(filterData) {
//输入框筛选
inputFilter(filterData) {
if (this.SEARCH) {
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
@@ -196,14 +174,14 @@ selectChange() {
})
}
}
this.aircrafts = filterData;
this.row_state = this.aircrafts.length > 0 ? this.aircrafts[0] : { renderFlight: {} };
}
this.render_data = filterData;
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
}
positionArray: Array<any> = [];
positionArrayIndex: number = 0;
//输入框定位
inputPosition(filterData) {
positionArray: Array<any> = [];
positionArrayIndex: number = 0;
//输入框定位
inputPosition(filterData) {
let transArray = []
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
@@ -260,5 +238,8 @@ selectChange() {
} else {
alert('没有搜索到相关数据');
}
let tr = $(".selected");
let objTr = tr[0];
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
}
}
@@ -5,6 +5,15 @@
<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>
</select>
<label class="radio-inline custom-radio nowrap mr-4">
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
@@ -22,7 +31,7 @@
<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>
@@ -36,7 +45,7 @@
</div>
<div class="input-container mr-4">
<label for="briefNameChn">航班代理:&nbsp;&nbsp;</label>
<select class="form-control" (ngModelChange)="selectChange()" [(ngModel)]="filterItems.briefNameChn" id="hb">
<select class="form-control" [(ngModel)]="filterItems.briefNameChn" (ngModelChange)="selectChange()" id="hb">
<option value=""></option>
<option *ngFor="let items of airlines" [value]="items.briefNameChn">{{items.briefNameChn}}</option>
</select>
@@ -63,7 +72,8 @@
</tr>
</thead>
<tbody>
<tr *ngFor="let airline of render_data;let i = index">
<tr *ngFor="let airline of render_data;let i = index" (click)="selectRow(airline)"
[ngClass]="{'selected':row_state===airline}">
<td>{{i+1}}</td>
<td>{{airline.airlineCode}}</td>
<td>{{airline.airlineName}}</td>
@@ -10,43 +10,51 @@ import * as $ from 'jquery';
})
export class AirlineComponent implements OnInit {
constructor(
private httpCilent: HttpClientService,
private basicDataService: BasicDataService
) { }
constructor(
private httpCilent: HttpClientService,
private basicDataService: BasicDataService
) { }
// 搜索条件
SEARCH = ''; //手动输入条件
FLT_POS = 1; //过滤还是定位
SEL_COL = ''; //选择列名
// 搜索条件
SEARCH = ''; //手动输入条件
FLT_POS = 1; //过滤还是定位
SEL_COL = ''; //选择列名
airlines:Array<any>;
public row_state: any = { renderFlight: {} };
public render_data: Array<object> = []; //显示数据,即需要显示的数据
public return_data: Array<object> = []; //下拉框显示数据
//下拉框
public filterItems = {
airlineName:'',
briefNameChn:'',
}
ngOnInit() {
this.airlines = this.basicDataService.airline;
this.basicDataService.airline_subject.subscribe(
data=>{
this.airlines = data;
this.render_data = this.airlines;
}
)
/**
* 固定表头
*/
var tableCont = document.querySelector('#table-container');
function scrollHandle (){
var scrollTop = this.scrollTop;
this.querySelector('thead').style.transform = 'translateY(' + scrollTop + 'px)';
airlines:Array<any>;
public row_state: any = { renderFlight: {} };
public render_data: Array<object> = []; //显示数据,即需要显示的数据
public return_data: Array<object> = []; //下拉框显示数据
//下拉框
public filterItems = {
airlineName:'',
briefNameChn:'',
}
ngOnInit() {
this.airlines = this.basicDataService.airline;
this.basicDataService.airline_subject.subscribe(
data=>{
this.airlines = data;
this.render_data = this.airlines;
}
tableCont.addEventListener('scroll',scrollHandle);
)
/**
* 固定表头
*/
var tableCont = document.querySelector('#table-container');
function scrollHandle (){
var scrollTop = this.scrollTop;
this.querySelector('thead').style.transform = 'translateY(' + scrollTop + 'px)';
}
tableCont.addEventListener('scroll',scrollHandle);
}
/**
* 选中某行
* @param i
*/
selectRow(i) {
this.row_state = i;
}
//输入框回车事件
inputEnter() {
@@ -54,7 +62,7 @@ inputEnter() {
this.inputFilter(this.airlines)
} else {
this.inputFilter(this.airlines)
// this.inputPosition(this.render_data)
this.inputPosition(this.airlines)
}
}
@@ -62,7 +70,7 @@ inputEnter() {
selectChange() {
this.return_data = this.airlines.filter(item=>{
let is_satis = true;
for (const key in this.filterItems) {debugger
for (const key in this.filterItems) {
if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) {
if (item[key] === this.filterItems[key]) {
is_satis = true;
@@ -191,5 +199,8 @@ inputPosition(filterData) {
} else {
alert('没有搜索到相关数据');
}
let tr = $(".selected");
let objTr = tr[0];
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
}
}
@@ -5,6 +5,16 @@
<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>
</select>
<label class="radio-inline custom-radio nowrap mr-4">
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
@@ -21,7 +31,7 @@
<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>
@@ -42,7 +52,7 @@
<!-- <option value="GZ">广州</option>
<option value="SH">上海</option>
<option value="BJ">北京</option> -->
<option *ngFor="let item of airports" [value]="item.cityId">{{item.cityId}}</option>
<option *ngFor="let item of citys" [value]="item.cityId">{{item.cityNameChn}}</option>
</select>
</div>
</div>
@@ -68,7 +78,8 @@
</tr>
</thead>
<tbody>
<tr *ngFor="let airport of render_data;let i = index">
<tr *ngFor="let airport of render_data;let i = index" (click)="selectRow(airport)"
[ngClass]="{'selected':row_state===airport}">
<td>{{i+1}}</td>
<td>{{airport.airportCode}}</td>
<td>{{airport.airportNameChn}}</td>
@@ -79,7 +90,7 @@
<td>{{airport.airportCodeCaa}}</td>
<td>{{airport.airportCodeIcao}}</td>
<td>{{airport.airportGroupId}}</td>
<td>{{airport.cityId}}</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> -->
</tr>
</tbody>
@@ -25,7 +25,7 @@ public filterItems = {
airportGroupId:'',
cityId:'',
}
citys : Array<any>; //城市
airports : Array<any>;
public row_state: any = { renderFlight: {} };
public render_data: Array<object> = []; //显示数据,即需要显示的数据
@@ -37,6 +37,16 @@ ngOnInit() {
data=>{
this.airports = data;
this.render_data = this.airports;
if(this.citys && this.citys.length > 0){//所在城市列表数据转换
this.basicDataTransHandle();
}
}
)
//城市
this.citys = this.basicDataService.city;
this.basicDataService.city_subject.subscribe(
data=>{
this.citys = data;
}
)
/**
@@ -49,13 +59,30 @@ 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;
})
}
/**
* 选中某行
* @param i
*/
selectRow(i) {
this.row_state = i;
}
//输入框回车事件
inputEnter() {
if (this.FLT_POS === 1) {
this.inputFilter(this.airports)
} else {
this.inputFilter(this.airports)
// this.inputPosition(this.render_data)
this.inputPosition(this.airports)
}
}
@@ -65,7 +92,7 @@ selectChange() {
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] || item[key] === this.filterItems[key]) {
is_satis = true;
continue;
} else {
@@ -192,5 +219,8 @@ inputPosition(filterData) {
} else {
alert('没有搜索到相关数据');
}
let tr = $(".selected");
let objTr = tr[0];
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
}
}
@@ -5,6 +5,10 @@
<div class="line-operator-left input-container mb-3 col-xlg-8 col-mlg-8 col-xl-8 col-lg-10">
<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>
</select>
<label class="radio-inline custom-radio nowrap mr-4">
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
@@ -19,7 +23,7 @@
<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" (click)="clearFiter()">刷新</button>
<!-- <button type="button" class="btn btn-info mr-3">刷新</button> -->
</div>
</div>
@@ -28,7 +32,7 @@
<label for="terminalAreaCode">所属航站楼区域:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.terminalAreaCode" (ngModelChange)="selectChange()" id="qy">
<option value=""></option>
<option *ngFor="let item of carousels" [value]="item.terminalAreaCode" >{{item.terminalAreaCode}}</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> -->
@@ -38,9 +42,12 @@
<label for="carouselStatus">资源状态:&nbsp;&nbsp;</label>
<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="K">可用</option>
<option value="R">不可用</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>
<option value="3">禁用</option>
<option value="4">预分</option>
</select>
</div>
</div>
@@ -60,11 +67,12 @@
</tr>
</thead>
<tbody>
<tr *ngFor="let carousel of render_data;let i = index">
<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.terminalAreaCode}}</td>
<td>{{carousel.terminalAreaName}}</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>
@@ -25,6 +25,7 @@ public filterItems = {
terminalAreaCode:'',
carouselStatus:'',
}
terminalAreas:Array<any>; //所属航站楼区域
carousels:Array<any>;
public row_state: any = { renderFlight: {} };
public render_data: Array<object> = []; //显示数据,即需要显示的数据
@@ -35,6 +36,38 @@ ngOnInit() {
data=>{
this.carousels = data;
this.render_data = this.carousels;
if(this.terminalAreas && this.terminalAreas.length > 0){//所属航站楼区域数据显示处理
this.terminalAreasHandle();
}
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;
}
)
/**
@@ -48,13 +81,29 @@ 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
*/
selectRow(i) {
this.row_state = i;
}
//输入框回车事件
inputEnter() {
if (this.FLT_POS === 1) {
this.inputFilter(this.carousels)
} else {
this.inputFilter(this.carousels)
// this.inputPosition(this.render_data)
this.inputPosition(this.carousels)
}
}
@@ -62,9 +111,24 @@ inputEnter() {
selectChange() {
this.return_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]) {
if (item[key] === +this.filterItems[key] || item[key] === this.filterItems[key]) {
is_satis = true;
continue;
} else {
@@ -75,6 +139,28 @@ selectChange() {
}
return is_satis;
})
this.return_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.render_data = this.return_data;
}
@@ -191,5 +277,8 @@ inputPosition(filterData) {
} else {
alert('没有搜索到相关数据');
}
let tr = $(".selected");
let objTr = tr[0];
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
}
}
@@ -5,6 +5,11 @@
<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>
</select>
<label class="radio-inline custom-radio nowrap mr-4">
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
@@ -19,36 +24,39 @@
<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" (click)="clearFiter()">刷新</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="">所属航站楼区域:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="checkinDesks" (ngModelChange)="selectChange()" id="qy">
<label for="terminalAreaCode">所属航站楼区域:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.terminalAreaCode" (ngModelChange)="selectChange()" id="qy">
<option value=""></option>
<option value="GH">国内区域</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>
<option value="QH">其他区域</option> -->
</select>
</div>
<div class="input-container mr-4">
<label for="">值机岛:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="checkinDesks" (ngModelChange)="selectChange()" id="zjd">
<label for="checkinGroupCode">值机岛:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.checkinGroupCode" (ngModelChange)="selectChange()" id="zjd">
<option value=""></option>
<option value="A">A岛</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>
<option value="C">C岛</option> -->
</select>
</div>
<div class="input-container mr-4">
<label for="">行李传送带:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="checkinDesks" (ngModelChange)="selectChange()" id="xl">
<label for="chutCode">行李传送带:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.chutCode" (ngModelChange)="selectChange()" id="xl">
<option value=""></option>
<option value="X">X行李</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>
<option value="Y">Y行李</option> -->
</select>
</div>
</div>
@@ -69,13 +77,14 @@
</tr>
</thead>
<tbody>
<tr *ngFor="let checkinDesk of checkinDesks;let i = index">
<tr *ngFor="let checkinDesk of render_data;let i = index" (click)="selectRow(checkinDesk)"
[ngClass]="{'selected':row_state===checkinDesk}">
<td>{{i+1}}</td>
<td>{{checkinDesk.checkindeskCode}}</td>
<td>{{checkinDesk.checkindeskName}}</td>
<td>{{checkinDesk.checkinGroupCode}}</td>
<td>{{checkinDesk.chutCode}}</td>
<td>{{checkinDesk.terminalAreaCode}}</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> -->
</tr>
</tbody>
@@ -20,15 +20,56 @@ SEARCH = ''; //手动输入条件
FLT_POS = 1; //过滤还是定位
SEL_COL = ''; //选择列名
//下拉框
public filterItems = {
terminalAreaCode:'',
checkinGroupCode:'',
chutCode:'',
}
checkinGroups : Array<any>; //值机岛
terminalAreas : Array<any>; //所属航站楼区域
chuts : Array<any>; //行李传送带
checkinDesks : Array<any>;
public row_state: any = { renderFlight: {} };
public render_data: Array<object> = []; //显示数据,即需要显示的数据
public return_data: Array<object> = []; //下拉框显示数据
ngOnInit() {
this.checkinDesks = 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.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;
}
)
/**
@@ -42,114 +83,76 @@ ngOnInit() {
tableCont.addEventListener('scroll',scrollHandle);
}
//刷新
clearFiter(){
$("#inputerInfo").val(""); //清空过滤或查找定位文本框
$("#qy").val(""); //清空所属航站楼区域
$("#zjd").val(""); //清空值机岛
$("#xl").val(""); //清空行李传送带
this.ngOnInit();
//所属航站楼区域数据转换处理
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
*/
selectRow(i) {
this.row_state = i;
}
//输入框回车事件
inputEnter() {
if (this.FLT_POS === 1) {
this.selectChange()
} else {
this.selectChange()
this.inputPosition(this.render_data)
}
if (this.FLT_POS === 1) {
this.inputFilter(this.checkinDesks)
} else {
this.inputFilter(this.checkinDesks)
this.inputPosition(this.checkinDesks)
}
}
//下拉框选择筛选
selectChange() {
let filter_data = [];
let filtercheckinDesks = this.render_data;
this.render_data.forEach(item => {
filter_data.push(Object.assign({}, item));
})
if (this.FLT_POS === 1) {
this.inputFilter(filter_data);
} else {
this.checkinDesks = filter_data;
this.row_state = this.checkinDesks.length > 0 ? this.checkinDesks[0] : { renderFlight: {} };
}
//下拉框筛选
filter_data = filter_data.filter(item => {
if (item) {
this.return_data = this.checkinDesks.filter(item=>{
let is_satis = true;
for (const key in filtercheckinDesks) {
if (filtercheckinDesks.hasOwnProperty(key) && filtercheckinDesks[key]) {
if (item[key] === filtercheckinDesks[key]) {
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;
} else if (item) {
let is_satis = true;
for (const key in filtercheckinDesks) {
if (filtercheckinDesks.hasOwnProperty(key) && filtercheckinDesks[key]) {
if (item[key] === filtercheckinDesks[key]) {
is_satis = true;
continue;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else {
let pre_satis = true;
let rea_satis = true;
for (const key in filtercheckinDesks) {
if (filtercheckinDesks.hasOwnProperty(key) && filtercheckinDesks[key]) {
if (item[key] === filtercheckinDesks[key]) {
pre_satis = true;
continue;
} else {
pre_satis = false;
break;
}
}
}
for (const key in filtercheckinDesks) {
if (filtercheckinDesks.hasOwnProperty(key) && filtercheckinDesks[key]) {
if (item[key] === filtercheckinDesks[key]) {
rea_satis = true;
continue;
} else {
rea_satis = false;
break;
}
}
}
if (pre_satis && !rea_satis) {
item = item;
return pre_satis;
} else if (!pre_satis && rea_satis) {
item = item;
return rea_satis;
} else if (pre_satis && rea_satis) {
return pre_satis && rea_satis;
} else {
return false;
}
}
})
}
this.render_data = this.return_data;
}
//输入框筛选
inputFilter(filterData) {
//输入框筛选
inputFilter(filterData) {
if (this.SEARCH) {
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
@@ -197,14 +200,14 @@ selectChange() {
})
}
}
this.checkinDesks = filterData;
this.row_state = this.checkinDesks.length > 0 ? this.checkinDesks[0] : { renderFlight: {} };
}
this.render_data = filterData;
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
}
positionArray: Array<any> = [];
positionArrayIndex: number = 0;
//输入框定位
inputPosition(filterData) {
positionArray: Array<any> = [];
positionArrayIndex: number = 0;
//输入框定位
inputPosition(filterData) {
let transArray = []
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
@@ -261,5 +264,8 @@ selectChange() {
} else {
alert('没有搜索到相关数据');
}
let tr = $(".selected");
let objTr = tr[0];
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
}
}
@@ -5,6 +5,8 @@
<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>
</select>
<label class="radio-inline custom-radio nowrap mr-4">
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
@@ -19,7 +21,7 @@
<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" (click)="clearFiter()">刷新</button>
<!-- <button type="button" class="btn btn-info mr-3">刷新</button> -->
</div>
</div>
</div>
@@ -36,7 +38,8 @@
</tr>
</thead>
<tbody>
<tr *ngFor="let checkinGroup of checkinGroups;let i = index">
<tr *ngFor="let checkinGroup of render_data;let i = index" (click)="selectRow(checkinGroup)"
[ngClass]="{'selected':row_state===checkinGroup}">
<td>{{i+1}}</td>
<td>{{checkinGroup.checkinGroupCode}}</td>
<td>{{checkinGroup.checkinGroupName}}</td>
@@ -20,9 +20,15 @@ SEARCH = ''; //手动输入条件
FLT_POS = 1; //过滤还是定位
SEL_COL = ''; //选择列名
//下拉框
public filterItems = {
}
checkinGroups : Array<any>;
public row_state: any = { renderFlight: {} };
public render_data: Array<object> = []; //显示数据,即需要显示的数据
public return_data: Array<object> = []; //下拉框显示数据
ngOnInit() {
this.checkinGroups = this.basicDataService.checkin_group;
this.basicDataService.checkin_group_subject.subscribe(
@@ -42,221 +48,159 @@ ngOnInit() {
tableCont.addEventListener('scroll',scrollHandle);
}
//刷新
clearFiter(){
$("#inputerInfo").val(""); //清空过滤或查找定位文本框
this.ngOnInit();
/**
* 选中某行
* @param i
*/
selectRow(i) {
this.row_state = i;
}
//输入框回车事件
inputEnter() {
if (this.FLT_POS === 1) {
this.selectChange()
} else {
this.selectChange()
this.inputPosition(this.render_data)
}
if (this.FLT_POS === 1) {
this.inputFilter(this.checkinGroups)
} else {
this.inputFilter(this.checkinGroups)
this.inputPosition(this.checkinGroups)
}
}
//下拉框选择筛选
selectChange() {
let filter_data = [];
let filtercheckinGroups = this.render_data;
this.render_data.forEach(item => {
filter_data.push(Object.assign({}, item));
})
if (this.FLT_POS === 1) {
this.inputFilter(filter_data);
} else {
this.checkinGroups = filter_data;
this.row_state = this.checkinGroups.length > 0 ? this.checkinGroups[0] : { renderFlight: {} };
}
//下拉框筛选
filter_data = filter_data.filter(item => {
if (item) {
let is_satis = true;
for (const key in filtercheckinGroups) {
if (filtercheckinGroups.hasOwnProperty(key) && filtercheckinGroups[key]) {
if (item[key] === filtercheckinGroups[key]) {
is_satis = true;
continue;
} else {
is_satis = false;
break;
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;
} else if (item) {
let is_satis = true;
for (const key in filtercheckinGroups) {
if (filtercheckinGroups.hasOwnProperty(key) && filtercheckinGroups[key]) {
if (item[key] === filtercheckinGroups[key]) {
is_satis = true;
continue;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else {
let pre_satis = true;
let rea_satis = true;
for (const key in filtercheckinGroups) {
if (filtercheckinGroups.hasOwnProperty(key) && filtercheckinGroups[key]) {
if (item[key] === filtercheckinGroups[key]) {
pre_satis = true;
continue;
} else {
pre_satis = false;
break;
}
}
}
for (const key in filtercheckinGroups) {
if (filtercheckinGroups.hasOwnProperty(key) && filtercheckinGroups[key]) {
if (item[key] === filtercheckinGroups[key]) {
rea_satis = true;
continue;
} else {
rea_satis = false;
break;
}
}
}
if (pre_satis && !rea_satis) {
item = item;
return pre_satis;
} else if (!pre_satis && rea_satis) {
item = item;
return rea_satis;
} else if (pre_satis && rea_satis) {
return pre_satis && rea_satis;
} else {
return false;
}
}
})
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 => {
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'))) {
is_satis = true;
break;
} else {
is_satis = false;
continue;
}
} else {
if (this.SEARCH) {
is_satis = false;
continue;
} else {
is_satis = true;
break;
}
if (this.SEARCH) {
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
filterData = filterData.filter(item => {
if (item[sel_col]) {
if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
return true;
}
} else {
continue;
if (this.SEARCH) {
return false;
} else {
return true;
}
}
}
return is_satis;
})
})
} 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'))) {
is_satis = true;
break;
} else {
is_satis = false;
continue;
}
} else {
if (this.SEARCH) {
is_satis = false;
continue;
} else {
is_satis = true;
break;
}
}
} else {
continue;
}
}
return is_satis;
})
}
}
}
this.checkinGroups = filterData;
this.row_state = this.checkinGroups.length > 0 ? this.checkinGroups[0] : { renderFlight: {} };
this.render_data = filterData;
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
}
positionArray: Array<any> = [];
positionArrayIndex: number = 0;
//输入框定位
inputPosition(filterData) {
let transArray = []
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
filterData.forEach(element => {
if (element[sel_col]) {
if (element[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
transArray.push(element)
}
} else {
if (!this.SEARCH) {
transArray.push(element)
}
}
});
} 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'))) {
transArray.push(element)
break;
} else {
continue;
}
} else {
if (this.SEARCH) {
continue;
} else {
transArray.push(element)
break;
}
let transArray = []
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
filterData.forEach(element => {
if (element[sel_col]) {
if (element[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
transArray.push(element)
}
} else {
continue;
if (!this.SEARCH) {
transArray.push(element)
}
}
}
});
}
if (transArray.length > 0) {
if (transArray.toString() == this.positionArray.toString()) {
this.positionArrayIndex++;
if (this.positionArrayIndex === this.positionArray.length) {
this.positionArrayIndex = 0;
}
this.row_state = this.positionArray[this.positionArrayIndex];
});
} else {
this.positionArray = transArray;
this.positionArrayIndex = 0;
this.row_state = this.positionArray[this.positionArrayIndex];
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'))) {
transArray.push(element)
break;
} else {
continue;
}
} else {
if (this.SEARCH) {
continue;
} else {
transArray.push(element)
break;
}
}
} else {
continue;
}
}
});
}
if (transArray.length > 0) {
if (transArray.toString() == this.positionArray.toString()) {
this.positionArrayIndex++;
if (this.positionArrayIndex === this.positionArray.length) {
this.positionArrayIndex = 0;
}
this.row_state = this.positionArray[this.positionArrayIndex];
} else {
this.positionArray = transArray;
this.positionArrayIndex = 0;
this.row_state = this.positionArray[this.positionArrayIndex];
}
} else {
alert('没有搜索到相关数据');
}
let tr = $(".selected");
let objTr = tr[0];
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
}
} else {
alert('没有搜索到相关数据');
}
}
}
@@ -5,6 +5,8 @@
<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>
</select>
<label class="radio-inline custom-radio nowrap mr-4">
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
@@ -19,7 +21,7 @@
<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" (click)="clearFiter()">刷新</button>
<!-- <button type="button" class="btn btn-info mr-3">刷新</button> -->
</div>
</div>
</div>
@@ -36,7 +38,8 @@
</tr>
</thead>
<tbody>
<tr *ngFor="let chut of chuts;let i = index">
<tr *ngFor="let chut of render_data;let i = index" (click)="selectRow(chut)"
[ngClass]="{'selected':row_state===chut}">
<td>{{i+1}}</td>
<td>{{chut.chutCode}}</td>
<td>{{chut.chutName}}</td>
+78 -134
View File
@@ -20,9 +20,15 @@ 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.basicDataService.chut_subject.subscribe(
@@ -42,160 +48,95 @@ ngOnInit() {
tableCont.addEventListener('scroll',scrollHandle);
}
//刷新
clearFiter(){
$("#inputerInfo").val(""); //清空过滤或查找定位文本框
this.ngOnInit();
/**
* 选中某行
* @param i
*/
selectRow(i) {
this.row_state = i;
}
//输入框回车事件
inputEnter() {
if (this.FLT_POS === 1) {
this.selectChange()
this.inputFilter(this.chuts)
} else {
this.selectChange()
this.inputPosition(this.render_data)
this.inputFilter(this.chuts)
this.inputPosition(this.chuts)
}
}
//下拉框选择筛选
selectChange() {
let filter_data = [];
let filterchuts = this.render_data;
this.render_data.forEach(item => {
filter_data.push(Object.assign({}, item));
})
if (this.FLT_POS === 1) {
this.inputFilter(filter_data);
} else {
this.chuts = filter_data;
this.row_state = this.chuts.length > 0 ? this.chuts[0] : { renderFlight: {} };
}
//下拉框筛选
filter_data = filter_data.filter(item => {
if (item) {
let is_satis = true;
for (const key in filterchuts) {
if (filterchuts.hasOwnProperty(key) && filterchuts[key]) {
if (item[key] === filterchuts[key]) {
is_satis = true;
continue;
} else {
is_satis = false;
break;
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;
} else if (item) {
let is_satis = true;
for (const key in filterchuts) {
if (filterchuts.hasOwnProperty(key) && filterchuts[key]) {
if (item[key] === filterchuts[key]) {
is_satis = true;
continue;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else {
let pre_satis = true;
let rea_satis = true;
for (const key in filterchuts) {
if (filterchuts.hasOwnProperty(key) && filterchuts[key]) {
if (item[key] === filterchuts[key]) {
pre_satis = true;
continue;
} else {
pre_satis = false;
break;
}
}
}
for (const key in filterchuts) {
if (filterchuts.hasOwnProperty(key) && filterchuts[key]) {
if (item[key] === filterchuts[key]) {
rea_satis = true;
continue;
} else {
rea_satis = false;
break;
}
}
}
if (pre_satis && !rea_satis) {
item = item;
return pre_satis;
} else if (!pre_satis && rea_satis) {
item = item;
return rea_satis;
} else if (pre_satis && rea_satis) {
return pre_satis && rea_satis;
} else {
return false;
}
}
})
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 => {
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'))) {
is_satis = true;
break;
} else {
is_satis = false;
continue;
}
} else {
if (this.SEARCH) {
is_satis = false;
continue;
} else {
is_satis = true;
break;
}
if (this.SEARCH) {
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
filterData = filterData.filter(item => {
if (item[sel_col]) {
if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
return true;
}
} else {
continue;
if (this.SEARCH) {
return false;
} else {
return true;
}
}
}
return is_satis;
})
})
} 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'))) {
is_satis = true;
break;
} else {
is_satis = false;
continue;
}
} else {
if (this.SEARCH) {
is_satis = false;
continue;
} else {
is_satis = true;
break;
}
}
} else {
continue;
}
}
return is_satis;
})
}
}
}
this.chuts = filterData;
this.row_state = this.chuts.length > 0 ? this.chuts[0] : { renderFlight: {} };
this.render_data = filterData;
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
}
positionArray: Array<any> = [];
@@ -258,5 +199,8 @@ inputPosition(filterData) {
} else {
alert('没有搜索到相关数据');
}
let tr = $(".selected");
let objTr = tr[0];
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
}
}
@@ -5,6 +5,10 @@
<div class="line-operator-left input-container mb-3 col-xlg-8 col-mlg-8 col-xl-8 col-lg-10">
<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>
</select>
<label class="radio-inline custom-radio nowrap mr-4">
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
@@ -22,33 +26,32 @@
<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" (click)="clearFiter()">刷新</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">
<!-- <div class="input-container mr-4">
<label for="">洲/地区:&nbsp;&nbsp;</label>
<select class="form-control">
<option value=""></option>
<option value="GH">非洲</option>
<option value="CH">亚洲</option>
</select>
</div>
</div> -->
<div class="input-container mr-4">
<label for="">国家:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="citys" (ngModelChange)="selectChange()" id="citry">
<label for="countryId">国家:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.countryId" (ngModelChange)="selectChange()" id="citry">
<option value=""></option>
<option value="ZG">中国</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>
<option value="YG">英国</option> -->
</select>
</div>
<div class="third-condition row">
<label class="radio-inline custom-checkbox nowrap checkInfo mr-4">
<!-- <label class="radio-inline custom-checkbox nowrap checkInfo mr-4">
<input type="checkbox">
<span>洲/地区-国家关联</span>
</label>
</label> -->
<label class="radio-inline custom-checkbox nowrap checkInfo mr-4">
<input type="checkbox">
<span>国家-城市关联</span>
@@ -72,7 +75,8 @@
</tr>
</thead>
<tbody>
<tr *ngFor="let city of citys;let i = index">
<tr *ngFor="let city of render_data;let i = index" (click)="selectRow(city)"
[ngClass]="{'selected':row_state===city}">
<td>{{i+1}}</td>
<td>{{city.cityCode}}</td>
<td>{{city.cityNameChn}}</td>
+37 -94
View File
@@ -20,9 +20,15 @@ SEARCH = ''; //手动输入条件
FLT_POS = 1; //过滤还是定位
SEL_COL = ''; //选择列名
//下拉框
public filterItems = {
countryId:'',
}
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.basicDataService.city_subject.subscribe(
@@ -42,112 +48,46 @@ ngOnInit() {
tableCont.addEventListener('scroll',scrollHandle);
}
//刷新
clearFiter(){
$("#inputerInfo").val(""); //清空过滤或查找定位文本框
$("#citry").val(""); //清空所国家
this.ngOnInit();
/**
* 选中某行
* @param i
*/
selectRow(i) {
this.row_state = i;
}
//输入框回车事件
inputEnter() {
if (this.FLT_POS === 1) {
this.selectChange()
} else {
this.selectChange()
this.inputPosition(this.render_data)
}
if (this.FLT_POS === 1) {
this.inputFilter(this.citys)
} else {
this.inputFilter(this.citys)
this.inputPosition(this.citys)
}
}
//下拉框选择筛选
selectChange() {
let filter_data = [];
let filtercitys = this.render_data;
this.render_data.forEach(item => {
filter_data.push(Object.assign({}, item));
})
if (this.FLT_POS === 1) {
this.inputFilter(filter_data);
} else {
this.citys = filter_data;
this.row_state = this.citys.length > 0 ? this.citys[0] : { renderFlight: {} };
}
//下拉框筛选
filter_data = filter_data.filter(item => {
if (item) {
this.return_data = this.citys.filter(item=>{
let is_satis = true;
for (const key in filtercitys) {
if (filtercitys.hasOwnProperty(key) && filtercitys[key]) {
if (item[key] === filtercitys[key]) {
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;
} else if (item) {
let is_satis = true;
for (const key in filtercitys) {
if (filtercitys.hasOwnProperty(key) && filtercitys[key]) {
if (item[key] === filtercitys[key]) {
is_satis = true;
continue;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else {
let pre_satis = true;
let rea_satis = true;
for (const key in filtercitys) {
if (filtercitys.hasOwnProperty(key) && filtercitys[key]) {
if (item[key] === filtercitys[key]) {
pre_satis = true;
continue;
} else {
pre_satis = false;
break;
}
}
}
for (const key in filtercitys) {
if (filtercitys.hasOwnProperty(key) && filtercitys[key]) {
if (item[key] === filtercitys[key]) {
rea_satis = true;
continue;
} else {
rea_satis = false;
break;
}
}
}
if (pre_satis && !rea_satis) {
item = item;
return pre_satis;
} else if (!pre_satis && rea_satis) {
item = item;
return rea_satis;
} else if (pre_satis && rea_satis) {
return pre_satis && rea_satis;
} else {
return false;
}
}
})
}
this.render_data = this.return_data;
}
//输入框筛选
inputFilter(filterData) {
//输入框筛选
inputFilter(filterData) {
if (this.SEARCH) {
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
@@ -195,14 +135,14 @@ selectChange() {
})
}
}
this.citys = filterData;
this.row_state = this.citys.length > 0 ? this.citys[0] : { renderFlight: {} };
}
this.render_data = filterData;
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
}
positionArray: Array<any> = [];
positionArrayIndex: number = 0;
//输入框定位
inputPosition(filterData) {
positionArray: Array<any> = [];
positionArrayIndex: number = 0;
//输入框定位
inputPosition(filterData) {
let transArray = []
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
@@ -259,5 +199,8 @@ selectChange() {
} else {
alert('没有搜索到相关数据');
}
let tr = $(".selected");
let objTr = tr[0];
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
}
}
@@ -3,8 +3,13 @@
<div class="search-filter mb-3">
<div class="first-condition row">
<div class="line-operator-left input-container mb-3 col-xlg-8 col-mlg-8 col-xl-8 col-lg-10">
<select class="mr-4 form-control" name="" id="">
<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> -->
</select>
<label class="radio-inline custom-radio nowrap mr-4">
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
@@ -19,7 +24,7 @@
<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>
@@ -28,14 +33,19 @@
<label for="terminalAreaCode">所属航站楼区域:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.terminalAreaCode" (ngModelChange)="selectChange()" id="qy">
<option value=""></option>
<option *ngFor="let items of gates" [value]="items.terminalAreaCode">{{items.terminalAreaCode}}</option>
<option *ngFor="let items of terminalAreas" [value]="items.terminalAreaCode">{{items.terminalAreaName}}</option>
</select>
</div>
<div class="input-container mr-4">
<label for="gateStatus">资源状态:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.gateStatus" (ngModelChange)="selectChange()" id="zy">
<option value=""></option>
<option *ngFor="let items of gates" [value]="items.gateStatus">{{items.gateStatus}}</option>
<option value="0">可用</option>
<option value="1">在用</option>
<option value="2">锁定</option>
<option value="3">禁用</option>
<option value="4">预分</option>
<!-- <option *ngFor="let items of gates" [value]="items.gateStatus">{{items.gateStatus}}</option> -->
</select>
</div>
</div>
@@ -55,11 +65,12 @@
</tr>
</thead>
<tbody>
<tr *ngFor="let gate of render_data;let i = index">
<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.terminalAreaCode}}</td>
<td>{{gate.terminalAreaName}}</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>
@@ -25,7 +25,7 @@ public filterItems = {
terminalAreaCode:'',
gateStatus:'',
}
terminalAreas : Array<any>; //所属航站楼区域
gates : Array<any>;
public row_state: any = { renderFlight: {} };
public render_data: Array<object> = []; //显示数据,即需要显示的数据
@@ -36,6 +36,38 @@ ngOnInit() {
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.terminalAreas = this.basicDataService.terminal_area;
this.basicDataService.terminal_area_subject.subscribe(
data=>{
this.terminalAreas = data;
}
)
/**
@@ -49,13 +81,29 @@ 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
*/
selectRow(i) {
this.row_state = i;
}
//输入框回车事件
inputEnter() {
if (this.FLT_POS === 1) {
this.inputFilter(this.gates)
} else {
this.inputFilter(this.gates)
// this.inputPosition(this.render_data)
this.inputPosition(this.gates)
}
}
@@ -63,9 +111,24 @@ inputEnter() {
selectChange() {
this.return_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]) {
if (item[key] === +this.filterItems[key] || item[key] === this.filterItems[key]) {
is_satis = true;
continue;
} else {
@@ -76,6 +139,28 @@ selectChange() {
}
return is_satis;
})
this.return_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 = this.return_data;
}
@@ -192,5 +277,8 @@ inputPosition(filterData) {
} else {
alert('没有搜索到相关数据');
}
let tr = $(".selected");
let objTr = tr[0];
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
}
}
@@ -5,6 +5,11 @@
<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>
</select>
<label class="radio-inline custom-radio nowrap mr-4">
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
@@ -19,7 +24,7 @@
<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>
@@ -28,7 +33,7 @@
<label for="terminalAreaCode">所属航站楼区域:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.terminalAreaCode" (ngModelChange)="selectChange()" id="qy">
<option value=""></option>
<option *ngFor="let items of stands" [value]="items.terminalAreaCode">{{items.terminalAreaCode}}</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> -->
@@ -37,21 +42,25 @@
<div class="input-container mr-4">
<label for="standType">机位类型:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.standType" (ngModelChange)="selectChange()" id="jtype">
<option value=""></option>
<option *ngFor="let items of stands" [value]="items.standType">{{items.standType}}</option>
<!-- <option value="YJW">远机位</option>
<option value="JJW">近机位</option>
<option value="GWJW">过夜机位</option>
<option value="ZJW">专机位</option> -->
<option value=""></option>
<option value="bridge">靠桥机位</option>
<option value="remote">远机位</option>
<option value="near">近机位</option>
<option value="night">过夜机位</option>
<option value="specific">专机位</option>
<!-- <option *ngFor="let items of stands" [value]="items.standType">{{items.standType}}</option> -->
</select>
</div>
<div class="input-container mr-4">
<label for="standStatus">资源状态:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.standStatus" (ngModelChange)="selectChange()" id="zystatus">
<option value=""></option>
<option *ngFor="let items of stands" [value]="items.standStatus">{{items.standStatus}}</option>
<!-- <option value="K">可用</option>
<option value="R">不可用</option> -->
<!-- <option *ngFor="let items of stands" [value]="items.standStatus">{{items.standStatus}}</option> -->
<option value="0">可用</option>
<option value="1">在用</option>
<option value="2">锁定</option>
<option value="3">禁用</option>
<option value="4">预分</option>
</select>
</div>
</div>
@@ -72,13 +81,14 @@
</tr>
</thead>
<tbody>
<tr *ngFor="let stand of render_data;let i = index">
<tr *ngFor="let stand of render_data;let i = index" (click)="selectRow(stand)"
[ngClass]="{'selected':row_state===stand}">
<td>{{i+1}}</td>
<td>{{stand.standCode}}</td>
<td>{{stand.standName}}</td>
<td>{{stand.standType}}</td>
<td>{{stand.standStatus}}</td>
<td>{{stand.terminalAreaCode}}</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> -->
</tr>
</tbody>
@@ -23,9 +23,11 @@ SEL_COL = ''; //选择列名
//下拉框
public filterItems = {
terminalAreaCode:'',
gateStatus:'',
standType:'',
standStatus:'',
}
terminalAreas : Array<any>; //所属航站楼区域
stands : Array<any>;
public row_state: any = { renderFlight: {} };
public render_data: Array<object> = []; //显示数据,即需要显示的数据
@@ -36,6 +38,60 @@ ngOnInit() {
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.terminalAreas = this.basicDataService.terminal_area;
this.basicDataService.terminal_area_subject.subscribe(
data=>{
this.terminalAreas = data;
}
)
/**
@@ -49,23 +105,71 @@ 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)
} else {
this.inputFilter(this.stands)
// this.inputPosition(this.render_data)
this.inputPosition(this.stands)
}
}
/**
* 选中某行
* @param i
*/
selectRow(i) {
this.row_state = i;
}
//下拉框选择筛选
selectChange() {
this.return_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]) {
if (item[key] === +this.filterItems[key] || item[key] === this.filterItems[key]) {
is_satis = true;
continue;
} else {
@@ -76,6 +180,50 @@ selectChange() {
}
return is_satis;
})
this.return_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.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;
}
@@ -192,5 +340,8 @@ inputPosition(filterData) {
} else {
alert('没有搜索到相关数据');
}
let tr = $(".selected");
let objTr = tr[0];
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
}
}
@@ -5,6 +5,8 @@
<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>
</select>
<label class="radio-inline custom-radio nowrap mr-4">
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
@@ -19,7 +21,7 @@
<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" (click)="clearFiter()">刷新</button>
<!-- <button type="button" class="btn btn-info mr-3">刷新</button> -->
</div>
</div>
</div>
@@ -36,7 +38,8 @@
</tr>
</thead>
<tbody>
<tr *ngFor="let terminalArea of terminalAreas;let i = index">
<tr *ngFor="let terminalArea of render_data;let i = index" (click)="selectRow(terminalArea)"
[ngClass]="{'selected':row_state===terminalArea}">
<td>{{i+1}}</td>
<td>{{terminalArea.terminalAreaCode}}</td>
<td>{{terminalArea.terminalAreaName}}</td>
@@ -20,9 +20,15 @@ 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.basicDataService.terminal_area_subject.subscribe(
@@ -42,111 +48,46 @@ ngOnInit() {
tableCont.addEventListener('scroll',scrollHandle);
}
//刷新
clearFiter(){
$("#inputerInfo").val(""); //清空过滤或查找定位文本框
this.ngOnInit();
/**
* 选中某行
* @param i
*/
selectRow(i) {
this.row_state = i;
}
//输入框回车事件
inputEnter() {
if (this.FLT_POS === 1) {
this.selectChange()
} else {
this.selectChange()
this.inputPosition(this.render_data)
}
if (this.FLT_POS === 1) {
this.inputFilter(this.terminalAreas)
} else {
this.inputFilter(this.terminalAreas)
this.inputPosition(this.terminalAreas)
}
}
//下拉框选择筛选
selectChange() {
let filter_data = [];
let filterterminalAreas = this.render_data;
this.render_data.forEach(item => {
filter_data.push(Object.assign({}, item));
})
if (this.FLT_POS === 1) {
this.inputFilter(filter_data);
} else {
this.terminalAreas = filter_data;
this.row_state = this.terminalAreas.length > 0 ? this.terminalAreas[0] : { renderFlight: {} };
}
//下拉框筛选
filter_data = filter_data.filter(item => {
if (item) {
this.return_data = this.terminalAreas.filter(item=>{
let is_satis = true;
for (const key in filterterminalAreas) {
if (filterterminalAreas.hasOwnProperty(key) && filterterminalAreas[key]) {
if (item[key] === filterterminalAreas[key]) {
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;
} else if (item) {
let is_satis = true;
for (const key in filterterminalAreas) {
if (filterterminalAreas.hasOwnProperty(key) && filterterminalAreas[key]) {
if (item[key] === filterterminalAreas[key]) {
is_satis = true;
continue;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else {
let pre_satis = true;
let rea_satis = true;
for (const key in filterterminalAreas) {
if (filterterminalAreas.hasOwnProperty(key) && filterterminalAreas[key]) {
if (item[key] === filterterminalAreas[key]) {
pre_satis = true;
continue;
} else {
pre_satis = false;
break;
}
}
}
for (const key in filterterminalAreas) {
if (filterterminalAreas.hasOwnProperty(key) && filterterminalAreas[key]) {
if (item[key] === filterterminalAreas[key]) {
rea_satis = true;
continue;
} else {
rea_satis = false;
break;
}
}
}
if (pre_satis && !rea_satis) {
item = item;
return pre_satis;
} else if (!pre_satis && rea_satis) {
item = item;
return rea_satis;
} else if (pre_satis && rea_satis) {
return pre_satis && rea_satis;
} else {
return false;
}
}
})
}
this.render_data = this.return_data;
}
//输入框筛选
inputFilter(filterData) {
//输入框筛选
inputFilter(filterData) {
if (this.SEARCH) {
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
@@ -194,14 +135,14 @@ selectChange() {
})
}
}
this.terminalAreas = filterData;
this.row_state = this.terminalAreas.length > 0 ? this.terminalAreas[0] : { renderFlight: {} };
}
this.render_data = filterData;
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
}
positionArray: Array<any> = [];
positionArrayIndex: number = 0;
//输入框定位
inputPosition(filterData) {
positionArray: Array<any> = [];
positionArrayIndex: number = 0;
//输入框定位
inputPosition(filterData) {
let transArray = []
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
@@ -258,5 +199,8 @@ selectChange() {
} else {
alert('没有搜索到相关数据');
}
let tr = $(".selected");
let objTr = tr[0];
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
}
}
@@ -5,6 +5,8 @@
<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>
</select>
<label class="radio-inline custom-radio nowrap mr-4">
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
@@ -19,7 +21,7 @@
<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" (click)="clearFiter()">刷新</button>
<!-- <button type="button" class="btn btn-info mr-3">刷新</button> -->
</div>
</div>
</div>
@@ -36,7 +38,8 @@
</tr>
</thead>
<tbody>
<tr *ngFor="let terminal of terminals;let i = index">
<tr *ngFor="let terminal of render_data;let i = index" (click)="selectRow(terminal)"
[ngClass]="{'selected':row_state===terminal}">
<td>{{i+1}}</td>
<td>{{terminal.terminalCode}}</td>
<td>{{terminal.terminalName}}</td>
@@ -20,9 +20,15 @@ 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.basicDataService.terminal_subject.subscribe(
@@ -42,160 +48,95 @@ ngOnInit() {
tableCont.addEventListener('scroll',scrollHandle);
}
//刷新
clearFiter(){
$("#inputerInfo").val(""); //清空过滤或查找定位文本框
this.ngOnInit();
/**
* 选中某行
* @param i
*/
selectRow(i) {
this.row_state = i;
}
//输入框回车事件
inputEnter() {
if (this.FLT_POS === 1) {
this.selectChange()
this.inputFilter(this.terminals)
} else {
this.selectChange()
this.inputPosition(this.render_data)
this.inputFilter(this.terminals)
this.inputPosition(this.terminals)
}
}
//下拉框选择筛选
selectChange() {
let filter_data = [];
let filterterminals = this.render_data;
this.render_data.forEach(item => {
filter_data.push(Object.assign({}, item));
})
if (this.FLT_POS === 1) {
this.inputFilter(filter_data);
} else {
this.terminals = filter_data;
this.row_state = this.terminals.length > 0 ? this.terminals[0] : { renderFlight: {} };
}
//下拉框筛选
filter_data = filter_data.filter(item => {
if (item) {
let is_satis = true;
for (const key in filterterminals) {
if (filterterminals.hasOwnProperty(key) && filterterminals[key]) {
if (item[key] === filterterminals[key]) {
is_satis = true;
continue;
} else {
is_satis = false;
break;
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;
} else if (item) {
let is_satis = true;
for (const key in filterterminals) {
if (filterterminals.hasOwnProperty(key) && filterterminals[key]) {
if (item[key] === filterterminals[key]) {
is_satis = true;
continue;
} else {
is_satis = false;
break;
}
}
}
return is_satis;
} else {
let pre_satis = true;
let rea_satis = true;
for (const key in filterterminals) {
if (filterterminals.hasOwnProperty(key) && filterterminals[key]) {
if (item[key] === filterterminals[key]) {
pre_satis = true;
continue;
} else {
pre_satis = false;
break;
}
}
}
for (const key in filterterminals) {
if (filterterminals.hasOwnProperty(key) && filterterminals[key]) {
if (item[key] === filterterminals[key]) {
rea_satis = true;
continue;
} else {
rea_satis = false;
break;
}
}
}
if (pre_satis && !rea_satis) {
item = item;
return pre_satis;
} else if (!pre_satis && rea_satis) {
item = item;
return rea_satis;
} else if (pre_satis && rea_satis) {
return pre_satis && rea_satis;
} else {
return false;
}
}
})
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 => {
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'))) {
is_satis = true;
break;
} else {
is_satis = false;
continue;
}
} else {
if (this.SEARCH) {
is_satis = false;
continue;
} else {
is_satis = true;
break;
}
if (this.SEARCH) {
if (this.SEL_COL) {
let sel_col = this.SEL_COL;
filterData = filterData.filter(item => {
if (item[sel_col]) {
if (item[sel_col].toString().match(new RegExp(this.SEARCH, 'i'))) {
return true;
}
} else {
continue;
if (this.SEARCH) {
return false;
} else {
return true;
}
}
}
return is_satis;
})
})
} 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'))) {
is_satis = true;
break;
} else {
is_satis = false;
continue;
}
} else {
if (this.SEARCH) {
is_satis = false;
continue;
} else {
is_satis = true;
break;
}
}
} else {
continue;
}
}
return is_satis;
})
}
}
}
this.terminals = filterData;
this.row_state = this.terminals.length > 0 ? this.terminals[0] : { renderFlight: {} };
this.render_data = filterData;
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
}
positionArray: Array<any> = [];
@@ -258,5 +199,8 @@ inputPosition(filterData) {
} else {
alert('没有搜索到相关数据');
}
}
let tr = $(".selected");
let objTr = tr[0];
$("#table-container").animate({ scrollTop: objTr.offsetTop - 42 }, "slow");
}
}