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
6271f8cc
Commit
6271f8cc
authored
Apr 18, 2019
by
van.chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交一下
parent
026761a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
191 additions
and
0 deletions
+191
-0
sensor-topic-way.component.html
...app/main/sensor-topic-way/sensor-topic-way.component.html
+89
-0
sensor-topic-way.component.ts
src/app/main/sensor-topic-way/sensor-topic-way.component.ts
+102
-0
No files found.
src/app/main/sensor-topic-way/sensor-topic-way.component.html
0 → 100644
View file @
6271f8cc
<div
class=
"tableBar"
@
fade
>
<div
class=
"btnLine"
style=
"margin-bottom: 10px"
>
<label
class=
"subTitle"
>
{{topicName}} 通道模板{{'detail' | translate}}
</label>
<button
nz-button
[
nzType
]="'
primary
'"
[
nzLoading
]="
isLoading
"
(
click
)="
add
()"
><span>
{{'addWay' | translate}}
</span></button>
<app-back
[
isLoading
]="
isLoading
"
></app-back>
</div>
<nz-table
#
nzTable
[
nzData
]="
data
"
[
nzSize
]="'
middle
'"
nzShowSizeChanger
[
nzLoading
]="
isLoading
"
>
<thead
nz-thead
>
<tr>
<th
nz-th
><span>
{{'wayName' | translate}}
</span></th>
<th
nz-th
><span>
{{'wayAlias' | translate}}
</span></th>
<th
nz-th
><span>
{{'per' | translate}}
</span></th>
<th
nz-th
><span>
{{'wayType' | translate}}
</span></th>
<th
nz-th
><span>
{{'max' | translate}}
</span></th>
<th
nz-th
><span>
{{'min' | translate}}
</span></th>
<th
nz-th
><span>
{{'alarmMax' | translate}}
</span></th>
<th
nz-th
><span>
{{'alarmMaxMax' | translate}}
</span></th>
<th
nz-th
><span>
{{'alarmMin' | translate}}
</span></th>
<th
nz-th
><span>
{{'alarmMinMin' | translate}}
</span></th>
<th
nz-th
><span>
{{'isAlarm' | translate}}
</span></th>
<th
nz-th
><span>
{{'oper' | translate}}
</span></th>
</tr>
</thead>
<tbody
nz-tbody
>
<tr
*
ngFor=
"let one of nzTable.data, let i = index"
>
<td
nz-td
>
{{one.name}}
</td>
<td
nz-td
>
{{one.alias}}
</td>
<td
nz-td
>
{{one.unit}}
</td>
<td
nz-td
>
{{one.type}}
</td>
<td
nz-td
>
{{one.rangeMax}}
</td>
<td
nz-td
>
{{one.rangeMin}}
</td>
<td
nz-td
>
{{one.alarmUp}}
</td>
<td
nz-td
>
{{one.upperAlarmLimit}}
</td>
<td
nz-td
>
{{one.alarmDown}}
</td>
<td
nz-td
>
{{one.lowerAlarmLimit}}
</td>
<td
nz-td
>
{{one.isAlarm === 1 ? '是': '否'}}
</td>
<td
nz-td
>
<span
class=
"editSpan"
(
click
)="
update
(
one
)"
>
{{'update' | translate}}
</span>
<nz-divider
nzType=
"vertical"
></nz-divider>
<span
class=
"deleteFontColor"
(
click
)="
deleteConfirm
(
one
)"
>
{{'delete' | translate}}
</span>
</td>
</tr>
</tbody>
</nz-table>
</div>
<nz-modal
[(
nzVisible
)]="
isV
"
[
nzContent
]="
con1
"
nzWidth=
"750"
[
nzFooter
]="
foot1
"
[
nzTitle
]="
isUpdate
?
('
update
'
|
translate
)
:
('
add
'
|
translate
)"
(
nzOnCancel
)="
cancel
()"
nzMaskClosable=
"false"
>
<ng-template
#
con1
>
<div
class=
"half"
>
<app-search-item
isMust=
"true"
inModal=
"true"
[
label
]="'
wayName
'
|
translate
"
[(
value
)]="
req
.
name
"
></app-search-item>
<app-search-item
inModal=
"true"
[
label
]="'
per
'
|
translate
"
[(
value
)]="
req
.
unit
"
></app-search-item>
<app-search-item
isMust=
"true"
inModal=
"true"
[
label
]="'
wayDescription
'
|
translate
"
[(
value
)]="
req
.
description
"
></app-search-item>
<app-search-item
isMust=
"true"
inModal=
"true"
[
label
]="'
max
'
|
translate
"
[(
value
)]="
req
.
rangeMax
"
></app-search-item>
<app-search-item
isMust=
"true"
inModal=
"true"
[
label
]="'
alarmMax
'
|
translate
"
[(
value
)]="
req
.
alarmUp
"
></app-search-item>
<app-search-item
isMust=
"true"
inModal=
"true"
[
label
]="'
alarmMaxMax
'
|
translate
"
[(
value
)]="
req
.
upperAlarmLimit
"
></app-search-item>
<div
class=
"searchItem inModal"
>
<div
class=
"item-label"
><span
class=
"deleteFontColor"
>
*
</span>
{{'isAlarm' | translate}}
</div>
<div
class=
"item-input"
>
<nz-radio-group
[(
ngModel
)]="
req
.
isAlarm
"
>
<label
nz-radio
[
nzValue
]="
1
"
>
是
</label>
<label
nz-radio
[
nzValue
]="
0
"
>
否
</label>
</nz-radio-group>
</div>
</div>
</div>
<div
class=
"half"
>
<app-search-item
inModal=
"true"
[
label
]="'
wayAlias
'
|
translate
"
[(
value
)]="
req
.
alias
"
></app-search-item>
<app-search-item
isMust=
"true"
inModal=
"true"
[
label
]="'
wayType
'
|
translate
"
[(
value
)]="
req
.
type
"
></app-search-item>
<app-search-item
isMust=
"true"
inModal=
"true"
[
label
]="'
min
'
|
translate
"
[(
value
)]="
req
.
rangeMin
"
></app-search-item>
<app-search-item
isMust=
"true"
inModal=
"true"
[
label
]="'
alarmMin
'
|
translate
"
[(
value
)]="
req
.
alarmDown
"
></app-search-item>
<app-search-item
isMust=
"true"
inModal=
"true"
[
label
]="'
alarmMinMin
'
|
translate
"
[(
value
)]="
req
.
lowerAlarmLimit
"
></app-search-item>
<app-search-item
isMust=
"true"
inModal=
"true"
[
label
]="'
alarmInterval
'
|
translate
"
[(
value
)]="
req
.
alarmInterval
"
></app-search-item>
</div>
<div
class=
"searchItem inModal"
>
<div
class=
"item-label"
style=
"width: 149px;"
><span
class=
"deleteFontColor"
>
*
</span>
{{'wayInfo' | translate}}
</div>
<div
class=
"item-input"
style=
"width: calc(100% - 158px);"
>
<textarea
nz-input
[(
ngModel
)]="
req
.
boxedart
"
></textarea>
</div>
</div>
</ng-template>
<ng-template
#
foot1
>
<button
nz-button
nzType=
"default"
[
nzLoading
]="
isLoading
"
(
click
)="
cancel
()"
><span>
{{'cancel' | translate}}
</span></button>
<button
nz-button
nzType=
"primary"
[
nzLoading
]="
isLoading
"
(
click
)="
save
()"
><span>
{{'confirm' | translate}}
</span></button>
</ng-template>
</nz-modal>
src/app/main/sensor-topic-way/sensor-topic-way.component.ts
0 → 100644
View file @
6271f8cc
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
ApiService
}
from
'../../service/api'
;
import
{
NzMessageService
,
NzModalService
}
from
'ng-zorro-antd'
;
import
{
ActivatedRoute
,
Router
}
from
'@angular/router'
;
import
{
TranslateService
}
from
'@ngx-translate/core'
;
import
{
fadeIn
}
from
'../../animation/fade-in'
;
@
Component
({
selector
:
'app-sensor-topic-way'
,
templateUrl
:
'./sensor-topic-way.component.html'
,
styles
:
[],
animations
:
[
fadeIn
]
})
export
class
SensorTopicWayComponent
implements
OnInit
{
req
:
any
=
{};
data
=
[];
isLoading
=
false
;
deviceNo
=
''
;
topicName
=
''
;
isV
=
false
;
isUpdate
=
false
;
constructor
(
private
api
:
ApiService
,
private
message
:
NzMessageService
,
private
ac
:
ActivatedRoute
,
private
translate
:
TranslateService
,
private
router
:
Router
,
private
modalService
:
NzModalService
)
{
}
ngOnInit
()
{
this
.
init
();
}
init
()
{
this
.
ac
.
queryParams
.
subscribe
((
params
)
=>
{
if
(
params
.
deviceNo
)
{
this
.
deviceNo
=
params
.
deviceNo
;
this
.
topicName
=
params
.
topicName
;
this
.
getData
();
}
});
}
getData
()
{
this
.
isLoading
=
true
;
this
.
api
.
probes
.
getAll
([{
deviceNo
:
this
.
deviceNo
,
topicName
:
this
.
topicName
},
this
.
next
]);
}
next
=
(
data
)
=>
{
if
(
data
&&
data
.
constructor
===
Array
)
{
this
.
data
=
data
;
}
else
if
(
data
&&
data
.
code
===
1
)
{
this
.
message
.
success
(
data
.
message
?
data
.
message
:
'操作成功'
);
this
.
isV
=
false
;
this
.
getData
();
}
else
if
(
data
&&
data
.
code
===
0
)
{
this
.
message
.
error
(
data
.
message
?
data
.
message
:
'操作失败'
);
}
else
{
this
.
message
.
error
(
data
&&
data
.
message
?
data
.
message
:
'获取数据失败'
);
}
this
.
isLoading
=
false
;
}
add
()
{
this
.
req
=
{};
this
.
isUpdate
=
false
;
this
.
isV
=
true
;
}
update
(
one
)
{
this
.
isUpdate
=
true
;
this
.
req
=
{...
one
};
this
.
req
.
oldName
=
one
.
name
;
this
.
isV
=
true
;
}
cancel
()
{
this
.
isV
=
false
;
}
save
()
{
this
.
isLoading
=
true
;
this
.
req
.
deviceNo
=
this
.
deviceNo
;
this
.
req
.
topicName
=
this
.
topicName
;
if
(
this
.
isUpdate
)
{
this
.
api
.
probes
.
updateProbes
([
this
.
req
,
this
.
next
]);
}
else
{
this
.
api
.
probes
.
addProbes
([
this
.
req
,
this
.
next
]);
}
}
deleteConfirm
(
one
)
{
this
.
modalService
.
confirm
({
nzTitle
:
'<i> </i>'
,
nzContent
:
'<b>'
+
this
.
translate
.
instant
(
'confirmDeleteThisRecord'
)
+
'</b>'
,
nzOnOk
:
()
=>
this
.
delete
(
one
)
});
}
delete
(
one
)
{
this
.
isLoading
=
true
;
this
.
api
.
probes
.
delAProbes
([{
deviceNo
:
this
.
deviceNo
,
name
:
one
.
name
,
topicName
:
this
.
topicName
},
this
.
next
]);
}
}
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