机位类型数据转换处理

This commit is contained in:
714943302@qq.com
2018-11-30 15:41:17 +08:00
parent 60e73de896
commit 9d945d6328
2 changed files with 69 additions and 7 deletions
@@ -42,12 +42,13 @@
<div class="input-container mr-4"> <div class="input-container mr-4">
<label for="standType">机位类型:&nbsp;&nbsp;</label> <label for="standType">机位类型:&nbsp;&nbsp;</label>
<select class="form-control" [(ngModel)]="filterItems.standType" (ngModelChange)="selectChange()" id="jtype"> <select class="form-control" [(ngModel)]="filterItems.standType" (ngModelChange)="selectChange()" id="jtype">
<option value=""></option> <option value=""></option>
<option *ngFor="let items of stands" [value]="items.standType">{{items.standType}}</option> <option value="bridge">靠桥机位</option>
<!-- <option value="YJW">远机位</option> <option value="remote">远机位</option>
<option value="JJW">近机位</option> <option value="near">近机位</option>
<option value="GWJW">过夜机位</option> <option value="night">过夜机位</option>
<option value="ZJW">专机位</option> --> <option value="specific">专机位</option>
<!-- <option *ngFor="let items of stands" [value]="items.standType">{{items.standType}}</option> -->
</select> </select>
</div> </div>
<div class="input-container mr-4"> <div class="input-container mr-4">
@@ -41,6 +41,28 @@ ngOnInit() {
if(this.terminalAreas && this.terminalAreas.length>0){//所属航站楼区域数据转换处理 if(this.terminalAreas && this.terminalAreas.length>0){//所属航站楼区域数据转换处理
this.terminalAreasHandle(); this.terminalAreasHandle();
} }
this.render_data.forEach(element => {//机位类型列表显示数据转换
if (element['standType'] == 'bridge') {
element['standType'] = '靠桥机位'
return element['standType'];
}
if(element['standType'] == 'remote'){
element['standType'] = '远机位'
return element['standType'];
}
if(element['standType'] == 'near'){
element['standType'] = '近机位'
return element['standType'];
}
if(element['standType'] == 'night'){
element['standType'] = '过夜机位'
return element['standType'];
}
if(element['standType'] == 'specific'){
element['standType'] = '专机位'
return element['standType'];
}
});
this.render_data.forEach(element => {//资源状态列表显示数据转换 this.render_data.forEach(element => {//资源状态列表显示数据转换
if (element['standStatus'] == '0') { if (element['standStatus'] == '0') {
element['standStatus'] = '可用' element['standStatus'] = '可用'
@@ -113,6 +135,7 @@ selectRow(i) {
selectChange() { selectChange() {
this.return_data = this.stands.filter(item=>{ this.return_data = this.stands.filter(item=>{
let is_satis = true; let is_satis = true;
//资源状态
if (item['standStatus'] == '可用') { if (item['standStatus'] == '可用') {
item['standStatus'] = '0' item['standStatus'] = '0'
} }
@@ -128,6 +151,22 @@ selectChange() {
if(item['standStatus'] == '预分'){ if(item['standStatus'] == '预分'){
item['standStatus'] = '4' item['standStatus'] = '4'
} }
//机位类型
if (item['standType'] == '靠桥机位') {
item['standType'] = 'bridge'
}
if(item['standType'] == '远机位'){
item['standType'] = 'remote'
}
if(item['standType'] == '近机位'){
item['standType'] = 'near'
}
if(item['standType'] == '过夜机位'){
item['standType'] = 'night'
}
if(item['standType'] == '专机位'){
item['standType'] = 'specific'
}
for (const key in this.filterItems) { for (const key in this.filterItems) {
if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) { if (this.filterItems.hasOwnProperty(key) && this.filterItems[key]) {
if (item[key] === +this.filterItems[key] || item[key] === this.filterItems[key]) { if (item[key] === +this.filterItems[key] || item[key] === this.filterItems[key]) {
@@ -141,7 +180,29 @@ selectChange() {
} }
return is_satis; return is_satis;
}) })
this.return_data.forEach(element => {//资源状态列表显示数据转换 this.return_data.forEach(element => { //机位类型列表显示数据转换
if (element['standType'] == 'bridge') {
element['standType'] = '靠桥机位'
return element['standType'];
}
if(element['standType'] == 'remote'){
element['standType'] = '远机位'
return element['standType'];
}
if(element['standType'] == 'near'){
element['standType'] = '近机位'
return element['standType'];
}
if(element['standType'] == 'night'){
element['standType'] = '过夜机位'
return element['standType'];
}
if(element['standType'] == 'specific'){
element['standType'] = '专机位'
return element['standType'];
}
});
this.return_data.forEach(element => { //资源状态列表显示数据转换
if (element['standStatus'] == '0') { if (element['standStatus'] == '0') {
element['standStatus'] = '可用' element['standStatus'] = '可用'
return element['standStatus']; return element['standStatus'];