季度计划检测机制优化
This commit is contained in:
@@ -56,7 +56,7 @@ export class MainComponent implements OnInit {
|
||||
this.airline_message_alert = JSON.parse(element.settingContent).targetList;
|
||||
}
|
||||
});
|
||||
this.changeDetectorRef.detectChanges();
|
||||
// this.changeDetectorRef.detectChanges();
|
||||
// this.operateSpinServiceService.hideSpin();
|
||||
}
|
||||
)
|
||||
@@ -584,6 +584,7 @@ export class MainComponent implements OnInit {
|
||||
this.render_data = filter_data;
|
||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : { renderFlight: {} };
|
||||
this.changeDetectorRef.detectChanges();
|
||||
this.operateSpinServiceService.hideSpin();
|
||||
}
|
||||
}, 10)
|
||||
}
|
||||
|
||||
@@ -1,39 +1,39 @@
|
||||
<div class="main-page" #mainPage>
|
||||
<div class="page-content">
|
||||
<div class="search-filter mb-3" #searchFilter>
|
||||
<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" [(ngModel)]="SEL_COL" name="" id="">
|
||||
<div class="page-content">
|
||||
<div class="search-filter mb-3" #searchFilter>
|
||||
<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" [(ngModel)]="SEL_COL" name="" id="">
|
||||
<option value="">选择列名</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">
|
||||
</select>
|
||||
<label class="radio-inline custom-radio nowrap mr-4">
|
||||
<input type="radio" [(ngModel)]="FLT_POS" [value]="1" name="filter-position">
|
||||
<span>过滤</span>
|
||||
</label>
|
||||
<label class="radio-inline custom-radio nowrap mr-4">
|
||||
<input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position">
|
||||
<input type="radio" [(ngModel)]="FLT_POS" [value]="2" name="filter-position">
|
||||
<span>查找定位</span>
|
||||
</label>
|
||||
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter) = "inputEnter()">
|
||||
</div>
|
||||
<div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-2">
|
||||
<input class="form-control" [(ngModel)]="SEARCH" type="text" (keyup.enter)="inputEnter()">
|
||||
</div>
|
||||
<div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-2">
|
||||
<button type="button" class="btn btn-info mr-2" (click)="toggleFilter()">{{filterClose?'展开':'关闭'}}</button>
|
||||
<button type="button" class="btn btn-info mr-2" (click)="refresh()">刷新</button>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="btn btn-info mr-2" (click)="refresh()">刷新</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="second-condition mb-3 row" [ngClass]="{'filterClose-c':filterClose,'filterClose-o':!filterClose}">
|
||||
<div class="second-condition mb-3 row" [ngClass]="{'filterClose-c':filterClose,'filterClose-o':!filterClose}">
|
||||
<div class="input-container mr-4">
|
||||
<label for="airlineId">航空公司: </label>
|
||||
<select class="form-control" [(ngModel)]="filterItems.airlineId" (ngModelChange)="selectChange()">
|
||||
<select class="form-control" [(ngModel)]="filterItems.airlineId" (ngModelChange)="selectChange()">
|
||||
<option value=""></option>
|
||||
<option *ngFor="let item of airlines" [value]="item.airlineId">{{item.airlineName}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-container mr-4">
|
||||
<label for="routeType">航线类别: </label>
|
||||
<select class="form-control" [(ngModel)]="filterItems.routeType" (ngModelChange)="selectChange()">
|
||||
<select class="form-control" [(ngModel)]="filterItems.routeType" (ngModelChange)="selectChange()">
|
||||
<option value=""></option>
|
||||
<option value="D">国内</option>
|
||||
<option value="I">国际</option>
|
||||
@@ -43,25 +43,31 @@
|
||||
</div>
|
||||
<div class="input-container mr-4">
|
||||
<label for="flightTypeCode">航班类别: </label>
|
||||
<select class="form-control" [(ngModel)]="filterItems.flightTypeCode" (ngModelChange)="selectChange()" >
|
||||
<select class="form-control" [(ngModel)]="filterItems.flightTypeCode" (ngModelChange)="selectChange()">
|
||||
<option value=""></option>
|
||||
<option *ngFor="let item of flightTypes" [value]="item.flightTypeCode">{{item.flightTypeNameCn}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="input-container mr-4">
|
||||
<!-- <div class="input-container mr-4">
|
||||
<label for="startDate">查询年份: </label>
|
||||
<input readonly type="text" id="startDate" class="form-control" style="background:transparent;cursor: pointer">
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="input-container mr-4">
|
||||
<label for="arriOrDept">到达/出发: </label>
|
||||
<select class="form-control" [(ngModel)]="filterItems.arriOrDept" (ngModelChange)="selectChange()">
|
||||
<select class="form-control" [(ngModel)]="filterItems.arriOrDept" (ngModelChange)="selectChange()">
|
||||
<option value=""></option>
|
||||
<option value="A">到达</option>
|
||||
<option value="D">出发</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="third-condition row" [ngClass]="{'filterClose-c':filterClose,'filterClose-o':!filterClose}">
|
||||
<div class="input-container mr-4">
|
||||
<label for="arriOrDept">查询年份: </label>
|
||||
<select class="form-control" [(ngModel)]="filterYear" (ngModelChange)="selectYearChange($event)">
|
||||
<option *ngFor="let year of yearLists" [value]="year">{{year}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="third-condition row" [ngClass]="{'filterClose-c':filterClose,'filterClose-o':!filterClose}">
|
||||
<label class="radio-inline custom-checkbox nowrap mr-4">
|
||||
<input type="checkbox" [(ngModel)]="checkboxGroup.related" (ngModelChange)="checkboxChange()">
|
||||
<span>航班关联信息</span>
|
||||
@@ -70,58 +76,57 @@
|
||||
<input type="checkbox" [(ngModel)]="checkboxGroup.detail" (ngModelChange)="checkboxChange()">
|
||||
<span>详细信息</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="airline-table">
|
||||
<div class="airline-table">
|
||||
<div #tableContainer id="table-container" class="table-container" [ngClass]="{'table-c': !tabClose,'table-o': tabClose}">
|
||||
<table id="table" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>序号</th>
|
||||
<th>航班号</th>
|
||||
<th>航班季度</th>
|
||||
<th>国际代码</th>
|
||||
<th>航空公司</th>
|
||||
<th>航线类别</th>
|
||||
<th>航班类别</th>
|
||||
<!-- <th>航班任务</th> -->
|
||||
<th>运营日</th>
|
||||
<th>开始日期</th>
|
||||
<th>结束日期</th>
|
||||
<th>航线</th>
|
||||
<th>进/出港</th>
|
||||
<th>到达时间</th>
|
||||
<th>出发时间</th>
|
||||
<th>机型</th>
|
||||
<th>飞行距离(千米)</th>
|
||||
<th>飞行时间(分钟)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let seasonal of render_data;let i = index" (click)="selectRow(seasonal)"
|
||||
[ngClass]="{'selected':row_state===seasonal}">
|
||||
<td>{{i+1}}</td>
|
||||
<td>{{seasonal.flightNumber}}</td>
|
||||
<td>{{seasonal.seasonRecId}}</td>
|
||||
<td>{{seasonal.internationalCode}}</td>
|
||||
<td>{{seasonal.airlineChnName}}</td>
|
||||
<td>{{seasonal.routeType}}</td>
|
||||
<td>{{seasonal.flightTypeNameCn}}</td>
|
||||
<!-- <td>{{seasonal.flightTask}}</td> -->
|
||||
<td>{{seasonal.operationDays}}</td>
|
||||
<td>{{seasonal.startDate}}</td>
|
||||
<td>{{seasonal.endDate}}</td>
|
||||
<td>{{seasonal.startAirport}}</td>
|
||||
<td>{{seasonal.arriOrDept}}</td>
|
||||
<td>{{seasonal.arrivalTime}}</td>
|
||||
<td>{{seasonal.departureTime}}</td>
|
||||
<td>{{seasonal.aircraftTypeName}}</td>
|
||||
<td>{{seasonal.flyingDistance}}</td>
|
||||
<td>{{seasonal.flyingTime}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table id="table" class="table table-bordered table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>序号</th>
|
||||
<th>航班号</th>
|
||||
<th>航班季度</th>
|
||||
<th>国际代码</th>
|
||||
<th>航空公司</th>
|
||||
<th>航线类别</th>
|
||||
<th>航班类别</th>
|
||||
<!-- <th>航班任务</th> -->
|
||||
<th>运营日</th>
|
||||
<th>开始日期</th>
|
||||
<th>结束日期</th>
|
||||
<th>航线</th>
|
||||
<th>进/出港</th>
|
||||
<th>到达时间</th>
|
||||
<th>出发时间</th>
|
||||
<th>机型</th>
|
||||
<th>飞行距离(千米)</th>
|
||||
<th>飞行时间(分钟)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let seasonal of render_data;let i = index" (click)="selectRow(seasonal)" [ngClass]="{'selected':row_state.seasonflightId===seasonal.seasonflightId}">
|
||||
<td>{{i+1}}{{seasonal.seasonflightId}}</td>
|
||||
<td>{{seasonal.flightNumber}}</td>
|
||||
<td>{{seasonal.seasonRecIdChn}}</td>
|
||||
<td>{{seasonal.internationalCode}}</td>
|
||||
<td>{{seasonal.airlineChnName}}</td>
|
||||
<td>{{seasonal.routeTypeChn}}</td>
|
||||
<td>{{seasonal.flightTypeChnName}}</td>
|
||||
<!-- <td>{{seasonal.flightTask}}</td> -->
|
||||
<td>{{seasonal.operationDays}}</td>
|
||||
<td>{{seasonal.startDate}}</td>
|
||||
<td>{{seasonal.endDate}}</td>
|
||||
<td>{{seasonal.AirportChn}}</td>
|
||||
<td>{{seasonal.arriOrDeptChn}}</td>
|
||||
<td>{{seasonal.arrivalTimeTra}}</td>
|
||||
<td>{{seasonal.departureTimeTra}}</td>
|
||||
<td>{{seasonal.aircraftTypeName}}</td>
|
||||
<td>{{seasonal.flyingDistance}}</td>
|
||||
<td>{{seasonal.flyingTime}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="airline-message" [ngClass]="{'tab-c': tabClose,'tab-o': !tabClose}">
|
||||
<nz-tabset [nzTabPosition]="'top'" [nzType]="'card'" [nzShowPagination]="false">
|
||||
@@ -133,6 +138,6 @@
|
||||
</nz-tab>
|
||||
</nz-tabset>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,16 +1,21 @@
|
||||
import { Component, OnInit ,ViewChild,Renderer2 } from '@angular/core';
|
||||
import { Component, OnInit, ViewChild, Renderer2, ChangeDetectorRef } from '@angular/core';
|
||||
|
||||
import { OperateSpinServiceService } from '../../services/operate-spin-service.service';
|
||||
import { HttpClientService } from '../../services/http-client.service';
|
||||
import { BasicDataService } from '../../services/basic-data-service';
|
||||
import { ChangeDetectorRef } from '@angular/core';
|
||||
|
||||
import { ToastService } from '../../components/toast/toast.service';
|
||||
import { ToastConfig, ToastType } from '../../components/toast/toast-model';
|
||||
|
||||
import * as $ from 'jquery';
|
||||
import { format } from 'util';
|
||||
|
||||
declare var laydate: any;
|
||||
|
||||
@Component({
|
||||
selector: 'app-seasonal-plan',
|
||||
templateUrl: './seasonal-plan.component.html',
|
||||
styleUrls: ['./seasonal-plan.component.scss']
|
||||
selector: 'app-seasonal-plan',
|
||||
templateUrl: './seasonal-plan.component.html',
|
||||
styleUrls: ['./seasonal-plan.component.scss']
|
||||
})
|
||||
export class SeasonalPlanComponent implements OnInit {
|
||||
|
||||
@@ -18,9 +23,13 @@ export class SeasonalPlanComponent implements OnInit {
|
||||
private renderer2: Renderer2,
|
||||
private httpCilent: HttpClientService,
|
||||
private basicDataService: BasicDataService,
|
||||
private operateSpinServiceService: OperateSpinServiceService,
|
||||
private toastService: ToastService,
|
||||
private changeDetectorRef: ChangeDetectorRef
|
||||
) { }
|
||||
) {
|
||||
this.operateSpinServiceService.showSpin();
|
||||
this.changeDetectorRef.detach();
|
||||
}
|
||||
|
||||
//勾选复选框
|
||||
public checkboxGroup = {
|
||||
@@ -31,19 +40,19 @@ export class SeasonalPlanComponent implements OnInit {
|
||||
//选择列名
|
||||
public col_lists = [
|
||||
{ col_code: 'flightNumber', col_chn: '航班号' },
|
||||
{ col_code: 'seasonRecId', col_chn: '航班季度' },
|
||||
{ col_code: 'seasonRecIdChn', col_chn: '航班季度' },
|
||||
{ col_code: 'internationalCode', col_chn: '国际代码' },
|
||||
{ col_code: 'airlineChnName', col_chn: '航空公司' },
|
||||
{ col_code: 'routeType', col_chn: '航线类别' },
|
||||
{ col_code: 'flightTypeNameCn', col_chn: '航班类别' },
|
||||
{ col_code: 'routeTypeChn', col_chn: '航线类别' },
|
||||
{ col_code: 'flightTypeChnName', col_chn: '航班类别' },
|
||||
/* { col_code: 'flightTask', col_chn: '航班任务' }, */
|
||||
{ col_code: 'operationDays', col_chn: '运营日' },
|
||||
{ col_code: 'startDate', col_chn: '开始日期' },
|
||||
{ col_code: 'endDate', col_chn: '结束日期' },
|
||||
{ col_code: 'startAirport', col_chn: '航线' },
|
||||
{ col_code: 'arriOrDept', col_chn: '进/出港' },
|
||||
{ col_code: 'arrivalTime', col_chn: '到达时间' },
|
||||
{ col_code: 'departureTime', col_chn: '出发时间' },
|
||||
{ col_code: 'AirportChn', col_chn: '航线' },
|
||||
{ col_code: 'arriOrDeptChn', col_chn: '进/出港' },
|
||||
{ col_code: 'arrivalTimeTra', col_chn: '到达时间' },
|
||||
{ col_code: 'departureTimeTra', col_chn: '出发时间' },
|
||||
{ col_code: 'aircraftTypeName', col_chn: '机型' },
|
||||
{ col_code: 'flyingDistance', col_chn: '飞行距离(千米)' },
|
||||
{ col_code: 'flyingTime', col_chn: '飞行时间(分钟)' },
|
||||
@@ -63,208 +72,168 @@ export class SeasonalPlanComponent implements OnInit {
|
||||
}
|
||||
public tabClose: boolean = true;
|
||||
|
||||
seasonals : Array<any>;
|
||||
airlines : Array<any>; //航空公司
|
||||
aircraftTypes : Array<any>; //机型
|
||||
flightTypes : Array<any>; //航班类别
|
||||
public row_state: any = { renderFlight: {} };
|
||||
yearLists: Array<any>;
|
||||
filterYear: string = '';
|
||||
yearOldValue: string = '';
|
||||
|
||||
seasonals: Array<any>; //季度计划
|
||||
airlines: Array<any>; //航空公司
|
||||
aircraftTypes: Array<any>; //机型
|
||||
flightTypes: Array<any>; //航班类别
|
||||
|
||||
public row_state: any = {};
|
||||
public combined_data: Array<object> = []; //组合数据,经过转换后的
|
||||
public render_data: Array<object> = []; //显示数据,即需要显示的数据
|
||||
public return_data: Array<object> = []; //下拉框显示数据
|
||||
|
||||
@ViewChild('mainPage') mainPage;
|
||||
@ViewChild('searchFilter') searchFilter;
|
||||
@ViewChild('tableContainer') tableContainer;
|
||||
|
||||
ngOnInit() {
|
||||
//选择年份
|
||||
this.laydateYear();
|
||||
this.renderer2.setStyle(this.tableContainer.nativeElement, 'height', this.mainPage.nativeElement.offsetHeight - this.searchFilter.nativeElement.offsetHeight - 55 + 'px');
|
||||
window.onresize = function () {
|
||||
this.renderer2.setStyle(this.tableContainer.nativeElement, 'height', this.mainPage.nativeElement.offsetHeight - this.searchFilter.nativeElement.offsetHeight - 55 + 'px');
|
||||
}.bind(this)
|
||||
/* 获取季度计划信息 */
|
||||
var value = new Date(new Date().getTime());
|
||||
var subValue = format(value).substring(11,15); //时间截取到年份
|
||||
this.httpCilent.get('/adminapi/schedule/flightSchdSeasons',{startDate: subValue}).subscribe(
|
||||
data => {
|
||||
this.seasonals = data.body;
|
||||
this.render_data = this.seasonals;
|
||||
this.airlinesHandle(); //航空公司
|
||||
this.aircraftTypesHandle(); //机型
|
||||
this.flightTypesHandle(); //航班类别
|
||||
this.render_data.forEach(element => {//航线类别列表显示数据转换
|
||||
if (element['routeType'] == 'D') {
|
||||
element['routeType'] = '国内'
|
||||
return element['routeType'];
|
||||
|
||||
|
||||
this.httpCilent.get('/adminapi/schedule/flightSchdSeason/years').toPromise().then(
|
||||
years => {
|
||||
this.yearLists = years.body;
|
||||
this.filterYear = this.yearLists[0];
|
||||
this.httpCilent.get('/adminapi/schedule/flightSchdSeasons', { startDate: this.yearLists[0] }).subscribe(
|
||||
data => {
|
||||
this.seasonals = data.body;
|
||||
// this.render_data = this.seasonals;
|
||||
|
||||
this.aircraftTypes = this.basicDataService.aircraft_type;
|
||||
this.flightTypes = this.basicDataService.flightTypes;
|
||||
this.airlines = this.basicDataService.airline;
|
||||
if (this.airlines && this.airlines.length > 0) {
|
||||
this.dataTransfer();
|
||||
} else {
|
||||
this.basicDataService.aircraft_type_subject.subscribe(
|
||||
data => {
|
||||
this.aircraftTypes = data;
|
||||
}
|
||||
);
|
||||
this.basicDataService.flightTypes_subject.subscribe(
|
||||
data => {
|
||||
this.flightTypes = data;
|
||||
}
|
||||
);
|
||||
this.basicDataService.airline_subject.subscribe(
|
||||
data => {
|
||||
this.airlines = data;
|
||||
this.dataTransfer();
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
if(element['routeType'] == 'I'){
|
||||
element['routeType'] = '国际'
|
||||
return element['routeType'];
|
||||
}
|
||||
if(element['routeType'] == 'M'){
|
||||
element['routeType'] = '混合'
|
||||
return element['routeType'];
|
||||
}
|
||||
if(element['routeType'] = 'R'){
|
||||
element['routeType'] = '地区'
|
||||
return element['routeType'];
|
||||
}
|
||||
});
|
||||
this.render_data.forEach(item => {//到达/出发列表显示数据转换
|
||||
if(item['arriOrDept'] == 'A'){
|
||||
item['arriOrDept'] = '到达'
|
||||
return item['arriOrDept']
|
||||
}
|
||||
if(item['arriOrDept'] == 'D'){
|
||||
item['arriOrDept'] = '出发'
|
||||
return item['arriOrDept']
|
||||
}
|
||||
});
|
||||
)
|
||||
}
|
||||
)
|
||||
//航空公司
|
||||
this.airlines = this.basicDataService.airline;
|
||||
this.basicDataService.airline_subject.subscribe(
|
||||
data=>{
|
||||
this.airlines = data;
|
||||
if(this.airlines && this.airlines.length > 0){//航空公司列表数据转换
|
||||
this.airlinesHandle();
|
||||
}
|
||||
}
|
||||
)
|
||||
//机型
|
||||
this.aircraftTypes = this.basicDataService.aircraft_type;
|
||||
this.basicDataService.aircraft_type_subject.subscribe(
|
||||
data => {
|
||||
this.aircraftTypes = data;
|
||||
if(this.aircraftTypes && this.aircraftTypes.length > 0){//机型列表数据转换
|
||||
this.aircraftTypesHandle();
|
||||
}
|
||||
}
|
||||
)
|
||||
//航班类别
|
||||
this.flightTypes = this.basicDataService.flightTypes;
|
||||
this.basicDataService.flightTypes_subject.subscribe(
|
||||
data=> {
|
||||
this.flightTypes = data;
|
||||
if(this.flightTypes && this.flightTypes.length > 0){//航班类别列表数据转换
|
||||
this.flightTypesHandle();
|
||||
}
|
||||
}
|
||||
)
|
||||
/**
|
||||
* 固定表头
|
||||
*/
|
||||
).catch(err => {
|
||||
alert('请求失败')
|
||||
})
|
||||
|
||||
var tableCont = document.querySelector('#table-container');
|
||||
function scrollHandle (){
|
||||
function scrollHandle() {
|
||||
var scrollTop = this.scrollTop;
|
||||
this.querySelector('thead').style.transform = 'translateY(' + scrollTop + 'px)';
|
||||
}
|
||||
tableCont.addEventListener('scroll',scrollHandle);
|
||||
tableCont.addEventListener('scroll', scrollHandle);
|
||||
}
|
||||
|
||||
//航空公司名称数据转换处理
|
||||
airlinesHandle() {
|
||||
this.render_data.forEach(item => {
|
||||
let airlineLinkIndex = this.airlines.findIndex(val => val.airlineId === item['airlineId']);
|
||||
if(this.airlines[airlineLinkIndex]){
|
||||
item['airlineChnName'] = this.airlines[airlineLinkIndex].airlineName;
|
||||
}
|
||||
})
|
||||
airlinesHandle(item) {
|
||||
let airlineLinkIndex = this.airlines.findIndex(val => val.airlineId === item['airlineId']);
|
||||
if (airlineLinkIndex > -1) {
|
||||
item['airlineChnName'] = this.airlines[airlineLinkIndex].airlineName;
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
//机型数据转换处理
|
||||
aircraftTypesHandle() {
|
||||
this.render_data.forEach(item => {
|
||||
let aircraftTypesLinkIndex = this.aircraftTypes.findIndex(val => val.aircraftTypeCode === item['aircraftTypeCode']);
|
||||
if(this.aircraftTypes[aircraftTypesLinkIndex]){
|
||||
item['aircraftTypeName'] = this.aircraftTypes[aircraftTypesLinkIndex].aircraftTypeName;
|
||||
}
|
||||
})
|
||||
aircraftTypesHandle(item) {
|
||||
let aircraftTypesLinkIndex = this.aircraftTypes.findIndex(val => val.aircraftTypeCode === item['aircraftTypeCode']);
|
||||
if (aircraftTypesLinkIndex > -1) {
|
||||
item['aircraftTypeName'] = this.aircraftTypes[aircraftTypesLinkIndex].aircraftTypeName;
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
//航班类别数据转换处理
|
||||
flightTypesHandle() {
|
||||
this.render_data.forEach(item => {
|
||||
let flightTypesLinkIndex = this.flightTypes.findIndex(val => val.flightTypeCode === item['flightTypeCode']);
|
||||
if(this.flightTypes[flightTypesLinkIndex]){
|
||||
item['flightTypeNameCn'] = this.flightTypes[flightTypesLinkIndex].flightTypeNameCn;
|
||||
}
|
||||
})
|
||||
flightTypesHandle(item) {
|
||||
let flightTypesLinkIndex = this.flightTypes.findIndex(val => val.flightTypeCode === item['flightTypeCode']);
|
||||
if (flightTypesLinkIndex > -1) {
|
||||
item['flightTypeChnName'] = this.flightTypes[flightTypesLinkIndex].flightTypeNameCn;
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
//选择年份
|
||||
laydateYear(){
|
||||
laydate.render({
|
||||
elem: '#startDate',
|
||||
showBottom: true,
|
||||
value: new Date(new Date().getTime()),
|
||||
type: 'year',
|
||||
// format: 'yyyy',
|
||||
done: (value) => {
|
||||
this.httpCilent.get('/adminapi/schedule/flightSchdSeasons', { startDate: value }).subscribe(
|
||||
data => {
|
||||
this.seasonals = data.body;
|
||||
this.render_data = this.seasonals;
|
||||
if(this.airlines && this.airlines.length > 0){//航空公司列表数据转换
|
||||
this.airlinesHandle();
|
||||
}
|
||||
if(this.aircraftTypes && this.aircraftTypes.length > 0){//机型列表数据转换
|
||||
this.aircraftTypesHandle();
|
||||
}
|
||||
if(this.flightTypes && this.flightTypes.length > 0){//航班类别列表数据转换
|
||||
this.flightTypesHandle();
|
||||
}
|
||||
this.render_data.forEach(element => {//航线类别列表显示数据转换
|
||||
if (element['routeType'] == 'D') {
|
||||
element['routeType'] = '国内'
|
||||
return element['routeType'];
|
||||
}
|
||||
if(element['routeType'] == 'I'){
|
||||
element['routeType'] = '国际'
|
||||
return element['routeType'];
|
||||
}
|
||||
if(element['routeType'] == 'M'){
|
||||
element['routeType'] = '混合'
|
||||
return element['routeType'];
|
||||
}
|
||||
if(element['routeType'] = 'R'){
|
||||
element['routeType'] = '地区'
|
||||
return element['routeType'];
|
||||
}
|
||||
});
|
||||
this.render_data.forEach(item => {//到达/出发列表显示数据转换
|
||||
if(item['arriOrDept'] == 'A'){
|
||||
item['arriOrDept'] = '到达'
|
||||
return item['arriOrDept']
|
||||
}
|
||||
if(item['arriOrDept'] == 'D'){
|
||||
item['arriOrDept'] = '出发'
|
||||
return item['arriOrDept']
|
||||
}
|
||||
});
|
||||
})
|
||||
//航空公司
|
||||
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;
|
||||
}
|
||||
)
|
||||
//航班类别
|
||||
this.flightTypes = this.basicDataService.flightTypes;
|
||||
this.basicDataService.flightTypes_subject.subscribe(
|
||||
data=> {
|
||||
this.flightTypes = data;
|
||||
}
|
||||
)
|
||||
//进/出港数据转换处理
|
||||
arriOrDeptHandle(item) {
|
||||
if (item['arriOrDept'] === 'A') {
|
||||
item['arriOrDeptChn'] = '到达'
|
||||
} else if (item['arriOrDept'] === 'D') {
|
||||
item['arriOrDeptChn'] = '出发'
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
//航线类别数据转换处理
|
||||
routeTypeHandle(item) {
|
||||
if (item['routeType'] === 'D') {
|
||||
item['routeTypeChn'] = '国内';
|
||||
} else if (item['routeType'] === 'I') {
|
||||
item['routeTypeChn'] = '国际';
|
||||
} else if (item['routeType'] === 'M') {
|
||||
item['routeTypeChn'] = '混合';
|
||||
} else if (item['routeType'] === 'R') {
|
||||
item['routeTypeChn'] = '地区';
|
||||
} else {
|
||||
item['routeTypeChn'] = '其他';
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
//数据转换统一处理
|
||||
dataTransfer() {
|
||||
this.seasonals.forEach(item => {
|
||||
let line = Object.assign({}, item);
|
||||
line = this.airlinesHandle(line);
|
||||
line = this.aircraftTypesHandle(line);
|
||||
line = this.flightTypesHandle(line);
|
||||
line = this.arriOrDeptHandle(line);
|
||||
line = this.routeTypeHandle(line);
|
||||
this.combined_data.push(line);
|
||||
})
|
||||
this.render_data = this.combined_data;
|
||||
this.changeDetectorRef.detectChanges();
|
||||
this.operateSpinServiceService.hideSpin();
|
||||
}
|
||||
|
||||
|
||||
selectYearChange($event) {
|
||||
this.operateSpinServiceService.showSpin();
|
||||
this.SEARCH = '';
|
||||
this.FLT_POS = 1;
|
||||
this.SEL_COL = '';
|
||||
|
||||
this.filterItems = {
|
||||
airlineId: '',
|
||||
routeType: '',
|
||||
flightTypeCode: '',
|
||||
arriOrDept: '',
|
||||
}
|
||||
this.httpCilent.get('/adminapi/schedule/flightSchdSeasons', { startDate: $event }).subscribe(
|
||||
data => {
|
||||
this.seasonals = data.body;
|
||||
this.combined_data = [];
|
||||
this.dataTransfer();
|
||||
}
|
||||
});
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
public filterClose: boolean = true;
|
||||
@@ -289,29 +258,30 @@ export class SeasonalPlanComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
}
|
||||
this.changeDetectorRef.detectChanges();
|
||||
}
|
||||
|
||||
/**
|
||||
* tab项切换事件
|
||||
*/
|
||||
nzClick() {
|
||||
|
||||
this.changeDetectorRef.detectChanges();
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新
|
||||
*/
|
||||
refresh() {
|
||||
const toastCfg = new ToastConfig(ToastType.SUCCESS, '', '刷新成功!', 3000);
|
||||
this.toastService.toast(toastCfg);
|
||||
this.selectYearChange(this.filterYear);
|
||||
}
|
||||
|
||||
/**
|
||||
* 选中某行
|
||||
* @param i
|
||||
* @param seasonal
|
||||
*/
|
||||
selectRow(i) {
|
||||
this.row_state = i;
|
||||
selectRow(seasonal) {
|
||||
this.row_state = seasonal;
|
||||
this.changeDetectorRef.detectChanges();
|
||||
}
|
||||
|
||||
//输入框回车事件
|
||||
@@ -325,75 +295,32 @@ export class SeasonalPlanComponent implements OnInit {
|
||||
|
||||
//下拉框选择筛选
|
||||
selectChange() {
|
||||
this.return_data = this.seasonals.filter(item=>{
|
||||
let is_satis = true;
|
||||
if(item['routeType'] == '国内'){
|
||||
item['routeType'] = 'D'
|
||||
}
|
||||
if(item['routeType'] == '国际'){
|
||||
item['routeType'] = 'I'
|
||||
}
|
||||
if(item['routeType'] == '混合'){
|
||||
item['routeType'] = 'M'
|
||||
}
|
||||
if(item['routeType'] == '地区'){
|
||||
item['routeType'] = 'R'
|
||||
}
|
||||
//到达/出发
|
||||
if(item['arriOrDept'] == '到达'){
|
||||
item['arriOrDept'] = 'A'
|
||||
}
|
||||
if(item['arriOrDept'] == '出发'){
|
||||
item['arriOrDept'] = 'D'
|
||||
}
|
||||
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;
|
||||
this.operateSpinServiceService.showSpin();
|
||||
setTimeout(() => {
|
||||
let filter_data = this.combined_data.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 = filter_data;
|
||||
if (this.FLT_POS === 1) {
|
||||
this.inputFilter(this.render_data);
|
||||
} else {
|
||||
this.row_state = this.render_data.length > 0 ? this.render_data[0] : {};
|
||||
this.changeDetectorRef.detectChanges();
|
||||
this.operateSpinServiceService.hideSpin();
|
||||
}
|
||||
return is_satis;
|
||||
})
|
||||
|
||||
this.return_data.forEach(element => {//航线类别列表显示数据转换
|
||||
if (element['routeType'] == 'D') {
|
||||
element['routeType'] = '国内'
|
||||
return element['routeType'];
|
||||
}
|
||||
if(element['routeType'] == 'I'){
|
||||
element['routeType'] = '国际'
|
||||
return element['routeType'];
|
||||
}
|
||||
if(element['routeType'] == 'M'){
|
||||
element['routeType'] = '混合'
|
||||
return element['routeType'];
|
||||
}
|
||||
if(element['routeType'] == 'R'){
|
||||
element['routeType'] = '地区'
|
||||
return element['routeType'];
|
||||
}
|
||||
});
|
||||
this.return_data.forEach(item => {//到达/出发列表显示数据转换
|
||||
if(item['arriOrDept'] == 'A'){
|
||||
item['arriOrDept'] = '到达'
|
||||
return item['arriOrDept']
|
||||
}
|
||||
if(item['arriOrDept'] == 'D'){
|
||||
item['arriOrDept'] = '出发'
|
||||
return item['arriOrDept']
|
||||
}
|
||||
});
|
||||
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: {} };
|
||||
}
|
||||
}, 10)
|
||||
}
|
||||
|
||||
//输入框筛选
|
||||
@@ -431,9 +358,11 @@ export class SeasonalPlanComponent implements OnInit {
|
||||
return is_satis;
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.render_data = filterData;
|
||||
}
|
||||
// this.render_data = filterData;
|
||||
this.changeDetectorRef.detectChanges();
|
||||
this.operateSpinServiceService.hideSpin();
|
||||
|
||||
}
|
||||
|
||||
positionArray: Array<any> = [];
|
||||
|
||||
Reference in New Issue
Block a user