添加航班tab栏
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<div class="tab-container">
|
||||
<div class="mb-4 fieldset-card">
|
||||
<fieldset>
|
||||
<legend>共享航班代码</legend>
|
||||
<div>
|
||||
<p>共享航班号:{{lines['renderFlight'].CSFT}}</p>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="mb-4 fieldset-card">
|
||||
<fieldset>
|
||||
<legend>经停机场</legend>
|
||||
<div>
|
||||
<p *ngFor="let airport of airports"><label>{{airport.airport}}</label>(到达 {{airport.scat?airport.scat:'__ : __'}} | 出发 {{airport.scdt?airport.scdt:'__ : __'}})</p>
|
||||
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="mb-4 fieldset-card">
|
||||
<fieldset>
|
||||
<legend>资源使用安排</legend>
|
||||
<div>
|
||||
<p><label>登机门:</label>{{lines['renderFlight'].GATE}}</p>
|
||||
<p><label>停机位:</label>{{lines['renderFlight'].STND}}</p>
|
||||
<p><label>值机柜台:</label>{{lines['renderFlight'].CHKC}}</p>
|
||||
<p><label>行李转盘:</label>{{lines['renderFlight'].BELT}}</p>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div class="mb-4 fieldset-card">
|
||||
<fieldset>
|
||||
<legend>航班状态记录</legend>
|
||||
<p>{{lines['renderFlight'].FTSS}}</p>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,22 @@
|
||||
.tab-container {
|
||||
padding: 10px 10px;
|
||||
height: 635px;
|
||||
overflow: auto;
|
||||
border: 1px solid #ccc;
|
||||
.fieldset-card {
|
||||
fieldset {
|
||||
padding: 5px 10px 20px 10px;
|
||||
border: 1px solid #ccc;
|
||||
legend {
|
||||
width: auto;
|
||||
padding: 0 5px;
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
p{
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { RelatedTabComponent } from './related-tab.component';
|
||||
|
||||
describe('RelatedTabComponent', () => {
|
||||
let component: RelatedTabComponent;
|
||||
let fixture: ComponentFixture<RelatedTabComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ RelatedTabComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(RelatedTabComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,41 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import timeFormatter from '../../../utils/time-formatter';
|
||||
|
||||
@Component({
|
||||
selector: 'app-related-tab',
|
||||
templateUrl: './related-tab.component.html',
|
||||
styleUrls: ['./related-tab.component.scss']
|
||||
})
|
||||
export class RelatedTabComponent implements OnInit {
|
||||
public lines;
|
||||
public airports;
|
||||
@Input() set flight(flight) {
|
||||
this.lines = Object.assign({}, flight);
|
||||
if (this.lines.preFlight && !this.lines.reaFlight) {
|
||||
this.airports = this.lines.renderFlight.ERUT.split(' - ');
|
||||
for (let i = 0; i < this.airports.length; i++) {
|
||||
this.airports[i] = { airport: this.airports[i], scdt: timeFormatter(this.lines.preFlight.ERUT[i].SCDT), scat: timeFormatter(this.lines.preFlight.ERUT[i].SCAT) }
|
||||
}
|
||||
} else if (!this.lines.preFlight && this.lines.reaFlight) {
|
||||
this.airports = this.lines.renderFlight.ERUT.split(' - ');
|
||||
for (let i = 0; i < this.airports.length; i++) {
|
||||
this.airports[i] = { airport: this.airports[i], scdt: timeFormatter(this.lines.reaFlight.ERUT[i].SCDT), scat: timeFormatter(this.lines.reaFlight.ERUT[i].SCAT) }
|
||||
}
|
||||
} else {
|
||||
this.lines.preFlight.ERUT[this.lines.preFlight.ERUT.length - 1]['SCDT'] = this.lines.reaFlight.ERUT[0]['SCDT'];
|
||||
let concatArray = this.lines.reaFlight.ERUT.slice(1);
|
||||
let linkAirport = this.lines.preFlight.ERUT.concat(concatArray)
|
||||
this.airports = this.lines.renderFlight.ERUT.split(' - ');
|
||||
for (let i = 0; i < this.airports.length; i++) {
|
||||
this.airports[i] = { airport: this.airports[i], scdt: timeFormatter(linkAirport[i].SCDT), scat: timeFormatter(linkAirport[i].SCAT) }
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user