Commit c7ab0af1 authored by wangqinghua's avatar wangqinghua

template

parent 33ab7b9a
......@@ -84,7 +84,7 @@
{{data.hosts[0].name}}
</ng-container>
</td>
<td class="handle">
<td class="handle cursor main-color">
<span (click)="showDeleteModal(data)">查看</span>
</td>
<td>
......
......@@ -231,14 +231,14 @@
<nz-form-item>
<nz-form-label [nzSpan]="4" nzRequired nzFor="serviceid">恢复主题</nz-form-label>
<nz-form-control [nzSpan]="14">
<input id="host4" type="text" nz-input name="host1" [(ngModel)]="validateForm.r_longdata" >
<input id="host4" type="text" nz-input name="host1" [(ngModel)]="validateForm.r_shortdata">
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label [nzSpan]="4" nzRequired nzFor="serviceid">恢复信息</nz-form-label>
<nz-form-control [nzSpan]="14">
<textarea nz-input nzPlaceholder="恢复信息" [nzAutosize]="{ minRows: 4, maxRows: 4 }" [(ngModel)]="validateForm.r_shortdata"></textarea>
<textarea nz-input nzPlaceholder="恢复信息" [nzAutosize]="{ minRows: 4, maxRows: 4 }" [(ngModel)]="validateForm.r_longdata"></textarea>
</nz-form-control>
</nz-form-item>
</ng-container>
......
......@@ -281,6 +281,7 @@ export class AlarmModalComponent implements OnInit {
def_longdata:this.validateForm.def_longdata,
r_longdata:this.validateForm.r_longdata,
r_shortdata:this.validateForm.r_shortdata,
hostIds:this.selectTreeList,
event:{
eventTypeId:this.validateForm.event.eventTypeId, //事件分类id
operators:this.operatorList, //事件负责人
......
......@@ -55,7 +55,7 @@ export class CreateGroupComponent implements OnInit {
return false;
}
if(this.title == '添加分组'){
if(this.title == '添加分组' || this.title == '添加模版组'){
this.create();
}else{
this.update();
......
......@@ -103,10 +103,4 @@
</form>
</nz-modal>
<!--键值查询-->
<smart-basic-key (keyValue)="getKey($event)" #basicKey></smart-basic-key>
<!--新建分类-->
<smart-new-type (data)="addItemType($event)" #newType></smart-new-type>
......@@ -363,4 +363,54 @@ export class OverAllService {
findLldrule(params): Observable<any> {
return this.http.get(SERVER_API_URL + '/lldrule/find/'+ params);
}
//分页查询触发器
findPageTrigger(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/triggerPrototype/findPage', data);
}
//主键查询触发器原型
findTriggerById(params): Observable<any> {
return this.http.get(SERVER_API_URL + '/triggerPrototype/find/'+ params);
}
//删除触发器
deleteTrigger(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/triggerPrototype/delete', data);
}
//修改触发器原型
updateTriggerPrototype(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/triggerPrototype/update', data);
}
//添加触发器原型
createTriggerPrototype(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/triggerPrototype/create', data);
}
//添加监控项原型
createItemPrototype(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/itemprototype/create', data);
}
//删除监控项原型
deleteItemPrototype(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/itemprototype/delete', data);
}
//分页查询监控项原型
findItemPrototype(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/itemprototype/findPage', data);
}
//修改监控项原型
updateItemPrototype(data): Observable<any> {
return this.http.post(SERVER_API_URL + '/itemprototype/update', data);
}
//主键查询监控项原型
findItemById(params): Observable<any> {
return this.http.get(SERVER_API_URL + '/itemprototype/find/'+ params);
}
}
......@@ -25,18 +25,16 @@
</div>
<div nz-row [nzGutter]="4" class="search-form">
<div nz-col nzSpan="3">
<button (click)="showAddModal()" nz-button nzType="default"><i class="anticon anticon-plus-circle-o"></i>添加资产
</button>
<button (click)="showAddModal()" nz-button nzType="default"><i class="anticon anticon-plus-circle-o"></i>添加资产</button>
</div>
<div nz-col nzSpan="18"></div>
<div nz-col nzSpan="3"></div>
</div>
<nz-table #nzTable [nzData]="childrenList">
<nz-table #nzTable [nzData]="checkList">
<thead>
<tr>
<th nzShowCheckbox [nzIndeterminate]="indeterminate" [nzChecked]="allChecked"
(nzCheckedChange)="checkAll($event)"></th>
<th nzShowCheckbox [nzIndeterminate]="indeterminate" [nzChecked]="allChecked" (nzCheckedChange)="checkAll($event)"></th>
<th>名称</th>
<th>监控项</th>
<th>阈值</th>
......@@ -47,7 +45,7 @@
</tr>
</thead>
<tbody>
<tr *ngFor="let data of childrenList">
<tr *ngFor="let data of checkList">
<td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="selectItem(data,$event)"></td>
<td class="round-tag tag-form">{{data.inventoryNo}}</td>
<td>{{data.name}}</td>
......
import { Component, OnInit } from '@angular/core';
import {ActivatedRoute, Router} from '@angular/router';
import {CommonService} from '../../../shared/common/common.service';
import {SystemService} from '../../../system/system.service';
import {OverAllService} from '../../overAll.service';
import {NzMessageService} from 'ng-zorro-antd';
import {pageSize} from '../../../app.constants';
@Component({
selector: 'smart-check-list',
......@@ -9,10 +15,77 @@ export class CheckListComponent implements OnInit {
tempName;
disName;
discoveryids;
constructor() { }
pageNum = 1;
pageCount = pageSize;
totalNum;
checkList;
selectList = [];
allChecked;
indeterminate;
constructor(private overAllSer: OverAllService, private routerInfo: ActivatedRoute,private router:Router,
private message:NzMessageService,private systemSer:SystemService,
private commonSer:CommonService) {
this.routerInfo.queryParams.subscribe(
(res) => {
this.discoveryids = res.id;
this.tempName = res.name
}
);
}
checkAll(value: boolean): void {
this.checkList.forEach(data => data.checked = value);
this.refreshStatus();
}
currentPageDataChange($event: Array<{ checked: boolean }>): void {
this.checkList = $event;
}
selectItem(item, e) {
if (e) {
this.selectList.push(item);
} else {
this.selectList.forEach((value, index) => {
if (value.id == item.id) {
this.selectList.splice(index, 1);
}
});
}
this.refreshStatus();
}
refreshStatus(): void {
const allChecked = this.checkList.every(value => value.checked === true);
const allUnChecked = this.checkList.every(value => !value.checked);
this.allChecked = allChecked;
this.indeterminate = (!allChecked) && (!allUnChecked);
}
ngOnInit() {
this.getList();
}
getList(){
const data = {
pageNum:this.pageNum,
pageCount:this.pageCount,
hostIds:[this.discoveryids]
};
this.overAllSer.findItemPrototype(data).subscribe(
(res) => {
this.checkList = res.data.data;
this.totalNum = res.data.totalNum;
}
);
}
showAddModal(){
}
}
......@@ -45,8 +45,12 @@
<tr *ngFor="let data of discoveryList">
<td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="selectItem(data,$event)"></td>
<td class="round-tag tag-form">{{data.name}}</td>
<td>{{data.itemsCount}}</td>
<td>{{data.triggersCount}}</td>
<td class="cursor main-color">
<span (click)="goToCheck(data)">{{data.itemsCount}}</span>
</td>
<td class="cursor main-color">
<span (click)="goToTrigger(data)">{{data.triggersCount}}</span>
</td>
<td>{{data.stock}}</td>
<td>{{data.usedcount}}</td>
<td>{{data.lendcount}}</td>
......
......@@ -149,7 +149,9 @@ export class DiscoveryListComponent implements OnInit {
goToCheck(data){
this.router.navigate(['app/main/checkList'],{
queryParams:{
invertoryId:data.id
id:data.itemid,
name:data.name,
tempName : this.tempName
}
})
}
......@@ -158,7 +160,9 @@ export class DiscoveryListComponent implements OnInit {
goToTrigger(data){
this.router.navigate(['app/main/triggerList'],{
queryParams:{
invertoryId:data.id
id:data.itemid,
name:data.name,
tempName : this.tempName
}
})
}
......
......@@ -32,7 +32,7 @@
<div nz-col nzSpan="3"></div>
</div>
<nz-table #nzTable [nzData]="childrenList">
<nz-table #nzTable [nzData]="triggerList">
<thead>
<tr>
<th nzShowCheckbox [nzIndeterminate]="indeterminate" [nzChecked]="allChecked"
......@@ -47,7 +47,7 @@
</tr>
</thead>
<tbody>
<tr *ngFor="let data of childrenList">
<tr *ngFor="let data of triggerList">
<td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="selectItem(data,$event)"></td>
<td class="round-tag tag-form">{{data.inventoryNo}}</td>
<td>{{data.name}}</td>
......
import { Component, OnInit } from '@angular/core';
import {Component, OnInit} from '@angular/core';
import {pageSize} from '../../../app.constants';
import {ActivatedRoute, Router} from '@angular/router';
import {CommonService} from '../../../shared/common/common.service';
import {SystemService} from '../../../system/system.service';
import {OverAllService} from '../../overAll.service';
import {NzMessageService} from 'ng-zorro-antd';
@Component({
selector: 'smart-trigger-list',
templateUrl: './trigger-list.component.html',
styles: []
selector: 'smart-trigger-list',
templateUrl: './trigger-list.component.html',
styles: []
})
export class TriggerListComponent implements OnInit {
tempName;
disName;
discoveryids;
constructor() { }
pageNum = 1;
pageCount = pageSize;
totalNum;
ngOnInit() {
}
triggerList;
selectList = [];
allChecked;
indeterminate;
constructor(private overAllSer: OverAllService, private routerInfo: ActivatedRoute, private router: Router,
private message: NzMessageService, private systemSer: SystemService,
private commonSer: CommonService) {
this.routerInfo.queryParams.subscribe(
(res) => {
this.discoveryids = res.id;
this.tempName = res.name;
}
);
}
checkAll(value: boolean): void {
this.triggerList.forEach(data => data.checked = value);
this.refreshStatus();
}
currentPageDataChange($event: Array<{ checked: boolean }>): void {
this.triggerList = $event;
}
selectItem(item, e) {
if (e) {
this.selectList.push(item);
} else {
this.selectList.forEach((value, index) => {
if (value.id == item.id) {
this.selectList.splice(index, 1);
}
});
}
this.refreshStatus();
}
refreshStatus(): void {
const allChecked = this.triggerList.every(value => value.checked === true);
const allUnChecked = this.triggerList.every(value => !value.checked);
this.allChecked = allChecked;
this.indeterminate = (!allChecked) && (!allUnChecked);
}
ngOnInit() {
this.getList();
}
getList() {
const data = {
pageNum: this.pageNum,
pageCount: this.pageCount,
hostIds: [this.discoveryids]
};
this.overAllSer.findItemPrototype(data).subscribe(
(res) => {
this.triggerList = res.data.data;
this.totalNum = res.data.totalNum;
}
);
}
showAddModal() {
}
}
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