Commit 1c0a45ba authored by wangqinghua's avatar wangqinghua

update

parent a03d9f45
......@@ -132,7 +132,6 @@ export class AlarmListComponent implements OnInit {
this.obj.startTime = this.datePipe.transform(this.dateBegin, 'yyyy-MM-dd HH:mm:ss');
this.obj.endTime = this.datePipe.transform(this.dateEnd, 'yyyy-MM-dd HH:mm:ss');
}
console.log(this.obj);
this.warnList.getList(this.obj);
}
}
......@@ -160,10 +160,16 @@
</nz-form-control>
</nz-form-item>
<ng-container *ngIf="conditionType == 'commonly'">
<nz-form-item class="form-select" *ngFor="let fault of faultConditionList;let i = index;">
<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-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>
......@@ -180,21 +186,26 @@
<nz-option nzValue="<" nzLabel="<"></nz-option>
</nz-select>
</nz-form-control>
<nz-form-control nz-col [nzSpan]="6">
<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]="3">
<button *ngIf="i == 0" nz-button nzType="primary" (click)="addFault()">添加条件</button>
<button *ngIf="i > 0" nz-button nzType="primary" (click)="deleteFault(i)"><i class="anticon anticon-close-circle-o"></i></button>
<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" *ngFor="let fault of conditionList;let i = index;">
<nz-form-label [nzSpan]="3"><span *ngIf="i == 0;">故障阈值</span></nz-form-label>
<nz-form-control [nzSpan]="18" class="form-select">
<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>
......@@ -211,12 +222,11 @@
<nz-option nzValue="<" nzLabel="<"></nz-option>
</nz-select>
</nz-form-control>
<nz-form-control nz-col [nzSpan]="6">
<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]="3">
<button *ngIf="i == 0" nz-button nzType="primary" (click)="addcondition()">添加条件</button>
<button *ngIf="i > 0" nz-button nzType="primary" (click)="deleteCondition(i)"><i class="anticon anticon-close-circle-o"></i></button>
<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>
......
......@@ -45,18 +45,10 @@ export class BasiCheckComponent implements OnInit {
interval; //间隔时长
conditionType = 'commonly';
faultConditionList = [
{
and: ' and ',
equal: '=',
value: '',
}
]; //危险阀值list
conditionList = [
{
and: ' and ',
equal: '=',
value: '',
}
]; //故障list
tabNum: number;
triggerObj = {
......@@ -356,7 +348,6 @@ export class BasiCheckComponent implements OnInit {
if(!res.and){
res.and = "";
}
console.log(res);
data.condition += res.and + '{' + this.hostName + ':' + this.validateForm.value.key_ + '.last()}' + res.equal + '' + res.value ;
});
this.faultConditionList.forEach(res => {
......@@ -369,6 +360,15 @@ export class BasiCheckComponent implements OnInit {
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);
}
......@@ -377,6 +377,27 @@ export class BasiCheckComponent implements OnInit {
}
}
//校验是否填值
checkFun(){
let error = true;
this.conditionList.map(e=>{
if(e.value.length > 0){
console.log(e.value)
}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 = {
......
......@@ -336,7 +336,6 @@
<button nz-button (click)="handleEditCancel()" nzType="primary">取消</button>
<button nz-button (click)="tabsChange(0)" nzType="primary">上一步</button>
<button nz-button (click)="tabsChange(2)" nzType="primary">下一步</button>
<button nz-button (click)="handEditleOk()" nzType="primary">完成</button>
</div>
</nz-tab>
......@@ -409,7 +408,7 @@
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired nzFor="equipmentTypeid">资产名称
</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="资产名称" name="name" [(ngModel)]="validateForm.name">
<input nz-input placeholder="资产名称" name="name" [(ngModel)]="validateForm.inventoryExtend.name">
</nz-form-control>
</nz-form-item>
</div>
......@@ -418,7 +417,7 @@
<nz-form-item nzFlex>
<nz-form-label [nzSpan]="6">负责人</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="负责人">
<input nz-input placeholder="负责人" name="person" [(ngModel)]="validateForm.inventoryExtend.person">
</nz-form-control>
</nz-form-item>
</div>
......@@ -430,14 +429,14 @@
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired nzFor="secondLevelType">资产数量
</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="资产数量">
<input nz-input placeholder="资产数量" name="inventorycount" [(ngModel)]="validateForm.inventoryExtend.inventorycount">
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="12">
<nz-form-item nzFlex>
<nz-form-label [nzSpan]="6" nzFor="serialnoA">品牌</nz-form-label>
<nz-form-label [nzSpan]="6" nzFor="invertoryname">品牌</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="品牌" name="invertoryname" [(ngModel)]="validateForm.inventoryExtend.invertoryname">
</nz-form-control>
......@@ -450,7 +449,7 @@
<nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired >库存</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="库存">
<input nz-input placeholder="库存" name="stock" [(ngModel)]="validateForm.inventoryExtend.stock">
</nz-form-control>
</nz-form-item>
</div>
......@@ -459,7 +458,7 @@
<nz-form-item nzFlex>
<nz-form-label [nzSpan]="6" >型号</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="型号" name="serialnoA" [(ngModel)]="validateForm.inventoryExtend.serialnoA">
<input nz-input placeholder="型号" name="serialnoA" [(ngModel)]="validateForm.inventoryExtend.serialnoA">
</nz-form-control>
</nz-form-item>
</div>
......@@ -470,7 +469,7 @@
<nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired>使用</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="使用" >
<input nz-input placeholder="使用" name="usedcount" [(ngModel)]="validateForm.inventoryExtend.usedcount">
</nz-form-control>
</nz-form-item>
</div>
......@@ -489,7 +488,7 @@
<nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired >借出</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="借出">
<input nz-input placeholder="借出" name="lendcount" [(ngModel)]="validateForm.inventoryExtend.lendcount">
</nz-form-control>
</nz-form-item>
</div>
......@@ -509,7 +508,7 @@
<nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired>维修</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="维修">
<input nz-input placeholder="维修" name="repaircount" [(ngModel)]="validateForm.inventoryExtend.repaircount">
</nz-form-control>
</nz-form-item>
</div>
......@@ -518,7 +517,7 @@
<nz-form-item nzFlex>
<nz-form-label [nzSpan]="6">存放地点</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="存放地点" [(ngModel)]="validateForm.inventoryExtend.storageLocation">
<input nz-input placeholder="存放地点" name="storageLocation" [(ngModel)]="validateForm.inventoryExtend.storageLocation">
</nz-form-control>
</nz-form-item>
</div>
......@@ -529,7 +528,7 @@
<nz-form-item nzFlex>
<nz-form-label [nzOffset]="4" [nzSpan]="6" nzRequired >报废</nz-form-label>
<nz-form-control [nzSpan]="14">
<input nz-input placeholder="报废" >
<input nz-input placeholder="报废" name="scrapcount" [(ngModel)]="validateForm.inventoryExtend.scrapcount">
</nz-form-control>
</nz-form-item>
</div>
......@@ -539,7 +538,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()" nzType="primary">完成</button>
<button nz-button (click)="handEditleOk()" nzType="primary">完成</button>
</div>
</nz-tab>
</nz-tabset>
......
......@@ -59,7 +59,7 @@ export class BasicEditComponent implements OnInit {
}
//获取分组
getGroup(){
getGroup() {
this.groupList = [];
this.overAllSer.findGroup().subscribe(
(res) => {
......@@ -100,15 +100,12 @@ export class BasicEditComponent implements OnInit {
this.validateForm.tls_issuer = data.tls_issuer + '';
this.validateForm.tls_subject = data.tls_subject + '';
this.validateForm.tls_psk = data.tls_psk + '';
this.validateForm.inventoryExtend = data.inventoryExtend;
this.validateForm.hostExtend.equipmentTypeid = data.hostExtend.equipmentTypeid +'';
this.validateForm.hostExtend.secondLevelTypeid = data.hostExtend.secondLevelTypeid +'';
this.validateForm.hostExtend.serviceid = data.hostExtend.serviceid +'';
this.validateForm.inventoryExtend = data.inventory;
this.validateForm.hostExtend = data.hostExtend;
this.validateForm.groups = data.groups;
if(data.parentTemplates){
if (data.parentTemplates) {
let tempArr = [];
tempArr = data.parentTemplates.map(res=>{
tempArr = data.parentTemplates.map(res => {
return res.templateid;
});
this.validateForm.templates = tempArr;
......@@ -120,6 +117,13 @@ export class BasicEditComponent implements OnInit {
res.type = res.type + '';
});
this.hostTypeChildrenList = [];
this.hostTypeList.forEach(res => {
if (this.validateForm.hostExtend.equipmentTypeid == res.id) {
this.hostTypeChildrenList = res.childs;
}
});
if (data.macros) {
this.macroList1 = data.macros;
}
......@@ -136,21 +140,20 @@ export class BasicEditComponent implements OnInit {
}
//确定
handEditleOk(){
if(!this.validateForm.hostExtend.equipmentTypeid) {
handEditleOk() {
if (!this.validateForm.hostExtend.equipmentTypeid) {
this.message.info('请选择选择设备类型');
return false;
}
if(!this.validateForm.hostExtend.secondLevelTypeid){
if (!this.validateForm.hostExtend.secondLevelTypeid) {
this.message.info('请选择选择二级类型');
return false;
}
if(!this.validateForm.name){
if (!this.validateForm.name) {
this.message.info('请输入显示名');
return false;
}
if(!this.validateForm.host){
if (!this.validateForm.host) {
this.message.info('请输入IP地址');
return false;
}
......@@ -163,12 +166,12 @@ export class BasicEditComponent implements OnInit {
groupArr.push(groupid);
}
}
this.interfaceslist.forEach(res=>{
if(res.bulk){
res.bulk = '1';
}else{
res.bulk = '0';
}
this.interfaceslist.forEach(res => {
if (res.bulk) {
res.bulk = '1';
} else {
res.bulk = '0';
}
});
this.validateForm.groups = groupArr;
......@@ -191,8 +194,10 @@ export class BasicEditComponent implements OnInit {
this.initForm();
this.getGroup();
this.done.emit();
this.message.success("创建成功");
}else{
this.message.error(res.errMsg);
}
this.message.info(res.errMsg);
},
(err) => {
this.message.info('系统错误');
......@@ -205,8 +210,8 @@ export class BasicEditComponent implements OnInit {
//比较监控模版是否发生变化
const clearArr = [];
this.templatesResoure.forEach(res=>{
if( this.validateForm.templates.indexOf(res) == -1 ){
this.templatesResoure.forEach(res => {
if (this.validateForm.templates.indexOf(res) == -1) {
clearArr.push(res);
}
});
......@@ -225,8 +230,10 @@ export class BasicEditComponent implements OnInit {
this.done.emit();
this.initForm();
this.getGroup();
this.message.success("修改成功");
}else{
this.message.error(res.errMsg);
}
this.message.info(res.errMsg);
},
(err) => {
this.message.info('系统错误');
......@@ -256,27 +263,27 @@ export class BasicEditComponent implements OnInit {
}
//获取设备类型
getTree(){
getTree() {
this.overAllSer.findTree().subscribe(
(res)=>{
if(res.errCode == 10000){
(res) => {
if (res.errCode == 10000) {
this.hostTypeList = res.data;
}else{
} else {
this.message.info(res.errMsg);
}
}
)
);
}
//
getChildren(item){
//二级类型的list
getChildren(item) {
this.hostTypeChildrenList = [];
this.validateForm.hostExtend.secondLevelTypeid = null;
this.hostTypeList.forEach(res=>{
if(item == res.id){
this.hostTypeChildrenList = res.childs;
}
})
this.hostTypeList.forEach(res => {
if (item == res.id) {
this.hostTypeChildrenList = res.childs;
}
});
}
//接口add
......@@ -400,7 +407,14 @@ export class BasicEditComponent implements OnInit {
mac: null,
storageLocation: null,
maintenanceExpiration: null,
name:null
name: null,
person: null,
ip: null,
usedcount: null,
stock: null,
lendcount: null,
repaircount: null,
scrapcount: null,
},
templates: null,
name: null,
......
......@@ -26,6 +26,13 @@ export class PauseComponent implements OnInit {
ngOnInit() {
}
initForm(){
this.data = {
startTime: null,
time: ''
};
}
showModal(id,type) {
this.id = id;
this.typeTitle = type;
......@@ -48,15 +55,18 @@ export class PauseComponent implements OnInit {
basic(){
const data = {
hostId: Number(this.id),
startTime: this.datePipe.transform(this.data.startTime,'yyyy-MM-dd HH:MM:ss'),
startTime: this.datePipe.transform(this.data.startTime,'yyyy-MM-dd HH:mm:ss'),
time: Number(this.data.time)
};
this.overAllSer.tempStop(data).subscribe(
(res) => {
if(res.errCode == 10000){
this.isShow = false;
this.initForm();
this.message.success("临时暂停成功");
}else{
this.message.error(res.errMsg);
}
this.message.info(res.errMsg);
}
);
}
......@@ -71,6 +81,7 @@ export class PauseComponent implements OnInit {
(res) => {
if(res.errCode == 10000){
this.isShow = false;
this.done.emit()
this.done.emit();
}
this.message.info(res.errMsg);
......
......@@ -615,7 +615,6 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
//添加or编辑监测点 之后
getList(){
this.getCheckList();
this.getCheckStatus();
this.findItemType();
}
......@@ -647,6 +646,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
//监测点列表
getCheckList() {
this.getCheckStatus();
this.loading = true;
const data = {
pageNum: this.pageIndex,
......
......@@ -107,8 +107,8 @@
<td class="round-tag">
<nz-tag *ngIf="item.maxLevel == 4 || item.maxLevel == 5" [nzColor]="color.red"></nz-tag>
<nz-tag *ngIf="item.maxLevel == 2 || item.maxLevel == 3" [nzColor]="col.yellow"></nz-tag>
<nz-tag *ngIf="item.maxLevel < 2" [nzColor]="col.green"></nz-tag>
<nz-tag *ngIf="item.maxLevel == 2 || item.maxLevel == 3" [nzColor]="color.yellow"></nz-tag>
<nz-tag *ngIf="item.maxLevel < 2" [nzColor]="color.green"></nz-tag>
</td>
<td>
<span (click)="goTOInventory(item?.inventory?.id)">{{item?.inventory?.name}}</span>
......@@ -386,6 +386,6 @@
<!--添加分组-->
<smart-create-group #smartCreateGroup (add)="handleOk($event)"></smart-create-group>
<!--临时暂停-->
<smart-pause #smartPause></smart-pause>
<smart-pause #smartPause (done)="handleOk($event)"></smart-pause>
<!--添加告警-->
<smart-alarm-modal #smartAlarmModal></smart-alarm-modal>
\ No newline at end of file
......@@ -184,6 +184,36 @@ export class NetworkCheckComponent implements OnInit {
});
}
//单个删除
showDeleteConfirm(item){
this.modalService.confirm({
nzTitle: '删除',
nzContent: '<b style="color: red;">确认要删除该网站监测吗?</b>',
nzOkText: '确定',
nzOkType: 'danger',
nzOnOk: () => {
let arr = [];
arr.push(item.httptestid);
const data = {
ids:arr
}
this.overAllSer.deleteBatch(data).subscribe(
(res) => {
if (res.errCode == 10000) {
this.message.info('删除成功');
this.batchSelectList = [];
this.getwebList();
} else {
this.message.info(res.errMsg);
}
}
);
},
nzCancelText: '取消',
nzOnCancel: () => console.log('Cancel')
});
}
//临时暂停
showTempStop(item){
this.smartPause.showModal(item.httptestid,'网站监测');
......
......@@ -20,6 +20,7 @@
<div nz-row class="search-form">
<div nz-col nzSpan="16">
<button (click)="showAddRoleModal()" nz-button nzType="default"><i class="anticon anticon-search"></i>sanyuanfenli</button>
<button (click)="showAddRoleModal()" nz-button nzType="default"><i class="anticon anticon-search"></i>新增角色</button>
</div>
<div nz-col nzSpan="8" class="text-right">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment