添加刷新及显示航班ID方便测试
This commit is contained in:
@@ -133,6 +133,7 @@
|
||||
<tr>
|
||||
<th>序号</th>
|
||||
<th>重要提示</th>
|
||||
<th>航班ID</th>
|
||||
<th *ngFor="let airline_col of render_col_lists">{{airline_col.COL_CN}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -158,6 +159,7 @@
|
||||
<img class="mr-2" *ngIf="getStopoverNotes(airline_row)" src="/adminweb/assets/images/important-notes/stopover.png"
|
||||
alt="">
|
||||
</td>
|
||||
<td>{{airline_row['renderFlight']['FLID']}}</td>
|
||||
<td *ngFor="let airline_col of render_col_lists" [ngClass]="getPosition(airline_col.COL_CODE,airline_row)"
|
||||
[ngStyle]="getColor(airline_col.COL_CODE,airline_row)">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td>
|
||||
</tr>
|
||||
|
||||
@@ -307,7 +307,7 @@ export class MainComponent implements OnInit {
|
||||
let index = this.airline_message_alert.findIndex(val => val['COL_CODE'] === alertType);
|
||||
if (index > -1) {
|
||||
let alertText = this.alertMessage[alertType]();
|
||||
const toastCfg = new ToastConfig(ToastType.SUCCESS, '', alertText, 10000);
|
||||
const toastCfg = new ToastConfig(ToastType.SUCCESS, '', alertText, 600000);
|
||||
this.toastService.toast(toastCfg);
|
||||
}
|
||||
}
|
||||
@@ -354,8 +354,65 @@ export class MainComponent implements OnInit {
|
||||
* 刷新
|
||||
*/
|
||||
refresh() {
|
||||
const toastCfg = new ToastConfig(ToastType.SUCCESS, '', '刷新成功!', 3000);
|
||||
this.toastService.toast(toastCfg);
|
||||
this.operateSpinServiceService.showSpin();
|
||||
this.canHandleDynamicMessage = false;
|
||||
this.canHandleDynamicAlert = false;
|
||||
this.SEARCH = ''; //手动输入条件
|
||||
this.LASTSEARCH = '';
|
||||
this.FLT_POS = 1; //过滤还是定位
|
||||
this.SEL_COL = ''; //选择列名
|
||||
this.LAST_SEL_COL = '';
|
||||
this.filterItems = {
|
||||
ALCD: '', //航空公司
|
||||
FLIN: '', //航线类别
|
||||
FLTY: '', //航班类别
|
||||
MVIN: '', //到达/出发
|
||||
FTSS: '', //运营状态
|
||||
TRML: '', //航站楼
|
||||
Abnormal_state: '', //异常状态
|
||||
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;
|
||||
} else if (element.groupCode === 'userSettingColor') {
|
||||
this.airline_color = JSON.parse(element.settingContent);
|
||||
} else if (element.groupCode === 'userSettingMsgAlert') {
|
||||
this.airline_message_alert = JSON.parse(element.settingContent).targetList;
|
||||
}
|
||||
});
|
||||
}
|
||||
)
|
||||
//获取航班动态信息
|
||||
this.httpCilent.get('/msgexchangeapi/all/flights').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);
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -109,16 +109,12 @@ export class HttpClientService {
|
||||
* @param observable
|
||||
*/
|
||||
commonProcess(observable: Observable<any>): Observable<any> {
|
||||
// this.spinService.spin(true);
|
||||
return Observable.create((observer) => {
|
||||
observable.subscribe(res => {
|
||||
// this.spinService.spin(false);
|
||||
observer.next(res);
|
||||
}, (err) => {
|
||||
// this.spinService.spin(false);
|
||||
observer.error(err);
|
||||
}, () => {
|
||||
// this.spinService.spin(false);
|
||||
observer.complete();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -81,18 +81,23 @@ export class FlightsDataHandle {
|
||||
flights_item = Object.assign({}, item)
|
||||
|
||||
if (flights_item['preFlight'] && !flights_item['reaFlight']) {
|
||||
render_flight['FLID'] = flights_item['preFlight']['FLID']
|
||||
for (let i = 0; i < col_lists.length; i++) {
|
||||
let key = col_lists[i]['COL_CODE'];
|
||||
render_flight[key] = this.formatter.hasOwnProperty(key) ? this.formatter[key](flights_item['preFlight']) : flights_item['preFlight'][key];
|
||||
}
|
||||
flights_item['renderFlight'] = render_flight;
|
||||
} else if (!flights_item['preFlight'] && flights_item['reaFlight']) {
|
||||
render_flight['FLID'] = flights_item['reaFlight']['FLID']
|
||||
for (let i = 0; i < col_lists.length; i++) {
|
||||
let key = col_lists[i]['COL_CODE']
|
||||
render_flight[key] = this.formatter.hasOwnProperty(key) ? this.formatter[key](flights_item['reaFlight']) : flights_item['reaFlight'][key];
|
||||
}
|
||||
flights_item['renderFlight'] = render_flight;
|
||||
} else {
|
||||
render_flight['FLID'] = flights_item['preFlight']['FLID'] + ' / ' + flights_item['reaFlight']['FLID'];
|
||||
render_pre_flight['FLID'] = flights_item['preFlight']['FLID'];
|
||||
render_rea_flight['FLID'] = flights_item['reaFlight']['FLID'];
|
||||
for (let i = 0; i < col_lists.length; i++) {
|
||||
let preHasValue, reaHasValue;
|
||||
let key = col_lists[i]['COL_CODE'];
|
||||
|
||||
Reference in New Issue
Block a user