历史数据刷新

This commit is contained in:
zhouyuejun
2018-12-24 18:32:32 +08:00
parent 9815df7b0f
commit bcda5908e7
5 changed files with 96 additions and 24 deletions
@@ -1,4 +1,4 @@
import { Component, OnInit,ViewChild,Renderer2 } from '@angular/core';
import { Component, OnInit, ViewChild, Renderer2 } from '@angular/core';
import { ChangeDetectorRef } from '@angular/core';
import { ToastService } from '../../components/toast/toast.service';
@@ -116,7 +116,7 @@ export class HistoricalDataComponent implements OnInit {
}
)
//获取航班动态信息
this.httpCilent.post('/adminapi/hitFlightData/list',{ hstFLightTime: '2018-11-22' }).subscribe(
this.httpCilent.post('/adminapi/hitFlightData/list').subscribe(
data => {
this.raw_data = data.body;
@@ -225,8 +225,53 @@ export class HistoricalDataComponent implements OnInit {
* 刷新
*/
refresh() {
const toastCfg = new ToastConfig(ToastType.SUCCESS, '', '刷新成功!', 3000);
this.toastService.toast(toastCfg);
this.operateSpinServiceService.showSpin();
this.SEARCH = ''; //手动输入条件
this.FLT_POS = 1; //过滤还是定位
this.SEL_COL = ''; //选择列名
this.filterItems = {
ALCD: '', //航空公司
FLIN: '', //航线类别
FLTY: '', //航班类别
MVIN: '', //到达/出发
FHAG: '', //机坪代理
MHAG: '', //维护代理
PHAG: '', //旅客代理
}
/* 获取用户设置 */
this.httpCilent.get('/adminapi/settings/uisettings').subscribe(
data => {
data.body.forEach(element => {
if (element.groupCode === 'userSettingCol') {
this.col_lists = JSON.parse(element.settingContent).allCols;
this.render_col_lists = JSON.parse(element.settingContent).targetList;
}
})
}
)
//获取航班动态信息
this.httpCilent.post('/adminapi/hitFlightData/list').subscribe(
data => {
this.raw_data = data.body;
//查找链接航班并将其组合成一条数据
this.combined_data = [];
let combined_linked_data = this.dataHandle.findLinkFlights(this.raw_data);
combined_linked_data.forEach(element => {
let flights_item = this.dataHandle.flightsRenderTransfer(element, this.col_lists);
this.combined_data.push(flights_item);
});
let combined_data = []
this.combined_data.forEach(item => {
combined_data.push(this.dataHandle.basicDataTransHandle(item, this.airports, this.citys, this.airlines, this.flightStatus, this.flightTypes));
})
this.combined_data = combined_data;
this.doSequence(this.combined_data);
const toastCfg = new ToastConfig(ToastType.SUCCESS, '', '刷新成功!', 3000);
this.toastService.toast(toastCfg);
}
)
}
+8 -8
View File
@@ -142,21 +142,21 @@
[ngClass]="{'selected':row_state['renderFlight']['FLNO']===airline_row['renderFlight']['FLNO']}">
<td>{{i+1}}</td>
<td>
<img class="mr-2" *ngIf="getVipNotes(airline_row)" src="/adminweb/assets/images/important-notes/vip.png"
<img class="mr-2" *ngIf="getVipNotes(airline_row)" src="/assets/images/important-notes/vip.png"
alt="">
<img class="mr-2" *ngIf="getOutplanNotes(airline_row)" src="/adminweb/assets/images/important-notes/out_plan.png"
<img class="mr-2" *ngIf="getOutplanNotes(airline_row)" src="/assets/images/important-notes/out_plan.png"
alt="">
<img class="mr-2" *ngIf="getAlternateNotes(airline_row)" src="/adminweb/assets/images/important-notes/alternate.png"
<img class="mr-2" *ngIf="getAlternateNotes(airline_row)" src="/assets/images/important-notes/alternate.png"
alt="">
<img class="mr-2" *ngIf="getDelay30Notes(airline_row)" src="/adminweb/assets/images/important-notes/delay_30.png"
<img class="mr-2" *ngIf="getDelay30Notes(airline_row)" src="/assets/images/important-notes/delay_30.png"
alt="">
<img class="mr-2" *ngIf="getDelayNotes(airline_row)" src="/adminweb/assets/images/important-notes/delay.png"
<img class="mr-2" *ngIf="getDelayNotes(airline_row)" src="/assets/images/important-notes/delay.png"
alt="">
<img class="mr-2" *ngIf="getReturnNotes(airline_row)" src="/adminweb/assets/images/important-notes/return.png"
<img class="mr-2" *ngIf="getReturnNotes(airline_row)" src="/assets/images/important-notes/return.png"
alt="">
<img class="mr-2" *ngIf="getCancleNotes(airline_row)" src="/adminweb/assets/images/important-notes/cancle.png"
<img class="mr-2" *ngIf="getCancleNotes(airline_row)" src="/assets/images/important-notes/cancle.png"
alt="">
<img class="mr-2" *ngIf="getStopoverNotes(airline_row)" src="/adminweb/assets/images/important-notes/stopover.png"
<img class="mr-2" *ngIf="getStopoverNotes(airline_row)" src="/assets/images/important-notes/stopover.png"
alt="">
</td>
<td>{{airline_row['renderFlight']['FLID']}}</td>
+12 -4
View File
@@ -43,6 +43,7 @@ export class MainComponent implements OnInit {
).subscribe(
(event: NavigationEnd) => {
if (event.urlAfterRedirects === '/app/main') {
// this.operateSpinServiceService.showSpin();
this.httpCilent.get('/adminapi/settings/uisettings').subscribe(
data => {
data.body.forEach(element => {
@@ -56,6 +57,7 @@ export class MainComponent implements OnInit {
}
});
this.changeDetectorRef.detectChanges();
// this.operateSpinServiceService.hideSpin();
}
)
}
@@ -123,6 +125,7 @@ export class MainComponent implements OnInit {
let data = JSON.parse(event as string);
if (data.topic === 'schd') {
let message = JSON.parse(data.message);
console.log(message);
//是否可以开始处理动态消息
if (this.canHandleDynamicMessage) {
this.dynamicMessageHandle(message);
@@ -131,6 +134,7 @@ export class MainComponent implements OnInit {
}
} else if (data.topic === 'msg') {
let message = JSON.parse(data.message);
console.log(message);
if (this.canHandleDynamicAlert) {
this.dynamicAlertHandle(message);
} else {
@@ -828,13 +832,17 @@ export class MainComponent implements OnInit {
if (this.orderHandle.isArriFlight(flight)) {
return false;
} else {
if (flight['reaFlight']['DELY'] && Array.isArray(flight['reaFlight']['DELY']) && flight['reaFlight']['DELY'].length > 0) {
if (parseInt(flight['preFlight']['DELY'][0]['DURA']) - 30 > 0) {
return true;
try {
if (flight['reaFlight']['DELY'] && Array.isArray(flight['reaFlight']['DELY']) && flight['reaFlight']['DELY'].length > 0) {
if (parseInt(flight['preFlight']['DELY'][0]['DURA']) - 30 > 0) {
return true;
} else {
return false;
}
} else {
return false;
}
} else {
} catch (error) {
return false;
}
}
+21 -2
View File
@@ -205,8 +205,17 @@ export class PagesComponent implements OnInit {
}
ngOnInit() {
this.user_name = JSON.parse(sessionStorage.getItem('userInfo')).login_name;
this.role_type = JSON.parse(sessionStorage.getItem('userInfo')).real_name;
if (sessionStorage.getItem('userInfo')) {
this.user_name = JSON.parse(sessionStorage.getItem('userInfo')).login_name;
this.role_type = JSON.parse(sessionStorage.getItem('userInfo')).real_name;
} else {
let cookieMsg = ['SESSION', 'token']
cookieMsg.forEach(element => {
this.delCookie(element)
})
this.router.navigate(['/login']);
}
let activeRoute = this.router.url;
this.selectActiveMenu(this.menuData, activeRoute);
@@ -246,6 +255,10 @@ export class PagesComponent implements OnInit {
confirmLogout() {
this.httpClient.post('/logout').subscribe(
data => {
let sessionStorageMsg = ['userInfo']
sessionStorageMsg.forEach(element => {
sessionStorage.removeItem(element)
})
const toastCfg = new ToastConfig(ToastType.SUCCESS, '', '退出系统成功!', 3000);
this.toastService.toast(toastCfg);
this.router.navigate(['/login']);
@@ -253,4 +266,10 @@ export class PagesComponent implements OnInit {
)
}
public delCookie($name) {
let myDate = new Date();
myDate.setTime(-1000);
document.cookie = $name + "=''; expires=" + myDate.toUTCString();
}
}
+6 -6
View File
@@ -36,7 +36,7 @@
}
}
.spin-container {
/* .spin-container {
position: fixed;
top: 0;
left: 0;
@@ -86,18 +86,18 @@
border: 4px solid transparent;
border-top-color: #e7ba08;
animation: spin 1.5s linear infinite
}
} */
</style>
</head>
<body>
<div class="spin-container" id="pageSpin">
<!-- <div class="spin-container" id="pageSpin">
<div class="spin1">
<div class="spin2"></div>
<div class="spin3"></div>
</div>
</div>
<script type="text/javascript">
</div> -->
<!-- <script type="text/javascript">
const initialize = function () {
let pageSpin = document.getElementById("pageSpin");
pageSpin.style.display = 'block';
@@ -108,7 +108,7 @@
}
}
initialize();
</script>
</script> -->
<app-root></app-root>
</body>