Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
towerFront
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
WitCloud
towerFront
Commits
a2a32348
Commit
a2a32348
authored
Jan 30, 2019
by
van.chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
一些修改
parent
bb2b2c94
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
86 additions
and
80 deletions
+86
-80
advanced.component.html
src/app/routes/pro/profile/advanced/advanced.component.html
+44
-52
advanced.component.less
src/app/routes/pro/profile/advanced/advanced.component.less
+8
-1
advanced.component.ts
src/app/routes/pro/profile/advanced/advanced.component.ts
+33
-26
environment.ts
src/environments/environment.ts
+1
-1
No files found.
src/app/routes/pro/profile/advanced/advanced.component.html
View file @
a2a32348
<!--<page-header>-->
<div
class=
"detailFull"
>
<!--<nz-alert *ngIf="base.locker === '1.0' && base.tiltWarn" nzType="success" nzBanner="true" nzMessage="铁塔运行正常,未发生异常报警!" nzShowIcon></nz-alert>-->
<div
class=
"topDetailHeader"
>
<!--<nz-alert *ngIf="base.locker !== '1.0'" nzType="error" nzBanner="true" nzMessage="铁塔门未正常关闭,请及时查看!" nzShowIcon></nz-alert>-->
<div
class=
"leftPart"
>
<!--<nz-alert *ngIf="!base.tiltWarn" nzType="error" nzBanner="true" nzMessage="铁塔倾斜异常,请及时查看!" nzShowIcon></nz-alert>-->
<div
class=
"oneLine"
*
ngFor=
"let one of leftItems"
>
<!--<sv-container size="small" col="2">-->
<img
class=
"oneIcon"
[
src
]="'../../../../../
assets
/
img
/'
+
one
.
icon
+
'.
png
'
"
>
<!--<sv label="名称">{{base.towerName}}</sv>-->
<div
class=
"oneLabel"
>
{{one.label}}
</div>
<!--<sv label="搭建时间">{{base.createTime}}</sv>-->
<div
class=
"oneValue"
>
{{base[one.value]}}{{one.per ? '(' + one.per + ')' : ''}}
</div>
<!--<sv label="倾斜角度" [type]="base.tiltWarn ? 'success' : 'danger'"><span style="font-weight: 600;font-size: 18px;">{{base.tilt}}(°)</span></sv>-->
</div>
<!--<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.humid}}(%rH)</sv>-->
<!--<sv label="网关剩余电量">{{base.bat}}(%)</sv>-->
<!--<sv label="数据最后更新时间">{{base.lastTime | date: 'yyyy-MM-dd HH:mm:ss'}}</sv>-->
<!--</sv-container>-->
<!--</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>
<div
class=
"rightPart"
>
<div
class=
"rightPart"
>
<div
class=
"rightLine per100"
>
<div
class=
"rightLine per100"
>
<img
class=
"rightIcon"
<img
class=
"rightIcon"
[
src
]="!
base
.
tiltWarn
||
!
base
.
locker
||
base
.
locker
!==
'
1
.
0
'
?
'../../../../../
assets
/
img
/
8
.
png
'
:
'../../../../../
assets
/
img
/
5
.
png
'"
>
[
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
]="!
base
.
tiltWarn
||
!
base
.
locker
||
base
.
locker
!==
'
1
.
0
'
?
'
rightLabel
danger
'
:
'
rightLabel
success
'"
>
{{!base.tiltWarn ? '铁塔倾斜异常,请及时查看' : !base.locker || base.locker !== '1.0' ? '铁塔门状态异常,请及时查看' : '铁塔运行正常,未发生异常报警'}}
</div>
<div
class=
"rightLine per50"
>
</div>
<img
class=
"rightIcon"
[
src
]="!
base
.
tiltWarn
?
'../../../../../
assets
/
img
/
9
.
png
'
:
'../../../../../
assets
/
img
/
6
.
png
'"
>
<div
class=
"rightLine per50"
>
<span
class=
"descLabel"
>
倾斜角度
</span>
<img
class=
"rightIcon"
<div
[
class
]="!
base
.
tiltWarn
?
'
rightLabel
danger
'
:
'
rightLabel
success
'"
>
{{base.tilt}}(°)
</div>
[
src
]="!
base
.
tiltWarn
?
'../../../../../
assets
/
img
/
9
.
png
'
:
'../../../../../
assets
/
img
/
6
.
png
'"
>
</div>
<span
class=
"descLabel"
>
倾斜角度
</span>
<div
class=
"rightLine per50"
>
<div
[
class
]="!
base
.
tiltWarn
?
'
rightLabel
danger
'
:
'
rightLabel
success
'"
>
{{base.tilt}}(°)
</div>
<img
class=
"rightIcon"
[
src
]="!
base
.
locker
||
base
.
locker
!==
'
1
.
0
'
?
'../../../../../
assets
/
img
/
10
.
png
'
:
'../../../../../
assets
/
img
/
7
.
png
'"
>
</div>
<span
class=
"descLabel"
>
门状态
</span>
<div
class=
"rightLine per50"
>
<div
[
class
]="!
base
.
locker
||
base
.
locker
!==
'
1
.
0
'
?
'
rightLabel
danger
'
:
'
rightLabel
success
'"
>
{{base.locker === '1.0' ? '正常-关' : '异常-开'}}
</div>
<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>
</div>
</div>
<nz-card
[
nzBordered
]="
false
"
>
<nz-card-tab>
<nz-tabset
nzSize=
"large"
>
<nz-tab
nzTitle=
"一周内"
>
<div
class=
"echartsPart"
echarts
[
options
]="
weektilt
"
></div>
<div
class=
"echartsPart"
echarts
[
options
]="
weektemp
"
></div>
<div
class=
"echartsPart"
echarts
[
options
]="
weekhumid
"
></div>
</nz-tab>
<nz-tab
nzTitle=
"一月内"
>
<div
class=
"echartsPart"
echarts
[
options
]="
monthtilt
"
></div>
<div
class=
"echartsPart"
echarts
[
options
]="
monthtemp
"
></div>
<div
class=
"echartsPart"
echarts
[
options
]="
monthhumid
"
></div>
</nz-tab>
</nz-tabset>
</nz-card-tab>
</nz-card>
</div>
</div>
<nz-card
[
nzBordered
]="
false
"
>
<nz-card-tab>
<nz-tabset
nzSize=
"large"
>
<nz-tab
nzTitle=
"一周内"
>
<div
class=
"echartsPart"
echarts
[
options
]="
weektilt
"
></div>
<div
class=
"echartsPart"
echarts
[
options
]="
weektemp
"
></div>
<div
class=
"echartsPart"
echarts
[
options
]="
weekhumid
"
></div>
</nz-tab>
<nz-tab
nzTitle=
"一月内"
>
<div
class=
"echartsPart"
echarts
[
options
]="
monthtilt
"
></div>
<div
class=
"echartsPart"
echarts
[
options
]="
monthtemp
"
></div>
<div
class=
"echartsPart"
echarts
[
options
]="
monthhumid
"
></div>
</nz-tab>
</nz-tabset>
</nz-card-tab>
</nz-card>
src/app/routes/pro/profile/advanced/advanced.component.less
View file @
a2a32348
...
@@ -6,6 +6,9 @@
...
@@ -6,6 +6,9 @@
left: 8px;
left: 8px;
}
}
}
}
.detailFull {
margin-top: 79px;
}
.echartsPart {
.echartsPart {
width: 100%;
width: 100%;
height: 450px;
height: 450px;
...
@@ -40,7 +43,6 @@
...
@@ -40,7 +43,6 @@
@media screen and (min-width: @screen-md) {
@media screen and (min-width: @screen-md) {
width: 33.333%;
width: 33.333%;
min-height: 200px;
min-height: 200px;
border-right: 1px solid #ccc;
}
}
@media screen and (max-width: @screen-md) {
@media screen and (max-width: @screen-md) {
...
@@ -60,6 +62,11 @@
...
@@ -60,6 +62,11 @@
display: inline-block;
display: inline-block;
width: calc(35% - 30px);
width: calc(35% - 30px);
}
}
.oneLine {
@media screen and (min-width: @screen-md) {
border-right: 2px solid #636368;
}
}
.oneValue {
.oneValue {
display: inline-block;
display: inline-block;
width: calc(64% - 30px);
width: calc(64% - 30px);
...
...
src/app/routes/pro/profile/advanced/advanced.component.ts
View file @
a2a32348
...
@@ -8,7 +8,7 @@ import { Router } from '@angular/router';
...
@@ -8,7 +8,7 @@ import { Router } from '@angular/router';
@
Component
({
@
Component
({
selector
:
'app-profile-advanced'
,
selector
:
'app-profile-advanced'
,
templateUrl
:
'./advanced.component.html'
,
templateUrl
:
'./advanced.component.html'
,
styleUrls
:
[
'./advanced.component.less'
]
styleUrls
:
[
'./advanced.component.less'
]
,
// changeDetection: ChangeDetectionStrategy.OnPush
// changeDetection: ChangeDetectionStrategy.OnPush
})
})
export
class
ProProfileAdvancedComponent
implements
OnInit
{
export
class
ProProfileAdvancedComponent
implements
OnInit
{
...
@@ -26,18 +26,18 @@ export class ProProfileAdvancedComponent implements OnInit {
...
@@ -26,18 +26,18 @@ export class ProProfileAdvancedComponent implements OnInit {
humid
:
'湿度数据'
,
humid
:
'湿度数据'
,
tilt
:
'倾斜数据'
,
tilt
:
'倾斜数据'
,
month
:
'近一月'
,
month
:
'近一月'
,
week
:
'近一周'
week
:
'近一周'
,
};
};
option
=
{
option
=
{
title
:
{
title
:
{
text
:
''
,
text
:
''
,
left
:
'center'
left
:
'center'
,
},
},
tooltip
:
{
tooltip
:
{
trigger
:
'axis'
trigger
:
'axis'
,
},
},
legend
:
{
legend
:
{
data
:
[]
data
:
[],
},
},
grid
:
{
grid
:
{
left
:
'4%'
,
left
:
'4%'
,
...
@@ -48,51 +48,58 @@ export class ProProfileAdvancedComponent implements OnInit {
...
@@ -48,51 +48,58 @@ export class ProProfileAdvancedComponent implements OnInit {
xAxis
:
{
xAxis
:
{
type
:
'category'
,
type
:
'category'
,
boundaryGap
:
true
,
boundaryGap
:
true
,
data
:
[]
data
:
[]
,
},
},
yAxis
:
{
yAxis
:
{
type
:
'value'
,
type
:
'value'
,
splitLine
:
{
splitLine
:
{
show
:
false
show
:
false
,
}
},
splitArea
:
{
show
:
true
,
areaStyle
:
{
color
:
[
'#F5F7FA'
,
'#fff'
]
}
},
},
},
series
:
[{
series
:
[{
data
:
[],
data
:
[],
symbol
:
'none'
,
symbol
:
'none'
,
type
:
'line'
,
type
:
'line'
,
lineStyle
:
{
lineStyle
:
{
color
:
'#0098d9'
color
:
'#0098d9'
,
}
}
,
}]
}]
,
};
};
leftItems
=
[{
leftItems
=
[{
icon
:
1
,
icon
:
1
,
label
:
'名称'
,
label
:
'名称'
,
per
:
''
,
per
:
''
,
value
:
'towerName'
value
:
'towerName'
,
},
{
},
{
icon
:
2
,
icon
:
2
,
label
:
'搭建时间'
,
label
:
'搭建时间'
,
per
:
''
,
per
:
''
,
value
:
'createTime'
value
:
'createTime'
,
},
{
},
{
icon
:
3
,
icon
:
3
,
label
:
'温度'
,
label
:
'温度'
,
per
:
'℃'
,
per
:
'℃'
,
value
:
'temp'
value
:
'temp'
,
},
{
},
{
icon
:
4
,
icon
:
4
,
label
:
'湿度'
,
label
:
'湿度'
,
per
:
'%rH'
,
per
:
'%rH'
,
value
:
'humid'
value
:
'humid'
,
},
{
},
{
icon
:
11
,
icon
:
11
,
label
:
'网关电量'
,
label
:
'网关电量'
,
per
:
'%'
,
per
:
'%'
,
value
:
'bat'
value
:
'bat'
,
}];
}];
constructor
(
public
msg
:
NzMessageService
,
private
http
:
_HttpClient
,
private
message
:
NzMessageService
,
private
router
:
Router
)
{}
constructor
(
public
msg
:
NzMessageService
,
private
http
:
_HttpClient
,
private
message
:
NzMessageService
,
private
router
:
Router
)
{
}
ngOnInit
()
{
ngOnInit
()
{
this
.
getBase
();
this
.
getBase
();
...
@@ -102,8 +109,8 @@ export class ProProfileAdvancedComponent implements OnInit {
...
@@ -102,8 +109,8 @@ export class ProProfileAdvancedComponent implements OnInit {
getBase
()
{
getBase
()
{
const
req
=
{
const
req
=
{
sn
:
"19040999"
,
sn
:
'19040999'
,
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
)
=>
{
this
.
handle
(
res
,
()
=>
{
this
.
handle
(
res
,
()
=>
{
...
@@ -122,7 +129,7 @@ export class ProProfileAdvancedComponent implements OnInit {
...
@@ -122,7 +129,7 @@ export class ProProfileAdvancedComponent implements OnInit {
const
param
=
[
'tilt'
,
'temp'
,
'humid'
];
const
param
=
[
'tilt'
,
'temp'
,
'humid'
];
param
.
map
((
item
,
index
)
=>
{
param
.
map
((
item
,
index
)
=>
{
this
.
getChart
(
item
,
'week'
,
index
);
this
.
getChart
(
item
,
'week'
,
index
);
})
})
;
}
}
getMonthCharts
()
{
getMonthCharts
()
{
...
@@ -130,7 +137,7 @@ export class ProProfileAdvancedComponent implements OnInit {
...
@@ -130,7 +137,7 @@ export class ProProfileAdvancedComponent implements OnInit {
const
param
=
[
'tilt'
,
'temp'
,
'humid'
];
const
param
=
[
'tilt'
,
'temp'
,
'humid'
];
param
.
map
((
item
,
index
)
=>
{
param
.
map
((
item
,
index
)
=>
{
this
.
getChart
(
item
,
'month'
,
index
);
this
.
getChart
(
item
,
'month'
,
index
);
})
})
;
}
}
getChart
(
item
,
type
,
index
)
{
getChart
(
item
,
type
,
index
)
{
...
@@ -138,9 +145,9 @@ export class ProProfileAdvancedComponent implements OnInit {
...
@@ -138,9 +145,9 @@ export class ProProfileAdvancedComponent implements OnInit {
const
req
=
{
const
req
=
{
endTime
:
new
Date
().
getTime
(),
endTime
:
new
Date
().
getTime
(),
parameter
:
item
,
parameter
:
item
,
sn
:
"19040999"
,
sn
:
'19040999'
,
startTime
:
end
,
startTime
:
end
,
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
)
=>
{
this
.
handle
(
res
,
()
=>
{
this
.
handle
(
res
,
()
=>
{
...
@@ -152,7 +159,7 @@ export class ProProfileAdvancedComponent implements OnInit {
...
@@ -152,7 +159,7 @@ export class ProProfileAdvancedComponent implements OnInit {
res
.
historyData
.
map
((
one
,
i
)
=>
{
res
.
historyData
.
map
((
one
,
i
)
=>
{
data
.
push
(
one
.
value
);
data
.
push
(
one
.
value
);
xAxis
.
push
(
one
.
time
);
xAxis
.
push
(
one
.
time
);
if
(
i
===
len
)
{
if
(
i
===
len
)
{
option
.
series
[
0
].
data
=
data
;
option
.
series
[
0
].
data
=
data
;
option
.
xAxis
.
data
=
xAxis
;
option
.
xAxis
.
data
=
xAxis
;
option
.
title
.
text
=
this
.
trans
[
type
]
+
this
.
trans
[
item
];
option
.
title
.
text
=
this
.
trans
[
type
]
+
this
.
trans
[
item
];
...
@@ -161,12 +168,12 @@ export class ProProfileAdvancedComponent implements OnInit {
...
@@ -161,12 +168,12 @@ export class ProProfileAdvancedComponent implements OnInit {
option
.
tooltip
.
formatter
=
'{a}<br/>时间: {b}<br/>数据值: {c}'
+
res
.
unit
;
option
.
tooltip
.
formatter
=
'{a}<br/>时间: {b}<br/>数据值: {c}'
+
res
.
unit
;
this
[
type
+
item
]
=
option
;
this
[
type
+
item
]
=
option
;
}
}
})
})
;
}
}
if
(
index
===
2
)
{
if
(
index
===
2
)
{
this
.
isLoading
=
false
;
this
.
isLoading
=
false
;
}
}
})
})
;
});
});
}
}
...
...
src/environments/environment.ts
View file @
a2a32348
...
@@ -7,7 +7,7 @@ export const environment = {
...
@@ -7,7 +7,7 @@ export const environment = {
production
:
false
,
production
:
false
,
useHash
:
true
,
useHash
:
true
,
hmr
:
false
,
hmr
:
false
,
baseUrl
:
'http://192.168.1.
5
3:8092'
baseUrl
:
'http://192.168.1.
1
3:8092'
};
};
/*
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment