From ca8511bcf028cc115583d76cacf970e41f616784 Mon Sep 17 00:00:00 2001 From: zhouyuejun <505127606@qq.com> Date: Thu, 17 Jan 2019 13:58:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=88=AA=E7=8F=AD=E8=AF=A6=E7=BB=86=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=8D=A1=E7=89=87=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/detail-tab/detail-tab.component.html | 52 ++++---- .../main/detail-tab/detail-tab.component.ts | 120 +++++++++++++++++- src/app/pages/main/main.component.ts | 6 +- .../related-tab/related-tab.component.html | 4 +- 4 files changed, 152 insertions(+), 30 deletions(-) diff --git a/src/app/pages/main/detail-tab/detail-tab.component.html b/src/app/pages/main/detail-tab/detail-tab.component.html index a307a76..64a4fb0 100644 --- a/src/app/pages/main/detail-tab/detail-tab.component.html +++ b/src/app/pages/main/detail-tab/detail-tab.component.html @@ -1,34 +1,38 @@ +
+ + +
描述类 -----------------------------------------
-

{{flight.renderFlight.FLNO}}

-

{{flight.renderFlight.ALCD}}

-

{{flight.renderFlight.FLIN}}

-

{{flight.renderFlight.FLTY}}

- -

{{flight.renderFlight.ERUT}}

-

{{flight.renderFlight.ACFT}}

-

{{flight.renderFlight.MVIN}}

-

{{flight.renderFlight.RENO}}

-

{{flight.renderFlight.FTSS}}

+

{{singleFlight.FLNO}}

+

{{singleFlight.ALCD}}

+

{{singleFlight.FLIN}}

+

{{singleFlight.FLTY}}

+ +

{{singleFlight.ERUT}}

+

{{singleFlight.ACFT}}

+

{{singleFlight.MVIN}}

+

{{singleFlight.RENO}}

+

{{singleFlight.FTSS}}

资源类 -----------------------------------------
-

{{flight.renderFlight.STND}}

-

{{flight.renderFlight.GATE}}

-

{{flight.renderFlight.CHKC}}

-

{{flight.renderFlight.CHUT}}

+

{{showPsst}}

+

{{singleFlight.GATE}}

+

{{singleFlight.CHKC}}

+

{{singleFlight.CHUT}}

时间类 -----------------------------------------
-

{{flight.renderFlight.SODT}}

-

{{flight.renderFlight.ESTT}}

-

{{flight.renderFlight.ACTT}}

-

{{flight.renderFlight.CHTM_ON}}

-

{{flight.renderFlight.CHTM_OFF}}

-

{{flight.renderFlight.COTM}}

-

{{flight.renderFlight.CCTM}}

-

{{flight.renderFlight.BOTM}}

-

{{flight.renderFlight.GCTM}}

+

{{singleFlight.SODT}}

+

{{singleFlight.ESTT}}

+

{{singleFlight.ACTT}}

+

{{singleFlight.CHTM_ON}}

+

{{singleFlight.CHTM_OFF}}

+

{{singleFlight.COTM}}

+

{{singleFlight.CCTM}}

+

{{singleFlight.BOTM}}

+

{{singleFlight.GCTM}}

