合并分支develop-1

This commit is contained in:
zhouyuejun
2018-11-07 16:51:00 +08:00
4 changed files with 2303 additions and 2139 deletions
+20 -8
View File
@@ -43,24 +43,18 @@
<option value=""></option>
</select>
</div>
<div class="input-container mr-4">
<!-- <div class="input-container mr-4">
<label for="">航班任务:&nbsp;&nbsp;</label>
<select class="form-control" name="" id="">
<option value=""></option>
</select>
</div>
</div> -->
<div class="input-container mr-4">
<label for="">到达/出发:</label>
<select class="form-control" name="" id="">
<option value=""></option>
</select>
</div>
<div class="input-container mr-4">
<label for="">航班代理:&nbsp;&nbsp;</label>
<select class="form-control" name="" id="">
<option value=""></option>
</select>
</div>
<div class="input-container mr-4">
<label for="">运营状态:&nbsp;&nbsp;</label>
<select class="form-control" name="" id="">
@@ -79,6 +73,24 @@
<option value=""></option>
</select>
</div>
<div class="input-container mr-4">
<label for="">机坪代理:&nbsp;&nbsp;</label>
<select class="form-control" name="" id="">
<option value=""></option>
</select>
</div>
<div class="input-container mr-4">
<label for="">旅客代理:&nbsp;&nbsp;</label>
<select class="form-control" name="" id="">
<option value=""></option>
</select>
</div>
<div class="input-container mr-4">
<label for="">维护代理:&nbsp;&nbsp;</label>
<select class="form-control" name="" id="">
<option value=""></option>
</select>
</div>
</div>
<div class="third-condition row">
+281 -119
View File
@@ -18,28 +18,60 @@ export class MainComponent implements OnInit {
public airline_color: Array<object> = [];
public row_state: number;
public TOP_1 = 100000000000; // 0-1
public TOP_2 = 200000000000; // 0-2
public TOP_3 = 300000000000; // 1
public TOP_4 = 400000000000; // 2
public TOP_5 = 500000000000; // 3
public TOP_6 = 600000000000; // 4-1-1
public TOP_7 = 700000000000; // 4-1-2
public TOP_8 = 800000000000; // 4-2-1-1
public TOP_9 = 900000000000; // 4-2-1-2
public TOP_10 = 1000000000000; // 4-2-2-1
public TOP_11 = 1100000000000; // 4-2-2-2
public TOP_12 = 1200000000000; // 5-1
public TOP_13 = 1300000000000; // 5-2
public TOP_14 = 1400000000000; // 6-1-1
public TOP_15 = 10000000000000; // 6-1-2
public TOP_16 = 20000000000000; // 6-2
public TOP_1 = 1000000000000;
public TOP_2 = 2000000000000;
public TOP_3 = 3000000000000;
public TOP_4 = 4000000000000;
public TOP_5 = 5000000000000;
public TOP_6 = 6000000000000;
public TOP_7 = 7000000000000;
public TOP_8 = 8000000000000;
public TOP_9 = 9000000000000;
public TOP_10 = 10000000000000;
public TOP_11 = 11000000000000;
public TOP_12 = 12000000000000;
public TOP_13 = 13000000000000;
public TOP_14 = 14000000000000;
public LEVEL_1 = 100000000000000;
public LEVEL_2 = 200000000000000;
public LEVEL_3 = 300000000000000;
public LEVEL_4 = 400000000000000;
public LEVEL_5 = 500000000000000;
public LEVEL_6 = 600000000000000;
public LEVEL_7 = 700000000000000;
public LEVEL_8 = 800000000000000;
public LEVEL_9 = 900000000000000;
public LEVEL_10 = 1000000000000000;
public LEVEL_11 = 1100000000000000;
public LEVEL_12 = 1200000000000000;
public LEVEL_13 = 1300000000000000;
public LEVEL_14 = 1400000000000000;
filterItems = {
SEARCH:'',
ALCD:'',
FLIN:'',
FLTY:'',
}
constructor(
private httpCilent: HttpClientService
) { }
selectRow($event, i) {
this.row_state = i;
}
getColor(col_CODE) {
if (col_CODE === 'SODT') {
return 'skyblue'
} else {
return null
}
}
ngOnInit() {
/* 获取显示列 */
@@ -56,7 +88,7 @@ export class MainComponent implements OnInit {
data => {
//解析数据
data.forEach(element => {
let air_message = JSON.parse(element.value)
let air_message = JSON.parse(element.value);
this.airline_row_lists.push(air_message);
});
@@ -64,7 +96,7 @@ export class MainComponent implements OnInit {
for (let i = 0; i < this.airline_row_lists.length; i++) {
if (this.airline_row_lists[i]['MVIN'] === 'D') {
if (this.airline_row_lists[i]['TAID']) {
let index = this.airline_row_lists.findIndex(val => { return val['FLID'] === this.airline_row_lists[i]['TAID'] })
let index = this.airline_row_lists.findIndex(val => { return val['FLID'] === this.airline_row_lists[i]['TAID'] });
if (index > -1) {
this.airline_row_lists[i]['isLinked'] = true;
this.airline_row_lists[i]['linkFlight'] = this.airline_row_lists[index];
@@ -75,6 +107,26 @@ export class MainComponent implements OnInit {
}
}
//排序
this.airline_row_lists.forEach(element => {
element['order'] = this.sequence(element)
element['ORDER'] = '+' + element['order']
})
this.airline_row_lists.sort(function (a, b) {
return (a['order'] - b['order']);
})
}
)
}
/**
* 行排序规则方法
* @param flight
* @return
*/
/** (0)000000+实际时间(到达航班有实际时间,且未超过1小时)
(0-1)无链接航班,取实际(到达)时间
(0-2)有链接航班,且出发航班未有实际时间,取实际(到达)时间
@@ -102,94 +154,122 @@ export class MainComponent implements OnInit {
(6-2)有链接航班,取实际(出发)时间
*/
//排序
this.airline_row_lists.forEach(element => {
if (element['ACTT']) {
if (this.isArriFlight(element)) {
if (!this.isOneHourLater(element['ACTT'])) {
element['ORDER'] = 'TOP_1' //到港航班(无链接)有实际时间,且未超过一小时
element['order'] = new Date(dateFormatter(element['ACTT'])).getTime() + this.TOP_1
public sequence(flight) {
let dateTag: number = 10;
let dateToCompare = new Date().getTime();
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDelayed(flight)) {
if (this.isLinked(flight)) {
if (this.getActualDatetime(flight['linkFlight']) && !this.getActualDatetime(flight)) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['linkFlight']))).getTime();
dateTag = this.TOP_1;
}
else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight))).getTime();
dateTag = this.TOP_2;
}
}
else {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight))).getTime();
dateTag = this.TOP_3;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight))).getTime();
dateTag = this.TOP_4;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isFlying(flight)) {
if (this.isArriFlight(flight)) {
if (this.getEstimatedDatetime(flight)) {
dateToCompare = new Date(dateFormatter(this.getEstimatedDatetime(flight))).getTime();
} else {
element['ORDER'] = 'TOP_14' //到港航班(无链接)有实际时间,但超过一小时
element['order'] = new Date(dateFormatter(element['ACTT'])).getTime() + this.TOP_14
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight))).getTime();
}
} else if (this.isDeptFlight(element)) {
element['ORDER'] = 'TOP_15' //出发航班(无链接)有实际时间
element['order'] = new Date(dateFormatter(element['ACTT'])).getTime() + this.TOP_15
} else if (this.isLinked(element)) {
element['ORDER'] = 'TOP_16' //链接航班有实际出发时间
element['order'] = new Date(dateFormatter(element['ACTT'])).getTime() + this.TOP_16
}
} else if (this.isLinked(flight)) {
if (this.getEstimatedDatetime(flight['linkFlight'])) {
dateToCompare = new Date(dateFormatter(this.getEstimatedDatetime(flight['linkFlight']))).getTime();
} else {
// if (element['SDSJ'] && !this.isBoading()) {
// element['ORDER'] = 'TOP_3'
// element['order'] = new Date(dateFormatter(element['SDSJ'])).getTime() + this.TOP_3
// }
// else if (this.isBoading() && !this.isOverBoading()){
// element['ORDER'] = 'TOP_4'
// element['order'] = new Date(dateFormatter(element['DJKS'])).getTime() + this.TOP_4
// }else if(this.isOverBoading()){
// element['ORDER'] = 'TOP_5'
// element['order'] = new Date(dateFormatter(element['DJJS'])).getTime() + this.TOP_5
// }else if(this.isCancled()){
// if(element['ESTT']){
// element['ORDER'] = 'TOP_12'
// element['order'] = new Date(dateFormatter(element['ESTT'])).getTime() + this.TOP_12
// }else{
// element['ORDER'] = 'TOP_13'
// element['order'] = new Date(dateFormatter(element['SODT'])).getTime() + this.TOP_13
// }
// }
// else
if(this.isArriFlight(element)||this.isDeptFlight(element)){
if(element['ESTT']){
element['ORDER'] = 'TOP_6' //航班(无链接)无实际时间,取预计时间
element['order'] = new Date(dateFormatter(element['ESTT'])).getTime() + this.TOP_6
}else{
element['ORDER'] = 'TOP_7' //航班(无链接)无实际时间和预计时间,取计划时间
element['order'] = new Date(dateFormatter(element['SODT'])).getTime() + this.TOP_7
}
}else if(this.isLinked(element)){
if(element['linkFlight']['ACTT']){
element['ORDER'] = 'TOP_2' //链接航班有实际到达时间,无出发时间
element['order'] = new Date(dateFormatter(element['linkFlight']['ACTT'])).getTime() + this.TOP_2
}else if(!element['linkFlight']['ACTT']){
if(element['linkFlight']['ESTT']){
element['ORDER'] = 'TOP_8' //链接航班无实际到达时间,取预计到达时间
element['order'] = new Date(dateFormatter(element['linkFlight']['ESTT'])).getTime() + this.TOP_8
}else{
element['ORDER'] = 'TOP_9' //链接航班无实际到达时间和预计到达时间,取计划到达时间
element['order'] = new Date(dateFormatter(element['linkFlight']['SODT'])).getTime() + this.TOP_9
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight['linkFlight']))).getTime();
}
}
// else if()
dateTag = this.TOP_5;
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && !this.isDone(flight) && this.isLinked(flight) && this.getActualDatetime(flight['linkFlight']) && !this.getActualDatetime(flight)) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight['linkFlight']))).getTime();
dateTag = this.TOP_6;
return dateToCompare + dateTag;
}
})
this.airline_row_lists.sort(function (a, b) {
return (a['order'] - b['order']);
})
if (!this.isCancled(flight) && !this.isDone(flight) && this.isDeptFlight(flight) && !this.startBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight))).getTime();
dateTag = this.TOP_7;
return dateToCompare + dateTag;
}
)
if (!this.isCancled(flight) && this.isArriFlight(flight) && this.isDone(flight)) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight))).getTime();
dateTag = this.TOP_8;
return dateToCompare + dateTag;
}
selectRow($event, i) {
this.row_state = i;
if (!this.isCancled(flight) && !this.isDone(flight) && this.isOverBoading(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight))).getTime();
dateTag = this.TOP_9;
return dateToCompare + dateTag;
}
getColor(col_CODE) {
if (col_CODE === 'SODT') {
return 'skyblue'
} else {
return null
if (!this.isCancled(flight) && !this.isDone(flight) && !this.isFlying(flight)) {
if (this.isLinked(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight))).getTime();
dateTag = this.TOP_10;
} else if (this.isArriFlight(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight))).getTime();
dateTag = this.TOP_11;
}
return dateToCompare + dateTag;
}
if (!this.isCancled(flight) && this.isDone(flight) && (this.isLinked(flight) || this.isDeptFlight(flight))) {
dateToCompare = new Date(dateFormatter(this.getActualDatetime(flight))).getTime();
dateTag = this.TOP_12;
return dateToCompare + dateTag;
}
if (this.isCancled(flight)) {
dateToCompare = new Date(dateFormatter(this.getScheduledDatetime(flight))).getTime();
dateTag = this.TOP_13;
return dateToCompare + dateTag;
}
return this.TOP_14
}
/**
* 获取航班实际时间
* @param flight
* @return
*/
public getActualDatetime(flight) {
return flight['ACTT'];
}
/**
* 获取航班预计时间
* @param flight
* @return
*/
public getEstimatedDatetime(flight) {
return flight['ESTT']
}
/**
* 获取航班计划时间
* @param flight
* @return
*/
public getScheduledDatetime(flight) {
return flight['SODT']
}
/**
* 判断航班是否是链接航班
* @param flight
* @return
*/
public isLinked(flight) {
@@ -202,6 +282,7 @@ export class MainComponent implements OnInit {
/**
* 判断航班是否是纯离港航班
* @param flight
* @return
*/
public isDeptFlight(flight) {
@@ -215,6 +296,7 @@ export class MainComponent implements OnInit {
/**
* 判断航班是否是纯到港航班
* @param flight
* @return
*/
public isArriFlight(flight) {
@@ -225,17 +307,82 @@ export class MainComponent implements OnInit {
}
}
/**
* 判断航班是否已经前站起飞
* @param flight
* @return
*/
public isFlying(flight) {
if (this.isArriFlight(flight)) {
if (flight['PADT']) {
return true
} else {
return false
}
} else if (this.isLinked(flight)) {
if (flight['linkFlight']['PADT']) {
return true
} else {
return false
}
} else {
return false;
}
}
/**
* 判断航班是否取消
* @param flight
* @return
*/
public isCancled(flight) {
if (this.isArriFlight(flight) || this.isDeptFlight(flight)) {
if (flight['CNCL']) {
return true
} else {
return false
}
} else {
return false
}
}
/**
* 判断航班是否延误(只针对纯离港航班或链接航班中的离港航班)
* @param flight
* @return
*/
public isDelayed(flight) {
if (this.isDeptFlight(flight) || this.isLinked(flight)) {
if (flight['DELY']) {
return true
} else {
return false
}
} else {
return false;
}
}
/**
* 判断航班是否已经执行完成
* @param flight
* @return
*/
public isDone(flight) {
if (this.isArriFlight(flight) && flight.ACTT) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!this.getActualDatetime(flight)) {
return false;
} else {
return true;
} else if (this.isDeptFlight(flight) && flight.ACTT) {
return true;
} else if (this.isLinked(flight) && flight.Actt) {
}
} else if (this.isArriFlight(flight)) {
if (!this.getActualDatetime(flight)) {
return false;
} else {
return true;
}
} else {
return false;
}
@@ -243,39 +390,54 @@ export class MainComponent implements OnInit {
/**
* 判断航班是否开始登机
* @param flight
* @return
*/
public isBoading() {
public startBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['BOTM']) {
return false;
} else {
return true;
}
} else {
return false;
}
}
/**
* 判断航班是否正在登机中
* @param flight
* @return
*/
public isBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (flight['BOTM'] && !flight['GCTM']) {
return true;
} else {
return false;
}
} else {
return false;
}
}
/**
* 判断航班是否登机结束
* @param flight
* @return
*/
public isOverBoading() {
return true;
}
/**
* 判断航班是否取消
* @return
*/
public isCancled() {
return true;
}
/**
* 判断实际时间是否已超过一小时
* @return
*
*/
public isOneHourLater(dateString) {
let nowTimeStamp = new Date().getTime()
let actTimeStamp = new Date(dateFormatter(dateString)).getTime()
if (nowTimeStamp - actTimeStamp > 3600000) {
return true
public isOverBoading(flight) {
if (this.isLinked(flight) || this.isDeptFlight(flight)) {
if (!flight['GCTM']) {
return false;
} else {
return false
return true;
}
} else {
return false;
}
}
@@ -39,16 +39,6 @@
"COL_CN":"计划到达/出发",
"COL_ORDER":"13"
},
{
"COL_CODE":"TAOP",
"COL_CN":"联合承运人",
"COL_ORDER":"2"
},
{
"COL_CODE":"TAFL",
"COL_CN":"链接航班号",
"COL_ORDER":"11"
},
{
"COL_CODE":"ESTT",
"COL_CN":"预计到达/出发",
File diff suppressed because it is too large Load Diff