Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
W
witiumCloud2
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
witiumCloud2
Commits
68cef080
Commit
68cef080
authored
Apr 14, 2020
by
frank
🏀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
传感器历史数据页面增加了一个主题的选择框
parent
d4a38d7d
Pipeline
#251
passed with stage
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
33 deletions
+48
-33
sensor-detail.component.html
src/app/main/sensor-detail/sensor-detail.component.html
+45
-32
sensor-detail.component.ts
src/app/main/sensor-detail/sensor-detail.component.ts
+3
-1
No files found.
src/app/main/sensor-detail/sensor-detail.component.html
View file @
68cef080
...
@@ -143,42 +143,55 @@
...
@@ -143,42 +143,55 @@
</nz-table>
</nz-table>
</nz-tab>
</nz-tab>
<nz-tab
nzTitle=
"图表"
>
<nz-tab
nzTitle=
"图表"
>
<div
class=
"cards"
>
<nz-row
style=
"min-height: 50px;"
>
<div
class=
"card"
*
ngFor=
"let one of actualData;let i = index"
>
<nz-col
[
nzSpan
]="
2
"
>
<div
class=
"title"
>
<p>
请选择主题
</p>
{{one.alias}}
</nz-col>
<div
class=
"rightSpan canClick"
(
click
)="
OnReqHistroyChart
(
i
)"
>
查看数据
</div>
<nz-col
[
nzSpan
]="
5
"
>
</div>
<nz-select
[(
ngModel
)]="
selectedTopicValue
"
nzAllowClear
nzPlaceHolder=
"Choose"
style=
"min-width: 300px"
>
<div
class=
"middle"
>
<nz-option
*
ngFor=
"let one of deviceData"
[
nzValue
]="
one
.
topicName
"
[
nzLabel
]="
one
.
topicName
"
></nz-option>
<div
class=
"left"
>
{{one.value}}{{one.unit === '-' ? '' : one.unit}}
</div>
</nz-select>
<div
class=
"right"
>
</nz-col>
{{one.rangeMin}}{{one.unit === '-' ? '' : one.unit}} - {{one.rangeMax}}{{one.unit === '-' ? '' : one.unit}}
</nz-row>
<nz-row>
<div
class=
"cards"
>
<div
class=
"card"
*
ngFor=
"let one of actualData;let i = index"
>
<div
class=
"title"
>
{{one.alias}}
<div
class=
"rightSpan canClick"
(
click
)="
OnReqHistroyChart
(
i
)"
>
查看数据
</div>
</div>
<div
class=
"middle"
>
<div
class=
"left"
>
{{one.value}}{{one.unit === '-' ? '' : one.unit}}
</div>
<div
class=
"right"
>
{{one.rangeMin}}{{one.unit === '-' ? '' : one.unit}} - {{one.rangeMax}}{{one.unit === '-' ? '' : one.unit}}
</div>
</div>
<div
class=
"bottom"
>
{{one.time | date: 'yyyy-MM-dd HH:mm:ss'}}
</div>
</div>
</div>
</div>
<div
class=
"bottom"
>
{{one.time | date: 'yyyy-MM-dd HH:mm:ss'}}
</div>
</div>
</div>
<div
class=
"charts"
*
ngIf=
"isClose"
>
<div
style=
"width: calc(100% - 80px);display: inline-block;vertical-align: top;padding-left: 15px;"
>
<app-search-select
inModal=
"true"
[
label
]="'
selectTime
'
|
translate
"
[(
value
)]="
selectTime3
"
optL=
"a"
optV=
"b"
[
data
]="[{
a:
'
1
小时',
b:
1
},
{
a:
'
24
小时',
b:
24
},
{
a:
'
7
天',
b:
144
},
{
a:
'自定义',
b:
0
}]"
></app-search-select>
<app-search-date
*
ngIf=
"selectTime3 === 0"
inModal=
"true"
[
label
]="'
startTime
'
|
translate
"
[(
value
)]="
req3
.
startTime
"
showTime=
"true"
></app-search-date>
<app-search-date
*
ngIf=
"selectTime3 === 0"
inModal=
"true"
[
label
]="'
endTime
'
|
translate
"
[(
value
)]="
req3
.
endTime
"
showTime=
"true"
></app-search-date>
</div>
</div>
<button
nz-button
class=
"searchBtn"
[
nzType
]="'
primary
'"
[
nzLoading
]="
isLoading
"
(
click
)="
onSearch
()"
>
<div
class=
"charts"
*
ngIf=
"isClose"
>
<span>
{{'search' | translate}}
</span></button>
<div
style=
"width: calc(100% - 80px);display: inline-block;vertical-align: top;padding-left: 15px;"
>
<nz-tabset
style=
"border-top: 1px solid #cccccc"
>
<app-search-select
inModal=
"true"
[
label
]="'
selectTime
'
|
translate
"
[(
value
)]="
selectTime3
"
<nz-tab
nzTitle=
"图表"
><div
echarts
[
options
]
=
"
chartOption
"
class=
"demo-chart"
></div></nz-tab>
optL=
"a"
optV=
"b"
[
data
]="[{
a:
'
1
小时',
b:
1
},
{
a:
'
24
小时',
b:
24
},
{
a:
'
7
天',
b:
144
},
{
a:
'自定义',
b:
0
}]"
></app-search-select>
</nz-tabset>
<app-search-date
*
ngIf=
"selectTime3 === 0"
inModal=
"true"
[
label
]="'
startTime
'
|
translate
"
[(
value
)]="
req3
.
startTime
"
<div
class=
"btnLine"
>
showTime=
"true"
></app-search-date>
<button
nz-button
class=
"searchBtn"
[
nzType
]="'
default
'"
[
nzLoading
]="
isLoading
"
(
click
)="
isClose =
false;"
>
<app-search-date
*
ngIf=
"selectTime3 === 0"
inModal=
"true"
[
label
]="'
endTime
'
|
translate
"
[(
value
)]="
req3
.
endTime
"
<span>
{{'close' | translate}}
</span></button>
showTime=
"true"
></app-search-date>
</div>
<button
nz-button
class=
"searchBtn"
[
nzType
]="'
primary
'"
[
nzLoading
]="
isLoading
"
(
click
)="
onSearch
()"
>
<span>
{{'search' | translate}}
</span></button>
<nz-tabset
style=
"border-top: 1px solid #cccccc"
>
<nz-tab
nzTitle=
"图表"
><div
echarts
[
options
]
=
"
chartOption
"
class=
"demo-chart"
></div></nz-tab>
</nz-tabset>
<div
class=
"btnLine"
>
<button
nz-button
class=
"searchBtn"
[
nzType
]="'
default
'"
[
nzLoading
]="
isLoading
"
(
click
)="
isClose =
false;"
>
<span>
{{'close' | translate}}
</span></button>
</div>
</div>
</div>
</
div
>
</
nz-row
>
</nz-tab>
</nz-tab>
</nz-tabset>
</nz-tabset>
</nz-tab>
</nz-tab>
...
...
src/app/main/sensor-detail/sensor-detail.component.ts
View file @
68cef080
...
@@ -52,6 +52,7 @@ export class SensorDetailComponent implements OnInit {
...
@@ -52,6 +52,7 @@ export class SensorDetailComponent implements OnInit {
hisTopicName
;
hisTopicName
;
hisAlias
;
hisAlias
;
hisDevInfo
;
hisDevInfo
;
selectedTopicValue
;
constructor
(
private
api
:
ApiService
,
private
message
:
NzMessageService
,
private
router
:
Router
,
private
ck
:
CheckService
,
constructor
(
private
api
:
ApiService
,
private
message
:
NzMessageService
,
private
router
:
Router
,
private
ck
:
CheckService
,
private
ac
:
ActivatedRoute
,
private
modalService
:
NzModalService
,
private
translate
:
TranslateService
)
{
private
ac
:
ActivatedRoute
,
private
modalService
:
NzModalService
,
private
translate
:
TranslateService
)
{
...
@@ -180,7 +181,8 @@ export class SensorDetailComponent implements OnInit {
...
@@ -180,7 +181,8 @@ export class SensorDetailComponent implements OnInit {
getHistoryData
():
void
{
getHistoryData
():
void
{
this
.
hisTopicName
=
this
.
wayData
[
0
].
topicName
;
// this.hisTopicName = this.wayData[0].topicName;
this
.
hisTopicName
=
this
.
selectedTopicValue
;
this
.
api
.
data
.
getHisData
([{
alias
:
this
.
hisDevInfo
.
alias
,
deviceList
:
[{
sn
:
this
.
hisDevInfo
.
SN
,
this
.
api
.
data
.
getHisData
([{
alias
:
this
.
hisDevInfo
.
alias
,
deviceList
:
[{
sn
:
this
.
hisDevInfo
.
SN
,
type
:
this
.
hisDevInfo
.
dType
}],
endTime
:
this
.
selectTime3
?
new
Date
().
getTime
()
:
this
.
req3
.
startTime
,
type
:
this
.
hisDevInfo
.
dType
}],
endTime
:
this
.
selectTime3
?
new
Date
().
getTime
()
:
this
.
req3
.
startTime
,
offset
:
0
-
new
Date
().
getTimezoneOffset
()
/
60
,
offset
:
0
-
new
Date
().
getTimezoneOffset
()
/
60
,
...
...
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