Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
smart
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
wangqinghua
smart
Commits
73ef8491
Commit
73ef8491
authored
Dec 12, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
ff17daaf
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
445 additions
and
210 deletions
+445
-210
basi-check.component.html
...ain/webapp/app/modal/basi-check/basi-check.component.html
+16
-39
basi-check.component.ts
src/main/webapp/app/modal/basi-check/basi-check.component.ts
+87
-24
basic-edit.component.html
...ain/webapp/app/modal/basic-edit/basic-edit.component.html
+1
-10
basic-edit.component.ts
src/main/webapp/app/modal/basic-edit/basic-edit.component.ts
+3
-6
select-person.component.html
...bapp/app/modal/select-person/select-person.component.html
+41
-3
select-person.component.ts
...webapp/app/modal/select-person/select-person.component.ts
+119
-2
warn-list.component.ts
src/main/webapp/app/modal/warn-list/warn-list.component.ts
+2
-0
basic-detail.component.html
...pp/overAll/basic/basic-detail/basic-detail.component.html
+0
-3
basic-detail.component.ts
.../app/overAll/basic/basic-detail/basic-detail.component.ts
+1
-1
overAll.service.ts
src/main/webapp/app/overAll/overAll.service.ts
+113
-108
group.component.ts
src/main/webapp/app/system/group/group.component.ts
+0
-1
inspect-plan.component.html
.../webapp/app/work/inspect-plan/inspect-plan.component.html
+1
-1
inspect-plan.component.ts
...in/webapp/app/work/inspect-plan/inspect-plan.component.ts
+2
-2
look-plan.component.ts
...in/webapp/app/work/modal/look-plan/look-plan.component.ts
+2
-1
plan-modal.component.html
...ebapp/app/work/modal/plan-modal/plan-modal.component.html
+9
-3
plan-modal.component.ts
.../webapp/app/work/modal/plan-modal/plan-modal.component.ts
+48
-6
No files found.
src/main/webapp/app/modal/basi-check/basi-check.component.html
View file @
73ef8491
...
...
@@ -87,18 +87,6 @@
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"data_type"
>
数据类型
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-select
name=
"data_type"
formControlName=
"data_type"
nzPlaceHolder=
"请选择数据类型"
>
<nz-option
nzValue=
"0"
nzLabel=
"十进制"
></nz-option>
<nz-option
nzValue=
"1"
nzLabel=
"八进制"
></nz-option>
<nz-option
nzValue=
"2"
nzLabel=
"二进制"
></nz-option>
<nz-option
nzValue=
"3"
nzLabel=
"布尔"
></nz-option>
</nz-select>
<nz-form-explain
*
ngIf=
"validateForm.get('data_type').dirty && validateForm.get('data_type').errors"
>
请选择数据类型!
</nz-form-explain>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"units"
>
单位
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
id=
"units"
name=
"units"
type=
"text"
nz-input
formControlName=
"units"
>
...
...
@@ -132,14 +120,6 @@
<nz-form-explain
*
ngIf=
"validateForm.get('delay').dirty && validateForm.get('delay').errors"
>
请输入数据更新间隔!
</nz-form-explain>
</nz-form-control>
</nz-form-item>
<!--<nz-form-item>-->
<!--<nz-form-label [nzSpan]="6" nzFor="interval">自定义时间间隔</nz-form-label>-->
<!--<nz-form-control [nzSpan]="14">-->
<!--<input id="interval" name="interval" placeholder="输入自定义时间间隔" type="text" nz-input-->
<!--formControlName="interval">-->
<!--</nz-form-control>-->
<!--</nz-form-item>-->
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
>
历史数据保留时长(单位天)
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
nzFor=
"history"
>
...
...
@@ -155,21 +135,19 @@
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
>
存储值
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
type=
"text"
name=
"storagevalue"
nz-input
formControlName=
"delta"
>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
>
查看值
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
nzFor=
"valuemapid"
>
查看值
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<input
type=
"text"
nz-input
name=
"valuemapid"
formControlName=
"valuemapid"
>
<nz-select
name=
"valuemapid"
formControlName=
"valuemapid"
nzPlaceHolder=
"请选择查看值"
>
<nz-option
nzValue=
"0"
nzLabel=
"不变"
></nz-option>
<ng-container
*
ngFor=
"let item of valueMapList"
>
<nz-option
[
nzValue
]="
item
.
valuemapid
"
[
nzLabel
]="
item
.
name
"
></nz-option>
</ng-container>
</nz-select>
</nz-form-control>
</nz-form-item>
</form>
<div
class=
"modal-footer-btn"
>
<button
nz-button
(
click
)="
handleCheckOk
()"
nzType=
"primary"
>
下一步
</button>
<button
nz-button
(
click
)="
handleCheckOk
()"
nzType=
"primary"
>
保存
</button>
</div>
</nz-tab>
<nz-tab
nzTitle=
"阈值设置"
nzDisabled=
"true"
>
...
...
@@ -186,16 +164,16 @@
<nz-form-label
[
nzSpan
]="
3
"
>
<span
*
ngIf=
"i == 0"
>
危险阈值
</span>
</nz-form-label>
<nz-form-control
[
nzSpan
]="
18
"
class=
"form-select"
>
<div
nz-row
[
nzGutter
]="
12
"
>
<nz-form-control
nz-col
[
nzSpan
]="
6
"
>
<nz-select
name=
"interfaces_main"
nzPlaceHolder=
"选择接口类型"
[(
ngModel
)]="
fault
.
and
"
>
<nz-form-control
nz-col
[
nzSpan
]="
4
"
>
<nz-select
name=
"interfaces_main"
nzPlaceHolder=
"选择接口类型"
[(
ngModel
)]="
fault
.
and
"
*
ngIf=
"i>0"
>
<nz-option
nzValue=
" and "
nzLabel=
"并且"
></nz-option>
<nz-option
nzValue=
" or "
nzLabel=
"或"
></nz-option>
</nz-select>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
3
"
>
<nz-form-control
nz-col
[
nzSpan
]="
4
"
>
<button
class=
"tag-button"
nz-button
nzType=
"default"
>
返回值
</button>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
6
"
>
<nz-form-control
nz-col
[
nzSpan
]="
3
"
>
<nz-select
name=
"interfaces_main"
nzPlaceHolder=
"选择接口类型"
[(
ngModel
)]="
fault
.
equal
"
>
<nz-option
nzValue=
"="
nzLabel=
"="
></nz-option>
<nz-option
nzValue=
">"
nzLabel=
">"
></nz-option>
...
...
@@ -217,13 +195,13 @@
<nz-form-label
[
nzSpan
]="
3
"
><span
*
ngIf=
"i == 0;"
>
故障阈值
</span></nz-form-label>
<nz-form-control
[
nzSpan
]="
18
"
class=
"form-select"
>
<div
nz-row
[
nzGutter
]="
12
"
>
<nz-form-control
nz-col
[
nzSpan
]="
6
"
>
<nz-select
name=
"interfaces_main"
[(
ngModel
)]="
fault
.
and
"
>
<nz-form-control
nz-col
[
nzSpan
]="
4
"
>
<nz-select
name=
"interfaces_main"
[(
ngModel
)]="
fault
.
and
"
*
ngIf=
"i>0"
>
<nz-option
nzValue=
" and "
nzLabel=
"并且"
></nz-option>
<nz-option
nzValue=
" or "
nzLabel=
"或"
></nz-option>
</nz-select>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
6
"
>
<nz-form-control
nz-col
[
nzSpan
]="
4
"
>
<button
class=
"tag-button"
nz-button
nzType=
"default"
>
返回值
</button>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
3
"
>
...
...
@@ -238,7 +216,7 @@
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
3
"
>
<button
*
ngIf=
"i == 0"
nz-button
nzType=
"primary"
(
click
)="
addcondition
()"
>
添加条件
</button>
<button
*
ngIf=
"i > 0"
nz-button
nzType=
"primary"
(
click
)="
deleteCondition
(
i
)"
>
删除条件
</button>
<button
*
ngIf=
"i > 0"
nz-button
nzType=
"primary"
(
click
)="
deleteCondition
(
i
)"
>
<i
class=
"anticon anticon-close-circle-o"
></i>
</button>
</nz-form-control>
</div>
</nz-form-control>
...
...
@@ -253,7 +231,6 @@
<textarea
rows=
"4"
nz-input
[(
ngModel
)]="
triggerObj
.
faultCondition
"
></textarea>
</nz-form-control>
</nz-form-item>
</ng-container>
<div
class=
"modal-footer-btn"
>
<button
nz-button
(
click
)="
saveTrigger
()"
nzType=
"primary"
>
完成
</button>
...
...
src/main/webapp/app/modal/basi-check/basi-check.component.ts
View file @
73ef8491
...
...
@@ -38,6 +38,7 @@ export class BasiCheckComponent implements OnInit {
hostName
;
//主机name
itemId
;
//监控项id
interfaceList
:
any
[];
valueMapList
=
[];
validateForm
:
FormGroup
;
checkList
;
//监测点分类
interval
;
//间隔时长
...
...
@@ -62,16 +63,19 @@ export class BasiCheckComponent implements OnInit {
faultCondition
:
''
,
itemName
:
''
};
triggerId
=
[];
constructor
(
private
overAllSer
:
OverAllService
,
private
fb
:
FormBuilder
,
private
message
:
NzMessageService
)
{
}
ngOnInit
()
{
this
.
initForm
();
this
.
getValuemap
();
}
initForm
(){
this
.
tabNum
=
1
;
this
.
tabNum
=
0
;
this
.
validateForm
=
this
.
fb
.
group
({
hostid
:[
this
.
hostId
],
name
:[
null
,[
Validators
.
required
]],
...
...
@@ -79,16 +83,14 @@ export class BasiCheckComponent implements OnInit {
key_
:[
null
,[
Validators
.
required
]],
value_type
:[
null
,[
Validators
.
required
]],
type
:[
null
,[
Validators
.
required
]],
data_type
:[
null
,[
Validators
.
required
]],
units
:[
null
],
formula
:[
null
,[
Validators
.
required
]],
history
:[
'3600'
],
trends
:[
null
],
valuemapid
:[
null
],
valuemapid
:[
'0'
],
delay
:[
null
,[
Validators
.
required
]],
snmp_oid
:[
null
],
snmp_community
:[
null
],
delta
:[
null
],
snmp_community
:[
'public'
],
applicationids
:[
null
],
});
this
.
triggerObj
=
{
...
...
@@ -113,20 +115,82 @@ export class BasiCheckComponent implements OnInit {
this
.
getItemType
();
}
//映射值
getValuemap
(){
this
.
overAllSer
.
findValuemap
().
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
this
.
valueMapList
=
res
.
data
;
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
}
)
}
//编辑
showEditModal
(
hostId
,
id
){
showEditModal
(
hostId
,
id
,
hostName
){
this
.
title
=
"编辑监测点"
;
this
.
hostId
=
hostId
;
this
.
isCheck
=
true
;
this
.
itemId
=
id
;
this
.
hostName
=
hostName
;
this
.
overAllSer
.
findItemDetail
(
id
).
subscribe
(
(
res
)
=>
{
const
data
=
res
.
data
[
0
];
data
.
type
+=
''
;
data
.
interfaceid
+=
""
;
data
.
value_type
+=
""
;
data
.
data_type
+=
""
;
this
.
validateForm
.
patchValue
(
data
);
data
.
triggers
.
forEach
(
(
value
)
=>
{
this
.
triggerId
.
push
(
value
.
triggerid
);
let
str
=
value
.
expression
;
let
equal
=
[];
let
arr
=
[];
let
con
=
""
;
let
a
=
str
.
split
(
" "
);
a
.
forEach
((
e
)
=>
{
// 符号数组
let
index1
=
e
.
indexOf
(
"}"
);
if
(
e
==
'and'
||
e
==
'or'
){
equal
.
push
(
e
);
}
if
(
index1
>
-
1
){
let
f
=
e
.
substring
(
index1
+
1
,
e
.
length
);
con
+=
'{'
+
this
.
hostName
+
':'
+
this
.
validateForm
.
value
.
key_
+
'.last()}'
+
f
+
" "
;
}
else
{
con
+=
e
+
" "
;
}
});
let
c
=
str
.
replace
(
/and/g
,
""
).
replace
(
/or/g
,
""
).
split
(
" "
);
c
.
forEach
(
(
val
,
index
)
=>
{
let
index1
=
val
.
indexOf
(
"}"
);
let
d
=
val
.
substring
(
index1
+
1
,
val
.
length
);
let
data
;
if
(
index
>
0
){
data
=
{
and
:
" "
+
equal
[
index
-
1
]
+
" "
,
equal
:
d
[
0
],
value
:
d
.
substring
(
1
,
c
.
length
),
}
}
else
{
data
=
{
equal
:
d
[
0
],
value
:
d
.
substring
(
1
,
c
.
length
),
}
}
arr
.
push
(
data
);
});
if
(
value
.
priority
==
2
||
value
.
priority
==
3
){
//危险
this
.
faultConditionList
=
arr
;
this
.
triggerObj
.
condition
=
con
;
}
if
(
value
.
priority
==
4
||
value
.
priority
==
5
){
//故障
this
.
conditionList
=
arr
;
this
.
triggerObj
.
faultCondition
=
con
;
}
});
}
);
...
...
@@ -159,6 +223,7 @@ export class BasiCheckComponent implements OnInit {
this
.
validateForm
.
controls
[
i
].
updateValueAndValidity
();
}
if
(
this
.
validateForm
.
invalid
){
this
.
message
.
error
(
"请输入必填信息"
);
return
false
;
}
this
.
validateForm
.
value
.
applicationids
=
[
this
.
validateForm
.
value
.
applicationids
];
...
...
@@ -176,13 +241,14 @@ export class BasiCheckComponent implements OnInit {
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
success
(
"创建监测点成功"
);
this
.
done
.
emit
();
this
.
tabNum
=
1
;
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
},
(
err
)
=>
{
this
.
message
.
info
(
'系统错误'
);
this
.
message
.
error
(
'系统错误'
);
}
);
}
...
...
@@ -193,14 +259,15 @@ export class BasiCheckComponent implements OnInit {
this
.
overAllSer
.
itemUpdata
(
this
.
validateForm
.
value
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
isCheck
=
false
;
this
.
initForm
();
this
.
message
.
success
(
"修改监测点成功"
);
this
.
done
.
emit
();
this
.
tabNum
=
1
;
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
this
.
message
.
info
(
res
.
errMsg
);
},
(
err
)
=>
{
this
.
message
.
info
(
'系统错误'
);
this
.
message
.
error
(
'系统错误'
);
}
);
}
...
...
@@ -288,20 +355,18 @@ export class BasiCheckComponent implements OnInit {
this
.
faultConditionList
.
forEach
(
res
=>
{
data
.
faultCondition
+=
'{'
+
this
.
hostName
+
':'
+
this
.
validateForm
.
value
.
key_
+
'.last()}'
+
res
.
equal
+
''
+
res
.
value
+
res
.
and
;
});
console
.
log
(
data
.
condition
.
substring
(
0
,
data
.
condition
.
length
-
4
));
console
.
log
(
data
.
faultCondition
.
substring
(
0
,
data
.
faultCondition
.
length
-
4
));
data
.
condition
=
data
.
condition
.
substring
(
0
,
data
.
condition
.
length
-
4
);
data
.
faultCondition
=
data
.
faultCondition
.
substring
(
0
,
data
.
faultCondition
.
length
-
4
);
}
else
{
//高级
data
.
condition
=
this
.
triggerObj
.
condition
;
data
.
faultCondition
=
this
.
triggerObj
.
faultCondition
;
}
//
if(this.title == "添加监测点"){
//
this.createTrigger(data);
//
}
//
if(this.title == "编辑监测点"){
//
this.updateTrigger(data);
//
}
if
(
this
.
title
==
"添加监测点"
){
this
.
createTrigger
(
data
);
}
if
(
this
.
title
==
"编辑监测点"
){
this
.
updateTrigger
(
data
);
}
}
//1.创建阈值
createTrigger
(
data
){
...
...
@@ -314,7 +379,6 @@ export class BasiCheckComponent implements OnInit {
(
response
)
=>
{
if
(
response
.
errCode
==
10000
){
this
.
message
.
success
(
"创建阈值成功"
);
this
.
done
.
emit
();
this
.
initForm
();
this
.
isCheck
=
false
;
}
else
{
...
...
@@ -327,15 +391,14 @@ export class BasiCheckComponent implements OnInit {
//2.修改阈值
updateTrigger
(
data
){
const
res
=
{
triggerid
:
''
,
triggerid
:
this
.
triggerId
,
itemName
:
this
.
validateForm
.
value
.
name
,
faultCondition
:
data
.
faultCondition
,
condition
:
data
.
condition
};
this
.
overAllSer
.
updateTrigger
(
data
).
subscribe
(
res
=>
{
this
.
overAllSer
.
updateTrigger
(
res
).
subscribe
(
res
=>
{
if
(
res
.
errCode
==
10000
){
this
.
message
.
success
(
"修改阈值成功"
);
this
.
done
.
emit
();
this
.
initForm
();
this
.
isCheck
=
false
;
}
else
{
...
...
src/main/webapp/app/modal/basic-edit/basic-edit.component.html
View file @
73ef8491
...
...
@@ -19,15 +19,6 @@
</nz-form-item>
</div>
<!--<div nz-col [nzSpan]="12">-->
<!--<nz-form-item nzFlex>-->
<!--<nz-form-label [nzSpan]="6" nzFor="invertoryname">品牌</nz-form-label>-->
<!--<nz-form-control [nzSpan]="14">-->
<!--<input id="invertoryname" nz-input placeholder="品牌" name="invertoryname"-->
<!--[(ngModel)]="validateForm.inventoryExtend.invertoryname">-->
<!--</nz-form-control>-->
<!--</nz-form-item>-->
<!--</div>-->
</div>
<div
nz-row
[
nzGutter
]="
24
"
>
...
...
@@ -548,7 +539,7 @@
<div
class=
"modal-footer-btn"
>
<button
nz-button
(
click
)="
handleEditCancel
()"
nzType=
"primary"
>
取消
</button>
<button
nz-button
(
click
)="
tabsChange
(
1
)"
nzType=
"primary"
>
上一步
</button>
<button
nz-button
(
click
)="
handleEditCancel
(
1
)"
nzType=
"primary"
>
完成
</button>
<button
nz-button
(
click
)="
handleEditCancel
()"
nzType=
"primary"
>
完成
</button>
</div>
</nz-tab>
</nz-tabset>
...
...
src/main/webapp/app/modal/basic-edit/basic-edit.component.ts
View file @
73ef8491
...
...
@@ -55,7 +55,6 @@ export class BasicEditComponent implements OnInit {
this
.
tabNum
=
0
;
this
.
initForm
();
this
.
getTemplate
();
this
.
getGroup
();
this
.
getTree
();
}
...
...
@@ -79,10 +78,12 @@ export class BasicEditComponent implements OnInit {
this
.
isBasicEdit
=
true
;
this
.
modalTitle
=
'添加资源'
;
this
.
hostId
=
hostId
;
this
.
getGroup
();
}
//编辑
editModal
(
hostId
,
name
,
gId
):
void
{
this
.
getGroup
();
this
.
isBasicEdit
=
true
;
this
.
hostId
=
hostId
;
this
.
modalTitle
=
'编辑资源'
;
...
...
@@ -100,10 +101,6 @@ export class BasicEditComponent implements OnInit {
this
.
validateForm
.
tls_subject
=
data
.
tls_subject
+
''
;
this
.
validateForm
.
tls_psk
=
data
.
tls_psk
+
''
;
this
.
validateForm
.
inventoryExtend
=
data
.
inventoryExtend
;
// this.validateForm.inventoryExtend.invertoryname = data.inventoryExtend.invertoryname;
// this.validateForm.inventoryExtend.mac = data.inventoryExtend.mac;
// this.validateForm.inventoryExtend.storageLocation = data.inventoryExtend.storageLocation;
// this.validateForm.inventoryExtend.maintenanceExpiration = data.inventoryExtend.maintenanceExpiration;
this
.
validateForm
.
hostExtend
.
equipmentTypeid
=
data
.
hostExtend
.
equipmentTypeid
+
''
;
this
.
validateForm
.
hostExtend
.
secondLevelTypeid
=
data
.
hostExtend
.
secondLevelTypeid
+
''
;
this
.
validateForm
.
hostExtend
.
serviceid
=
data
.
hostExtend
.
serviceid
+
''
;
...
...
@@ -258,7 +255,7 @@ export class BasicEditComponent implements OnInit {
);
}
//
getTree
//
获取设备类型
getTree
(){
this
.
overAllSer
.
findTree
().
subscribe
(
(
res
)
=>
{
...
...
src/main/webapp/app/modal/select-person/select-person.component.html
View file @
73ef8491
<p>
select-person works!
</p>
<!--添加资源-->
<nz-modal
[
nzWidth
]="
1080
"
[(
nzVisible
)]="
isVisible
"
[
nzTitle
]="
title
"
(
nzOnCancel
)="
handleEditCancel
()"
(
nzOnOk
)="
handEditleOk
()"
>
<div
nz-form
class=
"ant-advanced-search-form form-select"
>
<div
nz-row
[
nzGutter
]="
24
"
>
<div
nz-col
[
nzSpan
]="
8
"
>
<nz-tree
[(
ngModel
)]="
nodes
"
></nz-tree>
</div>
<div
nz-col
[
nzSpan
]="
8
"
>
<nz-table
#
basicTable
[
nzData
]="
userList
"
(
nzCurrentPageDataChange
)="
currentPageDataChange
($
event
)"
(
nzPageIndexChange
)="
refreshStatus
()"
(
nzPageSizeChange
)="
refreshStatus
()"
>
<thead>
<tr>
<th
nzShowCheckbox
[(
nzChecked
)]="
allChecked
"
[
nzIndeterminate
]="
indeterminate
"
(
nzCheckedChange
)="
checkAll
($
event
)"
></th>
<th>
姓名
</th>
<th>
手机号码
</th>
</tr>
</thead>
<tbody>
<tr
*
ngFor=
"let data of basicTable.data"
>
<td
nzShowCheckbox
[(
nzChecked
)]="
data
.
checked
"
(
nzCheckedChange
)="
selectItem
(
data
,$
event
)"
></td>
<td>
{{data.name}}
</td>
<td>
{{data.mobile}}
</td>
</tr>
</tbody>
</nz-table>
</div>
<div
nz-col
[
nzSpan
]="
8
"
>
<p>
已选中用户
<span
>
清空
</span></p>
<p
(
click
)="
handle
"
*
ngFor=
"let item of selectList;let i = index;"
>
<span>
{{item.name}}
</span>
<span>
{{item.mobile}}
</span>
<span
(
click
)="
deleteSelect
(
i
)"
>
X
</span>
</p>
</div>
</div>
</div>
</nz-modal>
src/main/webapp/app/modal/select-person/select-person.component.ts
View file @
73ef8491
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
Component
,
EventEmitter
,
OnInit
,
Output
}
from
'@angular/core'
;
import
{
NzTreeNode
}
from
'ng-zorro-antd'
;
import
{
SystemService
}
from
'../../system/system.service'
;
import
{
ToTree
}
from
'../../shared/common/toTree'
;
@
Component
({
selector
:
'smart-select-person'
,
...
...
@@ -6,10 +9,124 @@ import { Component, OnInit } from '@angular/core';
styles
:
[]
})
export
class
SelectPersonComponent
implements
OnInit
{
@
Output
()
done
=
new
EventEmitter
();
constructor
()
{
}
isVisible
=
false
;
title
;
groupList
;
userList
;
selectList
=
[];
nodes
:
any
[];
allChecked
=
false
;
checkedNumber
=
0
;
disabledButton
=
true
;
indeterminate
=
false
;
displayData
:
Array
<
{
key1
:
string
;
key2
:
number
;
key3
:
string
;
key4
:
string
;
checked
:
boolean
}
>
=
[];
constructor
(
private
systemSer
:
SystemService
,
private
toTreeSer
:
ToTree
)
{
}
checkAll
(
value
:
boolean
):
void
{
this
.
displayData
.
forEach
(
data
=>
data
.
checked
=
value
);
this
.
refreshStatus
();
}
currentPageDataChange
(
$event
:
Array
<
{
key1
:
string
;
key2
:
number
;
key3
:
string
;
key4
:
string
;
checked
:
boolean
}
>
):
void
{
this
.
displayData
=
$event
;
}
selectItem
(
item
,
e
){
if
(
e
){
this
.
selectList
.
push
(
item
);
}
else
{
this
.
selectList
.
forEach
((
value
,
index
)
=>
{
if
(
value
.
id
==
item
.
id
){
this
.
selectList
.
splice
(
index
,
1
)
}
})
}
this
.
refreshStatus
()
}
deleteSelect
(
index
){
this
.
selectList
.
splice
(
index
,
1
);
}
refreshStatus
():
void
{
const
allChecked
=
this
.
displayData
.
every
(
value
=>
value
.
checked
===
true
);
const
allUnChecked
=
this
.
displayData
.
every
(
value
=>
!
value
.
checked
);
this
.
allChecked
=
allChecked
;
this
.
indeterminate
=
(
!
allChecked
)
&&
(
!
allUnChecked
);
this
.
disabledButton
=
!
this
.
userList
.
some
(
value
=>
value
.
checked
);
this
.
checkedNumber
=
this
.
userList
.
filter
(
value
=>
value
.
checked
).
length
;
}
ngOnInit
()
{
}
init
(){
this
.
selectList
=
[];
this
.
allChecked
=
false
;
this
.
checkedNumber
=
0
;
this
.
disabledButton
=
true
;
this
.
indeterminate
=
false
;
}
showModal
(
title
)
{
this
.
getUser
();
this
.
getGroup
();
this
.
isVisible
=
true
;
this
.
title
=
title
;
}
getUser
()
{
const
data
=
{
'name'
:
''
,
'orgId'
:
''
,
'pageNumber'
:
'1'
,
'pageSize'
:
'10'
};
this
.
systemSer
.
user
(
data
).
subscribe
(
(
res
)
=>
{
this
.
userList
=
res
.
data
;
}
);
}
//组织信息
getGroup
()
{
this
.
systemSer
.
organization
().
subscribe
(
(
res
)
=>
{
this
.
groupList
=
res
.
data
;
this
.
groupList
.
forEach
(
res
=>
{
res
.
title
=
res
.
name
;
res
.
key
=
res
.
id
;
}
);
this
.
nodeTree
();
}
);
}
nodeTree
()
{
const
tree
=
this
.
toTreeSer
.
listToTree
(
'id'
,
'parentId'
,
this
.
groupList
,);
const
list
=
tree
.
map
(
res
=>
{
return
new
NzTreeNode
(
res
);
});
this
.
nodes
=
list
;
}
handleEditCancel
(){
this
.
isVisible
=
false
;
this
.
init
();
}
handEditleOk
(){
this
.
done
.
emit
(
this
.
selectList
);
this
.
isVisible
=
false
;
this
.
init
();
}
}
src/main/webapp/app/modal/warn-list/warn-list.component.ts
View file @
73ef8491
...
...
@@ -44,9 +44,11 @@ export class WarnListComponent implements OnInit {
this
.
alarmSer
.
eventFind
(
data
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
){
if
(
res
.
data
){
this
.
warnList
=
res
.
data
.
data
;
this
.
totalNum
=
res
.
data
.
totalNum
;
this
.
total
.
emit
(
this
.
totalNum
);
}
}
else
{
this
.
message
.
info
(
res
.
errMsg
);
}
...
...
src/main/webapp/app/overAll/basic/basic-detail/basic-detail.component.html
View file @
73ef8491
...
...
@@ -187,9 +187,6 @@
<nz-tab
#
thirdTabs
nzTitle=
"历史告警"
>
<smart-warn-list
#
warnList
></smart-warn-list>
</nz-tab>
<nz-tab
nzTitle=
"资产运维"
>
Content of Tab Pane 3
</nz-tab>
</nz-tabset>
</div>
</div>
...
...
src/main/webapp/app/overAll/basic/basic-detail/basic-detail.component.ts
View file @
73ef8491
...
...
@@ -598,7 +598,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
//编辑监测点
showEditModal
(
item
){
this
.
smartCheck
.
showEditModal
(
this
.
hostId
,
item
.
itemid
);
this
.
smartCheck
.
showEditModal
(
this
.
hostId
,
item
.
itemid
,
this
.
realName
);
}
//添加or编辑监测点 之后
...
...
src/main/webapp/app/overAll/overAll.service.ts
View file @
73ef8491
import
{
HttpClient
}
from
"@angular/common/http"
;
import
{
Observable
}
from
"rxjs/Rx"
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
SERVER_API_URL
}
from
"../app.constants"
;
import
{
HttpClient
}
from
'@angular/common/http'
;
import
{
Observable
}
from
'rxjs/Rx'
;
import
{
Injectable
}
from
'@angular/core'
;
import
{
SERVER_API_URL
}
from
'../app.constants'
;
@
Injectable
()
export
class
OverAllService
{
...
...
@@ -10,303 +10,308 @@ export class OverAllService {
}
//资源列表--所有类型
find
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/host/find'
,
data
);
find
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/host/find'
,
data
);
}
//停止-开启监控
stopOrOpen
(
params1
,
params2
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/host/stopOrOpen/'
+
params1
+
"/"
+
params2
);
stopOrOpen
(
params1
,
params2
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/host/stopOrOpen/'
+
params1
+
'/'
+
params2
);
}
//批量停止开启监控接口
batchStopOrOpen
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/host/batchStopOrOpen'
,
data
);
batchStopOrOpen
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/host/batchStopOrOpen'
,
data
);
}
//资源列表--资源分组
findGroup
():
Observable
<
any
>
{
findGroup
():
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/groups/getAll'
);
}
//资源列表--设备类型
findType
():
Observable
<
any
>
{
findType
():
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/hostType/selectAllEquipmentType'
);
}
//根据设备类型查询主机资源
findHostByType
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/host/selectAllHostByType/'
,
data
);
findHostByType
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/host/selectAllHostByType/'
,
data
);
}
//资源列表--查询主机
findDetail
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/host/find'
,
data
);
findDetail
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/host/find'
,
data
);
}
//资源详情
findDetailed
(
data
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/host/findDetailed/'
+
data
);
findDetailed
(
data
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/host/findDetailed/'
+
data
);
}
//平均响应时间
responseTime
(
data
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/host/responseTime/'
+
data
);
responseTime
(
data
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/host/responseTime/'
+
data
);
}
//丢包率
losed
(
data
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/host/losed/'
+
data
);
losed
(
data
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/host/losed/'
+
data
);
}
//CPU使用率
cupUsed
(
data
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/host/cpuUsed/'
+
data
.
hostId
+
"/"
+
data
.
hostType
);
cupUsed
(
data
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/host/cpuUsed/'
+
data
.
hostId
+
'/'
+
data
.
hostType
);
}
//内存使用率
used
(
data
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/host/used/'
+
data
.
hostId
+
"/"
+
data
.
hostType
);
used
(
data
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/host/used/'
+
data
.
hostId
+
'/'
+
data
.
hostType
);
}
//磁盘使用率
disks
(
data
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/host/disks/'
+
data
.
hostId
+
"/"
+
data
.
hostType
);
disks
(
data
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/host/disks/'
+
data
.
hostId
+
'/'
+
data
.
hostType
);
}
//进出口流量 --SNMP
inOutInfoSnmp
(
data
):
Observable
<
any
>
{
inOutInfoSnmp
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/host/inOutInfo'
,
data
);
}
//进出口流量 --
inOutInfoAgent
(
data
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/host/inOutInfoAgent/'
+
data
);
inOutInfoAgent
(
data
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/host/inOutInfoAgent/'
+
data
);
}
//主机接口
getinterface
(
data
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/hostInterface/getinterface/'
+
data
);
getinterface
(
data
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/hostInterface/getinterface/'
+
data
);
}
//查询键值
zabbixKey
(
data
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/zabbixKey/find/'
+
data
);
zabbixKey
(
data
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/zabbixKey/find/'
+
data
);
}
//创建监控点
create
(
data
):
Observable
<
any
>
{
create
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/item/create'
,
data
);
}
//删除资源--get
deleteHostGet
(
data
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/host/deleteHost/'
+
data
);
deleteHostGet
(
data
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/host/deleteHost/'
+
data
);
}
//批量删除资源--post
deleteHostPost
(
data
):
Observable
<
any
>
{
deleteHostPost
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/host/deleteHost'
,
data
);
}
//添加资源
createHost
(
data
):
Observable
<
any
>
{
createHost
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/host/create'
,
data
);
}
//获取分组信息
getgroups
(
data
):
Observable
<
any
>
{
getgroups
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/groups/getgroups'
,
data
);
}
//模版信息
templates
():
Observable
<
any
>
{
templates
():
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/templates'
);
}
//添加分组
createGroup
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/groups/create'
,
data
);
createGroup
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/groups/create'
,
data
);
}
//修改分组
updataGroup
(
data
):
Observable
<
any
>
{
return
this
.
http
.
put
(
SERVER_API_URL
+
'/groups/updata'
,
data
);
updataGroup
(
data
):
Observable
<
any
>
{
return
this
.
http
.
put
(
SERVER_API_URL
+
'/groups/updata'
,
data
);
}
//删除分组
deleteGroup
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/groups/delete'
,
data
);
deleteGroup
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/groups/delete'
,
data
);
}
//删除监控项
deleteItem
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/item/deleteItem'
,
data
);
deleteItem
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/item/deleteItem'
,
data
);
}
//监控设备数
findSize
():
Observable
<
any
>
{
findSize
():
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/host/findSize'
);
}
//监测点列表--type
findCheckByType
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/item/find/'
,
data
);
findCheckByType
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/item/find/'
,
data
);
}
//查询监控项
findItemDetail
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/item/details/'
+
params
);
findItemDetail
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/item/details/'
+
params
);
}
//监控项分类
findItemType
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/application/find'
,
data
);
findItemType
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/application/find'
,
data
);
}
//新增监控项分类
createItemType
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/application/create'
,
data
);
createItemType
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/application/create'
,
data
);
}
//监测点状态统计
findItemCount
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/item/findItemStatistics/'
+
params
);
findItemCount
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/item/findItemStatistics/'
+
params
);
}
//监测点图形数据
findGraphData
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/graph/findGraphData/'
,
data
);
findGraphData
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/graph/findGraphData/'
,
data
);
}
//监控项修改状态
itemUpdate
(
data
):
Observable
<
any
>
{
return
this
.
http
.
put
(
SERVER_API_URL
+
'/item/updata/'
,
data
);
itemUpdate
(
data
):
Observable
<
any
>
{
return
this
.
http
.
put
(
SERVER_API_URL
+
'/item/updata/'
,
data
);
}
itemUpdata
(
data
):
Observable
<
any
>
{
return
this
.
http
.
put
(
SERVER_API_URL
+
'/item/updata/'
,
data
);
itemUpdata
(
data
):
Observable
<
any
>
{
return
this
.
http
.
put
(
SERVER_API_URL
+
'/item/updata/'
,
data
);
}
//临时暂停
tempStop
(
data
):
Observable
<
any
>
{
tempStop
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/host/tempStop'
,
data
);
}
//查询报警主机 和报警数量 以及最高报警级别
findHostWarningCount
():
Observable
<
any
>
{
findHostWarningCount
():
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/statistics/findHostWarningCount'
);
}
//查询所有告警组
findWarnAll
():
Observable
<
any
>
{
findWarnAll
():
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/alertGroup/findAll'
);
}
//修改资源
updateHost
(
data
):
Observable
<
any
>
{
return
this
.
http
.
put
(
SERVER_API_URL
+
'/host/updataHost'
,
data
);
updateHost
(
data
):
Observable
<
any
>
{
return
this
.
http
.
put
(
SERVER_API_URL
+
'/host/updataHost'
,
data
);
}
//根据host的启用状态查询count 记录数
findHostCountByStatus
(
params
):
Observable
<
any
>
{
findHostCountByStatus
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/host/findHostCountByStatus/'
+
params
);
}
//查询所有主机的警告数和高危报警数
findWarningByAll
(
params
):
Observable
<
any
>
{
findWarningByAll
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/statistics/findWarningByAll/'
+
params
);
}
//网站监测
//查询网站监测列表
findWebscenario
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/webscenario/find'
,
data
);
findWebscenario
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/webscenario/find'
,
data
);
}
//修改网站监测
updateWebscenario
(
data
):
Observable
<
any
>
{
return
this
.
http
.
put
(
SERVER_API_URL
+
'/webscenario/update'
,
data
);
updateWebscenario
(
data
):
Observable
<
any
>
{
return
this
.
http
.
put
(
SERVER_API_URL
+
'/webscenario/update'
,
data
);
}
//创建网站监测
createWebscenario
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/webscenario/create'
,
data
);
createWebscenario
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/webscenario/create'
,
data
);
}
//临时暂停
tempStopWebscenario
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/webscenario/tempStop'
,
data
);
tempStopWebscenario
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/webscenario/tempStop'
,
data
);
}
//取消临时暂停
tempStopCancelWebscenario
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/webscenario/temp-stop-cancel/'
+
params
);
tempStopCancelWebscenario
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/webscenario/temp-stop-cancel/'
+
params
);
}
//启用禁用网站监测
statusBatch
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/webscenario/statusBatch'
,
data
);
statusBatch
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/webscenario/statusBatch'
,
data
);
}
//批量删除网站监测
deleteBatch
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/webscenario/delete'
,
data
);
deleteBatch
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/webscenario/delete'
,
data
);
}
//查找单个网站监测(数据回显接口)
findWeb
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/webscenario/find/'
+
params
);
findWeb
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/webscenario/find/'
+
params
);
}
//添加告警-查询告警目标接口
findAlertAim
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/webscenario/find-alert-aim/'
+
params
);
findAlertAim
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/webscenario/find-alert-aim/'
+
params
);
}
//添加告警接口
addWebAction
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/webscenario/add-web-action'
,
data
);
addWebAction
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/webscenario/add-web-action'
,
data
);
}
//查找最近一条监测状态
findCurrentState
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/webscenario/find-current-state/'
+
params
);
findCurrentState
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/webscenario/find-current-state/'
+
params
);
}
//查找监测图表数据
findChart
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/webscenario/findChart'
,
data
);
findChart
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/webscenario/findChart'
,
data
);
}
//查找阈值设定
findTrigger
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/webscenario/find-trigger/'
+
params
);
findTrigger
(
params
):
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/webscenario/find-trigger/'
+
params
);
}
//网站监测历史告警
findAlert
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/webscenario/findAlert'
,
data
);
findAlert
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/webscenario/findAlert'
,
data
);
}
//统计网站监测告警种类
countStatus
():
Observable
<
any
>
{
countStatus
():
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/webscenario/countStatus'
);
}
//查找所有设备类型tree
findTree
():
Observable
<
any
>
{
findTree
():
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/hostType/findTree'
);
}
//创建触发器
createTrigger
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/item/createItemTrigger'
,
data
);
createTrigger
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/item/createItemTrigger'
,
data
);
}
//修改触发器
updateTrigger
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/item/updateItemTrigger'
,
data
);
updateTrigger
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
'/item/updateItemTrigger'
,
data
);
}
//查看映射值
findValuemap
():
Observable
<
any
>
{
return
this
.
http
.
get
(
SERVER_API_URL
+
'/valuemap/find'
);
}
}
src/main/webapp/app/system/group/group.component.ts
View file @
73ef8491
...
...
@@ -48,7 +48,6 @@ export class GroupComponent implements OnInit {
this
.
checkedNumber
=
this
.
dataSet
.
filter
(
value
=>
value
.
checked
).
length
;
}
mouseAction
(
name
:
string
,
e
:
any
):
void
{
console
.
log
(
name
,
e
);
}
...
...
src/main/webapp/app/work/inspect-plan/inspect-plan.component.html
View file @
73ef8491
...
...
@@ -76,7 +76,7 @@
<span
*
ngIf=
"data.status == 2"
>
已结束
</span>
</td>
<td
class=
"handle text-center"
>
<span
(
click
)="
lookPlan
(
data
.
id
)"
>
查看
</span>
<span
(
click
)="
lookPlan
(
data
.
id
,
data
.
title
)"
>
查看
</span>
<span
(
click
)="
editPlan
(
data
.
id
)"
>
编辑
</span>
<span
(
click
)="
deletePlan
(
data
)"
>
删除
</span>
</td>
...
...
src/main/webapp/app/work/inspect-plan/inspect-plan.component.ts
View file @
73ef8491
...
...
@@ -90,8 +90,8 @@ export class InspectPlanComponent implements OnInit {
}
//查看计划
lookPlan
(
id
){
this
.
smartLookPlan
.
showModal
(
id
);
lookPlan
(
id
,
name
){
this
.
smartLookPlan
.
showModal
(
id
,
name
);
}
//删除计划
...
...
src/main/webapp/app/work/modal/look-plan/look-plan.component.ts
View file @
73ef8491
...
...
@@ -17,7 +17,8 @@ export class LookPlanComponent implements OnInit {
ngOnInit
()
{
}
showModal
(
id
){
showModal
(
id
,
name
){
this
.
title
=
"计划:"
+
name
;
this
.
isVisible
=
true
;
this
.
workSer
.
findPlan
(
id
).
subscribe
(
(
res
)
=>
{
...
...
src/main/webapp/app/work/modal/plan-modal/plan-modal.component.html
View file @
73ef8491
...
...
@@ -115,14 +115,20 @@
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
nzRequired
nzFor=
"serviceid"
>
参与人
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<label
nz-checkbox
></label>
<button
(
click
)="
selectPerson1
()"
nz-button
><span>
选择
</span></button>
<ng-container
*
ngFor=
"let item1 of participantsList;let i = index;"
>
<span>
{{item1.username}}
</span><span
(
click
)="
delete1
(
i
)"
>
X
</span>
</ng-container>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
4
"
nzRequired
nzFor=
"serviceid"
>
负责人
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<label
nz-checkbox
></label>
<button
(
click
)="
selectPerson2
()"
nz-button
><span>
选择
</span></button>
<ng-container
*
ngFor=
"let item2 of principalsList;let i = index;"
>
<span>
{{item2.username}}
</span><span
(
click
)="
delete2
(
i
)"
>
X
</span>
</ng-container>
</nz-form-control>
</nz-form-item>
...
...
@@ -148,5 +154,5 @@
</div>
</form>
</nz-modal>
<smart-select-person
#
smartSelectPerson
(
done
)="
getUser
($
event
)"
></smart-select-person>
src/main/webapp/app/work/modal/plan-modal/plan-modal.component.ts
View file @
73ef8491
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
FormBuilder
,
FormGroup
}
from
'@angular/forms'
;
import
{
Component
,
OnInit
,
ViewChild
}
from
'@angular/core'
;
import
{
FormBuilder
,
FormGroup
,
Validators
}
from
'@angular/forms'
;
import
{
WorkService
}
from
'../../work.service'
;
import
{
NzMessageService
,
UploadFile
}
from
'ng-zorro-antd'
;
import
{
SelectPersonComponent
}
from
'../../../modal/select-person/select-person.component'
;
@
Component
({
selector
:
'smart-plan-modal'
,
...
...
@@ -9,6 +10,7 @@ import {NzMessageService, UploadFile} from 'ng-zorro-antd';
styles
:
[]
})
export
class
PlanModalComponent
implements
OnInit
{
@
ViewChild
(
'smartSelectPerson'
)
smartSelectPerson
:
SelectPersonComponent
;
planList
;
planId
;
...
...
@@ -16,6 +18,10 @@ export class PlanModalComponent implements OnInit {
isVisiable
=
false
;
validateForm
:
FormGroup
;
fileList
:
UploadFile
[]
=
[];
modalTitle
;
participantsList
;
//参与人
principalsList
;
//负责人
constructor
(
private
workSer
:
WorkService
,
private
message
:
NzMessageService
,
private
fb
:
FormBuilder
)
{
...
...
@@ -30,8 +36,8 @@ export class PlanModalComponent implements OnInit {
this
.
validateForm
=
this
.
fb
.
group
({
title
:
[
null
],
typeId
:
[
null
],
startTime
:
[
null
],
endTime
:
[
null
],
startTime
:
[
null
,
[
Validators
.
required
]
],
endTime
:
[
null
,
[
Validators
.
required
]
],
cycleType
:
[
null
],
cycleNum
:
[
null
],
number
:
[
null
],
...
...
@@ -85,7 +91,7 @@ export class PlanModalComponent implements OnInit {
if
(
this
.
title
==
'添加计划'
)
{
this
.
create
();
}
if
(
this
.
title
=
'编辑计划'
)
{
if
(
this
.
title
=
=
'编辑计划'
)
{
this
.
update
();
}
}
...
...
@@ -116,7 +122,7 @@ export class PlanModalComponent implements OnInit {
});
formData
.
append
(
'json'
,
JSON
.
stringify
(
this
.
validateForm
.
value
));
formData
.
append
(
'id'
,
this
.
planId
);
this
.
workSer
.
cre
atePlan
(
formData
).
subscribe
(
this
.
workSer
.
upd
atePlan
(
formData
).
subscribe
(
(
res
)
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
success
(
'修改计划成功'
);
...
...
@@ -133,4 +139,40 @@ export class PlanModalComponent implements OnInit {
this
.
isVisiable
=
false
;
}
selectPerson1
()
{
this
.
modalTitle
=
'选择参与人'
;
this
.
smartSelectPerson
.
showModal
(
this
.
modalTitle
);
}
selectPerson2
()
{
this
.
modalTitle
=
'选择负责人'
;
this
.
smartSelectPerson
.
showModal
(
this
.
modalTitle
);
}
getUser
(
e
)
{
const
arr
=
[];
e
.
forEach
(
res
=>
{
const
data
=
{
username
:
res
.
name
,
userId
:
res
.
id
}
arr
.
push
(
data
);
})
if
(
this
.
modalTitle
==
'选择参与人'
)
{
this
.
participantsList
=
arr
;
}
if
(
this
.
modalTitle
==
'选择负责人'
)
{
this
.
principalsList
=
arr
;
}
}
//删除参与人
delete1
(
index
){
this
.
participantsList
.
splice
(
index
,
1
)
}
//删除负责人
delete2
(
index
){
this
.
principalsList
.
splice
(
index
,
1
)
}
}
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