Commit f4fae93f authored by wangqinghua's avatar wangqinghua

update

parent 6e87ad81
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
<nz-form-control [nzSpan]="14"> <nz-form-control [nzSpan]="14">
<input id="snmpCommunity" name="snmpCommunity" type="text" nz-input <input id="snmpCommunity" name="snmpCommunity" type="text" nz-input
formControlName="snmpCommunity"> formControlName="snmpCommunity">
<!--<nz-form-explain *ngIf="validateForm.get('note').dirty && validateForm.get('note').errors">Please input your username!</nz-form-explain>-->
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
<nz-form-item> <nz-form-item>
......
...@@ -88,32 +88,19 @@ export class BasiCheckComponent implements OnInit { ...@@ -88,32 +88,19 @@ export class BasiCheckComponent implements OnInit {
this.isCheck = true; this.isCheck = true;
this.hostId = hostId; this.hostId = hostId;
this.hostName = hostName; this.hostName = hostName;
// this.getItemType();
} }
//编辑 //编辑
showEditModal(hostId, id, hostName,templateid,title) { showEditModal(item,hostId, id, hostName,templateid,title) {
this.title = title; this.title = title;
this.hostId = hostId; this.hostId = hostId;
this.templateid = templateid; this.templateid = templateid;
this.isCheck = true; this.isCheck = true;
this.itemId = id; this.itemId = id;
this.hostName = hostName; this.hostName = hostName;
this.overAllSer.findItemDetail(id).subscribe( item.type += '';
(res) => { item.valueType += '';
const data = res.data[0]; this.validateForm.patchValue(item);
data.type += '';
data.valueType += '';
// if(data.applications){
// data.applications = data.applications.map(e=>{
// return e.applicationid;
// });
// }
this.validateForm.patchValue(data);
}
);
// this.getItemType();
} }
//获取监测点分类 //获取监测点分类
...@@ -176,7 +163,7 @@ export class BasiCheckComponent implements OnInit { ...@@ -176,7 +163,7 @@ export class BasiCheckComponent implements OnInit {
this.validateForm.patchValue({ this.validateForm.patchValue({
templateid:this.templateid templateid:this.templateid
}) })
this.validateForm.addControl('itemid', new FormControl(this.itemId)); this.validateForm.addControl('id', new FormControl(this.itemId));
this.overAllSer.itemUpdata(this.validateForm.value).subscribe( this.overAllSer.itemUpdata(this.validateForm.value).subscribe(
(res) => { (res) => {
if (res.errCode == 10000) { if (res.errCode == 10000) {
...@@ -187,9 +174,6 @@ export class BasiCheckComponent implements OnInit { ...@@ -187,9 +174,6 @@ export class BasiCheckComponent implements OnInit {
this.isCheck = false; this.isCheck = false;
} }
this.isOkLoading = false; this.isOkLoading = false;
},
(err) => {
this.message.error('系统错误');
} }
); );
} }
......
...@@ -405,26 +405,6 @@ export class BasicEditComponent implements OnInit { ...@@ -405,26 +405,6 @@ export class BasicEditComponent implements OnInit {
} }
} }
//只能一个默认
changeMain(index) {
let d = [];
this.interfaceslist.map(e => {
if (e.type == this.interfaceslist[index].type) {
d.push(e);
}
});
if (d.length > 1) {
this.interfaceslist.forEach(res => {
if (res.type == this.interfaceslist[index].type) {
res.main = '0';
}
});
}
console.log(d);
this.interfaceslist[index].main = '1';
}
//新增宏 //新增宏
addMacro1() { addMacro1() {
const data = { const data = {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<nz-form-item nzFlex> <nz-form-item nzFlex>
<nz-form-control [nzOffset]="4" [nzSpan]="14"> <nz-form-control [nzOffset]="4" [nzSpan]="14">
<nz-radio-group [(ngModel)]="conditionType"> <nz-radio-group [(ngModel)]="conditionType">
<label nz-radio-button nzValue="commonly"><span>常规</span></label> <!-- <label nz-radio-button nzValue="commonly"><span>常规</span></label>-->
<label nz-radio-button nzValue="high"><span>高级</span></label> <label nz-radio-button nzValue="high"><span>高级</span></label>
</nz-radio-group> </nz-radio-group>
</nz-form-control> </nz-form-control>
......
...@@ -17,7 +17,7 @@ export class ThresholdComponent implements OnInit { ...@@ -17,7 +17,7 @@ export class ThresholdComponent implements OnInit {
itemId; //监控项ID itemId; //监控项ID
hostName; //主机name hostName; //主机name
itemObj; //监控项对象 itemObj; //监控项对象
conditionType = 'commonly'; conditionType = 'high';
faultConditionList = []; //故障阈值 faultConditionList = []; //故障阈值
conditionList = []; //危险阈值 conditionList = []; //危险阈值
...@@ -78,14 +78,15 @@ export class ThresholdComponent implements OnInit { ...@@ -78,14 +78,15 @@ export class ThresholdComponent implements OnInit {
} }
//新增 //新增
showAddModal(title, itemId, hostName) { showAddModal(item, title, itemId, hostName) {
this.title = title; this.title = title;
this.itemId = itemId; this.itemId = itemId;
this.isVisiable = true; this.isVisiable = true;
this.hostName = hostName; this.hostName = hostName;
this.itemObj = item;
this.overAllSer.findItemDetail(this.itemId).subscribe( this.overAllSer.findItemDetail(this.itemId).subscribe(
(res) => { (res) => {
this.itemObj = res.data[0]; this.itemObj = res.data;
} }
); );
} }
...@@ -98,54 +99,15 @@ export class ThresholdComponent implements OnInit { ...@@ -98,54 +99,15 @@ export class ThresholdComponent implements OnInit {
this.hostName = hostName; this.hostName = hostName;
this.overAllSer.findItemDetail(this.itemId).subscribe( this.overAllSer.findItemDetail(this.itemId).subscribe(
(res) => { (res) => {
this.itemObj = res.data[0]; this.itemObj = res.data;
this.itemObj.triggers.forEach((value) => { 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) { //危险 if (value.priority == 2 || value.priority == 3) { //危险
this.conditionList = arr; this.triggerObj.condition = value.expression;
this.triggerObj.condition = con; this.triggerConditionId = value.id;
this.triggerConditionId = value.triggerid;
} }
if (value.priority == 4 || value.priority == 5) { //故障 if (value.priority == 4 || value.priority == 5) { //故障
this.faultConditionList = arr; this.triggerObj.faultCondition = value.expression;
this.triggerObj.faultCondition = con; this.triggerFaultConditionId = value.id;
this.triggerFaultConditionId = value.triggerid;
} }
}); });
} }
...@@ -163,19 +125,19 @@ export class ThresholdComponent implements OnInit { ...@@ -163,19 +125,19 @@ export class ThresholdComponent implements OnInit {
if (!res.and) { if (!res.and) {
res.and = ''; res.and = '';
} }
data.condition += res.and + '{' + this.hostName + ':' + this.itemObj.key_ + '.last()}' + res.equal + '' + res.value; data.condition += res.and + '{' + this.hostName + ':' + this.itemObj.key + '.last()}' + res.equal + '' + res.value;
}); });
this.faultConditionList.forEach(res => { this.faultConditionList.forEach(res => {
if (!res.and) { if (!res.and) {
res.and = ''; res.and = '';
} }
data.faultCondition += res.and + '{' + this.hostName + ':' + this.itemObj.key_ + '.last()}' + res.equal + '' + res.value; data.faultCondition += res.and + '{' + this.hostName + ':' + this.itemObj.key + '.last()}' + res.equal + '' + res.value;
}); });
} else { //高级 } else { //高级
data.condition = this.triggerObj.condition; data.condition = this.triggerObj.condition;
data.faultCondition = this.triggerObj.faultCondition; data.faultCondition = this.triggerObj.faultCondition;
} }
if (!this.checkFun()) { if (!this.checkFun() && !this.triggerObj.condition && !this.triggerObj.faultCondition) {
this.message.error('请输入阈值'); this.message.error('请输入阈值');
return false; return false;
} }
...@@ -183,13 +145,13 @@ export class ThresholdComponent implements OnInit { ...@@ -183,13 +145,13 @@ export class ThresholdComponent implements OnInit {
this.isOkLoading = true; this.isOkLoading = true;
if (this.title == '添加阈值') { if (this.title == '添加阈值') {
if (this.conditionList.length == 0 && this.faultConditionList.length == 0) { // if (this.conditionList.length == 0 && this.faultConditionList.length == 0) {
this.isVisiable = false; // this.isVisiable = false;
this.initForm(); // this.initForm();
return false; // return false;
}else{ // }else{
this.createTrigger(data); this.createTrigger(data);
} // }
} }
if (this.title == '编辑阈值') { if (this.title == '编辑阈值') {
this.updateTrigger(data); this.updateTrigger(data);
...@@ -220,7 +182,8 @@ export class ThresholdComponent implements OnInit { ...@@ -220,7 +182,8 @@ export class ThresholdComponent implements OnInit {
const res = { const res = {
itemName: this.itemObj.name, itemName: this.itemObj.name,
faultCondition: data.faultCondition, faultCondition: data.faultCondition,
condition: data.condition condition: data.condition,
itemid: this.itemId
}; };
this.overAllSer.createTrigger(res).subscribe( this.overAllSer.createTrigger(res).subscribe(
(response) => { (response) => {
...@@ -239,27 +202,36 @@ export class ThresholdComponent implements OnInit { ...@@ -239,27 +202,36 @@ export class ThresholdComponent implements OnInit {
//2.修改阈值 //2.修改阈值
updateTrigger(data) { updateTrigger(data) {
const res = { const condition = {
faultCondition: { //故障阈值 id: this.triggerConditionId,
itemName: this.itemObj.name, itemid: this.itemId,
condition: data.faultCondition, expression: data.condition,
triggerid: this.triggerFaultConditionId
},
condition: { //危险阈值
itemName: this.itemObj.name,
condition: data.condition,
triggerid: this.triggerConditionId
}
}; };
this.overAllSer.updateTrigger(res).subscribe(res => { const faultCondition = {
if (res.errCode == 10000) { id: this.triggerFaultConditionId,
this.message.success('修改阈值成功'); itemid: this.itemId,
this.initForm(); expression: data.faultCondition,
this.done.emit(); };
this.isVisiable = false; if (this.triggerConditionId) {
} this.overAllSer.updateTrigger(condition).subscribe(res => {
this.isOkLoading = false; if (res.errCode == 10000) {
}); this.initForm();
this.done.emit();
this.isOkLoading = false;
this.isVisiable = false;
}
});
}
if (this.triggerFaultConditionId) {
this.overAllSer.updateTrigger(faultCondition).subscribe(res => {
if (res.errCode == 10000) {
this.initForm();
this.done.emit();
this.isVisiable = false;
}
this.isOkLoading = false;
});
}
} }
//取消 //取消
......
...@@ -131,7 +131,8 @@ ...@@ -131,7 +131,8 @@
<label *ngFor="let item of itemTypeList" (click)="changeType(item)" nz-radio-button [nzValue]="item.applicationid">{{item.name}}</label> <label *ngFor="let item of itemTypeList" (click)="changeType(item)" nz-radio-button [nzValue]="item.applicationid">{{item.name}}</label>
</nz-radio-group> </nz-radio-group>
</div> </div>
<nz-table #checkTable [nzData]="checkList" [nzFrontPagination]="false" [nzTotal]="totalNum" [nzPageIndex]="pageIndex" [nzPageSize]="pageSize" (nzPageIndexChange)="change($event)" [nzLoading]="loading"> <nz-table #checkTable [nzData]="checkList" [nzFrontPagination]="false" [nzTotal]="totalNum" [nzPageIndex]="pageIndex"
[nzPageSize]="pageSize" (nzPageIndexChange)="change($event)" [nzLoading]="loading">
<thead> <thead>
<tr> <tr>
<th nzWidth="20%">监测点名称</th> <th nzWidth="20%">监测点名称</th>
...@@ -172,8 +173,8 @@ ...@@ -172,8 +173,8 @@
<span (click)="showEditModal(data)">编辑监测点</span> <span (click)="showEditModal(data)">编辑监测点</span>
<span (click)="deleteCheckItem(data)">删除监测点</span> <span (click)="deleteCheckItem(data)">删除监测点</span>
<br> <br>
<span (click)="showAddThresholdModal(data)">添加阈值</span> <span *ngIf="data?.triggers.length == 0" (click)="showAddThresholdModal(data)">添加阈值</span>
<span (click)="showEditThresholdModal(data)">编辑阈值</span> <span *ngIf="data?.triggers.length > 0" (click)="showEditThresholdModal(data)">编辑阈值</span>
</ng-container> </ng-container>
<span *ngIf="data.status == 0 && data.state==0" (click)="updateItem(data.itemid,1)" style="color: green">已启用</span> <span *ngIf="data.status == 0 && data.state==0" (click)="updateItem(data.itemid,1)" style="color: green">已启用</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>
......
...@@ -21,22 +21,26 @@ import {ThresholdComponent} from '../../../modal/threshold/threshold.component'; ...@@ -21,22 +21,26 @@ import {ThresholdComponent} from '../../../modal/threshold/threshold.component';
left: 233px; left: 233px;
z-index: 989; z-index: 989;
} }
.time-select{
.time-select {
position: absolute; position: absolute;
top: 55px; top: 55px;
right: 15px; right: 15px;
z-index: 999; z-index: 999;
} }
.select-border{
.select-border {
border: 1px solid #6097b7; border: 1px solid #6097b7;
border-radius: 5px; border-radius: 5px;
padding: 2px; padding: 2px;
margin-right: 5px; margin-right: 5px;
} }
:host ::ng-deep .tabs-smart .ant-tabs-nav-scroll div.ant-tabs-tab:nth-child(3){
:host ::ng-deep .tabs-smart .ant-tabs-nav-scroll div.ant-tabs-tab:nth-child(3) {
margin-right: 180px !important; margin-right: 180px !important;
} }
:host ::ng-deep .ant-radio-button-wrapper{
:host ::ng-deep .ant-radio-button-wrapper {
margin: 4px; margin: 4px;
} }
` `
...@@ -47,8 +51,8 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -47,8 +51,8 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
@ViewChild('smartThreshold') smartThreshold: ThresholdComponent; @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;
@ViewChild('checkEle') checkEle:ElementRef; @ViewChild('checkEle') checkEle: ElementRef;
color = color; color = color;
loading = false; loading = false;
hostId: string; hostId: string;
...@@ -69,7 +73,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -69,7 +73,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
secondOptionRight; secondOptionRight;
dataSet: any[]; dataSet: any[];
panel1 = {active: true, name: '响应时间与丢包率', disabled: false}; panel1 = {active: true, name: '响应时间与丢包率', disabled: false};
panel2 = {active: true, name: 'CPU使用率及内存使用率',disabled: false}; panel2 = {active: true, name: 'CPU使用率及内存使用率', disabled: false};
panel3 = {active: true, name: '磁盘使用情况', disabled: false}; panel3 = {active: true, name: '磁盘使用情况', disabled: false};
//监控点 //监控点
...@@ -123,17 +127,17 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -123,17 +127,17 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
units; //图表单位 units; //图表单位
constructor(private routerInfo: ActivatedRoute, private message: NzMessageService, constructor(private routerInfo: ActivatedRoute, private message: NzMessageService,
private overAllSer: OverAllService, private renderer: Renderer,private router:Router, private overAllSer: OverAllService, private renderer: Renderer, private router: Router,
private fb: FormBuilder, private modalService: NzModalService,private datePipe:DatePipe) { private fb: FormBuilder, private modalService: NzModalService, private datePipe: DatePipe) {
this.routerInfo.queryParams.subscribe(queryParams => { this.routerInfo.queryParams.subscribe(queryParams => {
this.hostId = queryParams.hostId; this.hostId = queryParams.hostId;
this.overAllSer.findDetailed(this.hostId).subscribe( this.overAllSer.findDetailed(this.hostId).subscribe(
(res)=>{ (res) => {
let data = res.data; let data = res.data;
this.hostName = data.name; //显示名 this.hostName = data.name; //显示名
this.realName = data.host; //主机名 this.realName = data.host; //主机名
} }
) );
}); });
} }
...@@ -146,18 +150,18 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -146,18 +150,18 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
// this.inOutInfo(); // this.inOutInfo();
//监测点 //监测点
this.getList(); this.getList();
//历史告警 //历史告警
const obj = { const obj = {
hostid:this.hostId hostid: this.hostId
}; };
this.warnList.getList(obj); this.warnList.getList(obj);
// this.disks(); // this.disks();
} }
ngAfterViewInit() { ngAfterViewInit() {
this.checkEle.nativeElement.children[1].children[0].children[0].children[2].children[0].children[0].children[2].style.marginRight = this.colorEle.nativeElement.offsetWidth +'px'; this.checkEle.nativeElement.children[1].children[0].children[0].children[2].children[0].children[0].children[2].style.marginRight = this.colorEle.nativeElement.offsetWidth + 'px';
} }
//平均响应时间 //平均响应时间
...@@ -475,10 +479,10 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -475,10 +479,10 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
data: res.data.disks.map((item) => { data: res.data.disks.map((item) => {
return item.name; return item.name;
}), }),
axisLabel:res.data.disks.map((item) => { axisLabel: res.data.disks.map((item) => {
let data = item.name; let data = item.name;
if(data.length > 5) { if (data.length > 5) {
data = data.substring(0, 4) + ".."; data = data.substring(0, 4) + '..';
} }
return data; return data;
}), }),
...@@ -505,7 +509,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -505,7 +509,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
}, },
}, },
data: res.data.disks.map((item) => { data: res.data.disks.map((item) => {
const pre = ( (item.used / item.total) * 100 ).toFixed(2); //已使用百分比 const pre = ((item.used / item.total) * 100).toFixed(2); //已使用百分比
return pre; return pre;
}) })
}, },
...@@ -530,7 +534,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -530,7 +534,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
}, },
}, },
data: res.data.disks.map((item) => { data: res.data.disks.map((item) => {
const pre = ( (item.total - item.used) / (item.total) * 100 ).toFixed(2); //剩余百分比 const pre = ((item.total - item.used) / (item.total) * 100).toFixed(2); //剩余百分比
return pre; return pre;
}) })
}, },
...@@ -549,12 +553,12 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -549,12 +553,12 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
const arr = [ const arr = [
{ {
name:"已使用", name: '已使用',
value:used, value: used,
}, },
{ {
name:"未使用", name: '未使用',
value:total, value: total,
} }
]; ];
...@@ -567,7 +571,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -567,7 +571,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
trigger: 'item', trigger: 'item',
formatter: '{a} <br/>{b} : {c} ({d}%)' formatter: '{a} <br/>{b} : {c} ({d}%)'
}, },
color: ['#3194e0','#bfbfbf'], color: ['#3194e0', '#bfbfbf'],
series: [ series: [
{ {
name: '', name: '',
...@@ -600,7 +604,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -600,7 +604,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
); );
} }
extension(){ extension() {
} }
...@@ -616,12 +620,12 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -616,12 +620,12 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
inOutInfo() { inOutInfo() {
this.inOutLoading = false; this.inOutLoading = false;
const data = { const data = {
obj:{ obj: {
hostid:Number(this.hostId) hostid: Number(this.hostId)
}, },
pageNum:this.pageNum, pageNum: this.pageNum,
pageCount:this.pageCount pageCount: this.pageCount
} };
this.overAllSer.inOutInfoSnmp(data).subscribe( this.overAllSer.inOutInfoSnmp(data).subscribe(
(res) => { (res) => {
if (res.errCode == 10000) { if (res.errCode == 10000) {
...@@ -634,33 +638,33 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -634,33 +638,33 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
} }
//进出口流量 翻页 //进出口流量 翻页
changeInoutInfo(e){ changeInoutInfo(e) {
this.pageNum = e; this.pageNum = e;
// this.inOutInfo(); // this.inOutInfo();
} }
//添加监测点 //添加监测点
showCheckModal() { showCheckModal() {
this.smartCheck.showAddModal(this.hostId,this.realName,'添加监测点'); this.smartCheck.showAddModal(this.hostId, this.realName, '添加监测点');
} }
//编辑监测点 //编辑监测点
showEditModal(item){ showEditModal(item) {
this.smartCheck.showEditModal(this.hostId,item.itemid,this.realName,item.templateid,'编辑监测点'); this.smartCheck.showEditModal(item,this.hostId, item.id, item.name, item.templateid, '编辑监测点');
} }
//添加阈值 //添加阈值
showAddThresholdModal(item){ showAddThresholdModal(item) {
this.smartThreshold.showAddModal("添加阈值",item.id,item.name); this.smartThreshold.showAddModal(item, '添加阈值', item.id, item.name);
} }
//编辑阈值 //编辑阈值
showEditThresholdModal(item){ showEditThresholdModal(item) {
this.smartThreshold.showEditModal("编辑阈值",item.itemid,this.hostId,this.realName); this.smartThreshold.showEditModal('编辑阈值', item.id, this.hostId, item.name);
} }
//添加or编辑监测点 之后 //添加or编辑监测点 之后
getList(){ getList() {
this.getCheckList(); this.getCheckList();
// this.findItemType(); // this.findItemType();
} }
...@@ -680,11 +684,11 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -680,11 +684,11 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
const data = { const data = {
pageNum: this.pageIndex, pageNum: this.pageIndex,
pageCount: pageSize, pageCount: pageSize,
obj:{ obj: {
applicationid: this.applicationId, applicationid: this.applicationId,
hostid: this.hostId, hostid: this.hostId,
priorityName:this.changeStates, priorityName: this.changeStates,
name:this.searchName name: this.searchName
} }
}; };
this.overAllSer.findCheckByType(data).subscribe( this.overAllSer.findCheckByType(data).subscribe(
...@@ -696,7 +700,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -696,7 +700,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
); );
} }
changeState(state){ changeState(state) {
this.tabNum = 1; this.tabNum = 1;
this.changeStates = state; this.changeStates = state;
this.getCheckList(); this.getCheckList();
...@@ -710,7 +714,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -710,7 +714,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
changeType(item) { changeType(item) {
this.pageIndex = 1; this.pageIndex = 1;
if(item.name == "全部"){ if (item.name == '全部') {
this.changeStates = null; this.changeStates = null;
} }
this.applicationId = item.applicationid; this.applicationId = item.applicationid;
...@@ -721,7 +725,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -721,7 +725,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
getCheckStatus() { getCheckStatus() {
this.overAllSer.findItemCount(this.hostId).subscribe( this.overAllSer.findItemCount(this.hostId).subscribe(
(res) => { (res) => {
if(res.errCode == 10000){ if (res.errCode == 10000) {
this.checkStatus = res.data; this.checkStatus = res.data;
} }
} }
...@@ -737,8 +741,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -737,8 +741,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
nzOkType: 'danger', nzOkType: 'danger',
nzOnOk: () => { nzOnOk: () => {
const data = { const data = {
itemids:[item.itemid], ids: [item.id],
templateid:item.templateid
}; };
this.overAllSer.deleteItem(data).subscribe( this.overAllSer.deleteItem(data).subscribe(
(res) => { (res) => {
...@@ -763,9 +766,9 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -763,9 +766,9 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
} }
//获取图表数据 //获取图表数据
getGraphDate(){ getGraphDate() {
const data = { const data = {
date: this.datePipe.transform(this.imageSelectDate,'yyyy-MM-dd'), date: this.datePipe.transform(this.imageSelectDate, 'yyyy-MM-dd'),
itemid: this.selectGraphadata.itemid itemid: this.selectGraphadata.itemid
}; };
this.overAllSer.findGraphData(data).subscribe( this.overAllSer.findGraphData(data).subscribe(
...@@ -788,9 +791,9 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -788,9 +791,9 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
splitLine: { splitLine: {
show: false show: false
}, },
axisLabel:{ //Y轴数据 axisLabel: { //Y轴数据
formatter:(value)=>{ formatter: (value) => {
return value+ " " +this.selectGraphadata.units; //负数取绝对值变正数 return value + ' ' + this.selectGraphadata.units; //负数取绝对值变正数
}, },
}, },
}, },
...@@ -802,7 +805,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -802,7 +805,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
series: { series: {
type: 'line', type: 'line',
data: result.map((item) => { data: result.map((item) => {
return item.value ; return item.value;
}), }),
} }
...@@ -827,10 +830,10 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -827,10 +830,10 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
(res) => { (res) => {
this.itemTypeList = res.data; this.itemTypeList = res.data;
const data = { const data = {
applicationid:'', applicationid: '',
name:'全部' name: '全部'
}; };
if (null!=res.data){ if (null != res.data) {
this.itemTypeList.unshift(data); this.itemTypeList.unshift(data);
} }
this.itemTypeValue = ''; this.itemTypeValue = '';
...@@ -874,7 +877,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -874,7 +877,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
nzOkType: 'danger', nzOkType: 'danger',
nzOnOk: () => { nzOnOk: () => {
const data = { const data = {
hostids:[] hostids: []
}; };
data.hostids.push(this.hostId); data.hostids.push(this.hostId);
this.overAllSer.deleteHostPost(data).subscribe( this.overAllSer.deleteHostPost(data).subscribe(
......
...@@ -86,9 +86,6 @@ ...@@ -86,9 +86,6 @@
</button> </button>
</div> </div>
<div nz-col nzSpan="7" class="text-right button"> <div nz-col nzSpan="7" class="text-right button">
<button (click)="batchDeleteConfirm()" nz-button nzType="default">
<i class="anticon anticon-close-circle-o"></i>删除资源
</button>
</div> </div>
</div> </div>
<nz-table #nzTable [nzData]="dataSet" [nzLoading]="loading" [nzFrontPagination]="false" [nzShowPagination]="true" <nz-table #nzTable [nzData]="dataSet" [nzLoading]="loading" [nzFrontPagination]="false" [nzShowPagination]="true"
...@@ -148,8 +145,7 @@ ...@@ -148,8 +145,7 @@
<span (click)="editBasicModal(item)">编辑</span> <span (click)="editBasicModal(item)">编辑</span>
<span (click)="showDeleteConfirm(item)">删除</span> <span (click)="showDeleteConfirm(item)">删除</span>
<span (click)="openHost(item)"> <span (click)="openHost(item)">
<ng-container *ngIf="item.status == 1">开启</ng-container> <ng-container *ngIf="item.status == 1">开启</ng-container><ng-container *ngIf="item.status == 0">停止</ng-container>监控
<ng-container *ngIf="item.status == 0">停止</ng-container>监控
</span> </span>
</td> </td>
</tr> </tr>
......
...@@ -230,15 +230,17 @@ export class BasicComponent implements OnInit { ...@@ -230,15 +230,17 @@ export class BasicComponent implements OnInit {
const data = { const data = {
pageNum: this.pageNum, pageNum: this.pageNum,
pageCount: this.pageCount, pageCount: this.pageCount,
name: this.searchName, obj:{
waringName: this.status, name: this.searchName,
equipmentTypeid: this.equipmentTypeid, waringName: this.status,
groupids: [] equipmentTypeid: this.equipmentTypeid,
groupids: []
}
}; };
if (this.groupid) { if (this.groupid) {
data.groupids.push(this.groupid); data.obj.groupids.push(this.groupid);
} else { } else {
data.groupids = []; data.obj.groupids = [];
} }
this.overAllSer.findHostPageNew(data).subscribe( this.overAllSer.findHostPageNew(data).subscribe(
(res) => { (res) => {
......
...@@ -167,7 +167,7 @@ export class OverAllService { ...@@ -167,7 +167,7 @@ export class OverAllService {
//查询监控项 //查询监控项
findItemDetail(params): Observable<any> { findItemDetail(params): Observable<any> {
return this.http.get(SERVER_API_URL + '/item/details/' + params); return this.http.get(SERVER_API_URL + '/item/find/' + params);
} }
//监控项分类 //监控项分类
...@@ -196,7 +196,7 @@ export class OverAllService { ...@@ -196,7 +196,7 @@ export class OverAllService {
} }
itemUpdata(data): Observable<any> { itemUpdata(data): Observable<any> {
return this.http.put(SERVER_API_URL + '/item/updata/', data); return this.http.put(SERVER_API_URL + '/item/update', data);
} }
//临时暂停 //临时暂停
...@@ -317,7 +317,7 @@ export class OverAllService { ...@@ -317,7 +317,7 @@ export class OverAllService {
//修改触发器 //修改触发器
updateTrigger(data): Observable<any> { updateTrigger(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/item/updateItemTrigger', data); return this.http.post(SERVER_API_URL + '/trigger/update', data);
} }
//查看映射值 //查看映射值
......
...@@ -167,7 +167,6 @@ export class ItemListComponent implements OnInit { ...@@ -167,7 +167,6 @@ export class ItemListComponent implements OnInit {
//编辑监测点 //编辑监测点
showEditModal(item){ showEditModal(item){
this.smartBasiCheck.showEditModal(this.hostId,item.itemid,this.tempName,item.templateid,'编辑模版监测点');
} }
//删除监测点 //删除监测点
...@@ -179,8 +178,7 @@ export class ItemListComponent implements OnInit { ...@@ -179,8 +178,7 @@ export class ItemListComponent implements OnInit {
nzOkType: 'danger', nzOkType: 'danger',
nzOnOk: () => { nzOnOk: () => {
const data = { const data = {
itemids:[item.itemid], itemids:[item.id],
templateid:item.templateid
}; };
this.overAllSer.deleteItem(data).subscribe( this.overAllSer.deleteItem(data).subscribe(
(res) => { (res) => {
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
<div nz-row class="search-form"> <div nz-row class="search-form">
<div nz-col nzSpan="16"> <div nz-col nzSpan="16">
<button (click)="showSeparationModal()" nz-button nzType="default">三员分立</button> <!-- <button (click)="showSeparationModal()" nz-button nzType="default">三员分立</button>-->
<button (click)="showAddRoleModal()" nz-button nzType="default"><i class="anticon anticon-plus-circle-o"></i>新增角色 <!-- <button (click)="showAddRoleModal()" nz-button nzType="default"><i class="anticon anticon-plus-circle-o"></i>新增角色-->
</button> </button>
</div> </div>
<div nz-col nzSpan="8" class="text-right"> <div nz-col nzSpan="8" class="text-right">
......
...@@ -27,11 +27,11 @@ export class PowerComponent implements OnInit { ...@@ -27,11 +27,11 @@ export class PowerComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.getRole(); this.getRole();
this.systemSer.userFind().subscribe( // this.systemSer.userFind().subscribe(
(res)=>{ // (res)=>{
this.isAdmin = res.data.isAdmin; // this.isAdmin = res.data.isAdmin;
} // }
) // )
} }
getRole() { getRole() {
......
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