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
1ab544da
Commit
1ab544da
authored
Jul 16, 2019
by
zhuangzhuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
网关正则修改
网关绑定的功能
parent
c7928dec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
gateway.component.ts
src/app/main/gateway/gateway.component.ts
+11
-2
check.ts
src/app/service/check.ts
+1
-1
No files found.
src/app/main/gateway/gateway.component.ts
View file @
1ab544da
...
...
@@ -278,37 +278,46 @@ export class GatewayComponent implements OnInit {
save
(
v
)
{
this
.
isLoading
=
true
;
console
.
log
(
'im here'
);
if
(
!
this
.
ck
.
formCheck
(
this
[
v
],
this
.
try
))
{
this
.
isLoading
=
false
;
return
;
}
console
.
log
(
'im here 2'
);
// 单个新增
if
(
!
this
.
isMulti
&&
this
.
isAddConV
&&
!
this
.
isUpdate
)
{
console
.
log
(
'add'
);
this
.
api
.
device
.
addGateway
([
this
.
req
,
this
.
next
]);
// 单个编辑
}
else
if
(
!
this
.
isMulti
&&
this
.
isAddConV
&&
this
.
isUpdate
)
{
console
.
log
(
'updateGateway'
);
this
.
api
.
device
.
updateGateway
([
this
.
req
,
this
.
next
]);
// 单个分配
}
else
if
(
!
this
.
isMulti
&&
this
.
isDivideConV
)
{
console
.
log
(
'updateCompany'
);
this
.
api
.
device
.
updateCompany
([
this
.
req4
,
this
.
next
]);
// 单个绑定
}
else
if
(
!
this
.
isMulti
&&
this
.
isBindConV
)
{
this
.
req3
.
device
=
null
;
console
.
log
(
'gatewayBindGateway'
);
// this.req3.device = null;
this
.
req3
.
pDeviceNo
=
this
.
req3
.
device
.
deviceNo
;
this
.
req3
.
influxdbDatabaseNo
=
this
.
req3
.
device
.
influxdbDatabaseNo
?
this
.
req3
.
device
.
influxdbDatabaseNo
:
'ITN78344312655581185'
;
this
.
api
.
device
.
gatewayBindGateway
([
this
.
req3
,
this
.
next
]);
// 批量新增
}
else
if
(
this
.
isMulti
&&
this
.
isMultiAddConV
)
{
console
.
log
(
'batchAddGateway'
);
this
.
api
.
device
.
batchAddGateway
([
this
.
req
,
this
.
next
]);
// 批量绑定
}
else
if
(
this
.
isMulti
&&
this
.
isBindConV
)
{
console
.
log
(
'multiply'
);
this
.
req3
.
bindDeviceAddressVos
=
[];
this
.
req3
.
pDeviceNo
=
this
.
req3
.
device
.
deviceNo
;
this
.
req3
.
influxdbDatabaseNo
=
this
.
req3
.
device
.
influxdbDatabaseNo
?
this
.
req3
.
device
.
influxdbDatabaseNo
:
'ITN78344312655581185'
;
this
.
req3
.
device
=
null
;
this
.
data
.
map
((
one
)
=>
{
if
(
one
.
checked
)
{
this
.
req3
.
bindDeviceAddressVos
.
push
({
deviceNo
:
one
.
deviceNo
,
address
:
Number
(
this
.
req3
.
address
)
+
one
.
cI
});
this
.
req3
.
bindDeviceAddressVos
.
push
({
deviceNo
:
one
.
deviceNo
,
address
:
this
.
req3
.
address
+
one
.
cI
});
}
});
this
.
api
.
device
.
batchBindDevice
([
this
.
req3
,
this
.
next
]);
...
...
src/app/service/check.ts
View file @
1ab544da
...
...
@@ -143,7 +143,7 @@ export class CheckService {
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
{
...
...
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