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