-
\ No newline at end of file + diff --git a/src/app/pages/main/detail-tab/detail-tab.component.ts b/src/app/pages/main/detail-tab/detail-tab.component.ts index 0d070f8..cd8db99 100644 --- a/src/app/pages/main/detail-tab/detail-tab.component.ts +++ b/src/app/pages/main/detail-tab/detail-tab.component.ts @@ -6,10 +6,128 @@ import { Component, OnInit, Input } from '@angular/core'; styleUrls: ['./detail-tab.component.scss'] }) export class DetailTabComponent implements OnInit { - @Input() flight; + public lines: any; + public singleFlight: any; + public btnClickDisabled: boolean = true; + + public showPsst: string; + + @Input() set flight(flight) { + this.lines = Object.assign({}, flight); + + if (this.lines.preFlight && !this.lines.reaFlight) { + this.singleFlight = this.lines.renderFlight; + let psst = this.psstFormatter(this.lines.preFlight); + if (psst) { + this.showPsst = this.singleFlight.STND + '(' + psst + ')'; + } else { + this.showPsst = this.singleFlight.STND + } + this.btnClickDisabled = true; + } else if (!this.lines.preFlight && this.lines.reaFlight) { + this.singleFlight = this.lines.renderFlight; + let psst = this.psstFormatter(this.lines.reaFlight); + if (psst) { + this.showPsst = this.singleFlight.STND + '(' + psst + ')'; + } else { + this.showPsst = this.singleFlight.STND + } + this.btnClickDisabled = true; + } else { + this.singleFlight = this.lines.renderPreFlight; + let psst = this.psstFormatter(this.lines.preFlight); + if (psst) { + this.showPsst = this.singleFlight.STND + '(' + psst + ')'; + } else { + this.showPsst = this.singleFlight.STND + } + this.btnClickDisabled = false; + }; + }; constructor() { } ngOnInit() { } + showPreFlight() { + if (this.lines.preFlight && !this.lines.reaFlight) { + this.singleFlight = this.lines.renderFlight; + let psst = this.psstFormatter(this.lines.preFlight); + if (psst) { + this.showPsst = this.singleFlight.STND + '(' + psst + ')'; + } else { + this.showPsst = this.singleFlight.STND + } + this.btnClickDisabled = true; + } else if (!this.lines.preFlight && this.lines.reaFlight) { + this.singleFlight = this.lines.renderFlight; + let psst = this.psstFormatter(this.lines.reaFlight); + if (psst) { + this.showPsst = this.singleFlight.STND + '(' + psst + ')'; + } else { + this.showPsst = this.singleFlight.STND + } + this.btnClickDisabled = true; + } else { + this.singleFlight = this.lines.renderPreFlight; + let psst = this.psstFormatter(this.lines.preFlight); + if (psst) { + this.showPsst = this.singleFlight.STND + '(' + psst + ')'; + } else { + this.showPsst = this.singleFlight.STND + } + this.btnClickDisabled = false; + }; + } + showReaFlight() { + if (this.lines.preFlight && !this.lines.reaFlight) { + this.singleFlight = this.lines.renderFlight; + let psst = this.psstFormatter(this.lines.preFlight); + if (psst) { + this.showPsst = this.singleFlight.STND + '(' + psst + ')'; + } else { + this.showPsst = this.singleFlight.STND + } + this.btnClickDisabled = true; + } else if (!this.lines.preFlight && this.lines.reaFlight) { + this.singleFlight = this.lines.renderFlight; + let psst = this.psstFormatter(this.lines.reaFlight); + if (psst) { + this.showPsst = this.singleFlight.STND + '(' + psst + ')'; + } else { + this.showPsst = this.singleFlight.STND + } + this.btnClickDisabled = true; + } else { + this.singleFlight = this.lines.renderPreFlight; + let psst = this.psstFormatter(this.lines.preFlight); + if (psst) { + this.showPsst = this.singleFlight.STND + '(' + psst + ')'; + } else { + this.showPsst = this.singleFlight.STND + } + this.btnClickDisabled = false; + }; + } + + + psstFormatter(flight) { + if (flight['PSDT']) { + if (Array.isArray(flight['PSDT']) && flight['PSDT'].length > 0) { + let psst = []; + for (let i = 0; i < flight['PSDT'].length; i++) { + psst.push(flight['PSDT'][i]['PSST']); + } + let set = new Set(psst); + return Array.from(set).join(',') + } else if (Object.prototype.toString.call(flight['PSDT']) === '[object Object]') { + return flight['PSDT']['PSST']; + } else { + return ''; + } + } else { + return ''; + } + } + } diff --git a/src/app/pages/main/main.component.ts b/src/app/pages/main/main.component.ts index 1c9d2a8..78fa670 100644 --- a/src/app/pages/main/main.component.ts +++ b/src/app/pages/main/main.component.ts @@ -141,7 +141,7 @@ export class MainComponent implements OnInit { let data = JSON.parse(event as string); if (data.topic === 'schd') { let message = JSON.parse(data.message); - console.log(message); + // console.log(message); //是否可以开始处理动态消息 if (this.canHandleDynamicMessage) { this.dynamicMessageHandle(message); @@ -150,7 +150,7 @@ export class MainComponent implements OnInit { } } else if (data.topic === 'msg') { let message = JSON.parse(data.message); - console.log(message); + // console.log(message); if (this.canHandleDynamicAlert) { this.dynamicAlertHandle(message); } else { @@ -449,7 +449,7 @@ export class MainComponent implements OnInit { /** * 创建线程并执行 */ - public promise: Worker = new Worker('/assets/web-worker-handle.js'); + public promise: Worker = new Worker('/adminweb/assets/web-worker-handle.js'); creatWorkers() { let dynamicData = { raw_data: this.raw_data, diff --git a/src/app/pages/main/related-tab/related-tab.component.html b/src/app/pages/main/related-tab/related-tab.component.html index 25bc545..aff22d8 100644 --- a/src/app/pages/main/related-tab/related-tab.component.html +++ b/src/app/pages/main/related-tab/related-tab.component.html @@ -27,8 +27,8 @@
资源使用安排
-

{{lines['renderFlight'].GATE}}

-

{{lines['renderFlight'].STND}}

+

{{lines['renderFlight'].GTDT}}

+

{{lines['renderFlight'].PSST}}

{{lines['renderFlight'].CHKC}}

{{lines['renderFlight'].BELT}}