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
776417ce
Commit
776417ce
authored
Jul 15, 2021
by
yating.lin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.修改传感器管理页面 2.去掉InfluxDB管理页面的测试假数据 3.去掉存储策略管理页面的测试假数据
parent
0cf1f8af
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
65 additions
and
136 deletions
+65
-136
influxdb.component.html
src/app/main/influxdb/influxdb.component.html
+4
-3
influxdb.component.ts
src/app/main/influxdb/influxdb.component.ts
+0
-80
retention-policy-mgr.component.ts
...in/retention-policy-mgr/retention-policy-mgr.component.ts
+8
-27
sensor-detail.component.ts
src/app/main/sensor-detail/sensor-detail.component.ts
+8
-5
sensor-mgr.component.html
src/app/main/sensor-mgr/sensor-mgr.component.html
+9
-8
sensor-mgr.component.ts
src/app/main/sensor-mgr/sensor-mgr.component.ts
+32
-12
api.ts
src/app/service/api.ts
+1
-0
zh.json
src/assets/i18n/zh.json
+3
-1
No files found.
src/app/main/influxdb/influxdb.component.html
View file @
776417ce
...
@@ -34,8 +34,8 @@
...
@@ -34,8 +34,8 @@
<td
nz-td
>
{{one.remark}}
</td>
<td
nz-td
>
{{one.remark}}
</td>
<td
nz-td
>
<td
nz-td
>
<span
class=
"editSpan"
(
click
)="
onPolicyMgr
(
one
)"
>
{{'retentionPolicyMgr' | translate}}
</span>
<span
class=
"editSpan"
(
click
)="
onPolicyMgr
(
one
)"
>
{{'retentionPolicyMgr' | translate}}
</span>
<nz-divider
nzType=
"vertical"
*
ngIf=
"0 == one.defaultDatabase"
></nz-divider>
<nz-divider
nzType=
"vertical"
></nz-divider>
<span
class=
"editSpan"
*
ngIf=
"0 == one.defaultDatabase"
(
click
)="
edit
(
one
)"
>
{{'edit' | translate}}
</span>
<span
class=
"editSpan"
(
click
)="
edit
(
one
)"
>
{{'edit' | translate}}
</span>
<nz-divider
nzType=
"vertical"
*
ngIf=
"0 == one.defaultDatabase"
></nz-divider>
<nz-divider
nzType=
"vertical"
*
ngIf=
"0 == one.defaultDatabase"
></nz-divider>
<span
class=
"deleteFontColor"
*
ngIf=
"0 == one.defaultDatabase"
<span
class=
"deleteFontColor"
*
ngIf=
"0 == one.defaultDatabase"
(
click
)="
deleteConfirm
(
one
)"
>
{{'delete' | translate}}
</span>
(
click
)="
deleteConfirm
(
one
)"
>
{{'delete' | translate}}
</span>
...
@@ -48,7 +48,8 @@
...
@@ -48,7 +48,8 @@
<nz-modal
[(
nzVisible
)]="
isVisible
"
[
nzTitle
]="(
isUpdate
?
'
editInfluxDB
'
:
'
addInfluxDB
')
|
translate
"
[
nzContent
]="
modalContent
"
nzWidth=
"500"
<nz-modal
[(
nzVisible
)]="
isVisible
"
[
nzTitle
]="(
isUpdate
?
'
editInfluxDB
'
:
'
addInfluxDB
')
|
translate
"
[
nzContent
]="
modalContent
"
nzWidth=
"500"
[
nzFooter
]="
modalFooter
"
(
nzOnCancel
)="
cancel
()"
nzMaskClosable=
"false"
>
[
nzFooter
]="
modalFooter
"
(
nzOnCancel
)="
cancel
()"
nzMaskClosable=
"false"
>
<ng-template
#
modalContent
>
<ng-template
#
modalContent
>
<app-search-item
isMust=
"true"
[(
value
)]="
req
.
databaseName
"
[
label
]="'
databaseName
'
|
translate
"
inModal=
"true"
></app-search-item>
<app-search-item
isMust=
"true"
inModal=
"true"
[
readonly
]="
isUpdate
"
[(
value
)]="
req
.
databaseName
"
[
label
]="'
databaseName
'
|
translate
"
></app-search-item>
<!--<app-search-select isMust="true" [(value)]="req.companyNo" [label]="'selectCompany' | translate" optL="companyName"-->
<!--<app-search-select isMust="true" [(value)]="req.companyNo" [label]="'selectCompany' | translate" optL="companyName"-->
<!--[data]="companys" inModal="true" optV="companyNo"></app-search-select>-->
<!--[data]="companys" inModal="true" optV="companyNo"></app-search-select>-->
<app-search-item
[(
value
)]="
req
.
remark
"
[
label
]="'
remark
'
|
translate
"
inModal=
"true"
></app-search-item>
<app-search-item
[(
value
)]="
req
.
remark
"
[
label
]="'
remark
'
|
translate
"
inModal=
"true"
></app-search-item>
...
...
src/app/main/influxdb/influxdb.component.ts
View file @
776417ce
...
@@ -48,86 +48,6 @@ export class InfluxdbComponent implements OnInit {
...
@@ -48,86 +48,6 @@ export class InfluxdbComponent implements OnInit {
}
}
next
=
(
data
)
=>
{
next
=
(
data
)
=>
{
// TODO 测试数据
data
=
[
{
influxdbDatabaseNo
:
'ITN78344312655581185'
,
databaseName
:
'witcloud'
,
field
:
'cloud'
,
description
:
'云平台2期'
,
policy
:
null
,
state
:
1
,
companyNo
:
'CN77632031189766160'
,
companyName
:
'上海辉度智能系统有限公司'
,
defaultDatabase
:
1
,
remark
:
null
,
createTime
:
1553149607703
,
updateTime
:
1553149607703
,
retentionPolicyName
:
'witium_policy'
,
duration
:
'2160h0m0s'
,
defaultPolicy
:
null
,
shardDuration
:
'720h0m0s'
},
{
influxdbDatabaseNo
:
'ITN88121886475026432'
,
databaseName
:
'111'
,
field
:
'111'
,
description
:
'111'
,
policy
:
'11'
,
state
:
1
,
companyNo
:
'CN77632031189766160'
,
companyName
:
'上海辉度智能系统有限公司'
,
defaultDatabase
:
0
,
remark
:
'11'
,
createTime
:
1555480762961
,
updateTime
:
1555480762961
,
retentionPolicyName
:
'witium_policy'
,
duration
:
'0s'
,
defaultPolicy
:
null
,
shardDuration
:
'168h0m0s'
},
{
influxdbDatabaseNo
:
'ITN153310897116160001'
,
databaseName
:
'Alliance'
,
field
:
'cloud'
,
description
:
'色谱仪'
,
policy
:
null
,
state
:
1
,
companyNo
:
'CN77632031189766160'
,
companyName
:
'上海辉度智能系统有限公司'
,
defaultDatabase
:
0
,
remark
:
null
,
createTime
:
123
,
updateTime
:
123
,
retentionPolicyName
:
'witium_policy'
,
duration
:
'0s'
,
defaultPolicy
:
null
,
shardDuration
:
'168h0m0s'
}
];
// data = [
// {
// influxdbDatabaseNo: "ITN243244992323002368",
// databaseName: "witiumCloud",
// field: "cloud",
// description: "云平台2期",
// policy: null,
// state: 1,
// companyNo: "CN243244992373334016",
// companyName: "上海辉度减速机平台",
// defaultDatabase: 1,
// remark: null,
// createTime: 1592464993455,
// updateTime: 1592464993455,
// retentionPolicyName: "witium_policy",
// duration: "0s",
// defaultPolicy: null,
// shardDuration: "168h0m0s"
// }
// ]
if
(
data
&&
data
.
constructor
===
Array
)
{
if
(
data
&&
data
.
constructor
===
Array
)
{
this
.
data
=
data
;
this
.
data
=
data
;
}
else
if
(
data
&&
data
.
code
===
1
)
{
}
else
if
(
data
&&
data
.
code
===
1
)
{
...
...
src/app/main/retention-policy-mgr/retention-policy-mgr.component.ts
View file @
776417ce
...
@@ -56,24 +56,8 @@ export class RetentionPolicyMgrComponent implements OnInit {
...
@@ -56,24 +56,8 @@ export class RetentionPolicyMgrComponent implements OnInit {
}
}
getData
()
{
getData
()
{
// this.isLoading = true;
this
.
isLoading
=
true
;
// this.api.influxdbPolicy.getPolicyByInfluxdb([{companyNo: this.companyNo}, this.next]);
this
.
api
.
influxdbPolicy
.
getPolicyByInfluxdb
([{
influxdbDatabaseNo
:
this
.
influxdbDatabaseNo
},
this
.
next
]);
this
.
data
=
[
{
retentionPolicyName
:
'witium_policy'
,
duration
:
'1000h0m0s'
,
shardDuration
:
'168h0m0s'
,
defaultPolicy
:
1
,
remark
:
''
},
{
retentionPolicyName
:
'autogen'
,
duration
:
'1000h0m0s'
,
shardDuration
:
'168h0m0s'
,
defaultPolicy
:
0
,
remark
:
''
},
{
retentionPolicyName
:
'autogen1'
,
duration
:
'1000h0m0s'
,
shardDuration
:
'168h0m0s'
,
defaultPolicy
:
0
,
remark
:
''
},
{
retentionPolicyName
:
'autogen2'
,
duration
:
'1000h0m0s'
,
shardDuration
:
'168h0m0s'
,
defaultPolicy
:
0
,
remark
:
''
},
{
retentionPolicyName
:
'autogen3'
,
duration
:
'1000h0m0s'
,
shardDuration
:
'168h0m0s'
,
defaultPolicy
:
0
,
remark
:
''
},
{
retentionPolicyName
:
'autogen4'
,
duration
:
'1000h0m0s'
,
shardDuration
:
'168h0m0s'
,
defaultPolicy
:
0
,
remark
:
''
},
{
retentionPolicyName
:
'autogen5'
,
duration
:
'1000h0m0s'
,
shardDuration
:
'168h0m0s'
,
defaultPolicy
:
0
,
remark
:
''
},
{
retentionPolicyName
:
'autogen6'
,
duration
:
'1000h0m0s'
,
shardDuration
:
'168h0m0s'
,
defaultPolicy
:
0
,
remark
:
''
},
{
retentionPolicyName
:
'autogen7'
,
duration
:
'1000h0m0s'
,
shardDuration
:
'168h0m0s'
,
defaultPolicy
:
0
,
remark
:
''
},
{
retentionPolicyName
:
'autogen8'
,
duration
:
'1000h0m0s'
,
shardDuration
:
'168h0m0s'
,
defaultPolicy
:
0
,
remark
:
''
},
{
retentionPolicyName
:
'autogen9'
,
duration
:
'1000h0m0s'
,
shardDuration
:
'168h0m0s'
,
defaultPolicy
:
0
,
remark
:
''
},
{
retentionPolicyName
:
'autogen10'
,
duration
:
'1000h0m0s'
,
shardDuration
:
'168h0m0s'
,
defaultPolicy
:
0
,
remark
:
''
},
{
retentionPolicyName
:
'autogen11'
,
duration
:
'1000h0m0s'
,
shardDuration
:
'168h0m0s'
,
defaultPolicy
:
0
,
remark
:
''
},
{
retentionPolicyName
:
'autogen12'
,
duration
:
'1000h0m0s'
,
shardDuration
:
'168h0m0s'
,
defaultPolicy
:
0
,
remark
:
''
},
];
}
}
add
()
{
add
()
{
...
@@ -84,16 +68,12 @@ export class RetentionPolicyMgrComponent implements OnInit {
...
@@ -84,16 +68,12 @@ export class RetentionPolicyMgrComponent implements OnInit {
onSetDefalut
(
one
)
{
onSetDefalut
(
one
)
{
const
param
=
{
const
param
=
{
retentionPolicyNo
:
this
.
req
.
retentionPolicyNo
,
retentionPolicyNo
:
one
.
retentionPolicyNo
,
influxdbDatabaseNo
:
this
.
req
.
influxdbDatabaseNo
,
influxdbDatabaseNo
:
one
.
influxdbDatabaseNo
,
retentionPolicyName
:
this
.
req
.
retentionPolicyName
,
retentionPolicyName
:
one
.
retentionPolicyName
duration
:
this
.
req
.
duration
,
defaultPolicy
:
this
.
req
.
defaultPolicy
,
shardDuration
:
this
.
req
.
shardDuration
,
remark
:
this
.
req
.
remark
,
};
};
this
.
isLoading
=
true
;
this
.
isLoading
=
true
;
this
.
api
.
influxdbPolicy
.
delInfluxdbPolicy
([{
influxdbDatabaseNo
:
one
.
influxdbDatabaseNo
}
,
this
.
next
]);
this
.
api
.
influxdbPolicy
.
updateDefaultPolicy
([
param
,
this
.
next
]);
}
}
edit
(
one
)
{
edit
(
one
)
{
...
@@ -129,6 +109,7 @@ export class RetentionPolicyMgrComponent implements OnInit {
...
@@ -129,6 +109,7 @@ export class RetentionPolicyMgrComponent implements OnInit {
if
(
this
.
isUpdate
)
{
if
(
this
.
isUpdate
)
{
this
.
api
.
influxdbPolicy
.
updateInfluxdbPolicy
([
param
,
this
.
next
]);
this
.
api
.
influxdbPolicy
.
updateInfluxdbPolicy
([
param
,
this
.
next
]);
}
else
{
}
else
{
param
.
influxdbDatabaseNo
=
this
.
influxdbDatabaseNo
;
this
.
api
.
influxdbPolicy
.
addInfluxdbPolicy
([
param
,
this
.
next
]);
this
.
api
.
influxdbPolicy
.
addInfluxdbPolicy
([
param
,
this
.
next
]);
}
}
}
}
...
@@ -147,6 +128,6 @@ export class RetentionPolicyMgrComponent implements OnInit {
...
@@ -147,6 +128,6 @@ export class RetentionPolicyMgrComponent implements OnInit {
}
}
delete
(
one
)
{
delete
(
one
)
{
this
.
api
.
influxdbPolicy
.
delInfluxdbPolicy
([{
influxdbDatabaseNo
:
one
.
influxdbDatabase
No
},
this
.
next
]);
this
.
api
.
influxdbPolicy
.
delInfluxdbPolicy
([{
retentionPolicyNo
:
one
.
retentionPolicy
No
},
this
.
next
]);
}
}
}
}
src/app/main/sensor-detail/sensor-detail.component.ts
View file @
776417ce
...
@@ -206,11 +206,14 @@ export class SensorDetailComponent implements OnInit {
...
@@ -206,11 +206,14 @@ 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
.
hisTopicName
=
this
.
selectedTopicValue
;
this
.
api
.
data
.
getHisData
([{
alias
:
this
.
hisDevInfo
.
alias
,
deviceList
:
[{
sn
:
this
.
hisDevInfo
.
SN
,
this
.
api
.
data
.
getHisData
([{
type
:
this
.
hisDevInfo
.
dType
}],
endTime
:
this
.
selectTime3
?
new
Date
().
getTime
()
:
this
.
req3
.
endTime
,
alias
:
this
.
hisDevInfo
.
alias
,
deviceList
:
[{
sn
:
this
.
hisDevInfo
.
SN
,
type
:
this
.
hisDevInfo
.
dType
}],
endTime
:
this
.
selectTime3
?
new
Date
().
getTime
()
:
this
.
req3
.
endTime
,
offset
:
0
-
new
Date
().
getTimezoneOffset
()
/
60
,
offset
:
0
-
new
Date
().
getTimezoneOffset
()
/
60
,
startTime
:
this
.
selectTime3
?
new
Date
().
getTime
()
-
this
.
selectTime3
*
60
*
60
*
1000
:
this
.
req3
.
startTime
,
startTime
:
this
.
selectTime3
?
new
Date
().
getTime
()
-
this
.
selectTime3
*
60
*
60
*
1000
:
this
.
req3
.
startTime
,
topicName
:
this
.
hisTopicName
},
(
data
)
=>
{
topicName
:
this
.
hisTopicName
},
(
data
)
=>
{
if
(
data
&&
data
.
constructor
===
Array
)
{
if
(
data
&&
data
.
constructor
===
Array
)
{
this
.
historyDate
=
[];
this
.
historyDate
=
[];
this
.
historyData
=
[];
this
.
historyData
=
[];
...
...
src/app/main/sensor-mgr/sensor-mgr.component.html
View file @
776417ce
...
@@ -104,14 +104,11 @@
...
@@ -104,14 +104,11 @@
[
data
]="
topicModels
"
inModal=
"true"
optV=
"topicModelNo"
></app-search-select>
[
data
]="
topicModels
"
inModal=
"true"
optV=
"topicModelNo"
></app-search-select>
<app-search-select
isMust=
"true"
[(
value
)]="
req
.
companyNo
"
[
label
]="'
selectCompany
'
|
translate
"
optL=
"companyName"
<app-search-select
isMust=
"true"
[(
value
)]="
req
.
companyNo
"
[
label
]="'
selectCompany
'
|
translate
"
optL=
"companyName"
(
valueChange
)="
companySelected
($
event
)"
[
data
]="
companys
"
inModal=
"true"
optV=
"companyNo"
></app-search-select>
(
valueChange
)="
companySelected
($
event
)"
[
data
]="
companys
"
inModal=
"true"
optV=
"companyNo"
></app-search-select>
<!--<app-search-select isMust="true" *ngIf="req.companyNo" [(value)]="req.influxdbDatabaseNo"-->
<!--[label]="'selectInfluxDB' | translate" optL="databaseName"-->
<!--[data]="influxdbs" inModal="true" optV="influxdbDatabaseNo"></app-search-select>-->
<app-search-select
[(
value
)]="
req
.
sceneNo
"
[
label
]="'
selectScene
'
|
translate
"
optL=
"sceneName"
<app-search-select
[(
value
)]="
req
.
sceneNo
"
[
label
]="'
selectScene
'
|
translate
"
optL=
"sceneName"
[
data
]="
scenes
"
inModal=
"true"
optV=
"sceneNo"
></app-search-select>
[
data
]="
scenes
"
inModal=
"true"
optV=
"sceneNo"
></app-search-select>
<app-search-select
inModal=
"true"
[
label
]="'
selectInfluxDBTable
'
|
translate
"
[(
value
)]="
req
.
influxdbDatabaseNo
"
<app-search-select
inModal=
"true"
[
label
]="'
selectInfluxDBTable
'
|
translate
"
[(
value
)]="
req
.
influxdbDatabaseNo
"
[
data
]="
influxDBTableList
"
optL=
"
opLevel"
optV=
"opValue
"
></app-search-select>
[
data
]="
influxDBTableList
"
optL=
"
databaseName"
optV=
"influxdbDatabaseNo
"
></app-search-select>
<app-search-item
inModal=
"true"
[
label
]="'
remark
'
|
translate
"
<app-search-item
inModal=
"true"
[
label
]="'
remark
'
|
translate
"
[(
value
)]="
req
.
remark
"
></app-search-item>
[(
value
)]="
req
.
remark
"
></app-search-item>
...
@@ -135,11 +132,12 @@
...
@@ -135,11 +132,12 @@
[
data
]="
topicModels
"
inModal=
"true"
optV=
"topicModelNo"
></app-search-select>
[
data
]="
topicModels
"
inModal=
"true"
optV=
"topicModelNo"
></app-search-select>
<app-search-select
isMust=
"true"
inModal=
"true"
[(
value
)]="
req
.
companyNo
"
[
label
]="'
selectCompany
'
|
translate
"
<app-search-select
isMust=
"true"
inModal=
"true"
[(
value
)]="
req
.
companyNo
"
[
label
]="'
selectCompany
'
|
translate
"
optL=
"companyName"
[
data
]="
companys
"
optV=
"companyNo"
></app-search-select>
optL=
"companyName"
[
data
]="
companys
"
optV=
"companyNo"
></app-search-select>
<!--<app-search-select inModal="true" *ngIf="req.companyNo" [(value)]="req.influxdbDatabaseNo"-->
<!--[label]="'selectInfluxDB' | translate" optL="databaseName"-->
<!--[data]="influxdbs" optV="influxdbDatabaseNo"></app-search-select>-->
<app-search-select
inModal=
"true"
[(
value
)]="
req
.
sceneNo
"
[
label
]="'
selectScene
'
|
translate
"
optL=
"sceneName"
<app-search-select
inModal=
"true"
[(
value
)]="
req
.
sceneNo
"
[
label
]="'
selectScene
'
|
translate
"
optL=
"sceneName"
[
data
]="
scenes
"
optV=
"sceneNo"
></app-search-select>
[
data
]="
scenes
"
optV=
"sceneNo"
></app-search-select>
<app-search-select
inModal=
"true"
[
label
]="'
selectInfluxDBTable
'
|
translate
"
[(
value
)]="
req
.
influxdbDatabaseNo
"
[
data
]="
influxDBTableList
"
optL=
"databaseName"
optV=
"influxdbDatabaseNo"
></app-search-select>
<app-search-item
inModal=
"true"
[
label
]="'
remark
'
|
translate
"
<app-search-item
inModal=
"true"
[
label
]="'
remark
'
|
translate
"
[(
value
)]="
req
.
remark
"
></app-search-item>
[(
value
)]="
req
.
remark
"
></app-search-item>
</ng-template>
</ng-template>
...
@@ -181,7 +179,10 @@
...
@@ -181,7 +179,10 @@
[
nzFooter
]="
foot5
"
(
nzOnCancel
)="
cancel
()"
nzMaskClosable=
"false"
>
[
nzFooter
]="
foot5
"
(
nzOnCancel
)="
cancel
()"
nzMaskClosable=
"false"
>
<ng-template
#
con5
>
<ng-template
#
con5
>
<app-search-select
isMust=
"true"
[(
value
)]="
req5
.
companyNo
"
[
label
]="'
selectCompany
'
|
translate
"
optL=
"companyName"
<app-search-select
isMust=
"true"
[(
value
)]="
req5
.
companyNo
"
[
label
]="'
selectCompany
'
|
translate
"
optL=
"companyName"
[
data
]="
companys
"
inModal=
"true"
optV=
"companyNo"
></app-search-select>
[
data
]="
companys
"
inModal=
"true"
optV=
"companyNo"
(
valueChange
)="
onChangeDivideCompany
(
req5
.
companyNo
)"
></app-search-select>
<app-search-select
isMust=
"true"
inModal=
"true"
[
label
]="'
selectCompanyInfluxDBTable
'
|
translate
"
[(
value
)]="
req5
.
influxdbDatabaseNo
"
[
data
]="
companyInfluxDBTableList
"
optL=
"databaseName"
optV=
"influxdbDatabaseNo"
></app-search-select>
</ng-template>
</ng-template>
<ng-template
#
foot5
>
<ng-template
#
foot5
>
<button
nz-button
nzType=
"default"
[
nzLoading
]="
isLoading
"
(
click
)="
cancel
()"
><span>
{{'cancel' | translate}}
</span></button>
<button
nz-button
nzType=
"default"
[
nzLoading
]="
isLoading
"
(
click
)="
cancel
()"
><span>
{{'cancel' | translate}}
</span></button>
...
...
src/app/main/sensor-mgr/sensor-mgr.component.ts
View file @
776417ce
...
@@ -50,6 +50,7 @@ export class SensorMgrComponent implements OnInit {
...
@@ -50,6 +50,7 @@ export class SensorMgrComponent implements OnInit {
total
=
0
;
total
=
0
;
influxDBTableList
=
[];
influxDBTableList
=
[];
companyInfluxDBTableList
=
[];
constructor
(
private
api
:
ApiService
,
private
message
:
NzMessageService
,
private
router
:
Router
,
constructor
(
private
api
:
ApiService
,
private
message
:
NzMessageService
,
private
router
:
Router
,
private
modalService
:
NzModalService
,
private
translate
:
TranslateService
,
private
ck
:
CheckService
)
{
private
modalService
:
NzModalService
,
private
translate
:
TranslateService
,
private
ck
:
CheckService
)
{
...
@@ -140,10 +141,7 @@ export class SensorMgrComponent implements OnInit {
...
@@ -140,10 +141,7 @@ export class SensorMgrComponent implements OnInit {
this
.
api
.
influxdbTables
.
getAll
(
[
''
,
(
data
)
=>
{
this
.
api
.
influxdbTables
.
getAll
(
[
''
,
(
data
)
=>
{
if
(
data
&&
data
.
constructor
===
Array
)
{
if
(
data
&&
data
.
constructor
===
Array
)
{
data
.
forEach
(
one
=>
{
this
.
influxDBTableList
=
data
;
this
.
influxDBTableList
.
push
({
opLevel
:
one
.
databaseName
,
opValue
:
one
.
influxdbDatabaseNo
});
});
}
else
{
}
else
{
this
.
message
.
error
(
data
&&
data
.
message
?
data
.
message
:
'获取数据失败'
);
this
.
message
.
error
(
data
&&
data
.
message
?
data
.
message
:
'获取数据失败'
);
}
}
...
@@ -268,7 +266,7 @@ export class SensorMgrComponent implements OnInit {
...
@@ -268,7 +266,7 @@ export class SensorMgrComponent implements OnInit {
this
.
req3
=
{
this
.
req3
=
{
address
:
''
,
address
:
''
,
deviceNo
:
one
.
deviceNo
,
deviceNo
:
one
.
deviceNo
,
influxdbDatabaseNo
:
'ITN78344312655581185'
,
influxdbDatabaseNo
:
one
.
influxdbDatabaseNo
,
pDeviceNo
:
''
pDeviceNo
:
''
};
};
this
.
isBindConV
=
true
;
this
.
isBindConV
=
true
;
...
@@ -293,9 +291,10 @@ export class SensorMgrComponent implements OnInit {
...
@@ -293,9 +291,10 @@ export class SensorMgrComponent implements OnInit {
divide
(
one
)
{
divide
(
one
)
{
this
.
isMulti
=
false
;
this
.
isMulti
=
false
;
this
.
req5
=
{...
one
};
this
.
req5
=
{...
one
};
this
.
getInfluxDBByCompany
(
one
.
companyNo
);
this
.
try
=
{
this
.
try
=
{
trans
:
{
companyNo
:
'selectCompany'
},
trans
:
{
companyNo
:
'selectCompany'
,
influxdbDatabaseNo
:
'selectCompanyInfluxDBTable'
},
field
:
[
'companyNo'
,
'deviceNo'
]};
field
:
[
'companyNo'
,
'deviceNo'
,
'influxdbDatabaseNo'
]};
this
.
isDivideConV
=
true
;
this
.
isDivideConV
=
true
;
}
}
...
@@ -317,6 +316,27 @@ export class SensorMgrComponent implements OnInit {
...
@@ -317,6 +316,27 @@ export class SensorMgrComponent implements OnInit {
this
.
isDivideConV
=
false
;
this
.
isDivideConV
=
false
;
}
}
getInfluxDBByCompany
(
value
)
{
this
.
companyInfluxDBTableList
=
[];
if
(
value
)
{
this
.
isLoading
=
true
;
this
.
api
.
influxdbTables
.
getByCompanyNo
(
[{
companyNo
:
value
},
(
data
)
=>
{
if
(
data
&&
data
.
constructor
===
Array
)
{
this
.
companyInfluxDBTableList
=
data
;
}
else
{
this
.
message
.
error
(
data
&&
data
.
message
?
data
.
message
:
'获取数据失败'
);
}
this
.
isLoading
=
false
;
}]);
}
}
onChangeDivideCompany
(
value
)
{
this
.
req5
.
influxdbDatabaseNo
=
null
;
this
.
companyInfluxDBTableList
=
[];
this
.
getInfluxDBByCompany
(
value
);
}
save
(
v
)
{
save
(
v
)
{
this
.
isLoading
=
true
;
this
.
isLoading
=
true
;
if
(
!
this
.
ck
.
formCheck
(
this
[
v
],
this
.
try
))
{
if
(
!
this
.
ck
.
formCheck
(
this
[
v
],
this
.
try
))
{
...
@@ -334,12 +354,10 @@ export class SensorMgrComponent implements OnInit {
...
@@ -334,12 +354,10 @@ export class SensorMgrComponent implements OnInit {
this
.
req
.
alarmMethodNos
=
[];
this
.
req
.
alarmMethodNos
=
[];
this
.
req
.
alarmUsers
=
[];
this
.
req
.
alarmUsers
=
[];
this
.
req
.
model
=
1
;
this
.
req
.
model
=
1
;
this
.
req
.
influxdbDatabaseNo
=
'ITN78344312655581185'
;
this
.
api
.
device
.
updateSensor
([
this
.
req
,
this
.
next
]);
this
.
api
.
device
.
updateSensor
([
this
.
req
,
this
.
next
]);
// 单个绑定
// 单个绑定
}
else
if
(
!
this
.
isMulti
&&
this
.
isBindConV
)
{
}
else
if
(
!
this
.
isMulti
&&
this
.
isBindConV
)
{
this
.
req3
.
pDeviceNo
=
this
.
req3
.
device
.
deviceNo
;
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
]);
this
.
api
.
device
.
gatewayBindGateway
([
this
.
req3
,
this
.
next
]);
// 单个分配
// 单个分配
}
else
if
(
!
this
.
isMulti
&&
this
.
isDivideConV
)
{
}
else
if
(
!
this
.
isMulti
&&
this
.
isDivideConV
)
{
...
@@ -354,7 +372,7 @@ export class SensorMgrComponent implements OnInit {
...
@@ -354,7 +372,7 @@ export class SensorMgrComponent implements OnInit {
}
else
if
(
this
.
isMulti
&&
this
.
isBindConV
)
{
}
else
if
(
this
.
isMulti
&&
this
.
isBindConV
)
{
this
.
req3
.
bindDeviceAddressVos
=
[];
this
.
req3
.
bindDeviceAddressVos
=
[];
this
.
req3
.
pDeviceNo
=
this
.
req3
.
device
.
deviceNo
;
this
.
req3
.
pDeviceNo
=
this
.
req3
.
device
.
deviceNo
;
this
.
req3
.
influxdbDatabaseNo
=
this
.
req3
.
device
.
influxdbDatabaseNo
?
this
.
req3
.
device
.
influxdbDatabaseNo
:
'ITN78344312655581185'
;
//
this.req3.influxdbDatabaseNo = this.req3.device.influxdbDatabaseNo ? this.req3.device.influxdbDatabaseNo : 'ITN78344312655581185';
this
.
req3
.
device
=
null
;
this
.
req3
.
device
=
null
;
this
.
data
.
map
((
one
)
=>
{
this
.
data
.
map
((
one
)
=>
{
if
(
one
.
checked
)
{
if
(
one
.
checked
)
{
...
@@ -370,7 +388,7 @@ export class SensorMgrComponent implements OnInit {
...
@@ -370,7 +388,7 @@ export class SensorMgrComponent implements OnInit {
this
.
req5
.
devices
.
push
(
one
.
deviceNo
);
this
.
req5
.
devices
.
push
(
one
.
deviceNo
);
}
}
});
});
this
.
req5
.
influxdbDatabaseNo
=
'ITN78344312655581185'
;
//
this.req5.influxdbDatabaseNo = 'ITN78344312655581185';
this
.
api
.
device
.
batchUpdateCompany
([
this
.
req5
,
this
.
next
]);
this
.
api
.
device
.
batchUpdateCompany
([
this
.
req5
,
this
.
next
]);
}
}
}
}
...
@@ -408,7 +426,9 @@ export class SensorMgrComponent implements OnInit {
...
@@ -408,7 +426,9 @@ export class SensorMgrComponent implements OnInit {
allDivide
()
{
allDivide
()
{
this
.
isMulti
=
true
;
this
.
isMulti
=
true
;
this
.
req5
=
{};
this
.
req5
=
{};
this
.
try
=
{
trans
:
{
companyNo
:
'selectCompany'
},
field
:
[
'companyNo'
]};
this
.
try
=
{
trans
:
{
companyNo
:
'selectCompany'
,
influxdbDatabaseNo
:
'selectCompanyInfluxDBTable'
},
field
:
[
'companyNo'
,
'influxdbDatabaseNo'
]};
this
.
isDivideConV
=
true
;
this
.
isDivideConV
=
true
;
}
}
...
...
src/app/service/api.ts
View file @
776417ce
...
@@ -154,6 +154,7 @@ export class ApiService {
...
@@ -154,6 +154,7 @@ export class ApiService {
getPolicyByInfluxdb
:
(
data
)
=>
this
.
trans
(
'post'
,
'/device/influxdbPolicy/getPolicyByInfluxdb'
,
data
),
getPolicyByInfluxdb
:
(
data
)
=>
this
.
trans
(
'post'
,
'/device/influxdbPolicy/getPolicyByInfluxdb'
,
data
),
delInfluxdbPolicy
:
(
data
)
=>
this
.
trans
(
'post'
,
'/device/influxdbPolicy/delInfluxdbPolicy'
,
data
),
delInfluxdbPolicy
:
(
data
)
=>
this
.
trans
(
'post'
,
'/device/influxdbPolicy/delInfluxdbPolicy'
,
data
),
getAllPolicyByCompany
:
(
data
)
=>
this
.
trans
(
'post'
,
'/device/influxdbPolicy/getAllPolicyByCompany'
,
data
),
getAllPolicyByCompany
:
(
data
)
=>
this
.
trans
(
'post'
,
'/device/influxdbPolicy/getAllPolicyByCompany'
,
data
),
updateDefaultPolicy
:
(
data
)
=>
this
.
trans
(
'post'
,
'/device/influxdbPolicy/updateDefaultPolicy'
,
data
),
};
};
public
probes
=
{
public
probes
=
{
...
...
src/assets/i18n/zh.json
View file @
776417ce
...
@@ -197,5 +197,7 @@
...
@@ -197,5 +197,7 @@
"isDefaultDB"
:
"是否 default"
,
"isDefaultDB"
:
"是否 default"
,
"popDuration"
:
"存储策略时长(h)"
,
"popDuration"
:
"存储策略时长(h)"
,
"popShardDuration"
:
"shard保存时长(h)"
,
"popShardDuration"
:
"shard保存时长(h)"
,
"selectInfluxDBTable"
:
"选择InfluxDB数据库"
"selectInfluxDBTable"
:
"选择InfluxDB数据库"
,
"selectCompanyInfluxDBTable"
:
"选择InfluxDB数据库"
,
"noUserInfo"
:
"用户信息不存在"
}
}
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