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
95ab2f6f
Commit
95ab2f6f
authored
Apr 26, 2019
by
van.chen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111
parent
0f9101e3
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
323 additions
and
160 deletions
+323
-160
gateway.component.html
src/app/main/gateway/gateway.component.html
+27
-25
gateway.component.ts
src/app/main/gateway/gateway.component.ts
+13
-4
module-detail.component.html
src/app/main/module-detail/module-detail.component.html
+32
-16
module-detail.component.ts
src/app/main/module-detail/module-detail.component.ts
+15
-2
module-mgr.component.ts
src/app/main/module-mgr/module-mgr.component.ts
+3
-3
sensor-detail.component.ts
src/app/main/sensor-detail/sensor-detail.component.ts
+8
-2
sensor-mgr.component.html
src/app/main/sensor-mgr/sensor-mgr.component.html
+27
-27
sensor-mgr.component.ts
src/app/main/sensor-mgr/sensor-mgr.component.ts
+12
-4
sensor-topic-way.component.html
...app/main/sensor-topic-way/sensor-topic-way.component.html
+23
-11
sensor-topic-way.component.ts
src/app/main/sensor-topic-way/sensor-topic-way.component.ts
+23
-3
topic-module-detail.component.ts
...main/topic-module-detail/topic-module-detail.component.ts
+8
-2
topic-module-mgr.component.ts
src/app/main/topic-module-mgr/topic-module-mgr.component.ts
+9
-3
topic-module-way.component.html
...app/main/topic-module-way/topic-module-way.component.html
+23
-11
topic-module-way.component.ts
src/app/main/topic-module-way/topic-module-way.component.ts
+15
-2
check.ts
src/app/service/check.ts
+83
-44
environment.ts
src/environments/environment.ts
+2
-1
No files found.
src/app/main/gateway/gateway.component.html
View file @
95ab2f6f
...
...
@@ -24,13 +24,13 @@
(
nzPageSizeChange
)="
pageChange
()"
>
<thead
nz-thead
>
<tr>
<
!--<th-->
<!--nzShowCheckbox-->
<!--[(nzChecked)]="isAllCheck"-->
<!--[nzDisabled]="data.length===0"-->
<!--[nzIndeterminate]="isIndeterminate"-->
<!--(nzCheckedChange)="checkAll($event)"-->
<!--></th>--
>
<
th
nzShowCheckbox
[(
nzChecked
)]="
isAllCheck
"
[
nzDisabled
]="
data
.
length=
==0"
[
nzIndeterminate
]="
isIndeterminate
"
(
nzCheckedChange
)="
checkAll
($
event
)"
></th
>
<th
nz-th
><span>
{{'gatewayName' | translate}}
</span></th>
<th
nz-th
><span>
{{'gatewaySN' | translate}}
</span></th>
<th
nz-th
><span>
{{'type' | translate}}
</span></th>
...
...
@@ -49,7 +49,7 @@
</thead>
<tbody
nz-tbody
>
<tr
*
ngFor=
"let one of nzTable.data,let i = index"
>
<
!--<td nzShowCheckbox [(nzChecked)]="one.checked" (nzCheckedChange)="oneCheck()"></td>--
>
<
td
nzShowCheckbox
[(
nzChecked
)]="
one
.
checked
"
(
nzCheckedChange
)="
oneCheck
()"
></td
>
<td
nz-td
class=
"canClick"
(
click
)="
toSee
(
one
)"
>
{{one.name}}
</td>
<td
nz-td
>
{{one.sn}}
</td>
<td
nz-td
>
{{one.type}}
</td>
...
...
@@ -75,23 +75,25 @@
</tr>
</tbody>
</nz-table>
<!--<div class="btnLine whenOneLine" style="text-align: left; margin-top: -48px;">-->
<!--<button nz-button [nzType]="'primary'" [nzLoading]="isLoading" [disabled]="!isCheckedOne" (click)="allDelete()">-->
<!--<span>{{'delete' | translate}}</span></button>-->
<!--<button nz-button class="btnAll" [nzLoading]="isLoading" [disabled]="!canbind" (click)="allBind()"><span>{{'bind' | translate}}</span>-->
<!--</button>-->
<!--<button nz-button [nzType]="'primary'" [nzLoading]="isLoading" [disabled]="!canUnbind" (click)="allUnbind()">-->
<!--<span>{{'unbind' | translate}}</span></button>-->
<!--<button nz-button class="btnAll" [nzLoading]="isLoading" [disabled]="!isCheckedOne" (click)="allDivide()"><span>{{'divide' | translate}}</span>-->
<!--</button>-->
<!--<button nz-button [nzType]="'primary'" [nzLoading]="isLoading" [disabled]="!isCheckedOne" (click)="allUpdate()">-->
<!--<span>{{'update' | translate}}</span></button>-->
<!--</div>-->
<!--<div class="pagePart whenOneLine">-->
<!--<nz-pagination [nzPageIndex]="page" [nzTotal]="total" [nzPageSize]="rows"-->
<!--[nzShowTotal]="totalTemplate"></nz-pagination>-->
<!--<ng-template #totalTemplate> 共 {{ total }} 项</ng-template>-->
<!--</div>-->
<div
class=
"btnLine whenOneLine"
style=
"text-align: left; margin-top: -48px;"
>
<button
nz-button
[
nzType
]="'
primary
'"
[
nzLoading
]="
isLoading
"
[
disabled
]="!
isCheckedOne
"
(
click
)="
allDelete
()"
>
<span>
{{'delete' | translate}}
</span></button>
<button
nz-button
class=
"btnAll"
[
nzLoading
]="
isLoading
"
[
disabled
]="!
canbind
"
(
click
)="
allBind
()"
>
<span>
{{'bind' | translate}}
</span>
</button>
<button
nz-button
[
nzType
]="'
primary
'"
[
nzLoading
]="
isLoading
"
[
disabled
]="!
canUnbind
"
(
click
)="
allUnbind
()"
>
<span>
{{'unbind' | translate}}
</span></button>
<button
nz-button
class=
"btnAll"
[
nzLoading
]="
isLoading
"
[
disabled
]="!
isCheckedOne
"
(
click
)="
allDivide
()"
>
<span>
{{'divide' | translate}}
</span>
</button>
<button
nz-button
[
nzType
]="'
primary
'"
[
nzLoading
]="
isLoading
"
[
disabled
]="!
isCheckedOne
"
(
click
)="
allUpdate
()"
>
<span>
{{'update' | translate}}
</span></button>
</div>
<div
class=
"pagePart whenOneLine"
>
<nz-pagination
[
nzPageIndex
]="
page
"
[
nzTotal
]="
total
"
[
nzPageSize
]="
rows
"
[
nzShowTotal
]="
totalTemplate
"
></nz-pagination>
<ng-template
#
totalTemplate
>
共 {{ total }} 项
</ng-template>
</div>
</div>
<nz-modal
[(
nzVisible
)]="
isAddConV
"
[
nzTitle
]="
isUpdate
?
('
updateGateway
'
|
translate
)
:
('
addGateway
'
|
translate
)"
[
nzContent
]="
con1
"
nzWidth=
"500"
...
...
src/app/main/gateway/gateway.component.ts
View file @
95ab2f6f
...
...
@@ -205,7 +205,10 @@ export class GatewayComponent implements OnInit {
this
.
isMulti
=
false
;
this
.
isUpdate
=
false
;
this
.
isAddConV
=
true
;
this
.
try
=
{
field
:
[
'name'
,
'sn'
,
'companyNo'
]};
this
.
try
=
{
trans
:
{
name
:
'gatewayName'
,
sn
:
'gatewaySN'
,
companyNo
:
'selectCompany'
},
field
:
[
'name'
,
'sn'
,
'companyNo'
]
};
}
bind
(
one
)
{
...
...
@@ -217,7 +220,10 @@ export class GatewayComponent implements OnInit {
influxdbDatabaseNo
:
''
,
pDeviceNo
:
''
};
this
.
try
=
{
field
:
[
'address'
,
'deviceNo'
]};
this
.
try
=
{
trans
:
{
address
:
'bindTongxinAddr'
},
field
:
[
'address'
,
'deviceNo'
]
};
this
.
isBindConV
=
true
;
}
...
...
@@ -238,7 +244,10 @@ export class GatewayComponent implements OnInit {
this
.
isMulti
=
false
;
this
.
req
=
{...
one
};
this
.
companySelected
(
one
.
companyNo
);
this
.
try
=
{
field
:
[
'name'
,
'sn'
,
'companyNo'
,
'deviceNo'
]};
this
.
try
=
{
trans
:
{
name
:
'gatewayName'
,
sn
:
'gatewaySN'
,
companyNo
:
'selectCompany'
},
field
:
[
'name'
,
'sn'
,
'companyNo'
,
'deviceNo'
]
};
this
.
isUpdate
=
true
;
this
.
isAddConV
=
true
;
}
...
...
@@ -246,7 +255,7 @@ export class GatewayComponent implements OnInit {
divide
(
one
)
{
this
.
isMulti
=
false
;
this
.
req4
=
{...
one
};
this
.
try
=
{
field
:
[
'companyNo'
,
'deviceNo'
]};
this
.
try
=
{
trans
:
{
companyNo
:
'selectCompany'
},
field
:
[
'companyNo'
,
'deviceNo'
]};
this
.
isDivideConV
=
true
;
}
...
...
src/app/main/module-detail/module-detail.component.html
View file @
95ab2f6f
<div
class=
"tableBar"
@
fade
>
<div
class=
"btnLine"
style=
"margin-bottom: 10px"
>
<label
class=
"subTitle"
>
{{probesModelName}} 通道模板{{'detail' | translate}}
</label>
<button
nz-button
[
nzType
]="'
primary
'"
[
nzLoading
]="
isLoading
"
(
click
)="
add
()"
><span>
{{'addWay' | translate}}
</span></button>
<button
nz-button
[
nzType
]="'
primary
'"
[
nzLoading
]="
isLoading
"
(
click
)="
add
()"
><span>
{{'addWay' | translate}}
</span>
</button>
<app-back
[
isLoading
]="
isLoading
"
></app-back>
</div>
<nz-table
#
nzTable
...
...
@@ -39,7 +40,7 @@
<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
>
{{one.isAlarm === 1 ? '是'
: '否'}}
</td>
<td
nz-td
>
<span
class=
"editSpan"
(
click
)="
update
(
one
)"
>
{{'update' | translate}}
</span>
<nz-divider
nzType=
"vertical"
></nz-divider>
...
...
@@ -50,15 +51,14 @@
</nz-table>
</div>
<nz-modal
[(
nzVisible
)]="
isV
"
[
nzContent
]="
con1
"
nzWidth=
"750"
[
nzFooter
]="
foot1
"
[
nzTitle
]="
isUpdate
?
('
update
'
|
translate
)
:
('
add
'
|
translate
)"
(
nzOnCancel
)="
cancel
()"
nzMaskClosable=
"false"
>
[
nzFooter
]="
foot1
"
[
nzTitle
]="
isUpdate
?
('
update
'
|
translate
)
:
('
add
'
|
translate
)"
(
nzOnCancel
)="
cancel
()"
nzMaskClosable=
"false"
>
<ng-template
#
con1
>
<div
class=
"half"
>
<app-search-item
nz-tooltip
nzTitle=
"此处输入为英文"
isMust=
"true"
inModal=
"true"
[
label
]="'
wayName
'
|
translate
"
[(
value
)]="
req
.
name
"
></app-search-item>
<app-search-item
isMust=
"true"
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
inModal=
"true"
[
label
]="'
max
'
|
translate
"
[(
value
)]="
req
.
rangeMax
"
></app-search-item>
<app-search-item
inModal=
"true"
[
label
]="'
alarmMax
'
|
translate
"
[(
value
)]="
req
.
alarmUp
"
></app-search-item>
<app-search-item
inModal=
"true"
[
label
]="'
alarmMaxMax
'
|
translate
"
[(
value
)]="
req
.
upperAlarmLimit
"
></app-search-item>
<app-search-item
nz-tooltip
nzTitle=
"此处输入为英文或数字"
isMust=
"true"
inModal=
"true"
[
label
]="'
wayName
'
|
translate
"
[(
value
)]="
req
.
name
"
></app-search-item>
<app-search-select
isMust=
"true"
inModal=
"true"
[
label
]="'
wayType
'
|
translate
"
[(
value
)]="
req
.
type
"
[
data
]="[{
a:
'
AI
'},
{
a:
'
AO
'},
{
a:
'
DI
'},
{
a:
'
DO
'}]"
optL=
"a"
optV=
"a"
></app-search-select>
<div
class=
"searchItem inModal"
>
<div
class=
"item-label"
><span
class=
"deleteFontColor"
>
*
</span>
{{'isAlarm' | translate}}
</div>
<div
class=
"item-input"
>
...
...
@@ -68,14 +68,28 @@
</nz-radio-group>
</div>
</div>
<app-search-item
inModal=
"true"
[
label
]="'
max
'
|
translate
"
[(
value
)]="
req
.
rangeMax
"
></app-search-item>
<app-search-item
*
ngIf=
"req.isAlarm"
inModal=
"true"
[
label
]="'
alarmMax
'
|
translate
"
[(
value
)]="
req
.
alarmUp
"
></app-search-item>
<app-search-item
*
ngIf=
"req.isAlarm"
inModal=
"true"
[
label
]="'
alarmMaxMax
'
|
translate
"
[(
value
)]="
req
.
upperAlarmLimit
"
></app-search-item>
<app-search-item
*
ngIf=
"req.isAlarm && req.type !== 'DI' && req.type !== 'DO'"
inModal=
"true"
[
label
]="'
alarmInterval
'
|
translate
"
[(
value
)]="
req
.
alarmInterval
"
></app-search-item>
</div>
<div
class=
"half"
>
<app-search-item
isMust=
"true"
nz-tooltip
nzTitle=
"此处输入为英文"
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"
nz-tooltip
nzTitle=
"此处输入为英文或数字"
inModal=
"true"
[
label
]="'
wayAlias
'
|
translate
"
[(
value
)]="
req
.
alias
"
></app-search-item>
<app-search-item
*
ngIf=
"req.type !== 'DI' && req.type !== 'DO'"
isMust=
"true"
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
inModal=
"true"
[
label
]="'
min
'
|
translate
"
[(
value
)]="
req
.
rangeMin
"
></app-search-item>
<app-search-item
inModal=
"true"
[
label
]="'
alarmMin
'
|
translate
"
[(
value
)]="
req
.
alarmDown
"
></app-search-item>
<app-search-item
inModal=
"true"
[
label
]="'
alarmMinMin
'
|
translate
"
[(
value
)]="
req
.
lowerAlarmLimit
"
></app-search-item>
<app-search-item
inModal=
"true"
[
label
]="'
alarmInterval
'
|
translate
"
[(
value
)]="
req
.
alarmInterval
"
></app-search-item>
<app-search-item
*
ngIf=
"req.isAlarm"
inModal=
"true"
[
label
]="'
alarmMin
'
|
translate
"
[(
value
)]="
req
.
alarmDown
"
></app-search-item>
<app-search-item
*
ngIf=
"req.isAlarm"
inModal=
"true"
[
label
]="'
alarmMinMin
'
|
translate
"
[(
value
)]="
req
.
lowerAlarmLimit
"
></app-search-item>
<app-search-item
*
ngIf=
"req.isAlarm && (req.type === 'DI' || req.type === 'DO')"
inModal=
"true"
[
label
]="'
alarmInterval
'
|
translate
"
[(
value
)]="
req
.
alarmInterval
"
></app-search-item>
</div>
<div
class=
"searchItem inModal"
>
<div
class=
"item-label"
style=
"width: 149px;"
>
{{'wayInfo' | translate}}
</div>
...
...
@@ -85,7 +99,9 @@
</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>
<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/module-detail/module-detail.component.ts
View file @
95ab2f6f
...
...
@@ -80,7 +80,11 @@ export class ModuleDetailComponent implements OnInit {
this
.
isUpdate
=
false
;
this
.
isV
=
true
;
this
.
try
=
{
field
:
[
'probesModelNo'
,
'name'
,
'alias'
,
'description'
,
'type'
,
'unit'
,
'isAlarm'
],
trans
:
{
name
:
'wayName'
,
alias
:
'wayAlias'
,
description
:
'wayDescription'
,
type
:
'per'
,
isAlarm
:
'isAlarm'
,
alarmUp
:
'alarmMax'
,
upperAlarmLimit
:
'alarmMaxMax'
,
rangeMax
:
'max'
,
alarmDown
:
'alarmMin'
,
lowerAlarmLimit
:
'alarmMinMin'
,
alarmInterval
:
'alarmInterval'
,
rangeMin
:
'min'
},
field
:
[
'probesModelNo'
,
'name'
,
'alias'
,
'description'
,
'type'
,
'isAlarm'
],
num
:
[
'alarmUp'
,
'upperAlarmLimit'
,
'rangeMax'
,
'alarmDown'
,
'lowerAlarmLimit'
,
'alarmInterval'
,
'rangeMin'
],
eng
:
[
'name'
,
'alias'
]
};
}
...
...
@@ -91,7 +95,11 @@ export class ModuleDetailComponent implements OnInit {
this
.
req
.
oldName
=
one
.
name
;
this
.
isV
=
true
;
this
.
try
=
{
field
:
[
'probesModelNo'
,
'name'
,
'alias'
,
'description'
,
'type'
,
'unit'
,
'isAlarm'
],
trans
:
{
name
:
'wayName'
,
alias
:
'wayAlias'
,
description
:
'wayDescription'
,
type
:
'per'
,
isAlarm
:
'isAlarm'
,
alarmUp
:
'alarmMax'
,
upperAlarmLimit
:
'alarmMaxMax'
,
rangeMax
:
'max'
,
alarmDown
:
'alarmMin'
,
lowerAlarmLimit
:
'alarmMinMin'
,
alarmInterval
:
'alarmInterval'
,
rangeMin
:
'min'
},
field
:
[
'probesModelNo'
,
'name'
,
'alias'
,
'description'
,
'type'
,
'isAlarm'
],
num
:
[
'alarmUp'
,
'upperAlarmLimit'
,
'rangeMax'
,
'alarmDown'
,
'lowerAlarmLimit'
,
'alarmInterval'
,
'rangeMin'
],
eng
:
[
'name'
,
'alias'
]
};
}
...
...
@@ -103,6 +111,11 @@ export class ModuleDetailComponent implements OnInit {
save
()
{
this
.
isLoading
=
true
;
this
.
req
.
probesModelNo
=
this
.
probesModelNo
;
if
(
this
.
req
.
type
!==
'DI'
&&
this
.
req
.
type
!==
'DO'
&&
!
this
.
req
.
unit
)
{
this
.
message
.
warning
(
'单位为必填项'
);
this
.
isLoading
=
false
;
return
false
;
}
if
(
!
this
.
ck
.
formCheck
(
this
.
req
,
this
.
try
))
{
this
.
isLoading
=
false
;
return
false
;
...
...
src/app/main/module-mgr/module-mgr.component.ts
View file @
95ab2f6f
...
...
@@ -92,21 +92,21 @@ export class ModuleMgrComponent implements OnInit {
newProbesModelName
:
''
,
probesModelNo
:
one
.
probesModelNo
};
this
.
try
=
{
field
:
[
'newProbesModelName'
,
'probesModelNo'
]};
this
.
try
=
{
trans
:
{
newProbesModelName
:
'moduleName'
},
field
:
[
'newProbesModelName'
,
'probesModelNo'
]};
}
add
()
{
this
.
req
=
{};
this
.
isUpdate
=
false
;
this
.
isAddConV
=
true
;
this
.
try
=
{
field
:
[
'probesModelName'
,
'num'
]};
this
.
try
=
{
trans
:
{
probesModelName
:
'moduleName'
,
num
:
'wayNum'
},
field
:
[
'probesModelName'
,
'num'
]};
}
update
(
one
)
{
this
.
isUpdate
=
true
;
this
.
req
=
{...
one
};
this
.
isAddConV
=
true
;
this
.
try
=
{
field
:
[
'probesModelNo'
,
'probesModelName'
]};
this
.
try
=
{
trans
:
{
probesModelName
:
'moduleName'
},
field
:
[
'probesModelNo'
,
'probesModelName'
]};
}
cancel
(
v
)
{
...
...
src/app/main/sensor-detail/sensor-detail.component.ts
View file @
95ab2f6f
...
...
@@ -153,7 +153,7 @@ export class SensorDetailComponent implements OnInit {
this
.
req5
=
{
deviceNo
:
this
.
deviceNo
};
this
.
try
=
{
field
:
[
]};
this
.
try
=
{
trans
:
{
topicModelNo
:
'topicModel'
},
field
:
[
'topicModelNo'
]};
}
add
()
{
...
...
@@ -163,6 +163,8 @@ export class SensorDetailComponent implements OnInit {
this
.
req
.
frequency
=
0
;
this
.
isUC
=
true
;
this
.
try
=
{
trans
:
{
dataType
:
'dataType'
,
frequency
:
'frequency'
,
interval
:
'interval'
,
topicName
:
'topicName'
,
topicType
:
'topicType'
,
dataInterval
:
'dataSaveInTime'
},
field
:
[
'dataType'
,
'deviceNo'
,
'frequency'
,
'interval'
,
'topicName'
,
'topicType'
],
num
:
[
'interval'
,
'dataInterval'
]
};
...
...
@@ -175,6 +177,8 @@ export class SensorDetailComponent implements OnInit {
this
.
req
.
oldTopicName
=
one
.
topicName
;
this
.
isUC
=
true
;
this
.
try
=
{
trans
:
{
dataType
:
'dataType'
,
frequency
:
'frequency'
,
interval
:
'interval'
,
topicName
:
'topicName'
,
topicType
:
'topicType'
,
dataInterval
:
'dataSaveInTime'
},
field
:
[
'dataType'
,
'deviceNo'
,
'frequency'
,
'interval'
,
'topicName'
,
'topicType'
,
'oldTopicName'
],
num
:
[
'interval'
,
'dataInterval'
]
};
...
...
@@ -264,6 +268,8 @@ export class SensorDetailComponent implements OnInit {
deviceNo
:
this
.
deviceNo
,
newTopicModelName
:
''
};
this
.
try
=
{
field
:
[
'companyNo'
,
'deviceNo'
,
'newTopicModelName'
]};
this
.
try
=
{
trans
:
{
companyNo
:
'selectCompany'
,
newTopicModelName
:
'moduleName'
},
field
:
[
'companyNo'
,
'deviceNo'
,
'newTopicModelName'
]};
}
}
src/app/main/sensor-mgr/sensor-mgr.component.html
View file @
95ab2f6f
...
...
@@ -6,8 +6,8 @@
<span>
{{'search' | translate}}
</span></button>
<button
nz-button
class=
"btnAll"
[
nzLoading
]="
isLoading
"
(
click
)="
onGetAll
()"
><span>
{{'allData' | translate}}
</span>
</button>
<
!--<button nz-button class="btnAdd" [nzLoading]="isLoading" (click)="multiAdd()">--
>
<
!--<span>{{'multiAdd' | translate}}</span></button>--
>
<
button
nz-button
class=
"btnAdd"
[
nzLoading
]="
isLoading
"
(
click
)="
multiAdd
()"
>
<
span>
{{'multiAdd' | translate}}
</span></button
>
<button
nz-button
[
nzType
]="'
primary
'"
[
nzLoading
]="
isLoading
"
(
click
)="
add
()"
>
<span>
{{'addSensor' | translate}}
</span></button>
</div>
...
...
@@ -24,13 +24,13 @@
(
nzPageSizeChange
)="
pageChange
()"
>
<thead
nz-thead
>
<tr>
<
!--<th-->
<!--nzShowCheckbox-->
<!--[(nzChecked)]="isAllCheck"-->
<!--[nzDisabled]="data.length===0"-->
<!--[nzIndeterminate]="isIndeterminate"-->
<!--(nzCheckedChange)="checkAll($event)"-->
<!--></th>--
>
<
th
nzShowCheckbox
[(
nzChecked
)]="
isAllCheck
"
[
nzDisabled
]="
data
.
length=
==0"
[
nzIndeterminate
]="
isIndeterminate
"
(
nzCheckedChange
)="
checkAll
($
event
)"
></th
>
<th
nz-th
><span>
{{'sensorName' | translate}}
</span></th>
<th
nz-th
><span>
{{'sensorSN' | translate}}
</span></th>
<th
nz-th
><span>
{{'frontName' | translate}}
</span></th>
...
...
@@ -48,7 +48,7 @@
</thead>
<tbody
nz-tbody
>
<tr
*
ngFor=
"let one of nzTable.data,let i = index"
>
<
!--<td nzShowCheckbox [(nzChecked)]="one.checked" (nzCheckedChange)="oneCheck()"></td>--
>
<
td
nzShowCheckbox
[(
nzChecked
)]="
one
.
checked
"
(
nzCheckedChange
)="
oneCheck
()"
></td
>
<td
nz-td
class=
"canClick"
(
click
)="
toSee
(
one
)"
>
{{one.name}}
</td>
<td
nz-td
>
{{one.sn}}
</td>
<td
nz-td
>
{{one.prefixName}}
</td>
...
...
@@ -72,23 +72,23 @@
</tr>
</tbody>
</nz-table>
<
!--<div class="btnLine whenOneLine" style="text-align: left; margin-top: -48px;">--
>
<
!--<button nz-button [nzType]="'primary'" [nzLoading]="isLoading" [disabled]="!isCheckedOne" (click)="allDelete()">--
>
<
!--<span>{{'delete' | translate}}</span></button>--
>
<
!--<button nz-button class="btnAll" [nzLoading]="isLoading" [disabled]="!canbind" (click)="allBind()"><span>{{'bind' | translate}}</span>--
>
<
!--</button>--
>
<
!--<button nz-button [nzType]="'primary'" [nzLoading]="isLoading" [disabled]="!canUnbind" (click)="allUnbind()">--
>
<
!--<span>{{'unbind' | translate}}</span></button>--
>
<
!--<button nz-button class="btnAll" [nzLoading]="isLoading" [disabled]="!isCheckedOne" (click)="allDivide()"><span>{{'divide' | translate}}</span>--
>
<
!--</button>--
>
<
!--<button nz-button [nzType]="'primary'" [nzLoading]="isLoading" [disabled]="!isCheckedOne" (click)="allUpdate()">--
>
<
!--<span>{{'update' | translate}}</span></button>--
>
<
!--</div>--
>
<
!--<div class="pagePart whenOneLine">--
>
<
!--<nz-pagination [nzPageIndex]="page" [nzTotal]="total" [nzPageSize]="rows"-->
<!--[nzShowTotal]="totalTemplate"></nz-pagination>--
>
<
!--<ng-template #totalTemplate> 共 {{ total }} 项</ng-template>--
>
<
!--</div>--
>
<
div
class=
"btnLine whenOneLine"
style=
"text-align: left; margin-top: -48px;"
>
<
button
nz-button
[
nzType
]="'
primary
'"
[
nzLoading
]="
isLoading
"
[
disabled
]="!
isCheckedOne
"
(
click
)="
allDelete
()"
>
<
span>
{{'delete' | translate}}
</span></button
>
<
button
nz-button
class=
"btnAll"
[
nzLoading
]="
isLoading
"
[
disabled
]="!
canbind
"
(
click
)="
allBind
()"
><span>
{{'bind' | translate}}
</span
>
<
/button
>
<
button
nz-button
[
nzType
]="'
primary
'"
[
nzLoading
]="
isLoading
"
[
disabled
]="!
canUnbind
"
(
click
)="
allUnbind
()"
>
<
span>
{{'unbind' | translate}}
</span></button
>
<
button
nz-button
class=
"btnAll"
[
nzLoading
]="
isLoading
"
[
disabled
]="!
isCheckedOne
"
(
click
)="
allDivide
()"
><span>
{{'divide' | translate}}
</span
>
<
/button
>
<
button
nz-button
[
nzType
]="'
primary
'"
[
nzLoading
]="
isLoading
"
[
disabled
]="!
isCheckedOne
"
(
click
)="
allUpdate
()"
>
<
span>
{{'update' | translate}}
</span></button
>
<
/div
>
<
div
class=
"pagePart whenOneLine"
>
<
nz-pagination
[
nzPageIndex
]="
page
"
[
nzTotal
]="
total
"
[
nzPageSize
]="
rows
"
[
nzShowTotal
]="
totalTemplate
"
></nz-pagination
>
<
ng-template
#
totalTemplate
>
共 {{ total }} 项
</ng-template
>
<
/div
>
</div>
<nz-modal
[(
nzVisible
)]="
isAddConV
"
[
nzContent
]="
con1
"
nzWidth=
"500"
[
nzTitle
]="
isUpdate
?
('
updateSensor
'
|
translate
)
:
('
addSensor
'
|
translate
)"
...
...
src/app/main/sensor-mgr/sensor-mgr.component.ts
View file @
95ab2f6f
...
...
@@ -231,7 +231,9 @@ export class SensorMgrComponent implements OnInit {
this
.
isMulti
=
false
;
this
.
isAddConV
=
true
;
this
.
isUpdate
=
false
;
this
.
try
=
{
field
:
[
'name'
,
'sn'
,
'type'
,
'companyNo'
]};
this
.
try
=
{
trans
:
{
name
:
'sensorName'
,
sn
:
'sensorSN'
,
type
:
'type'
,
companyNo
:
'selectCompany'
},
field
:
[
'name'
,
'sn'
,
'type'
,
'companyNo'
]};
}
bind
(
one
)
{
...
...
@@ -244,7 +246,9 @@ export class SensorMgrComponent implements OnInit {
pDeviceNo
:
''
};
this
.
isBindConV
=
true
;
this
.
try
=
{
field
:
[
'address'
,
'deviceNo'
]};
this
.
try
=
{
trans
:
{
address
:
'belongAddress'
},
field
:
[
'address'
,
'deviceNo'
]};
}
unbind
(
one
)
{
...
...
@@ -263,7 +267,9 @@ export class SensorMgrComponent implements OnInit {
divide
(
one
)
{
this
.
isMulti
=
false
;
this
.
req5
=
{...
one
};
this
.
try
=
{
field
:
[
'companyNo'
,
'deviceNo'
]};
this
.
try
=
{
trans
:
{
companyNo
:
'selectCompany'
},
field
:
[
'companyNo'
,
'deviceNo'
]};
this
.
isDivideConV
=
true
;
}
...
...
@@ -273,7 +279,9 @@ export class SensorMgrComponent implements OnInit {
this
.
companySelected
(
one
.
companyNo
);
this
.
isUpdate
=
true
;
this
.
isAddConV
=
true
;
this
.
try
=
{
field
:
[
'name'
,
'sn'
,
'type'
,
'companyNo'
,
'deviceNo'
]};
this
.
try
=
{
trans
:
{
name
:
'sensorName'
,
sn
:
'sensorSN'
,
type
:
'type'
,
companyNo
:
'selectCompany'
},
field
:
[
'name'
,
'sn'
,
'type'
,
'companyNo'
,
'deviceNo'
]};
}
cancel
(
v
)
{
...
...
src/app/main/sensor-topic-way/sensor-topic-way.component.html
View file @
95ab2f6f
...
...
@@ -53,12 +53,10 @@
[
nzFooter
]="
foot1
"
[
nzTitle
]="
isUpdate
?
('
update
'
|
translate
)
:
('
add
'
|
translate
)"
(
nzOnCancel
)="
cancel
()"
nzMaskClosable=
"false"
>
<ng-template
#
con1
>
<div
class=
"half"
>
<app-search-item
nz-tooltip
nzTitle=
"此处输入为英文"
isMust=
"true"
inModal=
"true"
[
label
]="'
wayName
'
|
translate
"
[(
value
)]="
req
.
name
"
></app-search-item>
<app-search-item
isMust=
"true"
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
inModal=
"true"
[
label
]="'
max
'
|
translate
"
[(
value
)]="
req
.
rangeMax
"
></app-search-item>
<app-search-item
inModal=
"true"
[
label
]="'
alarmMax
'
|
translate
"
[(
value
)]="
req
.
alarmUp
"
></app-search-item>
<app-search-item
inModal=
"true"
[
label
]="'
alarmMaxMax
'
|
translate
"
[(
value
)]="
req
.
upperAlarmLimit
"
></app-search-item>
<app-search-item
nz-tooltip
nzTitle=
"此处输入为英文或数字"
isMust=
"true"
inModal=
"true"
[
label
]="'
wayName
'
|
translate
"
[(
value
)]="
req
.
name
"
></app-search-item>
<app-search-select
isMust=
"true"
inModal=
"true"
[
label
]="'
wayType
'
|
translate
"
[(
value
)]="
req
.
type
"
[
data
]="[{
a:
'
AI
'},
{
a:
'
AO
'},
{
a:
'
DI
'},
{
a:
'
DO
'}]"
optL=
"a"
optV=
"a"
></app-search-select>
<div
class=
"searchItem inModal"
>
<div
class=
"item-label"
><span
class=
"deleteFontColor"
>
*
</span>
{{'isAlarm' | translate}}
</div>
<div
class=
"item-input"
>
...
...
@@ -68,14 +66,28 @@
</nz-radio-group>
</div>
</div>
<app-search-item
inModal=
"true"
[
label
]="'
max
'
|
translate
"
[(
value
)]="
req
.
rangeMax
"
></app-search-item>
<app-search-item
*
ngIf=
"req.isAlarm"
inModal=
"true"
[
label
]="'
alarmMax
'
|
translate
"
[(
value
)]="
req
.
alarmUp
"
></app-search-item>
<app-search-item
*
ngIf=
"req.isAlarm"
inModal=
"true"
[
label
]="'
alarmMaxMax
'
|
translate
"
[(
value
)]="
req
.
upperAlarmLimit
"
></app-search-item>
<app-search-item
*
ngIf=
"req.isAlarm && req.type !== 'DI' && req.type !== 'DO'"
inModal=
"true"
[
label
]="'
alarmInterval
'
|
translate
"
[(
value
)]="
req
.
alarmInterval
"
></app-search-item>
</div>
<div
class=
"half"
>
<app-search-item
nz-tooltip
nzTitle=
"此处输入为英文"
isMust=
"true"
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"
nz-tooltip
nzTitle=
"此处输入为英文或数字"
inModal=
"true"
[
label
]="'
wayAlias
'
|
translate
"
[(
value
)]="
req
.
alias
"
></app-search-item>
<app-search-item
*
ngIf=
"req.type !== 'DI' && req.type !== 'DO'"
isMust=
"true"
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
inModal=
"true"
[
label
]="'
min
'
|
translate
"
[(
value
)]="
req
.
rangeMin
"
></app-search-item>
<app-search-item
inModal=
"true"
[
label
]="'
alarmMin
'
|
translate
"
[(
value
)]="
req
.
alarmDown
"
></app-search-item>
<app-search-item
inModal=
"true"
[
label
]="'
alarmMinMin
'
|
translate
"
[(
value
)]="
req
.
lowerAlarmLimit
"
></app-search-item>
<app-search-item
inModal=
"true"
[
label
]="'
alarmInterval
'
|
translate
"
[(
value
)]="
req
.
alarmInterval
"
></app-search-item>
<app-search-item
*
ngIf=
"req.isAlarm"
inModal=
"true"
[
label
]="'
alarmMin
'
|
translate
"
[(
value
)]="
req
.
alarmDown
"
></app-search-item>
<app-search-item
*
ngIf=
"req.isAlarm"
inModal=
"true"
[
label
]="'
alarmMinMin
'
|
translate
"
[(
value
)]="
req
.
lowerAlarmLimit
"
></app-search-item>
<app-search-item
*
ngIf=
"req.isAlarm && (req.type === 'DI' || req.type === 'DO')"
inModal=
"true"
[
label
]="'
alarmInterval
'
|
translate
"
[(
value
)]="
req
.
alarmInterval
"
></app-search-item>
</div>
<div
class=
"searchItem inModal"
>
<div
class=
"item-label"
style=
"width: 149px;"
>
{{'wayInfo' | translate}}
</div>
...
...
src/app/main/sensor-topic-way/sensor-topic-way.component.ts
View file @
95ab2f6f
...
...
@@ -71,7 +71,11 @@ export class SensorTopicWayComponent implements OnInit {
this
.
isUpdate
=
false
;
this
.
isV
=
true
;
this
.
try
=
{
field
:
[
'deviceNo'
,
'topicName'
,
'name'
,
'alias'
,
'description'
,
'type'
,
'unit'
,
'isAlarm'
],
trans
:
{
name
:
'wayName'
,
alias
:
'wayAlias'
,
description
:
'wayDescription'
,
type
:
'per'
,
isAlarm
:
'isAlarm'
,
alarmUp
:
'alarmMax'
,
upperAlarmLimit
:
'alarmMaxMax'
,
rangeMax
:
'max'
,
alarmDown
:
'alarmMin'
,
lowerAlarmLimit
:
'alarmMinMin'
,
alarmInterval
:
'alarmInterval'
,
rangeMin
:
'min'
},
field
:
[
'deviceNo'
,
'topicName'
,
'name'
,
'alias'
,
'description'
,
'type'
,
'isAlarm'
],
num
:
[
'alarmUp'
,
'upperAlarmLimit'
,
'rangeMax'
,
'alarmDown'
,
'lowerAlarmLimit'
,
'alarmInterval'
,
'rangeMin'
],
eng
:
[
'name'
,
'alias'
]
};
}
...
...
@@ -82,7 +86,11 @@ export class SensorTopicWayComponent implements OnInit {
this
.
req
.
oldName
=
one
.
name
;
this
.
isV
=
true
;
this
.
try
=
{
field
:
[
'deviceNo'
,
'topicName'
,
'name'
,
'alias'
,
'description'
,
'type'
,
'unit'
,
'isAlarm'
],
trans
:
{
name
:
'wayName'
,
alias
:
'wayAlias'
,
description
:
'wayDescription'
,
type
:
'per'
,
isAlarm
:
'isAlarm'
,
alarmUp
:
'alarmMax'
,
upperAlarmLimit
:
'alarmMaxMax'
,
rangeMax
:
'max'
,
alarmDown
:
'alarmMin'
,
lowerAlarmLimit
:
'alarmMinMin'
,
alarmInterval
:
'alarmInterval'
,
rangeMin
:
'min'
},
field
:
[
'deviceNo'
,
'topicName'
,
'name'
,
'alias'
,
'description'
,
'type'
,
'isAlarm'
],
num
:
[
'alarmUp'
,
'upperAlarmLimit'
,
'rangeMax'
,
'alarmDown'
,
'lowerAlarmLimit'
,
'alarmInterval'
,
'rangeMin'
],
eng
:
[
'name'
,
'alias'
]
};
}
...
...
@@ -101,8 +109,18 @@ export class SensorTopicWayComponent implements OnInit {
return
false
;
}
if
(
this
.
isV
&&
this
.
isUpdate
)
{
if
(
this
.
req
.
type
!==
'DI'
&&
this
.
req
.
type
!==
'DO'
&&
!
this
.
req
.
unit
)
{
this
.
message
.
warning
(
'单位为必填项'
);
this
.
isLoading
=
false
;
return
false
;
}
this
.
api
.
probes
.
updateProbes
([
this
.
req
,
this
.
next
]);
}
else
if
(
this
.
isV
&&
!
this
.
isUpdate
)
{
if
(
this
.
req
.
type
!==
'DI'
&&
this
.
req
.
type
!==
'DO'
&&
!
this
.
req
.
unit
)
{
this
.
message
.
warning
(
'单位为必填项'
);
this
.
isLoading
=
false
;
return
false
;
}
this
.
api
.
probes
.
addProbes
([
this
.
req
,
this
.
next
]);
}
else
if
(
this
.
isSaveOther
)
{
this
.
api
.
probes
.
saveAsProbesModel
([
this
.
req2
,
this
.
next
]);
...
...
@@ -132,6 +150,8 @@ export class SensorTopicWayComponent implements OnInit {
deviceNo
:
this
.
deviceNo
,
topicName
:
this
.
topicName
};
this
.
try
=
{
field
:
[
'newProbesModelName'
,
'deviceNo'
]};
this
.
try
=
{
trans
:
{
newProbesModelName
:
'moduleName'
},
field
:
[
'newProbesModelName'
,
'deviceNo'
]};
}
}
src/app/main/topic-module-detail/topic-module-detail.component.ts
View file @
95ab2f6f
...
...
@@ -93,7 +93,10 @@ export class TopicModuleDetailComponent implements OnInit {
this
.
req
=
{};
this
.
req
.
frequency
=
0
;
this
.
isUpdate
=
false
;
this
.
try
=
{
field
:
[
'topicName'
,
'topicType'
,
'dataType'
,
'interval'
],
this
.
try
=
{
trans
:
{
topicName
:
'topicName'
,
topicType
:
'topicType'
,
dataType
:
'dataType'
,
interval
:
'inTime'
,
dataInterval
:
'dataInterval'
},
field
:
[
'topicName'
,
'topicType'
,
'dataType'
,
'interval'
],
num
:
[
'dataType'
,
'interval'
,
'dataInterval'
]};
this
.
isV
=
true
;
}
...
...
@@ -103,7 +106,10 @@ export class TopicModuleDetailComponent implements OnInit {
this
.
req
=
{...
one
};
this
.
req
.
frequency
=
0
;
this
.
req
.
oldTopicName
=
one
.
topicName
;
this
.
try
=
{
field
:
[
'topicModelNo'
,
'topicName'
,
'topicType'
,
'dataType'
,
'interval'
],
this
.
try
=
{
trans
:
{
topicName
:
'topicName'
,
topicType
:
'topicType'
,
dataType
:
'dataType'
,
interval
:
'inTime'
,
dataInterval
:
'dataInterval'
},
field
:
[
'topicModelNo'
,
'topicName'
,
'topicType'
,
'dataType'
,
'interval'
],
num
:
[
'dataType'
,
'interval'
,
'dataInterval'
]};
this
.
isV
=
true
;
}
...
...
src/app/main/topic-module-mgr/topic-module-mgr.component.ts
View file @
95ab2f6f
...
...
@@ -92,21 +92,27 @@ export class TopicModuleMgrComponent implements OnInit {
newTopicModelName
:
''
,
topicModelNo
:
one
.
topicModelNo
};
this
.
try
=
{
field
:
[
'newTopicModelName'
,
'topicModelNo'
]};
this
.
try
=
{
trans
:
{
newTopicModelName
:
'moduleName'
},
field
:
[
'newTopicModelName'
,
'topicModelNo'
]};
}
add
()
{
this
.
isUpdate
=
false
;
this
.
req
=
{};
this
.
isAddConV
=
true
;
this
.
try
=
{
field
:
[
'topicModelName'
,
'prefixName'
]};
this
.
try
=
{
trans
:
{
newTopicModelName
:
'moduleName'
},
field
:
[
'topicModelName'
,
'prefixName'
]};
}
update
(
one
)
{
this
.
isUpdate
=
true
;
this
.
req
=
{...
one
};
this
.
isAddConV
=
true
;
this
.
try
=
{
field
:
[
'topicModelNo'
,
'topicModelName'
,
'prefixName'
]};
this
.
try
=
{
trans
:
{
newTopicModelName
:
'moduleName'
,
front
:
'prefixName'
},
field
:
[
'topicModelNo'
,
'topicModelName'
,
'prefixName'
]};
}
cancel
(
v
)
{
...
...
src/app/main/topic-module-way/topic-module-way.component.html
View file @
95ab2f6f
...
...
@@ -51,12 +51,10 @@
[
nzFooter
]="
foot1
"
[
nzTitle
]="
isUpdate
?
('
update
'
|
translate
)
:
('
add
'
|
translate
)"
(
nzOnCancel
)="
cancel
()"
nzMaskClosable=
"false"
>
<ng-template
#
con1
>
<div
class=
"half"
>
<app-search-item
nz-tooltip
nzTitle=
"此处输入为英文"
isMust=
"true"
inModal=
"true"
[
label
]="'
wayName
'
|
translate
"
[(
value
)]="
req
.
name
"
></app-search-item>
<app-search-item
isMust=
"true"
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
inModal=
"true"
[
label
]="'
max
'
|
translate
"
[(
value
)]="
req
.
rangeMax
"
></app-search-item>
<app-search-item
inModal=
"true"
[
label
]="'
alarmMax
'
|
translate
"
[(
value
)]="
req
.
alarmUp
"
></app-search-item>
<app-search-item
inModal=
"true"
[
label
]="'
alarmMaxMax
'
|
translate
"
[(
value
)]="
req
.
upperAlarmLimit
"
></app-search-item>
<app-search-item
nz-tooltip
nzTitle=
"此处输入为英文或数字"
isMust=
"true"
inModal=
"true"
[
label
]="'
wayName
'
|
translate
"
[(
value
)]="
req
.
name
"
></app-search-item>
<app-search-select
isMust=
"true"
inModal=
"true"
[
label
]="'
wayType
'
|
translate
"
[(
value
)]="
req
.
type
"
[
data
]="[{
a:
'
AI
'},
{
a:
'
AO
'},
{
a:
'
DI
'},
{
a:
'
DO
'}]"
optL=
"a"
optV=
"a"
></app-search-select>
<div
class=
"searchItem inModal"
>
<div
class=
"item-label"
><span
class=
"deleteFontColor"
>
*
</span>
{{'isAlarm' | translate}}
</div>
<div
class=
"item-input"
>
...
...
@@ -66,14 +64,28 @@
</nz-radio-group>
</div>
</div>
<app-search-item
inModal=
"true"
[
label
]="'
max
'
|
translate
"
[(
value
)]="
req
.
rangeMax
"
></app-search-item>
<app-search-item
*
ngIf=
"req.isAlarm"
inModal=
"true"
[
label
]="'
alarmMax
'
|
translate
"
[(
value
)]="
req
.
alarmUp
"
></app-search-item>
<app-search-item
*
ngIf=
"req.isAlarm"
inModal=
"true"
[
label
]="'
alarmMaxMax
'
|
translate
"
[(
value
)]="
req
.
upperAlarmLimit
"
></app-search-item>
<app-search-item
*
ngIf=
"req.isAlarm && req.type !== 'DI' && req.type !== 'DO'"
inModal=
"true"
[
label
]="'
alarmInterval
'
|
translate
"
[(
value
)]="
req
.
alarmInterval
"
></app-search-item>
</div>
<div
class=
"half"
>
<app-search-item
nz-tooltip
nzTitle=
"此处输入为英文"
isMust=
"true"
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"
nz-tooltip
nzTitle=
"此处输入为英文或数字"
inModal=
"true"
[
label
]="'
wayAlias
'
|
translate
"
[(
value
)]="
req
.
alias
"
></app-search-item>
<app-search-item
*
ngIf=
"req.type !== 'DI' && req.type !== 'DO'"
isMust=
"true"
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
inModal=
"true"
[
label
]="'
min
'
|
translate
"
[(
value
)]="
req
.
rangeMin
"
></app-search-item>
<app-search-item
inModal=
"true"
[
label
]="'
alarmMin
'
|
translate
"
[(
value
)]="
req
.
alarmDown
"
></app-search-item>
<app-search-item
inModal=
"true"
[
label
]="'
alarmMinMin
'
|
translate
"
[(
value
)]="
req
.
lowerAlarmLimit
"
></app-search-item>
<app-search-item
inModal=
"true"
[
label
]="'
alarmInterval
'
|
translate
"
[(
value
)]="
req
.
alarmInterval
"
></app-search-item>
<app-search-item
*
ngIf=
"req.isAlarm"
inModal=
"true"
[
label
]="'
alarmMin
'
|
translate
"
[(
value
)]="
req
.
alarmDown
"
></app-search-item>
<app-search-item
*
ngIf=
"req.isAlarm"
inModal=
"true"
[
label
]="'
alarmMinMin
'
|
translate
"
[(
value
)]="
req
.
lowerAlarmLimit
"
></app-search-item>
<app-search-item
*
ngIf=
"req.isAlarm && (req.type === 'DI' || req.type === 'DO')"
inModal=
"true"
[
label
]="'
alarmInterval
'
|
translate
"
[(
value
)]="
req
.
alarmInterval
"
></app-search-item>
</div>
<div
class=
"searchItem inModal"
>
<div
class=
"item-label"
style=
"width: 149px;"
>
{{'wayInfo' | translate}}
</div>
...
...
src/app/main/topic-module-way/topic-module-way.component.ts
View file @
95ab2f6f
...
...
@@ -80,7 +80,11 @@ export class TopicModuleWayComponent implements OnInit {
this
.
isUpdate
=
false
;
this
.
isV
=
true
;
this
.
try
=
{
field
:
[
'topicModelNo'
,
'topicName'
,
'name'
,
'alias'
,
'description'
,
'type'
,
'unit'
,
'isAlarm'
],
trans
:
{
name
:
'wayName'
,
alias
:
'wayAlias'
,
description
:
'wayDescription'
,
type
:
'per'
,
isAlarm
:
'isAlarm'
,
alarmUp
:
'alarmMax'
,
upperAlarmLimit
:
'alarmMaxMax'
,
rangeMax
:
'max'
,
alarmDown
:
'alarmMin'
,
lowerAlarmLimit
:
'alarmMinMin'
,
alarmInterval
:
'alarmInterval'
,
rangeMin
:
'min'
},
field
:
[
'topicModelNo'
,
'topicName'
,
'name'
,
'alias'
,
'description'
,
'type'
,
'isAlarm'
],
num
:
[
'alarmUp'
,
'upperAlarmLimit'
,
'rangeMax'
,
'alarmDown'
,
'lowerAlarmLimit'
,
'alarmInterval'
,
'rangeMin'
],
eng
:
[
'name'
,
'alias'
]
};
}
...
...
@@ -91,7 +95,11 @@ export class TopicModuleWayComponent implements OnInit {
this
.
req
.
oldName
=
one
.
name
;
this
.
isV
=
true
;
this
.
try
=
{
field
:
[
'topicModelNo'
,
'topicName'
,
'name'
,
'alias'
,
'description'
,
'type'
,
'unit'
,
'isAlarm'
],
trans
:
{
name
:
'wayName'
,
alias
:
'wayAlias'
,
description
:
'wayDescription'
,
type
:
'per'
,
isAlarm
:
'isAlarm'
,
alarmUp
:
'alarmMax'
,
upperAlarmLimit
:
'alarmMaxMax'
,
rangeMax
:
'max'
,
alarmDown
:
'alarmMin'
,
lowerAlarmLimit
:
'alarmMinMin'
,
alarmInterval
:
'alarmInterval'
,
rangeMin
:
'min'
},
field
:
[
'topicModelNo'
,
'topicName'
,
'name'
,
'alias'
,
'description'
,
'type'
,
'isAlarm'
],
num
:
[
'alarmUp'
,
'upperAlarmLimit'
,
'rangeMax'
,
'alarmDown'
,
'lowerAlarmLimit'
,
'alarmInterval'
,
'rangeMin'
],
eng
:
[
'name'
,
'alias'
]
};
}
...
...
@@ -104,6 +112,11 @@ export class TopicModuleWayComponent implements OnInit {
this
.
isLoading
=
true
;
this
.
req
.
topicModelNo
=
this
.
topicModelNo
;
this
.
req
.
topicName
=
this
.
topicName
;
if
(
this
.
req
.
type
!==
'DI'
&&
this
.
req
.
type
!==
'DO'
&&
!
this
.
req
.
unit
)
{
this
.
message
.
warning
(
'单位为必填项'
);
this
.
isLoading
=
false
;
return
false
;
}
if
(
!
this
.
ck
.
formCheck
(
this
.
req
,
this
.
try
))
{
this
.
isLoading
=
false
;
return
false
;
...
...
src/app/service/check.ts
View file @
95ab2f6f
import
{
Injectable
}
from
'@angular/core'
;
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
import
{
isUndefined
}
from
'util'
;
import
{
TranslateService
}
from
'@ngx-translate/core'
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
import
{
isUndefined
}
from
'util'
;
import
{
TranslateService
}
from
'@ngx-translate/core'
;
@
Injectable
()
export
class
CheckService
{
constructor
(
private
message
:
NzMessageService
,
private
translate
:
TranslateService
)
{}
private
flag
=
0
;
private
trans
=
{};
constructor
(
private
message
:
NzMessageService
,
private
translate
:
TranslateService
)
{
}
formCheck
(
data
,
req
)
{
const
fNum
=
req
.
field
.
length
;
this
.
flag
=
0
;
this
.
trans
=
req
.
trans
;
const
fieldStr
=
'-'
+
req
.
field
.
join
(
'-'
)
+
'-'
;
const
field
=
req
.
field
.
filter
((
item
)
=>
data
[
item
]
!==
''
&&
data
[
item
]
!==
null
&&
!
isUndefined
(
data
[
item
])).
length
;
if
(
field
!==
fNum
)
{
this
.
message
.
warning
(
this
.
translate
.
instant
(
'pleaseFillAll'
));
if
(
req
.
field
)
{
req
.
field
.
filter
((
item
)
=>
this
.
checkField
(
fieldStr
,
data
,
item
));
if
(
this
.
flag
)
{
return
false
;
}
const
tNum
=
req
.
time
?
req
.
time
.
length
:
0
;
const
time
=
req
.
time
?
req
.
time
.
filter
((
item
)
=>
this
.
checkTime
(
fieldStr
,
data
,
item
)).
length
:
0
;
if
(
time
!==
tNum
)
{
this
.
message
.
warning
(
this
.
translate
.
instant
(
'wrongTime'
));
}
if
(
req
.
time
)
{
req
.
time
.
filter
((
item
)
=>
this
.
checkTime
(
fieldStr
,
data
,
item
));
if
(
this
.
flag
)
{
return
false
;
}
const
telNum
=
req
.
tel
?
req
.
tel
.
length
:
0
;
const
tel
=
req
.
tel
?
req
.
tel
.
filter
((
item
)
=>
this
.
checkTel
(
fieldStr
,
data
,
item
)).
length
:
0
;
if
(
tel
!==
telNum
)
{
this
.
message
.
warning
(
this
.
translate
.
instant
(
'wrongTel'
));
}
if
(
req
.
tel
)
{
req
.
tel
.
filter
((
item
)
=>
this
.
checkTel
(
fieldStr
,
data
,
item
));
if
(
this
.
flag
)
{
return
false
;
}
const
mNum
=
req
.
money
?
req
.
money
.
length
:
0
;
const
money
=
req
.
money
?
req
.
money
.
filter
((
item
)
=>
this
.
checkMoney
(
fieldStr
,
data
,
item
)).
length
:
0
;
if
(
money
!==
mNum
)
{
this
.
message
.
warning
(
this
.
translate
.
instant
(
'wrongAmount'
));
}
if
(
req
.
money
)
{
req
.
money
.
filter
((
item
)
=>
this
.
checkMoney
(
fieldStr
,
data
,
item
));
if
(
this
.
flag
)
{
return
false
;
}
const
nNum
=
req
.
num
?
req
.
num
.
length
:
0
;
const
num
=
req
.
num
?
req
.
num
.
filter
((
item
)
=>
this
.
checkNum
(
fieldStr
,
data
,
item
)).
length
:
0
;
if
(
num
!==
nNum
)
{
this
.
message
.
warning
(
this
.
translate
.
instant
(
'wrongNum'
));
}
if
(
req
.
num
)
{
req
.
num
.
filter
((
item
)
=>
this
.
checkNum
(
fieldStr
,
data
,
item
));
if
(
this
.
flag
)
{
return
false
;
}
}
const
f2Num
=
req
.
float2
?
req
.
float2
.
length
:
0
;
const
float2
=
req
.
float2
?
req
.
float2
.
filter
((
item
)
=>
this
.
checkFloat2
(
fieldStr
,
data
,
item
)).
length
:
0
;
if
(
float2
!==
f2Num
)
{
this
.
message
.
warning
(
this
.
translate
.
instant
(
'wrongNum'
));
if
(
req
.
float2
)
{
req
.
float2
.
filter
((
item
)
=>
this
.
checkFloat2
(
fieldStr
,
data
,
item
));
if
(
this
.
flag
)
{
return
false
;
}
}
const
eNum
=
req
.
eng
?
req
.
eng
.
length
:
0
;
const
eng
=
req
.
eng
?
req
.
eng
.
filter
((
item
)
=>
this
.
checkEng
(
fieldStr
,
data
,
item
)).
length
:
0
;
if
(
eng
!==
eNum
)
{
this
.
message
.
warning
(
this
.
translate
.
instant
(
'wrongEng'
));
if
(
req
.
eng
)
{
req
.
eng
.
filter
((
item
)
=>
this
.
checkEng
(
fieldStr
,
data
,
item
));
if
(
this
.
flag
)
{
return
false
;
}
}
return
true
;
}
private
checkField
(
fieldStr
,
data
,
field
)
{
if
(
this
.
flag
===
1
)
{
return
false
;
}
if
((
data
[
field
]
===
''
||
isUndefined
(
data
[
field
])
||
data
[
field
]
===
null
)
&&
fieldStr
.
indexOf
(
'-'
+
field
+
'-'
)
>=
-
1
)
{
this
.
message
.
warning
(
this
.
translate
.
instant
(
this
.
trans
[
field
])
+
'为必填字段, 请检查'
);
this
.
flag
=
1
;
return
false
;
}
else
{
return
true
;
}
}
private
checkTime
(
fieldStr
,
data
,
time
)
{
if
(
this
.
flag
===
1
)
{
return
false
;
}
if
((
data
[
time
]
===
''
||
isUndefined
(
data
[
time
])
||
data
[
time
]
===
null
)
&&
fieldStr
.
indexOf
(
'-'
+
time
+
'-'
)
<=
-
1
)
{
return
true
;
}
if
(
data
[
time
]
&&
new
Date
(
data
[
time
]).
getTime
()
>
0
&&
new
Date
(
data
[
time
]).
getTime
().
toString
().
length
===
13
)
{
return
true
;
}
else
{
this
.
message
.
warning
(
this
.
translate
.
instant
(
this
.
trans
[
time
])
+
'格式填写错误, 应填入正确时间'
);
this
.
flag
=
1
;
return
false
;
}
}
private
checkTel
(
fieldStr
,
data
,
tel
)
{
if
(
this
.
flag
===
1
)
{
return
false
;
}
if
((
data
[
tel
]
===
''
||
isUndefined
(
data
[
tel
])
||
data
[
tel
]
===
null
)
&&
fieldStr
.
indexOf
(
'-'
+
tel
+
'-'
)
<=
-
1
)
{
return
true
;
}
const
reg
=
new
RegExp
(
'^1
\\
d{10}$'
);
const
reg
=
new
RegExp
(
'^1
\\
d{10}$'
);
if
(
data
[
tel
].
length
!==
11
||
!
reg
.
test
(
data
[
tel
]))
{
this
.
message
.
warning
(
this
.
translate
.
instant
(
this
.
trans
[
tel
])
+
'格式填写错误, 应填入正确11位手机号'
);
this
.
flag
=
1
;
return
false
;
}
else
{
return
true
;
...
...
@@ -81,47 +108,59 @@ export class CheckService {
}
private
checkMoney
(
fieldStr
,
data
,
money
)
{
if
(
this
.
flag
===
1
)
{
return
false
;
}
if
((
data
[
money
]
===
''
||
isUndefined
(
data
[
money
])
||
data
[
money
]
===
null
)
&&
fieldStr
.
indexOf
(
'-'
+
money
+
'-'
)
<=
-
1
)
{
return
true
;
}
if
(
parseFloat
(
data
[
money
]).
toFixed
(
2
)
===
data
[
money
]
&&
parseInt
(
data
[
money
],
10
).
toString
().
length
<
8
)
{
return
true
;
}
else
{
this
.
message
.
warning
(
this
.
translate
.
instant
(
this
.
trans
[
money
])
+
'格式填写错误, 应填入数字金额'
);
this
.
flag
=
1
;
return
false
;
}
}
private
checkNum
(
fieldStr
,
data
,
num
)
{
if
(
this
.
flag
===
1
)
{
return
false
;
}
if
((
data
[
num
]
===
''
||
isUndefined
(
data
[
num
])
||
data
[
num
]
===
null
)
&&
fieldStr
.
indexOf
(
'-'
+
num
+
'-'
)
<=
-
1
)
{
return
true
;
}
const
reg
=
new
RegExp
(
'^[0-9]*$'
);
const
reg
=
new
RegExp
(
'^[0-9]*$'
);
if
(
reg
.
test
(
data
[
num
]))
{
return
true
;
}
else
{
this
.
message
.
warning
(
this
.
translate
.
instant
(
this
.
trans
[
num
])
+
'格式填写错误, 应填入数值'
);
this
.
flag
=
1
;
return
false
;
}
}
private
checkFloat2
(
fieldStr
,
data
,
float2
)
{
if
(
this
.
flag
===
1
)
{
return
false
;
}
if
((
data
[
float2
]
===
''
||
isUndefined
(
data
[
float2
])
||
data
[
float2
]
===
null
)
&&
fieldStr
.
indexOf
(
'-'
+
float2
+
'-'
)
<=
-
1
)
{
return
true
;
}
if
(
parseFloat
(
data
[
float2
]).
toFixed
(
2
).
toString
()
===
data
[
float2
])
{
if
(
parseFloat
(
data
[
float2
]).
toFixed
(
2
).
toString
()
===
data
[
float2
])
{
return
true
;
}
else
{
this
.
message
.
warning
(
this
.
translate
.
instant
(
this
.
trans
[
float2
])
+
'格式填写错误, 应填入两位小数'
);
this
.
flag
=
1
;
return
false
;
}
}
private
checkEng
(
fieldStr
,
data
,
eng
)
{
if
(
this
.
flag
===
1
)
{
return
false
;
}
if
((
data
[
eng
]
===
''
||
isUndefined
(
data
[
eng
])
||
data
[
eng
]
===
null
)
&&
fieldStr
.
indexOf
(
'-'
+
eng
+
'-'
)
<=
-
1
)
{
return
true
;
}
const
reg
=
new
RegExp
(
'^[a-zA-Z
]*$'
);
const
reg
=
new
RegExp
(
'^[a-zA-Z0-9
]*$'
);
if
(
reg
.
test
(
data
[
eng
]))
{
return
true
;
}
else
{
this
.
message
.
warning
(
this
.
translate
.
instant
(
this
.
trans
[
eng
])
+
'格式填写错误, 应填入英文或数字'
);
this
.
flag
=
1
;
return
false
;
}
}
...
...
src/environments/environment.ts
View file @
95ab2f6f
...
...
@@ -4,8 +4,9 @@
export
const
environment
=
{
production
:
false
,
baseUrl
:
'http://cloud-test.witium.com/api'
,
// 对外访问测试网地址
//
baseUrl: 'http://cloud-test.witium.com/api', // 对外访问测试网地址
// baseUrl: 'http://172.16.1.53:8092', // cy
baseUrl
:
'http://172.16.1.52:8094'
,
// zz
};
/*
...
...
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