Commit e45d61e3 authored by wangqinghua's avatar wangqinghua

update

parent 6d6349eb
...@@ -124,13 +124,17 @@ export class BasiCheckComponent implements OnInit { ...@@ -124,13 +124,17 @@ export class BasiCheckComponent implements OnInit {
} }
//编辑 //编辑
showEditModal(hostId, id, hostName,templateid) { showEditModal(hostId, id, hostName,templateid,title) {
this.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;
if(this.title == '编辑模版监测点'){
this.isInterface = false;
this.validateForm.get('interfaceid').clearValidators();
}
this.overAllSer.findItemDetail(id).subscribe( this.overAllSer.findItemDetail(id).subscribe(
(res) => { (res) => {
const data = res.data[0]; const data = res.data[0];
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<nz-modal [(nzVisible)]="isNode" nzTitle="节点" (nzOnCancel)="handleNodeCancel()" (nzOnOk)="handleNodeOk()"> <nz-modal [(nzVisible)]="isNode" nzTitle="节点" (nzOnCancel)="handleNodeCancel()" (nzOnOk)="handleNodeOk()">
<div nz-form class="ant-advanced-search-form form-select"> <div nz-form class="ant-advanced-search-form form-select">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="7" nzFor="group" >设备名称</nz-form-label> <nz-form-label [nzSpan]="7" nzFor="group" >显示名称</nz-form-label>
<nz-form-control [nzSpan]="12"> <nz-form-control [nzSpan]="12">
<input nz-input type="text" [(ngModel)]="name"> <input nz-input type="text" [(ngModel)]="name">
</nz-form-control> </nz-form-control>
......
...@@ -645,7 +645,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit { ...@@ -645,7 +645,7 @@ export class BasicDetailComponent implements OnInit, AfterViewInit {
//编辑监测点 //编辑监测点
showEditModal(item){ showEditModal(item){
this.smartCheck.showEditModal(this.hostId,item.itemid,this.realName,item.templateid); this.smartCheck.showEditModal(this.hostId,item.itemid,this.realName,item.templateid,'编辑监测点');
} }
//添加阈值 //添加阈值
......
...@@ -162,12 +162,12 @@ export class ItemListComponent implements OnInit { ...@@ -162,12 +162,12 @@ export class ItemListComponent implements OnInit {
//添加监测点 //添加监测点
showAddModal(){ showAddModal(){
this.smartBasiCheck.showAddModal(this.hostId,this.tempName,"添加监测点"); this.smartBasiCheck.showAddModal(this.hostId,this.tempName,"添加模版监测点");
} }
//编辑监测点 //编辑监测点
showEditModal(item){ showEditModal(item){
this.smartBasiCheck.showEditModal(this.hostId,item.itemid,this.tempName,item.templateid); this.smartBasiCheck.showEditModal(this.hostId,item.itemid,this.tempName,item.templateid,'编辑模版监测点');
} }
} }
...@@ -35,12 +35,12 @@ ...@@ -35,12 +35,12 @@
</button> </button>
</div> </div>
</div> </div>
<nz-table #nzTable [nzData]="dataSet" nzSingleSort [nzLoading]="loading" [nzShowPagination]="frontPagination"> <nz-table #nzTable [nzData]="dataSet" nzSingleSort [nzLoading]="isLoading" [nzShowPagination]="frontPagination">
<thead> <thead>
<tr> <tr>
<th [nzChecked]="allChecked"></th> <th [nzChecked]="allChecked"></th>
<th>名称</th> <th nzWidth="20%">名称</th>
<th>描述</th> <th nzWidth="20%">描述</th>
<th>自动发现</th> <th>自动发现</th>
<th>监控项</th> <th>监控项</th>
<th>阈值</th> <th>阈值</th>
...@@ -92,8 +92,6 @@ ...@@ -92,8 +92,6 @@
<span (click)="showDeleteGroupConfirm(item)">删除</span> <span (click)="showDeleteGroupConfirm(item)">删除</span>
</ng-container> </ng-container>
<ng-container *ngIf="item.level"> <ng-container *ngIf="item.level">
<!--<span (click)="showBasicCheckModal(item.templateid,item.host)">添加监测点</span>-->
<!--<span (click)="showDiscoveryAddModal(item)">添加自动发现</span>-->
<span (click)="showTempEditModal(item)">编辑</span> <span (click)="showTempEditModal(item)">编辑</span>
<span (click)="showDeleteConfirm(item)">删除</span> <span (click)="showDeleteConfirm(item)">删除</span>
</ng-container> </ng-container>
...@@ -123,11 +121,8 @@ ...@@ -123,11 +121,8 @@
<span (click)="goToTri(item)">{{item.triggersCount}}</span> <span (click)="goToTri(item)">{{item.triggersCount}}</span>
</td> </td>
<td class="handle main-color"> <td class="handle main-color">
<!--<span (click)="showBasicCheckModal(item.templateid,item.host)">添加监测点</span>--> <span (click)="showTempEditModal(item)">编辑</span>
<span (click)="showDiscoveryAddModal(item.templateid,item.host)">添加自动发现</span>
<span (click)="editBasicModal(item)">编辑</span>
<span (click)="showDeleteConfirm(item)">删除</span> <span (click)="showDeleteConfirm(item)">删除</span>
<!--<span (click)="showAlarm(item)">添加告警</span>-->
</td> </td>
</tr> </tr>
</ng-container> </ng-container>
......
...@@ -15,9 +15,9 @@ import {DiscoveryComponent} from '../../modal/discovery/discovery.component'; ...@@ -15,9 +15,9 @@ import {DiscoveryComponent} from '../../modal/discovery/discovery.component';
import {StrategyComponent} from '../../modal/strategy/strategy.component'; import {StrategyComponent} from '../../modal/strategy/strategy.component';
@Component({ @Component({
selector: 'smart-template', selector: 'smart-template',
templateUrl: './template.component.html', templateUrl: './template.component.html',
styles: [] styles: []
}) })
export class TemplateComponent implements OnInit { export class TemplateComponent implements OnInit {
//组件 //组件
...@@ -32,7 +32,7 @@ export class TemplateComponent implements OnInit { ...@@ -32,7 +32,7 @@ export class TemplateComponent implements OnInit {
color = color; color = color;
//表格信息 //表格信息
loading = false; isLoading = false;
frontPagination = true; frontPagination = true;
selectedValue; selectedValue;
...@@ -123,22 +123,24 @@ export class TemplateComponent implements OnInit { ...@@ -123,22 +123,24 @@ export class TemplateComponent implements OnInit {
} }
//获取模版组 //获取模版组
getTemplateGroup(){ getTemplateGroup() {
this.isLoading = true;
this.overAllSer.getTemplateGroups().subscribe( this.overAllSer.getTemplateGroups().subscribe(
(res)=>{ (res) => {
this.dataSet = res.data; this.dataSet = res.data;
this.isLoading = false;
for (let i = 0; i < this.dataSet.length; i++) { for (let i = 0; i < this.dataSet.length; i++) {
this.dataSet[i].host = i; this.dataSet[i].host = i;
this.dataSet[i].checked = false; this.dataSet[i].checked = false;
} }
this.toTree(null); this.toTree(null);
} }
) );
} }
//搜索 //搜索
search() { search() {
this.loading = true; this.isLoading = true;
this.searchStatus = true; this.searchStatus = true;
this.frontPagination = false; this.frontPagination = false;
const data = { const data = {
...@@ -151,7 +153,7 @@ export class TemplateComponent implements OnInit { ...@@ -151,7 +153,7 @@ export class TemplateComponent implements OnInit {
if (res.errCode == 10000) { if (res.errCode == 10000) {
this.searchData = res.data; this.searchData = res.data;
} }
this.loading = false; this.isLoading = false;
} }
); );
} }
...@@ -164,26 +166,26 @@ export class TemplateComponent implements OnInit { ...@@ -164,26 +166,26 @@ export class TemplateComponent implements OnInit {
//添加模版 //添加模版
showTempAddModal() { showTempAddModal() {
this.smartStrategy.showAddModal("添加模版"); this.smartStrategy.showAddModal('添加模版');
} }
//编辑模版 //编辑模版
showTempEditModal(item) { showTempEditModal(item) {
this.smartStrategy.showEditModal("编辑模版", item.templateid); this.smartStrategy.showEditModal('编辑模版', item.templateid);
} }
//模版监测点 //模版监测点
showBasicCheckModal(hostid, host) { showBasicCheckModal(hostid, host) {
this.smartCheck.showAddModal(hostid, host,"添加模版监测点"); this.smartCheck.showAddModal(hostid, host, '添加模版监测点');
} }
//添加自动发现 //添加自动发现
showDiscoveryAddModal(item){ showDiscoveryAddModal(item) {
this.smartDiscovery.showAddModal(item.templateid,"添加自动发现") this.smartDiscovery.showAddModal(item.templateid, '添加自动发现');
} }
//goto 自动发现页面 //goto 自动发现页面
goToDiscovery(item){ goToDiscovery(item) {
this.router.navigate(['app/main/discoveryList'], { this.router.navigate(['app/main/discoveryList'], {
queryParams: { queryParams: {
templateid: item.templateid, templateid: item.templateid,
...@@ -194,7 +196,7 @@ export class TemplateComponent implements OnInit { ...@@ -194,7 +196,7 @@ export class TemplateComponent implements OnInit {
} }
//goto 监控项列表 //goto 监控项列表
goToItem(item){ goToItem(item) {
this.router.navigate(['app/main/itemList'], { this.router.navigate(['app/main/itemList'], {
queryParams: { queryParams: {
templateid: item.templateid, templateid: item.templateid,
...@@ -205,7 +207,7 @@ export class TemplateComponent implements OnInit { ...@@ -205,7 +207,7 @@ export class TemplateComponent implements OnInit {
} }
//goto阈值列表 //goto阈值列表
goToTri(item){ goToTri(item) {
this.router.navigate(['app/main/triList'], { this.router.navigate(['app/main/triList'], {
queryParams: { queryParams: {
templateid: item.templateid, templateid: item.templateid,
...@@ -277,7 +279,7 @@ export class TemplateComponent implements OnInit { ...@@ -277,7 +279,7 @@ export class TemplateComponent implements OnInit {
} }
return false; return false;
} }
this.loading = true; this.isLoading = true;
const data = { const data = {
'groupids': [item.groupid], 'groupids': [item.groupid],
}; };
...@@ -289,7 +291,7 @@ export class TemplateComponent implements OnInit { ...@@ -289,7 +291,7 @@ export class TemplateComponent implements OnInit {
} else { } else {
this.message.info('该分组下无资源'); this.message.info('该分组下无资源');
} }
this.loading = false; this.isLoading = false;
} }
); );
} }
...@@ -304,7 +306,7 @@ export class TemplateComponent implements OnInit { ...@@ -304,7 +306,7 @@ export class TemplateComponent implements OnInit {
} }
return false; return false;
} }
this.loading = true; this.isLoading = true;
const data = { const data = {
type: item.equipmentTypeId type: item.equipmentTypeId
}; };
...@@ -316,7 +318,7 @@ export class TemplateComponent implements OnInit { ...@@ -316,7 +318,7 @@ export class TemplateComponent implements OnInit {
} else { } else {
this.message.info('该分组下无资源'); this.message.info('该分组下无资源');
} }
this.loading = false; this.isLoading = false;
} }
); );
} }
......
...@@ -1040,7 +1040,7 @@ editor.utils = { ...@@ -1040,7 +1040,7 @@ editor.utils = {
img = "icon_virtual_host.png"; // 默认图片 img = "icon_virtual_host.png"; // 默认图片
} }
if (!text) { if (!text) {
text = "图片"; // 默认标签 text = ""; // 默认标签
} }
var node = new JTopo.Node() var node = new JTopo.Node()
node.fontColor = editor.config.nodeFontColor node.fontColor = editor.config.nodeFontColor
......
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