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
071aee01
Commit
071aee01
authored
Jan 04, 2019
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
ce253d58
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
434 additions
and
359 deletions
+434
-359
app.main.module.ts
src/main/webapp/app/app.main.module.ts
+2
-0
basi-check.component.html
...ain/webapp/app/modal/basi-check/basi-check.component.html
+2
-117
basi-check.component.ts
src/main/webapp/app/modal/basi-check/basi-check.component.ts
+2
-196
threshold.component.html
src/main/webapp/app/modal/threshold/threshold.component.html
+102
-0
threshold.component.ts
src/main/webapp/app/modal/threshold/threshold.component.ts
+274
-0
basic-detail.component.html
...pp/overAll/basic/basic-detail/basic-detail.component.html
+14
-8
basic-detail.component.ts
.../app/overAll/basic/basic-detail/basic-detail.component.ts
+16
-19
threshold.component.html
src/main/webapp/app/threshold/threshold.component.html
+0
-3
threshold.component.ts
src/main/webapp/app/threshold/threshold.component.ts
+0
-15
child-assets.component.ts
...pp/work/asset-part/child-assets/child-assets.component.ts
+16
-1
work.service.ts
src/main/webapp/app/work/work.service.ts
+6
-0
No files found.
src/main/webapp/app/app.main.module.ts
View file @
071aee01
...
@@ -95,6 +95,7 @@ import {SelectGroupComponent} from './modal/select-group/select-group.component'
...
@@ -95,6 +95,7 @@ import {SelectGroupComponent} from './modal/select-group/select-group.component'
import
{
ModifyPasswordComponent
}
from
'./modal/modify-password/modify-password.component'
;
import
{
ModifyPasswordComponent
}
from
'./modal/modify-password/modify-password.component'
;
import
{
FullScreenComponent
}
from
'./modal/full-screen/full-screen.component'
;
import
{
FullScreenComponent
}
from
'./modal/full-screen/full-screen.component'
;
import
{
LookRoleComponent
}
from
'./look-role/look-role.component'
;
import
{
LookRoleComponent
}
from
'./look-role/look-role.component'
;
import
{
ThresholdComponent
}
from
'./modal/threshold/threshold.component'
;
@
NgModule
({
@
NgModule
({
imports
:
[
imports
:
[
...
@@ -192,6 +193,7 @@ import {LookRoleComponent} from './look-role/look-role.component';
...
@@ -192,6 +193,7 @@ import {LookRoleComponent} from './look-role/look-role.component';
FullScreenComponent
,
FullScreenComponent
,
LookPlanComponent
,
LookPlanComponent
,
LookRoleComponent
,
LookRoleComponent
,
ThresholdComponent
,
],
],
providers
:[
providers
:[
OverAllService
,
OverAllService
,
...
...
src/main/webapp/app/modal/basi-check/basi-check.component.html
View file @
071aee01
<section>
<nz-modal
[
nzWidth
]="
880
"
[(
nzVisible
)]="
isCheck
"
[
nzTitle
]="
title
"
(
nzOnCancel
)="
handleCheckCancel
()"
<nz-modal
[
nzWidth
]="
880
"
[
nzFooter
]="
null
"
[(
nzVisible
)]="
isCheck
"
[
nzTitle
]="
title
"
(
nzOnCancel
)="
handleCheckCancel
()"
(
nzOnOk
)="
handleCheckOk
()"
>
(
nzOnOk
)="
handleCheckOk
()"
>
<nz-tabset
[
nzSelectedIndex
]="
tabNum
"
style=
"padding-bottom: 25px;min-height: 500px"
>
<nz-tab
nzTitle=
"基本属性"
nzDisabled=
"true"
>
<form
[
formGroup
]="
validateForm
"
nz-form
>
<form
[
formGroup
]="
validateForm
"
nz-form
>
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"checkName"
>
监测点名称
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"checkName"
>
监测点名称
</nz-form-label>
...
@@ -102,15 +98,6 @@
...
@@ -102,15 +98,6 @@
<button
nz-button
nzType=
"primary"
(
click
)="
showTypeModal
()"
>
新建分类
</button>
<button
nz-button
nzType=
"primary"
(
click
)="
showTypeModal
()"
>
新建分类
</button>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<!--<nz-form-item>-->
<!--<nz-form-label [nzSpan]="6" nzRequired nzFor="formula">使用自定义倍数</nz-form-label>-->
<!--<nz-form-control [nzSpan]="14">-->
<!--<input id="formula" name="formula" type="text" placeholder="输入倍数" nz-input-->
<!--formControlName="formula">-->
<!--<nz-form-explain *ngIf="validateForm.get('formula').dirty && validateForm.get('formula').errors">请输入自定义倍数!</nz-form-explain>-->
<!--</nz-form-control>-->
<!--</nz-form-item>-->
<nz-form-item>
<nz-form-item>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"delay"
>
数据更新间隔
</nz-form-label>
<nz-form-label
[
nzSpan
]="
6
"
nzRequired
nzFor=
"delay"
>
数据更新间隔
</nz-form-label>
<nz-form-control
[
nzSpan
]="
14
"
>
<nz-form-control
[
nzSpan
]="
14
"
>
...
@@ -145,109 +132,7 @@
...
@@ -145,109 +132,7 @@
<!--</nz-form-control>-->
<!--</nz-form-control>-->
<!--</nz-form-item>-->
<!--</nz-form-item>-->
</form>
</form>
<div
class=
"modal-footer-btn"
>
</nz-modal>
<button
nz-button
(
click
)="
handleCheckOk
()"
nzType=
"primary"
>
下一步
</button>
</div>
</nz-tab>
<nz-tab
nzTitle=
"阈值设置"
nzDisabled=
"true"
>
<nz-form-item
nzFlex
>
<nz-form-control
[
nzOffset
]="
4
"
[
nzSpan
]="
14
"
>
<nz-radio-group
[(
ngModel
)]="
conditionType
"
>
<label
nz-radio-button
nzValue=
"commonly"
><span>
常规
</span></label>
<label
nz-radio-button
nzValue=
"high"
><span>
高级
</span></label>
</nz-radio-group>
</nz-form-control>
</nz-form-item>
<ng-container
*
ngIf=
"conditionType == 'commonly'"
>
<nz-form-item
class=
"form-select"
>
<nz-form-control
class=
"form-select"
>
<div
nz-row
[
nzGutter
]="
12
"
>
<nz-form-control
nz-col
[
nzPush
]="
3
"
[
nzSpan
]="
6
"
>
<button
nz-button
nzType=
"primary"
nzSize=
"small"
(
click
)="
addFault
()"
>
添加条件
</button>
<span>
危险阈值
</span>
</nz-form-control>
</div>
<div
nz-row
[
nzGutter
]="
12
"
*
ngFor=
"let fault of faultConditionList;let i = index;"
>
<nz-form-control
nz-col
[
nzSpan
]="
3
"
></nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
5
"
>
<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
]="
4
"
>
<button
class=
"tag-button"
nz-button
nzType=
"default"
>
返回值
</button>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
5
"
>
<nz-select
name=
"interfaces_main"
nzPlaceHolder=
"选择接口类型"
[(
ngModel
)]="
fault
.
equal
"
>
<nz-option
nzValue=
"="
nzLabel=
"="
></nz-option>
<nz-option
nzValue=
">"
nzLabel=
">"
></nz-option>
<nz-option
nzValue=
"<"
nzLabel=
"<"
></nz-option>
</nz-select>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
5
"
>
<input
type=
"text"
placeholder=
"值"
nz-input
name=
"value"
[(
ngModel
)]="
fault
.
value
"
>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
2
"
>
<button
nz-button
nzType=
"primary"
(
click
)="
deleteFault
(
i
)"
><i
class=
"anticon anticon-close-circle-o"
></i></button>
</nz-form-control>
</div>
</nz-form-control>
</nz-form-item>
<nz-form-item
class=
"form-select"
>
<nz-form-control
class=
"form-select"
>
<div
nz-row
[
nzGutter
]="
12
"
>
<nz-form-control
nz-col
[
nzPush
]="
3
"
[
nzSpan
]="
6
"
>
<button
nz-button
nzType=
"primary"
nzSize=
"small"
(
click
)="
addcondition
()"
>
添加条件
</button>
<span>
故障阈值
</span>
</nz-form-control>
</div>
<div
nz-row
[
nzGutter
]="
12
"
*
ngFor=
"let fault of conditionList;let i = index;"
>
<nz-form-control
nz-col
[
nzSpan
]="
3
"
></nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
5
"
>
<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
]="
4
"
>
<button
class=
"tag-button"
nz-button
nzType=
"default"
>
返回值
</button>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
5
"
>
<nz-select
name=
"interfaces_main"
nzPlaceHolder=
"选择接口类型"
[(
ngModel
)]="
fault
.
equal
"
>
<nz-option
nzValue=
"="
nzLabel=
"="
></nz-option>
<nz-option
nzValue=
">"
nzLabel=
">"
></nz-option>
<nz-option
nzValue=
"<"
nzLabel=
"<"
></nz-option>
</nz-select>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
5
"
>
<input
type=
"text"
placeholder=
"值"
nz-input
name=
"value"
[(
ngModel
)]="
fault
.
value
"
>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
2
"
>
<button
nz-button
nzType=
"primary"
(
click
)="
deleteCondition
(
i
)"
><i
class=
"anticon anticon-close-circle-o"
></i></button>
</nz-form-control>
</div>
</nz-form-control>
</nz-form-item>
</ng-container>
<ng-container
*
ngIf=
"conditionType == 'high'"
>
<nz-form-item
nzFlex
>
<nz-form-control
[
nzOffset
]="
4
"
[
nzSpan
]="
14
"
>
<p>
危险阈值
</p>
<textarea
rows=
"4"
nz-input
[(
ngModel
)]="
triggerObj
.
condition
"
></textarea>
<p>
故障阈值
</p>
<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>
</div>
</nz-tab>
</nz-tabset>
</nz-modal>
</section>
<!--键值查询-->
<!--键值查询-->
<smart-basic-key
(
keyValue
)="
getKey
($
event
)"
#
basicKey
></smart-basic-key>
<smart-basic-key
(
keyValue
)="
getKey
($
event
)"
#
basicKey
></smart-basic-key>
...
...
src/main/webapp/app/modal/basi-check/basi-check.component.ts
View file @
071aee01
...
@@ -44,21 +44,13 @@ export class BasiCheckComponent implements OnInit {
...
@@ -44,21 +44,13 @@ export class BasiCheckComponent implements OnInit {
validateForm
:
FormGroup
;
validateForm
:
FormGroup
;
checkList
;
//监测点分类
checkList
;
//监测点分类
interval
;
//间隔时长
interval
;
//间隔时长
conditionType
=
'commonly'
;
faultConditionList
=
[
];
//危险阀值list
conditionList
=
[
];
//故障list
tabNum
:
number
;
tabNum
:
number
;
triggerObj
=
{
triggerObj
=
{
condition
:
''
,
condition
:
''
,
faultCondition
:
''
,
faultCondition
:
''
,
itemName
:
''
itemName
:
''
};
};
triggerConditionId
;
triggerFaultConditionId
;
constructor
(
private
overAllSer
:
OverAllService
,
private
fb
:
FormBuilder
,
constructor
(
private
overAllSer
:
OverAllService
,
private
fb
:
FormBuilder
,
private
message
:
NzMessageService
)
{
private
message
:
NzMessageService
)
{
...
@@ -142,56 +134,6 @@ export class BasiCheckComponent implements OnInit {
...
@@ -142,56 +134,6 @@ export class BasiCheckComponent implements OnInit {
});
});
}
}
this
.
validateForm
.
patchValue
(
data
);
this
.
validateForm
.
patchValue
(
data
);
data
.
triggers
.
forEach
((
value
)
=>
{
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
;
this
.
triggerConditionId
=
value
.
triggerid
;
}
if
(
value
.
priority
==
4
||
value
.
priority
==
5
)
{
//故障
this
.
conditionList
=
arr
;
this
.
triggerObj
.
faultCondition
=
con
;
this
.
triggerFaultConditionId
=
value
.
triggerid
;
}
});
}
}
);
);
...
@@ -244,6 +186,7 @@ export class BasiCheckComponent implements OnInit {
...
@@ -244,6 +186,7 @@ export class BasiCheckComponent implements OnInit {
this
.
message
.
success
(
'创建监测点成功'
);
this
.
message
.
success
(
'创建监测点成功'
);
this
.
done
.
emit
();
this
.
done
.
emit
();
this
.
tabNum
=
1
;
this
.
tabNum
=
1
;
this
.
isCheck
=
false
;
}
else
{
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
this
.
message
.
error
(
res
.
errMsg
);
}
}
...
@@ -263,6 +206,7 @@ export class BasiCheckComponent implements OnInit {
...
@@ -263,6 +206,7 @@ export class BasiCheckComponent implements OnInit {
this
.
message
.
success
(
'修改监测点成功'
);
this
.
message
.
success
(
'修改监测点成功'
);
this
.
done
.
emit
();
this
.
done
.
emit
();
this
.
tabNum
=
1
;
this
.
tabNum
=
1
;
this
.
isCheck
=
false
;
}
else
{
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
this
.
message
.
error
(
res
.
errMsg
);
}
}
...
@@ -306,148 +250,10 @@ export class BasiCheckComponent implements OnInit {
...
@@ -306,148 +250,10 @@ export class BasiCheckComponent implements OnInit {
);
);
}
}
//危险add
addFault
()
{
const
demo
=
{
and
:
' and '
,
equal
:
'='
,
value
:
''
,
};
this
.
faultConditionList
.
push
(
demo
);
}
//故障add
addcondition
()
{
const
demo
=
{
and
:
' and '
,
equal
:
'='
,
value
:
''
,
};
this
.
conditionList
.
push
(
demo
);
}
//危险delete
deleteFault
(
index
)
{
this
.
faultConditionList
.
splice
(
index
,
1
);
}
//故障delete
deleteCondition
(
index
)
{
this
.
conditionList
.
splice
(
index
,
1
);
}
getKey
(
keyValue
):
void
{
getKey
(
keyValue
):
void
{
const
d
=
{
const
d
=
{
key_
:
keyValue
key_
:
keyValue
};
};
this
.
validateForm
.
patchValue
(
d
);
this
.
validateForm
.
patchValue
(
d
);
}
}
//阈值--start
saveTrigger
()
{
const
data
=
{
condition
:
''
,
faultCondition
:
''
};
if
(
this
.
conditionType
==
'commonly'
)
{
//常规
this
.
conditionList
.
forEach
(
res
=>
{
if
(
!
res
.
and
){
res
.
and
=
""
;
}
data
.
condition
+=
res
.
and
+
'{'
+
this
.
hostName
+
':'
+
this
.
validateForm
.
value
.
key_
+
'.last()}'
+
res
.
equal
+
''
+
res
.
value
;
});
this
.
faultConditionList
.
forEach
(
res
=>
{
if
(
!
res
.
and
){
res
.
and
=
""
;
}
data
.
faultCondition
+=
res
.
and
+
'{'
+
this
.
hostName
+
':'
+
this
.
validateForm
.
value
.
key_
+
'.last()}'
+
res
.
equal
+
''
+
res
.
value
;
});
}
else
{
//高级
data
.
condition
=
this
.
triggerObj
.
condition
;
data
.
faultCondition
=
this
.
triggerObj
.
faultCondition
;
}
if
(
!
this
.
checkFun
()){
this
.
message
.
error
(
"请输入阈值"
);
return
false
;
}
if
(
this
.
conditionList
.
length
==
0
&&
this
.
faultConditionList
.
length
==
0
){
this
.
isCheck
=
false
;
this
.
initForm
();
return
false
;
}
if
(
this
.
title
==
'添加监测点'
)
{
this
.
createTrigger
(
data
);
}
if
(
this
.
title
==
'编辑监测点'
)
{
this
.
updateTrigger
(
data
);
}
}
//校验是否填值
checkFun
(){
let
error
=
true
;
this
.
conditionList
.
map
(
e
=>
{
if
(
e
.
value
.
length
>
0
){
}
else
{
error
=
false
;
}
});
this
.
faultConditionList
.
map
(
e
=>
{
if
(
e
.
value
.
length
>
0
){
console
.
log
(
e
.
value
)
}
else
{
error
=
false
;
}
});
return
error
;
}
//1.创建阈值
createTrigger
(
data
)
{
const
res
=
{
itemName
:
this
.
validateForm
.
value
.
name
,
faultCondition
:
data
.
faultCondition
.
substring
(
5
,
data
.
faultCondition
.
length
),
condition
:
data
.
condition
.
substring
(
5
,
data
.
faultCondition
.
length
)
};
this
.
overAllSer
.
createTrigger
(
res
).
subscribe
(
(
response
)
=>
{
if
(
response
.
errCode
==
10000
)
{
this
.
message
.
success
(
'创建阈值成功'
);
this
.
initForm
();
this
.
isCheck
=
false
;
}
else
{
this
.
message
.
error
(
response
.
errMsg
);
}
}
);
}
//2.修改阈值
updateTrigger
(
data
)
{
const
res
=
{
faultCondition
:
{
itemName
:
this
.
validateForm
.
value
.
name
,
faultCondition
:
data
.
faultCondition
,
triggerid
:
this
.
triggerFaultConditionId
},
condition
:
{
itemName
:
this
.
validateForm
.
value
.
name
,
condition
:
data
.
condition
,
triggerid
:
this
.
triggerConditionId
}
};
this
.
overAllSer
.
updateTrigger
(
res
).
subscribe
(
res
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
success
(
'修改阈值成功'
);
this
.
initForm
();
this
.
isCheck
=
false
;
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
});
}
//阈值--end
}
}
src/main/webapp/app/modal/threshold/threshold.component.html
0 → 100644
View file @
071aee01
<section>
<nz-modal
[
nzWidth
]="
880
"
[(
nzVisible
)]="
isVisiable
"
[
nzTitle
]="
title
"
(
nzOnCancel
)="
handleCheckCancel
()"
(
nzOnOk
)="
saveTrigger
()"
>
<nz-form-item
nzFlex
>
<nz-form-control
[
nzOffset
]="
4
"
[
nzSpan
]="
14
"
>
<nz-radio-group
[(
ngModel
)]="
conditionType
"
>
<label
nz-radio-button
nzValue=
"commonly"
><span>
常规
</span></label>
<label
nz-radio-button
nzValue=
"high"
><span>
高级
</span></label>
</nz-radio-group>
</nz-form-control>
</nz-form-item>
<ng-container
*
ngIf=
"conditionType == 'commonly'"
>
<nz-form-item
class=
"form-select"
>
<nz-form-control
class=
"form-select"
>
<div
nz-row
[
nzGutter
]="
12
"
>
<nz-form-control
nz-col
[
nzPush
]="
3
"
[
nzSpan
]="
6
"
>
<button
nz-button
nzType=
"primary"
nzSize=
"small"
(
click
)="
addcondition
()"
>
添加条件
</button>
<span>
危险阈值
</span>
</nz-form-control>
</div>
<div
nz-row
[
nzGutter
]="
12
"
*
ngFor=
"let fault of conditionList;let i = index;"
>
<nz-form-control
nz-col
[
nzSpan
]="
3
"
></nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
5
"
>
<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
]="
4
"
>
<button
class=
"tag-button"
nz-button
nzType=
"default"
>
返回值
</button>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
5
"
>
<nz-select
name=
"interfaces_main"
nzPlaceHolder=
"选择接口类型"
[(
ngModel
)]="
fault
.
equal
"
>
<nz-option
nzValue=
"="
nzLabel=
"="
></nz-option>
<nz-option
nzValue=
">"
nzLabel=
">"
></nz-option>
<nz-option
nzValue=
"<"
nzLabel=
"<"
></nz-option>
</nz-select>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
5
"
>
<input
type=
"text"
placeholder=
"值"
nz-input
name=
"value"
[(
ngModel
)]="
fault
.
value
"
>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
2
"
>
<button
nz-button
nzType=
"primary"
(
click
)="
deleteCondition
(
i
)"
><i
style=
"color: #fff"
class=
"anticon anticon-close-circle-o"
></i></button>
</nz-form-control>
</div>
</nz-form-control>
</nz-form-item>
<nz-form-item
class=
"form-select"
>
<nz-form-control
class=
"form-select"
>
<div
nz-row
[
nzGutter
]="
12
"
>
<nz-form-control
nz-col
[
nzPush
]="
3
"
[
nzSpan
]="
6
"
>
<button
nz-button
nzType=
"primary"
nzSize=
"small"
(
click
)="
addFault
()"
>
添加条件
</button>
<span>
故障阈值
</span>
</nz-form-control>
</div>
<div
nz-row
[
nzGutter
]="
12
"
*
ngFor=
"let fault of faultConditionList;let i = index;"
>
<nz-form-control
nz-col
[
nzSpan
]="
3
"
></nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
5
"
>
<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
]="
4
"
>
<button
class=
"tag-button"
nz-button
nzType=
"default"
>
返回值
</button>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
5
"
>
<nz-select
name=
"interfaces_main"
nzPlaceHolder=
"选择接口类型"
[(
ngModel
)]="
fault
.
equal
"
>
<nz-option
nzValue=
"="
nzLabel=
"="
></nz-option>
<nz-option
nzValue=
">"
nzLabel=
">"
></nz-option>
<nz-option
nzValue=
"<"
nzLabel=
"<"
></nz-option>
</nz-select>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
5
"
>
<input
type=
"text"
placeholder=
"值"
nz-input
name=
"value"
[(
ngModel
)]="
fault
.
value
"
>
</nz-form-control>
<nz-form-control
nz-col
[
nzSpan
]="
2
"
>
<button
nz-button
nzType=
"primary"
(
click
)="
deleteFault
(
i
)"
><i
style=
"color: #fff"
class=
"anticon anticon-close-circle-o"
></i></button>
</nz-form-control>
</div>
</nz-form-control>
</nz-form-item>
</ng-container>
<ng-container
*
ngIf=
"conditionType == 'high'"
>
<nz-form-item
nzFlex
>
<nz-form-control
[
nzOffset
]="
4
"
[
nzSpan
]="
14
"
>
<p>
危险阈值
</p>
<textarea
rows=
"4"
nz-input
[(
ngModel
)]="
triggerObj
.
condition
"
></textarea>
<p>
故障阈值
</p>
<textarea
rows=
"4"
nz-input
[(
ngModel
)]="
triggerObj
.
faultCondition
"
></textarea>
</nz-form-control>
</nz-form-item>
</ng-container>
</nz-modal>
</section>
src/main/webapp/app/modal/threshold/threshold.component.ts
0 → 100644
View file @
071aee01
import
{
Component
,
EventEmitter
,
OnInit
,
Output
}
from
'@angular/core'
;
import
{
OverAllService
}
from
'../../overAll/overAll.service'
;
import
{
FormBuilder
}
from
'@angular/forms'
;
import
{
NzMessageService
}
from
'ng-zorro-antd'
;
@
Component
({
selector
:
'smart-threshold'
,
templateUrl
:
'./threshold.component.html'
,
styles
:
[]
})
export
class
ThresholdComponent
implements
OnInit
{
@
Output
()
done
=
new
EventEmitter
<
any
>
();
isVisiable
=
false
;
title
;
itemId
;
//监控项ID
hostName
;
//主机name
itemObj
;
//监控项对象
conditionType
=
'commonly'
;
faultConditionList
=
[
];
//故障阈值
conditionList
=
[
];
//危险阈值
triggerConditionId
;
triggerFaultConditionId
;
triggerObj
=
{
condition
:
''
,
faultCondition
:
''
,
itemName
:
''
};
constructor
(
private
overAllSer
:
OverAllService
,
private
fb
:
FormBuilder
,
private
message
:
NzMessageService
)
{
}
ngOnInit
()
{
}
initForm
(){
this
.
faultConditionList
=
[
];
//危险阀值list
this
.
conditionList
=
[
];
//故障list
this
.
triggerObj
=
{
condition
:
''
,
faultCondition
:
''
,
itemName
:
''
};
}
//危险add
addFault
()
{
const
demo
=
{
and
:
' and '
,
equal
:
'='
,
value
:
''
,
};
this
.
faultConditionList
.
push
(
demo
);
}
//危险add
addcondition
()
{
const
demo
=
{
and
:
' and '
,
equal
:
'='
,
value
:
''
,
};
this
.
conditionList
.
push
(
demo
);
}
//故障delete
deleteFault
(
index
)
{
this
.
faultConditionList
.
splice
(
index
,
1
);
}
//危险delete
deleteCondition
(
index
)
{
this
.
conditionList
.
splice
(
index
,
1
);
}
//新增
showAddModal
(
title
,
itemId
,
hostName
)
{
this
.
title
=
title
;
this
.
itemId
=
itemId
;
this
.
isVisiable
=
true
;
this
.
hostName
=
hostName
;
this
.
overAllSer
.
findItemDetail
(
this
.
itemId
).
subscribe
(
(
res
)
=>
{
this
.
itemObj
=
res
.
data
[
0
];
}
)
}
//编辑
showEditModal
(
title
,
itemId
,
hostId
,
hostName
)
{
this
.
title
=
title
;
this
.
itemId
=
itemId
;
this
.
isVisiable
=
true
;
this
.
hostName
=
hostName
;
this
.
overAllSer
.
findItemDetail
(
this
.
itemId
).
subscribe
(
(
res
)
=>
{
this
.
itemObj
=
res
.
data
[
0
];
this
.
itemObj
.
triggers
.
forEach
((
value
)
=>
{
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
.
itemObj
.
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
,
d
.
length
),
};
}
else
{
data
=
{
equal
:
d
[
0
],
value
:
d
.
substring
(
1
,
d
.
length
),
};
}
arr
.
push
(
data
);
});
if
(
value
.
priority
==
2
||
value
.
priority
==
3
)
{
//危险
this
.
conditionList
=
arr
;
this
.
triggerObj
.
condition
=
con
;
this
.
triggerConditionId
=
value
.
triggerid
;
}
if
(
value
.
priority
==
4
||
value
.
priority
==
5
)
{
//故障
this
.
faultConditionList
=
arr
;
this
.
triggerObj
.
faultCondition
=
con
;
this
.
triggerFaultConditionId
=
value
.
triggerid
;
}
});
console
.
log
(
this
.
faultConditionList
);
console
.
log
(
this
.
conditionList
);
}
);
}
//阈值--start
saveTrigger
()
{
const
data
=
{
condition
:
''
,
faultCondition
:
''
};
if
(
this
.
conditionType
==
'commonly'
)
{
//常规
this
.
conditionList
.
forEach
(
res
=>
{
if
(
!
res
.
and
){
res
.
and
=
""
;
}
data
.
condition
+=
res
.
and
+
'{'
+
this
.
hostName
+
':'
+
this
.
itemObj
.
key_
+
'.last()}'
+
res
.
equal
+
''
+
res
.
value
;
});
this
.
faultConditionList
.
forEach
(
res
=>
{
if
(
!
res
.
and
){
res
.
and
=
""
;
}
data
.
faultCondition
+=
res
.
and
+
'{'
+
this
.
hostName
+
':'
+
this
.
itemObj
.
key_
+
'.last()}'
+
res
.
equal
+
''
+
res
.
value
;
});
}
else
{
//高级
data
.
condition
=
this
.
triggerObj
.
condition
;
data
.
faultCondition
=
this
.
triggerObj
.
faultCondition
;
}
if
(
!
this
.
checkFun
()){
this
.
message
.
error
(
"请输入阈值"
);
return
false
;
}
if
(
this
.
conditionList
.
length
==
0
&&
this
.
faultConditionList
.
length
==
0
){
this
.
isVisiable
=
false
;
this
.
initForm
();
return
false
;
}
if
(
this
.
title
==
'添加阈值'
)
{
this
.
createTrigger
(
data
);
}
if
(
this
.
title
==
'编辑阈值'
)
{
this
.
updateTrigger
(
data
);
}
}
//校验是否填值
checkFun
(){
let
error
=
true
;
this
.
conditionList
.
map
(
e
=>
{
if
(
e
.
value
.
length
>
0
){
}
else
{
error
=
false
;
}
});
this
.
faultConditionList
.
map
(
e
=>
{
if
(
e
.
value
.
length
>
0
){
console
.
log
(
e
.
value
)
}
else
{
error
=
false
;
}
});
return
error
;
}
//1.创建阈值
createTrigger
(
data
)
{
const
res
=
{
itemName
:
this
.
itemObj
.
name
,
faultCondition
:
data
.
faultCondition
,
condition
:
data
.
condition
};
this
.
overAllSer
.
createTrigger
(
res
).
subscribe
(
(
response
)
=>
{
if
(
response
.
errCode
==
10000
)
{
this
.
message
.
success
(
'创建阈值成功'
);
this
.
initForm
();
this
.
isVisiable
=
false
;
}
else
{
this
.
message
.
error
(
response
.
errMsg
);
}
}
);
}
//2.修改阈值
updateTrigger
(
data
)
{
const
res
=
{
faultCondition
:
{
//故障阈值
itemName
:
this
.
itemObj
.
name
,
condition
:
data
.
faultCondition
,
triggerid
:
this
.
triggerFaultConditionId
},
condition
:
{
//危险阈值
itemName
:
this
.
itemObj
.
name
,
condition
:
data
.
condition
,
triggerid
:
this
.
triggerConditionId
}
};
this
.
overAllSer
.
updateTrigger
(
res
).
subscribe
(
res
=>
{
if
(
res
.
errCode
==
10000
)
{
this
.
message
.
success
(
'修改阈值成功'
);
this
.
initForm
();
this
.
isVisiable
=
false
;
}
else
{
this
.
message
.
error
(
res
.
errMsg
);
}
});
}
//取消
handleCheckCancel
(){
this
.
isVisiable
=
false
;
this
.
initForm
();
}
}
src/main/webapp/app/overAll/basic/basic-detail/basic-detail.component.html
View file @
071aee01
...
@@ -156,7 +156,7 @@
...
@@ -156,7 +156,7 @@
<tr>
<tr>
<th
nzWidth=
"250px"
>
监测点名称
</th>
<th
nzWidth=
"250px"
>
监测点名称
</th>
<th
>
最新数据
</th>
<th
>
最新数据
</th>
<th
nzWidth=
"2
5
0px"
>
最新数据时间
</th>
<th
nzWidth=
"2
0
0px"
>
最新数据时间
</th>
<th>
监测点分类
</th>
<th>
监测点分类
</th>
<th>
更新时间间隔
</th>
<th>
更新时间间隔
</th>
<th>
图表
</th>
<th>
图表
</th>
...
@@ -176,13 +176,16 @@
...
@@ -176,13 +176,16 @@
<td>
{{data.itemType}}
</td>
<td>
{{data.itemType}}
</td>
<td>
{{data.delay}}
</td>
<td>
{{data.delay}}
</td>
<td
class=
"main-color cursor main-color"
>
<td
class=
"main-color cursor main-color"
>
<span
(
click
)="
showImageModal
(
data
)"
>
图表
</span>
<span
*
ngIf=
"data.value_type == 0 || data.value_type == 3"
(
click
)="
showImageModal
(
data
)"
>
图表
</span>
</td>
</td>
<td
class=
"handle cursor"
>
<td
class=
"handle cursor main-color"
>
<span
(
click
)="
showEditModal
(
data
)"
>
编辑监测点
</span>
<ng-container
*
ngIf=
"!data.flags"
>
<span
(
click
)="
deleteCheckItem
(
data
)"
>
删除监测点
</span>
<span
(
click
)="
showEditModal
(
data
)"
>
编辑监测点
</span>
<span
(
click
)="
deleteCheckItem
(
data
)"
>
添加阈值
</span>
<span
(
click
)="
deleteCheckItem
(
data
)"
>
删除监测点
</span>
<span
(
click
)="
deleteCheckItem
(
data
)"
>
编辑阈值
</span>
<br>
<span
*
ngIf=
"data.triggerCount == 0"
(
click
)="
showAddThresholdModal
(
data
)"
>
添加阈值
</span>
<span
*
ngIf=
"data.triggerCount > 0"
(
click
)="
showEditThresholdModal
(
data
)"
>
编辑阈值
</span>
</ng-container>
<span
*
ngIf=
"data.status == 0 && data.state==0"
(
click
)="
updateItem
(
data
.
itemid
,
1
)"
style=
"color: red"
>
停止
</span>
<span
*
ngIf=
"data.status == 0 && data.state==0"
(
click
)="
updateItem
(
data
.
itemid
,
1
)"
style=
"color: red"
>
停止
</span>
<span
*
ngIf=
"data.status == 0 && data.state==1"
(
click
)="
updateItem
(
data
.
itemid
,
1
)"
style=
"color: red"
>
不支持的
</span>
<span
*
ngIf=
"data.status == 0 && data.state==1"
(
click
)="
updateItem
(
data
.
itemid
,
1
)"
style=
"color: red"
>
不支持的
</span>
<span
*
ngIf=
"data.status == 1 && data.state==0"
(
click
)="
updateItem
(
data
.
itemid
,
0
)"
style=
"color: green"
>
启用
</span>
<span
*
ngIf=
"data.status == 1 && data.state==0"
(
click
)="
updateItem
(
data
.
itemid
,
0
)"
style=
"color: green"
>
启用
</span>
...
@@ -201,9 +204,12 @@
...
@@ -201,9 +204,12 @@
</div>
</div>
</nz-spin>
</nz-spin>
<!--
添加
监测点-->
<!--监测点-->
<smart-basi-check
#
smartCheck
(
done
)="
getList
()"
></smart-basi-check>
<smart-basi-check
#
smartCheck
(
done
)="
getList
()"
></smart-basi-check>
<!--阈值-->
<smart-threshold
#
smartThreshold
(
done
)="
getList
()"
></smart-threshold>
<nz-modal
[
nzFooter
]="
null
"
nzWidth=
"1080"
[(
nzVisible
)]="
isGrapha
"
nzTitle=
""
(
nzOnCancel
)="
handleImageCancel
()"
>
<nz-modal
[
nzFooter
]="
null
"
nzWidth=
"1080"
[(
nzVisible
)]="
isGrapha
"
nzTitle=
""
(
nzOnCancel
)="
handleImageCancel
()"
>
<div
class=
"releative"
>
<div
class=
"releative"
>
<div
class=
"time-select"
>
<div
class=
"time-select"
>
...
...
src/main/webapp/app/overAll/basic/basic-detail/basic-detail.component.ts
View file @
071aee01
...
@@ -8,6 +8,7 @@ import {NzModalService} from 'ng-zorro-antd';
...
@@ -8,6 +8,7 @@ import {NzModalService} from 'ng-zorro-antd';
import
{
color
,
pageSize
}
from
'../../../app.constants'
;
import
{
color
,
pageSize
}
from
'../../../app.constants'
;
import
{
WarnListComponent
}
from
'../../../modal/warn-list/warn-list.component'
;
import
{
WarnListComponent
}
from
'../../../modal/warn-list/warn-list.component'
;
import
{
DatePipe
}
from
'@angular/common'
;
import
{
DatePipe
}
from
'@angular/common'
;
import
{
ThresholdComponent
}
from
'../../../modal/threshold/threshold.component'
;
@
Component
({
@
Component
({
selector
:
'jhi-basic-detail'
,
selector
:
'jhi-basic-detail'
,
...
@@ -40,6 +41,7 @@ import {DatePipe} from '@angular/common';
...
@@ -40,6 +41,7 @@ import {DatePipe} from '@angular/common';
})
})
export
class
BasicDetailComponent
implements
OnInit
,
AfterViewInit
{
export
class
BasicDetailComponent
implements
OnInit
,
AfterViewInit
{
@
ViewChild
(
'smartCheck'
)
smartCheck
:
BasiCheckComponent
;
@
ViewChild
(
'smartCheck'
)
smartCheck
:
BasiCheckComponent
;
@
ViewChild
(
'smartThreshold'
)
smartThreshold
:
ThresholdComponent
;
@
ViewChild
(
'thirdTabs'
)
thirdTabs
:
ElementRef
;
@
ViewChild
(
'thirdTabs'
)
thirdTabs
:
ElementRef
;
@
ViewChild
(
'warnList'
)
warnList
:
WarnListComponent
;
@
ViewChild
(
'warnList'
)
warnList
:
WarnListComponent
;
@
ViewChild
(
'colorEle'
)
colorEle
:
ElementRef
;
@
ViewChild
(
'colorEle'
)
colorEle
:
ElementRef
;
...
@@ -111,6 +113,8 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
...
@@ -111,6 +113,8 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
warn_totalNum
;
warn_totalNum
;
warn_pageNum
=
1
;
warn_pageNum
=
1
;
searchName
;
validateForm
:
FormGroup
;
validateForm
:
FormGroup
;
isSpinning
;
//刷新
isSpinning
;
//刷新
...
@@ -635,28 +639,20 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
...
@@ -635,28 +639,20 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
this
.
smartCheck
.
showEditModal
(
this
.
hostId
,
item
.
itemid
,
this
.
realName
);
this
.
smartCheck
.
showEditModal
(
this
.
hostId
,
item
.
itemid
,
this
.
realName
);
}
}
//添加or编辑监测点 之后
//添加阈值
getList
(){
showAddThresholdModal
(
item
){
this
.
getCheckList
();
this
.
smartThreshold
.
showAddModal
(
"添加阈值"
,
item
.
itemid
,
this
.
realName
);
this
.
findItemType
();
}
handleCheckCancel
()
{
this
.
isCheck
=
false
;
}
}
showKeyModal
()
{
//编辑阈值
this
.
isKey
=
true
;
showEditThresholdModal
(
item
){
this
.
keyTypeChange
(
);
this
.
smartThreshold
.
showEditModal
(
"编辑阈值"
,
item
.
itemid
,
this
.
hostId
,
this
.
realName
);
}
}
//键值类型变更
//添加or编辑监测点 之后
keyTypeChange
()
{
getList
(){
this
.
overAllSer
.
zabbixKey
(
this
.
keyType
).
subscribe
(
this
.
getCheckList
();
(
res
)
=>
{
this
.
findItemType
();
this
.
keyList
=
res
.
data
;
}
);
}
}
handleKeyCancel
()
{
handleKeyCancel
()
{
...
@@ -677,7 +673,8 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
...
@@ -677,7 +673,8 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
obj
:{
obj
:{
applicationid
:
this
.
applicationId
,
applicationid
:
this
.
applicationId
,
hostid
:
this
.
hostId
,
hostid
:
this
.
hostId
,
priorityName
:
this
.
changeStates
priorityName
:
this
.
changeStates
,
name
:
this
.
searchName
}
}
};
};
this
.
overAllSer
.
findCheckByType
(
data
).
subscribe
(
this
.
overAllSer
.
findCheckByType
(
data
).
subscribe
(
...
...
src/main/webapp/app/threshold/threshold.component.html
deleted
100644 → 0
View file @
ce253d58
<p>
threshold works!
</p>
src/main/webapp/app/threshold/threshold.component.ts
deleted
100644 → 0
View file @
ce253d58
import
{
Component
,
OnInit
}
from
'@angular/core'
;
@
Component
({
selector
:
'smart-threshold'
,
templateUrl
:
'./threshold.component.html'
,
styles
:
[]
})
export
class
ThresholdComponent
implements
OnInit
{
constructor
()
{
}
ngOnInit
()
{
}
}
src/main/webapp/app/work/asset-part/child-assets/child-assets.component.ts
View file @
071aee01
...
@@ -161,7 +161,22 @@ export class ChildAssetsComponent implements OnInit {
...
@@ -161,7 +161,22 @@ export class ChildAssetsComponent implements OnInit {
let
title
;
let
title
;
title
=
this
.
selectList
.
length
==
0
?
"确定导出所有的资产?"
:
"确定导出所选择的资产"
;
title
=
this
.
selectList
.
length
==
0
?
"确定导出所有的资产?"
:
"确定导出所选择的资产"
;
this
.
commonSer
.
confirmThing
(
"导出"
,
title
,()
=>
{
this
.
commonSer
.
confirmThing
(
"导出"
,
title
,()
=>
{
const
data
=
{
type
:
this
.
childId
,
ids
:
this
.
selectList
.
map
(
e
=>
{
return
e
.
id
;
}),
query_name
:
null
};
this
.
workSer
.
getExportUrl
(
data
).
subscribe
(
(
res
)
=>
{
this
.
workSer
.
downloadTemplate
(
"inventory"
,
res
.
data
).
subscribe
(
(
data
)
=>
{
this
.
commonSer
.
downloadFile
(
"文件"
,
data
)
}
)
}
)
});
});
}
}
}
}
src/main/webapp/app/work/work.service.ts
View file @
071aee01
...
@@ -194,4 +194,10 @@ export class WorkService {
...
@@ -194,4 +194,10 @@ export class WorkService {
return
this
.
http
.
get
(
SERVER_API_URL
+
"/api/download/file/"
+
pararmsType
+
"/"
+
paramsId
,{
responseType
:
'blob'
});
return
this
.
http
.
get
(
SERVER_API_URL
+
"/api/download/file/"
+
pararmsType
+
"/"
+
paramsId
,{
responseType
:
'blob'
});
}
}
/**
* 批量下载资产文件
*/
getExportUrl
(
data
):
Observable
<
any
>
{
return
this
.
http
.
post
(
SERVER_API_URL
+
"/inventory/getExportUrl"
,
data
);
}
}
}
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