Commit 87ae2388 authored by van.chen's avatar van.chen

自动化部署

parent f8a3c486
# Http Server
# Version: 2.4.33
FROM registry.cn-hangzhou.aliyuncs.com/witcloud/docker-httpd:latest
# Maintainers
MAINTAINER Carit Zhu "carit.zhu@witium.com"
RUN rm -rf /usr/local/apache2/htdocs/*
# Add dist package
ADD dist.tar.gz /usr/local/apache2/htdocs/
<page-header [title]="'编号: ' + (base.towerNo || '-')"> <!--<page-header>-->
<nz-alert *ngIf="base.locker === '1.0' && base.tiltWarn" nzType="success" nzBanner="true" nzMessage="铁塔运行正常,未发生异常报警!" nzShowIcon></nz-alert> <!--<nz-alert *ngIf="base.locker === '1.0' && base.tiltWarn" nzType="success" nzBanner="true" nzMessage="铁塔运行正常,未发生异常报警!" nzShowIcon></nz-alert>-->
<nz-alert *ngIf="base.locker !== '1.0'" nzType="error" nzBanner="true" nzMessage="铁塔门未正常关闭,请及时查看!" nzShowIcon></nz-alert> <!--<nz-alert *ngIf="base.locker !== '1.0'" nzType="error" nzBanner="true" nzMessage="铁塔门未正常关闭,请及时查看!" nzShowIcon></nz-alert>-->
<nz-alert *ngIf="!base.tiltWarn" nzType="error" nzBanner="true" nzMessage="铁塔倾斜异常,请及时查看!" nzShowIcon></nz-alert> <!--<nz-alert *ngIf="!base.tiltWarn" nzType="error" nzBanner="true" nzMessage="铁塔倾斜异常,请及时查看!" nzShowIcon></nz-alert>-->
<sv-container size="small" col="2"> <!--<sv-container size="small" col="2">-->
<sv label="名称">{{base.towerName}}</sv> <!--<sv label="名称">{{base.towerName}}</sv>-->
<sv label="搭建时间">{{base.createTime}}</sv> <!--<sv label="搭建时间">{{base.createTime}}</sv>-->
<sv label="倾斜角度" [type]="base.tiltWarn ? 'success' : 'danger'"><span style="font-weight: 600;font-size: 18px;">{{base.tilt}}(°)</span></sv> <!--<sv label="倾斜角度" [type]="base.tiltWarn ? 'success' : 'danger'"><span style="font-weight: 600;font-size: 18px;">{{base.tilt}}(°)</span></sv>-->
<sv label="门状态" [type]="base.locker === '1.0' ? 'success' : 'danger'"><span style="font-weight: 600;font-size: 18px;">{{base.locker === '1.0' ? '正常-关' : '异常-开'}}</span></sv> <!--<sv label="门状态" [type]="base.locker === '1.0' ? 'success' : 'danger'"><span style="font-weight: 600;font-size: 18px;">{{base.locker === '1.0' ? '正常-关' : '异常-开'}}</span></sv>-->
<sv label="温度">{{base.temp}}(℃)</sv> <!--<sv label="温度">{{base.temp}}(℃)</sv>-->
<sv label="湿度">{{base.humid}}(%rH)</sv> <!--<sv label="湿度">{{base.humid}}(%rH)</sv>-->
<sv label="网关剩余电量">{{base.bat}}(%)</sv> <!--<sv label="网关剩余电量">{{base.bat}}(%)</sv>-->
<sv label="数据最后更新时间">{{base.lastTime | date: 'yyyy-MM-dd HH:mm:ss'}}</sv> <!--<sv label="数据最后更新时间">{{base.lastTime | date: 'yyyy-MM-dd HH:mm:ss'}}</sv>-->
</sv-container> <!--</sv-container>-->
</page-header> <!--</page-header>-->
<div class="topDetailHeader">
<div class="leftPart">
<div class="oneLine" *ngFor="let one of leftItems">
<img class="oneIcon" [src]="'../../../../../assets/img/' + one.icon + '.png' ">
<div class="oneLabel">{{one.label}}</div>
<div class="oneValue">{{base[one.value]}}{{one.per ? '(' + one.per + ')' : ''}}</div>
</div>
</div>
<div class="rightPart">
<div class="rightLine per100">
<img class="rightIcon" [src]="!base.tiltWarn || !base.locker || base.locker !== '1.0' ? '../../../../../assets/img/8.png' : '../../../../../assets/img/5.png'">
<div [class]="!base.tiltWarn || !base.locker || base.locker !== '1.0' ? 'rightLabel danger' : 'rightLabel success'">{{!base.tiltWarn ? '铁塔倾斜异常,请及时查看' : !base.locker || base.locker !== '1.0' ? '铁塔门状态异常,请及时查看' : '铁塔运行正常,未发生异常报警'}}</div>
</div>
<div class="rightLine per50">
<img class="rightIcon" [src]="!base.tiltWarn ? '../../../../../assets/img/9.png' : '../../../../../assets/img/6.png'">
<span class="descLabel">倾斜角度</span>
<div [class]="!base.tiltWarn ? 'rightLabel danger' : 'rightLabel success'">{{base.tilt}}(°)</div>
</div>
<div class="rightLine per50">
<img class="rightIcon" [src]="!base.locker || base.locker !== '1.0' ? '../../../../../assets/img/10.png' : '../../../../../assets/img/7.png'">
<span class="descLabel">门状态</span>
<div [class]="!base.locker || base.locker !== '1.0' ? 'rightLabel danger' : 'rightLabel success'">{{base.locker === '1.0' ? '正常-关' : '异常-开'}}</div>
</div>
</div>
</div>
<nz-card [nzBordered]="false"> <nz-card [nzBordered]="false">
<nz-card-tab> <nz-card-tab>
<nz-tabset nzSize="large"> <nz-tabset nzSize="large">
......
...@@ -25,5 +25,128 @@ ...@@ -25,5 +25,128 @@
margin-bottom: 4px; margin-bottom: 4px;
} }
} }
.topDetailHeader {
width: calc(100% + 50px);
margin: 0 -25px 30px -25px;
background-color: #fff;
}
.leftPart {
padding: 30px 20px;
line-height: 40px;
z-index: 5;
display: inline-block;
font-size: 17px;
@media screen and (min-width: @screen-md) {
width: 33.333%;
min-height: 200px;
border-right: 1px solid #ccc;
}
@media screen and (max-width: @screen-md) {
width: 100%;
min-height: 160px;
padding: 10px 10px;
}
}
.oneIcon{
display: inline-block;
height: 40px;
width: 40px;
text-align: center;
margin: 0 10px;
}
.oneLabel {
display: inline-block;
width: calc(35% - 30px);
}
.oneValue {
display: inline-block;
width: calc(64% - 30px);
}
.rightPart {
z-index: 5;
display: inline-block;
vertical-align: top;
@media screen and (min-width: @screen-md) {
padding: 30px 20px;
width: 66.666%;
min-height: 200px;
}
@media screen and (max-width: @screen-md) {
width: 100%;
min-height: 140px;
padding: 10px 10px;
border-top: 1px solid #ccc;
}
}
.rightLine {
font-weight: 600;
position: relative;
@media screen and (min-width: @screen-md) {
height: 80px;
line-height: 80px;
}
@media screen and (max-width: @screen-md) {
height: 50px;
line-height: 50px;
}
}
.rightIcon {
display: inline-block;
height: 60px;
width: 60px;
@media screen and (min-width: @screen-md) {
height: 60px;
width: 60px;
}
@media screen and (max-width: @screen-md) {
height: 40px;
width: 40px;
}
text-align: center;
margin: 0 20px 5px 10px;
}
.rightLabel {
letter-spacing: 5px;
display: inline-block;
width: calc(100% - 90px);
font-size: 26px;
}
.per100 {
width: 100%;
}
.per50 {
width: 50%;
display: inline-block;
}
.success {
color: #acea06;
}
.danger {
color: #ff000f;
}
span.descLabel {
display: inline-block;
position: absolute;
text-align: center;
width: 60px;
@media screen and (min-width: @screen-md) {
left: 10px;
bottom: -45px;
}
@media screen and (max-width: @screen-md) {
left: 0;
bottom: -35px;
}
}
} }
} }
...@@ -3,6 +3,7 @@ import { NzMessageService, NzTabChangeEvent } from 'ng-zorro-antd'; ...@@ -3,6 +3,7 @@ import { NzMessageService, NzTabChangeEvent } from 'ng-zorro-antd';
import { _HttpClient } from '@delon/theme'; import { _HttpClient } from '@delon/theme';
import { STColumn } from '@delon/abc'; import { STColumn } from '@delon/abc';
import { environment } from '@env/environment'; import { environment } from '@env/environment';
import { Router } from '@angular/router';
@Component({ @Component({
selector: 'app-profile-advanced', selector: 'app-profile-advanced',
...@@ -57,15 +58,36 @@ export class ProProfileAdvancedComponent implements OnInit { ...@@ -57,15 +58,36 @@ export class ProProfileAdvancedComponent implements OnInit {
}, },
series: [{ series: [{
data: [], data: [],
symbol: 'none',
type: 'line', type: 'line',
lineStyle: { lineStyle: {
color: '#0098d9' color: '#0098d9'
} }
}] }]
}; };
leftItems = [{
icon: 1,
label: '名称',
per: '',
value: 'towerName'
}, {
icon: 2,
label: '搭建时间',
per: '',
value: 'createTime'
}, {
icon: 3,
label: '温度',
per: '℃',
value: 'temp'
}, {
icon: 4,
label: '湿度',
per: '%rH',
value: 'humid'
}];
constructor(public msg: NzMessageService, private http: _HttpClient, private message: NzMessageService, private router: Router) {}
constructor(public msg: NzMessageService, private http: _HttpClient, private message: NzMessageService) {}
ngOnInit() { ngOnInit() {
this.getBase(); this.getBase();
...@@ -79,12 +101,14 @@ export class ProProfileAdvancedComponent implements OnInit { ...@@ -79,12 +101,14 @@ export class ProProfileAdvancedComponent implements OnInit {
type: "WTD93RX" type: "WTD93RX"
}; };
this.http.post(environment.baseUrl + '/data/getRealTimeData', req).subscribe((res: any) => { this.http.post(environment.baseUrl + '/data/getRealTimeData', req).subscribe((res: any) => {
if (res && res.towerNo) { this.handle(res, () => {
this.base = res; if (res && res.towerNo) {
this.base.tiltWarn = (res.tilt && Number(res.tilt) < 10) || res.tilt === 'N/A' ? true : false; this.base = res;
} else { this.base.tiltWarn = (res.tilt && Number(res.tilt) < 10) || res.tilt === 'N/A' ? true : false;
this.message.error(res.message); } else {
} this.message.error(res.message);
}
});
}); });
} }
...@@ -114,28 +138,38 @@ export class ProProfileAdvancedComponent implements OnInit { ...@@ -114,28 +138,38 @@ export class ProProfileAdvancedComponent implements OnInit {
type: "WTD93RX" type: "WTD93RX"
}; };
this.http.post(environment.baseUrl + '/data/getHistoryDataByTime', req).subscribe((res: any) => { this.http.post(environment.baseUrl + '/data/getHistoryDataByTime', req).subscribe((res: any) => {
if (res.historyData && res.historyData.constructor === Array && res.historyData.length > 0) { this.handle(res, () => {
const len = res.historyData.length - 1; if (res.historyData && res.historyData.constructor === Array && res.historyData.length > 0) {
const data = []; const len = res.historyData.length - 1;
const xAxis = []; const data = [];
const option = JSON.parse(JSON.stringify(this.option)); const xAxis = [];
res.historyData.map((one, i) => { const option = JSON.parse(JSON.stringify(this.option));
data.push(one.value); res.historyData.map((one, i) => {
xAxis.push(one.time); data.push(one.value);
if(i === len) { xAxis.push(one.time);
option.series[0].data = data; if(i === len) {
option.xAxis.data = xAxis; option.series[0].data = data;
option.title.text = this.trans[type] + this.trans[item]; option.xAxis.data = xAxis;
option.yAxis.name = '数值(' + res.unit + ')'; option.title.text = this.trans[type] + this.trans[item];
option.series[0].name = this.trans[type] + this.trans[item]; option.yAxis.name = '数值(' + res.unit + ')';
option.tooltip.formatter = '{a}: {c}' + res.unit; option.series[0].name = this.trans[type] + this.trans[item];
this[type + item] = option; option.tooltip.formatter = '{a}: {c}' + res.unit;
} this[type + item] = option;
}) }
} })
if (index === 2) { }
this.isLoading = false; if (index === 2) {
} this.isLoading = false;
}
})
}); });
} }
handle(res, next) {
if (res.code === 2) {
this.router.navigate(['/passport/login']);
} else {
next();
}
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment