Commit 1c0a45ba authored by wangqinghua's avatar wangqinghua

update

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