登机门-航站楼区域数据显示处理

This commit is contained in:
714943302@qq.com
2018-11-28 09:16:49 +08:00
parent 1b6ad5c703
commit 22affb26b4
2 changed files with 16 additions and 5 deletions
@@ -7,7 +7,7 @@
<option value="">选择列名</option> <option value="">选择列名</option>
<option value="gateCode">登机门代码</option> <option value="gateCode">登机门代码</option>
<option value="gateName">登机门名称</option> <option value="gateName">登机门名称</option>
<option value="terminalAreaCode">航站楼区域</option> <option value="terminalAreaName">航站楼区域</option>
<option value="gateStatus">资源状态</option> <option value="gateStatus">资源状态</option>
<!-- <option *ngFor="let items of gates" [value]="items.titleInfo">{{items.titleInfo}}</option> --> <!-- <option *ngFor="let items of gates" [value]="items.titleInfo">{{items.titleInfo}}</option> -->
</select> </select>
@@ -24,7 +24,7 @@
<div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1"> <div class="line-operator-right mb-3 col-xlg-4 col-mlg-4 col-xl-4 col-lg-1">
<!-- <button type="button" class="btn btn-info mr-3">登机门编辑</button> <!-- <button type="button" class="btn btn-info mr-3">登机门编辑</button>
<button type="button" class="btn btn-info mr-3">打印</button> --> <button type="button" class="btn btn-info mr-3">打印</button> -->
<button type="button" class="btn btn-info mr-3">刷新</button> <!-- <button type="button" class="btn btn-info mr-3">刷新</button> -->
</div> </div>
</div> </div>
@@ -33,7 +33,7 @@
<label for="terminalAreaCode">所属航站楼区域:&nbsp;&nbsp;</label> <label for="terminalAreaCode">所属航站楼区域:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.terminalAreaCode" (ngModelChange)="selectChange()" id="qy"> <select class="form-control" [(ngModel)]="filterItems.terminalAreaCode" (ngModelChange)="selectChange()" id="qy">
<option value=""></option> <option value=""></option>
<option *ngFor="let items of terminalAreas" [value]="items.terminalAreaName">{{items.terminalAreaName}}</option> <option *ngFor="let items of terminalAreas" [value]="items.terminalAreaCode">{{items.terminalAreaName}}</option>
</select> </select>
</div> </div>
<div class="input-container mr-4"> <div class="input-container mr-4">
@@ -50,7 +50,7 @@
<div id="table-container" class="table-container"> <div id="table-container" class="table-container">
<table id="table" class="table table-bordered table-striped"> <table id="table" class="table table-bordered table-striped">
<thead> <thead>
<tr id="titleInfo"> <tr>
<th>序号</th> <th>序号</th>
<th>登机门代码</th> <th>登机门代码</th>
<th>登机门名称</th> <th>登机门名称</th>
@@ -65,7 +65,7 @@
<td>{{i+1}}</td> <td>{{i+1}}</td>
<td>{{gate.gateCode}}</td> <td>{{gate.gateCode}}</td>
<td>{{gate.gateName}}</td> <td>{{gate.gateName}}</td>
<td>{{gate.terminalAreaCode}}</td> <td>{{gate.terminalAreaName}}</td>
<td>{{gate.gateStatus}}</td> <td>{{gate.gateStatus}}</td>
<!-- <td *ngFor="let airline_col of gate_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> --> <!-- <td *ngFor="let airline_col of gate_lists" [ngStyle]="{'background-color':getColor(airline_col.COL_CODE)}">{{airline_row['renderFlight'][airline_col.COL_CODE]}}</td> -->
</tr> </tr>
@@ -36,6 +36,9 @@ ngOnInit() {
data=>{ data=>{
this.gates = data; this.gates = data;
this.render_data = this.gates; this.render_data = this.gates;
if(this.terminalAreas && this.terminalAreas.length > 0){//所属航站楼区域数据显示处理
this.terminalAreasHandle();
}
} }
) )
//所属航站楼区域 //所属航站楼区域
@@ -56,6 +59,14 @@ ngOnInit() {
tableCont.addEventListener('scroll',scrollHandle); tableCont.addEventListener('scroll',scrollHandle);
} }
//所属航站楼区域数据转换处理
terminalAreasHandle() {
this.render_data.forEach(item => {
let terminalAreasLinkIndex = this.terminalAreas.findIndex(val => val.terminalAreaCode === item['terminalAreaCode']);
item['terminalAreaName'] = this.terminalAreas[terminalAreasLinkIndex].terminalAreaName;
})
}
/** /**
* 选中某行 * 选中某行
* @param i * @param i