Commit a00efaba authored by wangqinghua's avatar wangqinghua

网站监测 service

parent 6ad91809
...@@ -5,8 +5,6 @@ import {JhiLoginModalComponent} from "./shared"; ...@@ -5,8 +5,6 @@ import {JhiLoginModalComponent} from "./shared";
import {JhiMainComponent} from "./layouts"; import {JhiMainComponent} from "./layouts";
import {BasicComponent} from "./overAll/basic/basic.component"; import {BasicComponent} from "./overAll/basic/basic.component";
import {BasicDetailComponent} from "./overAll/basic/basic-detail/basic-detail.component"; import {BasicDetailComponent} from "./overAll/basic/basic-detail/basic-detail.component";
import {MonitorComponent} from "./overAll/monitor/monitor.component";
import {SecurityComponent} from "./overAll/security/security.component";
import {AuditComponent} from "./system/audit/audit.component"; import {AuditComponent} from "./system/audit/audit.component";
import {ExamineComponent} from "./system/examine/examine.component"; import {ExamineComponent} from "./system/examine/examine.component";
import {GroupComponent} from "./system/group/group.component"; import {GroupComponent} from "./system/group/group.component";
...@@ -33,8 +31,6 @@ export const route: Routes = [ ...@@ -33,8 +31,6 @@ export const route: Routes = [
{path: 'basic', component: BasicComponent}, {path: 'basic', component: BasicComponent},
{path: 'basic-detail', component: BasicDetailComponent}, {path: 'basic-detail', component: BasicDetailComponent},
{path: 'networkCheck', component: NetworkCheckComponent}, {path: 'networkCheck', component: NetworkCheckComponent},
{path: 'monitor', component: MonitorComponent},
{path: 'security', component: SecurityComponent},
{path: 'audit', component: AuditComponent}, {path: 'audit', component: AuditComponent},
{path: 'examine', component: ExamineComponent}, {path: 'examine', component: ExamineComponent},
{path: 'group', component: GroupComponent}, {path: 'group', component: GroupComponent},
......
...@@ -60,7 +60,6 @@ ...@@ -60,7 +60,6 @@
</thead> </thead>
<tbody> <tbody>
<!--设备类型--> <!--设备类型-->
<ng-container *ngIf="selectedValue == 'type'"> <ng-container *ngIf="selectedValue == 'type'">
<ng-template ngFor let-data [ngForOf]="nzTable.data"> <ng-template ngFor let-data [ngForOf]="nzTable.data">
...@@ -199,7 +198,7 @@ ...@@ -199,7 +198,7 @@
<ng-container *ngIf="item.status == 0">停止</ng-container> <ng-container *ngIf="item.status == 0">停止</ng-container>
监控 监控
</a></li> </a></li>
<li nz-menu-item><a>查看监测点</a></li> <li nz-menu-item (click)="goDetail(item)"><a>查看监测点</a></li>
<li (click)="showAlarm(item)" nz-menu-item><a>添加告警</a></li> <li (click)="showAlarm(item)" nz-menu-item><a>添加告警</a></li>
</ul> </ul>
</nz-dropdown> </nz-dropdown>
......
<div nz-row class="breadcrumbs" >
<div nz-col nzSpan="16">
<nz-breadcrumb class="padding-8-0">
<nz-breadcrumb-item>
首页
</nz-breadcrumb-item>
<nz-breadcrumb-item>
<a>综合监控</a>
</nz-breadcrumb-item>
<nz-breadcrumb-item>
基础资源监控
</nz-breadcrumb-item>
</nz-breadcrumb>
</div>
<div nz-col nzSpan="8" class="text-right">
<button nz-button nzType="primary"><i class="anticon anticon-search"></i></button>
<button nz-button nzType="primary"><i class="anticon anticon-sync"></i></button>
<button nz-button nzType="primary"><i class="anticon anticon-arrows-alt"></i></button>
</div>
</div>
<div nz-row class="search-form">
<div nz-col nzSpan="16">
<span>监控设备数:120</span>
<span>设备状态:
<span> <nz-tag [nzColor]="'#64ad58'"></nz-tag>110 </span>
<span> <nz-tag [nzColor]="'#ed9e2e'"></nz-tag>120 </span>
<span> <nz-tag [nzColor]="'#dd4127'"></nz-tag>119 </span>
<span> <nz-tag [nzColor]="'#aaaaaa'"></nz-tag>112 </span>
</span>
<nz-select style="width: 200px;" nzShowSearch nzAllowClear nzPlaceHolder="按组分开">
<nz-option nzLabel="A" nzValue="A"></nz-option>
<nz-option nzLabel="B" nzValue="B"></nz-option>
<nz-option nzLabel="C" nzValue="C"></nz-option>
</nz-select>
</div>
<div nz-col nzSpan="8" class="text-right">
<button nz-button nzType="default"><i class="anticon anticon-pause-circle-o"></i>关闭监控</button>
<button nz-button nzType="default"><i class="anticon anticon-play-circle-o"></i>开启监控</button>
<button nz-button nzType="default"><i class="anticon anticon-close-circle"></i>删除资源</button>
</div>
</div>
<nz-table #nzTable [nzData]="data" nzSingleSort>
<thead>
<tr>
<th nzShowCheckbox></th>
<th nzShowSort>名称</th>
<th nzShowSort nzWidth="20%">状态</th>
<th nzShowSort>类型</th>
<th nzShowSort>监控点</th>
<th nzShowSort>CPU利用率</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<ng-template ngFor let-data [ngForOf]="nzTable.data">
<ng-template ngFor let-item [ngForOf]="expandDataCache[data.key]">
<tr *ngIf="(item.parent&&item.parent.expand)||!(item.parent)">
<td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="refreshStatus($event)"></td>
<td [nzIndentSize]="item.level*20" [nzShowExpand]="!!item.children" [(nzExpand)]="item.expand" (nzExpandChange)="collapse(expandDataCache[data.key],item,$event)">
{{item.key1}}
</td>
<td>{{item.key2}}</td>
<td>{{item.key3}}</td>
<td>{{item.key4}}</td>
<td>{{item.key5}}</td>
<td>
<span *ngIf="!item.level">
<span (click)="showBasicEditModal()">添加资源</span>
<span>编辑</span>
<span>删除</span>
</span>
<span *ngIf="item.level">
<span>添加检测点</span>
<span>编辑</span>
<span>删除</span>
<span class="table-operation">
<nz-dropdown>
<a nz-dropdown class="operation">
更多 <i class="anticon anticon-down"></i>
</a>
<ul nz-menu>
<li nz-menu-item>
<a>Action 1</a>
</li>
<li nz-menu-item>
<a>Action 2</a>
</li>
</ul>
</nz-dropdown>
</span>
</span>
</td>
</tr>
</ng-template>
</ng-template>
</tbody>
</nz-table>
<nz-modal [nzWidth]="780" [(nzVisible)]="isBasicEdit" nzTitle="添加检测点" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()">
<form nz-form [nzLayout]="'vertical'" [formGroup]="validateForm" (ngSubmit)="submitForm()">
<div>
基本属性
<label nz-checkbox></label>
<div nz-row>
<div nz-col [nzSpan]="12">
<nz-form-item [nzFlex]="true">
<nz-form-label [nzSm]="8" [nzXs]="24" nzRequired nzFor="email1">监测点名称</nz-form-label>
<nz-form-control [nzSm]="16" [nzXs]="24">
<input nz-input >
<!--<nz-form-explain *ngIf="validateForm.get('email').dirty && validateForm.get('email').errors">The input is not valid E-mail!</nz-form-explain>-->
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="12">
<nz-form-item [nzFlex]="true">
<nz-form-label [nzSm]="8" [nzXs]="24" nzRequired nzFor="email1">类型</nz-form-label>
<nz-form-control [nzSm]="16" [nzXs]="24">
<nz-select name="select-error">
<nz-option nzValue="number" nzLabel="数字"></nz-option>
<nz-option nzValue="Option 2" nzLabel="Option 2"></nz-option>
</nz-select>
<!--<nz-form-explain *ngIf="validateForm.get('email').dirty && validateForm.get('email').errors">The input is not valid E-mail!</nz-form-explain>-->
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row>
<div nz-col [nzSpan]="12">
<nz-form-item [nzFlex]="true">
<nz-form-label [nzSm]="8" [nzXs]="24" nzRequired nzFor="email2">信息类型</nz-form-label>
<nz-form-control [nzSm]="16" [nzXs]="24">
<nz-select name="select-error">
<nz-option nzValue="number" nzLabel="数字"></nz-option>
<nz-option nzValue="Option 2" nzLabel="Option 2"></nz-option>
</nz-select>
<!--<nz-form-explain *ngIf="validateForm.get('email').dirty && validateForm.get('email').errors">The input is not valid E-mail!</nz-form-explain>-->
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="12">
<nz-form-item [nzFlex]="true">
<nz-form-label [nzSm]="8" [nzXs]="24" nzRequired nzFor="email3">单位</nz-form-label>
<nz-form-control [nzSm]="16" [nzXs]="24">
<input nz-input >
<!--<nz-form-explain *ngIf="validateForm.get('email').dirty && validateForm.get('email').errors">The input is not valid E-mail!</nz-form-explain>-->
</nz-form-control>
</nz-form-item>
</div>
</div>
</div>
<div>
阀值设置
<label nz-checkbox></label>
</div>
</form>
</nz-modal>
import { Component, OnInit } from '@angular/core';
import {TreeNodeInterface} from "../basic/basic.component";
import {
FormBuilder,
FormGroup,
Validators
} from '@angular/forms';
@Component({
selector: 'jhi-monitor',
templateUrl: './monitor.component.html',
styles: []
})
export class MonitorComponent implements OnInit {
isBasicEdit = false;
constructor(private fb: FormBuilder) { }
data = [
{
key : 1,
key1 : '名称',
key2 : '状态',
key3 : '类型',
key4 : '监控点',
key5 : 'CPU利用率',
children: [
{
key : 11,
key1 : '名称',
key2 : '状态',
key3 : '类型',
key4 : '监控点',
key5 : 'CPU利用率',
},
{
key : 12,
key1 : '名称',
key2 : '状态',
key3 : '类型',
key4 : '监控点',
key5 : 'CPU利用率',
children: [ {
key : 121,
key1 : '名称',
key2 : '状态',
key3 : '类型',
key4 : '监控点',
key5 : 'CPU利用率',
} ]
},
{
key : 13,
key1 : '名称',
key2 : '状态',
key3 : '类型',
key4 : '监控点',
key5 : 'CPU利用率',
children: [
{
key : 131,
key1 : '名称',
key2 : '状态',
key3 : '类型',
key4 : '监控点',
key5 : 'CPU利用率',
children: [
{
key : 1311,
key1 : '名称',
key2 : '状态',
key3 : '类型',
key4 : '监控点',
key5 : 'CPU利用率',
},
{
key : 1312,
key1 : '名称',
key2 : '状态',
key3 : '类型',
key4 : '监控点',
key5 : 'CPU利用率',
}
]
}
]
}
]
},
{
key : 2,
key1 : '名称',
key2 : '状态',
key3 : '类型',
key4 : '监控点',
key5 : 'CPU利用率',
}
];
expandDataCache = {};
// collapse(array: TreeNodeInterface[], data: TreeNodeInterface, $event: boolean): void {
// if ($event === false) {
// if (data.children) {
// data.children.forEach(d => {
// const target = array.find(a => a.key === d.key);
// target.expand = false;
// this.collapse(array, target, false);
// });
// } else {
// return;
// }
// }
// }
// convertTreeToList(root: object): TreeNodeInterface[] {
// const stack = [];
// const array = [];
// const hashMap = {};
// stack.push({ ...root, level: 0, expand: false });
//
// while (stack.length !== 0) {
// const node = stack.pop();
// // this.visitNode(node, hashMap, array);
// if (node.children) {
// for (let i = node.children.length - 1; i >= 0; i--) {
// stack.push({ ...node.children[ i ], level: node.level + 1, expand: false, parent: node });
// }
// }
// }
//
// return array;
// }
// visitNode(node: TreeNodeInterface, hashMap: object, array: TreeNodeInterface[]): void {
// if (!hashMap[ node.key ]) {
// hashMap[ node.key ] = true;
// array.push(node);
// }
// }
validateForm: FormGroup;
submitForm(): void {
for (const i in this.validateForm.controls) {
this.validateForm.controls[ i ].markAsDirty();
this.validateForm.controls[ i ].updateValueAndValidity();
}
}
ngOnInit(): void {
// this.data.forEach(item => {
// this.expandDataCache[ item.key ] = this.convertTreeToList(item);
// });
this.validateForm = this.fb.group({
userName: [ null, [ Validators.required ] ],
password: [ null, [ Validators.required ] ],
remember: [ true ]
});
}
showBasicEditModal(){
this.isBasicEdit = true;
}
handleOk(): void {
this.isBasicEdit = false;
}
handleCancel(): void {
this.isBasicEdit = false;
}
}
...@@ -208,4 +208,70 @@ export class OverAllService { ...@@ -208,4 +208,70 @@ export class OverAllService {
findWarningByAll(params): Observable<any>{ findWarningByAll(params): Observable<any>{
return this.http.get(SERVER_API_URL + '/statistics/findWarningByAll/' + params); return this.http.get(SERVER_API_URL + '/statistics/findWarningByAll/' + params);
} }
//网站监测
//查询网站监测列表
findWebscenario(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/webscenario/find' ,data);
}
//修改网站监测
updateWebscenario(data): Observable<any>{
return this.http.put(SERVER_API_URL + '/webscenario/update' ,data);
}
//创建网站监测
createWebscenario(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/webscenario/create' ,data);
}
//临时暂停
tempStopWebscenario(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/webscenario/tempStop' ,data);
}
//取消临时暂停
tempStopCancelWebscenario(params): Observable<any>{
return this.http.get(SERVER_API_URL + '/webscenario/temp-stop-cancel/' +params);
}
//启用禁用网站监测
statusBatch(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/statusBatch' ,data);
}
//批量删除网站监测
deleteBatch(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/webscenario/delete' ,data);
}
//查找单个网站监测(数据回显接口)
findWeb(params): Observable<any>{
return this.http.get(SERVER_API_URL + '/webscenario/find/' +params);
}
//添加告警-查询告警目标接口
findAlertAim(params): Observable<any>{
return this.http.get(SERVER_API_URL + '/webscenario/find-alert-aim/' +params);
}
//添加告警接口
addWebAction(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/webscenario/add-web-action' ,data);
}
//查找最近一条监测状态
findCurrentState(params): Observable<any>{
return this.http.get(SERVER_API_URL + '/webscenario/find-current-state/' +params);
}
//查找监测图表数据
findChart(data): Observable<any>{
return this.http.post(SERVER_API_URL + '/webscenario/findChart' ,data);
}
//查找阈值设定
findTrigger(params): Observable<any>{
return this.http.get(SERVER_API_URL + '/webscenario/find-trigger/' +params);
}
} }
\ No newline at end of file
<div nz-row class="breadcrumbs" >
<div nz-col nzSpan="16">
<nz-breadcrumb class="padding-8-0">
<nz-breadcrumb-item>
首页
</nz-breadcrumb-item>
<nz-breadcrumb-item>
<a>综合监控</a>
</nz-breadcrumb-item>
<nz-breadcrumb-item>
基础资源监控
</nz-breadcrumb-item>
</nz-breadcrumb>
</div>
<div nz-col nzSpan="8" class="text-right">
<button nz-button nzType="primary"><i class="anticon anticon-search"></i></button>
<button nz-button nzType="primary"><i class="anticon anticon-sync"></i></button>
<button nz-button nzType="primary"><i class="anticon anticon-arrows-alt"></i></button>
</div>
</div>
<div nz-row class="search-form">
<div nz-col nzSpan="16">
<span>监控设备数:120</span>
<span>设备状态:
<span> <nz-tag [nzColor]="'#64ad58'"></nz-tag>110 </span>
<span> <nz-tag [nzColor]="'#ed9e2e'"></nz-tag>120 </span>
<span> <nz-tag [nzColor]="'#dd4127'"></nz-tag>119 </span>
<span> <nz-tag [nzColor]="'#aaaaaa'"></nz-tag>112 </span>
</span>
<nz-select style="width: 200px;" nzShowSearch nzAllowClear nzPlaceHolder="按组分开">
<nz-option nzLabel="A" nzValue="A"></nz-option>
<nz-option nzLabel="B" nzValue="B"></nz-option>
<nz-option nzLabel="C" nzValue="C"></nz-option>
</nz-select>
</div>
<div nz-col nzSpan="8" class="text-right">
<button nz-button nzType="default"><i class="anticon anticon-pause-circle-o"></i>关闭监控</button>
<button nz-button nzType="default"><i class="anticon anticon-play-circle-o"></i>开启监控</button>
<button nz-button nzType="default"><i class="anticon anticon-close-circle"></i>删除资源</button>
</div>
</div>
<nz-table #nzTable [nzData]="data" nzSingleSort>
<thead>
<tr>
<th nzShowCheckbox></th>
<th nzShowSort>名称</th>
<th nzShowSort nzWidth="20%">状态</th>
<th nzShowSort>类型</th>
<th nzShowSort>监控点</th>
<th nzShowSort>CPU利用率</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<ng-template ngFor let-data [ngForOf]="nzTable.data">
<ng-template ngFor let-item [ngForOf]="expandDataCache[data.key]">
<tr *ngIf="(item.parent&&item.parent.expand)||!(item.parent)">
<td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="refreshStatus($event)"></td>
<td [nzIndentSize]="item.level*20" [nzShowExpand]="!!item.children" [(nzExpand)]="item.expand" (nzExpandChange)="collapse(expandDataCache[data.key],item,$event)">
{{item.key1}}
</td>
<td>{{item.key2}}</td>
<td>{{item.key3}}</td>
<td>{{item.key4}}</td>
<td>{{item.key5}}</td>
<td>
<span *ngIf="!item.level">
<span (click)="showBasicEditModal()">添加资源</span>
<span>编辑</span>
<span>删除</span>
</span>
<span *ngIf="item.level">
<span>添加检测点</span>
<span>编辑</span>
<span>删除</span>
<span class="table-operation">
<nz-dropdown>
<a nz-dropdown class="operation">
更多 <i class="anticon anticon-down"></i>
</a>
<ul nz-menu>
<li nz-menu-item>
<a>Action 1</a>
</li>
<li nz-menu-item>
<a>Action 2</a>
</li>
</ul>
</nz-dropdown>
</span>
</span>
</td>
</tr>
</ng-template>
</ng-template>
</tbody>
</nz-table>
<nz-modal [nzWidth]="780" [(nzVisible)]="isBasicEdit" nzTitle="添加检测点" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()">
<form nz-form [nzLayout]="'vertical'" [formGroup]="validateForm" (ngSubmit)="submitForm()">
<div>
基本属性
<label nz-checkbox></label>
<div nz-row>
<div nz-col [nzSpan]="12">
<nz-form-item [nzFlex]="true">
<nz-form-label [nzSm]="8" [nzXs]="24" nzRequired nzFor="email1">监测点名称</nz-form-label>
<nz-form-control [nzSm]="16" [nzXs]="24">
<input nz-input >
<!--<nz-form-explain *ngIf="validateForm.get('email').dirty && validateForm.get('email').errors">The input is not valid E-mail!</nz-form-explain>-->
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="12">
<nz-form-item [nzFlex]="true">
<nz-form-label [nzSm]="8" [nzXs]="24" nzRequired nzFor="email1">类型</nz-form-label>
<nz-form-control [nzSm]="16" [nzXs]="24">
<nz-select name="select-error">
<nz-option nzValue="number" nzLabel="数字"></nz-option>
<nz-option nzValue="Option 2" nzLabel="Option 2"></nz-option>
</nz-select>
<!--<nz-form-explain *ngIf="validateForm.get('email').dirty && validateForm.get('email').errors">The input is not valid E-mail!</nz-form-explain>-->
</nz-form-control>
</nz-form-item>
</div>
</div>
<div nz-row>
<div nz-col [nzSpan]="12">
<nz-form-item [nzFlex]="true">
<nz-form-label [nzSm]="8" [nzXs]="24" nzRequired nzFor="email2">信息类型</nz-form-label>
<nz-form-control [nzSm]="16" [nzXs]="24">
<nz-select name="select-error">
<nz-option nzValue="number" nzLabel="数字"></nz-option>
<nz-option nzValue="Option 2" nzLabel="Option 2"></nz-option>
</nz-select>
<!--<nz-form-explain *ngIf="validateForm.get('email').dirty && validateForm.get('email').errors">The input is not valid E-mail!</nz-form-explain>-->
</nz-form-control>
</nz-form-item>
</div>
<div nz-col [nzSpan]="12">
<nz-form-item [nzFlex]="true">
<nz-form-label [nzSm]="8" [nzXs]="24" nzRequired nzFor="email3">单位</nz-form-label>
<nz-form-control [nzSm]="16" [nzXs]="24">
<input nz-input >
<!--<nz-form-explain *ngIf="validateForm.get('email').dirty && validateForm.get('email').errors">The input is not valid E-mail!</nz-form-explain>-->
</nz-form-control>
</nz-form-item>
</div>
</div>
</div>
<div>
阀值设置
<label nz-checkbox></label>
</div>
</form>
</nz-modal>
import { Component, OnInit } from '@angular/core';
import {TreeNodeInterface} from "../basic/basic.component";
import {
FormBuilder,
FormGroup,
Validators
} from '@angular/forms';
@Component({
selector: 'jhi-security',
templateUrl: './security.component.html',
styles: []
})
export class SecurityComponent implements OnInit {
isBasicEdit = false;
constructor(private fb: FormBuilder) { }
data = [
{
key : 1,
key1 : '名称',
key2 : '状态',
key3 : '类型',
key4 : '监控点',
key5 : 'CPU利用率',
children: [
{
key : 11,
key1 : '名称',
key2 : '状态',
key3 : '类型',
key4 : '监控点',
key5 : 'CPU利用率',
},
{
key : 12,
key1 : '名称',
key2 : '状态',
key3 : '类型',
key4 : '监控点',
key5 : 'CPU利用率',
children: [ {
key : 121,
key1 : '名称',
key2 : '状态',
key3 : '类型',
key4 : '监控点',
key5 : 'CPU利用率',
} ]
},
{
key : 13,
key1 : '名称',
key2 : '状态',
key3 : '类型',
key4 : '监控点',
key5 : 'CPU利用率',
children: [
{
key : 131,
key1 : '名称',
key2 : '状态',
key3 : '类型',
key4 : '监控点',
key5 : 'CPU利用率',
children: [
{
key : 1311,
key1 : '名称',
key2 : '状态',
key3 : '类型',
key4 : '监控点',
key5 : 'CPU利用率',
},
{
key : 1312,
key1 : '名称',
key2 : '状态',
key3 : '类型',
key4 : '监控点',
key5 : 'CPU利用率',
}
]
}
]
}
]
},
{
key : 2,
key1 : '名称',
key2 : '状态',
key3 : '类型',
key4 : '监控点',
key5 : 'CPU利用率',
}
];
expandDataCache = {};
collapse(array: TreeNodeInterface[], data: TreeNodeInterface, $event: boolean): void {
if ($event === false) {
if (data.children) {
data.children.forEach(d => {
const target = array.find(a => a.host === d.host);
target.expand = false;
this.collapse(array, target, false);
});
} else {
return;
}
}
}
convertTreeToList(root: object): TreeNodeInterface[] {
const stack = [];
const array = [];
const hashMap = {};
stack.push({ ...root, level: 0, expand: false });
while (stack.length !== 0) {
const node = stack.pop();
this.visitNode(node, hashMap, array);
if (node.children) {
for (let i = node.children.length - 1; i >= 0; i--) {
stack.push({ ...node.children[ i ], level: node.level + 1, expand: false, parent: node });
}
}
}
return array;
}
visitNode(node: TreeNodeInterface, hashMap: object, array: TreeNodeInterface[]): void {
if (!hashMap[ node.host ]) {
hashMap[ node.host ] = true;
array.push(node);
}
}
validateForm: FormGroup;
submitForm(): void {
for (const i in this.validateForm.controls) {
this.validateForm.controls[ i ].markAsDirty();
this.validateForm.controls[ i ].updateValueAndValidity();
}
}
ngOnInit(): void {
this.data.forEach(item => {
this.expandDataCache[ item.key ] = this.convertTreeToList(item);
});
this.validateForm = this.fb.group({
userName: [ null, [ Validators.required ] ],
password: [ null, [ Validators.required ] ],
remember: [ true ]
});
}
showBasicEditModal(){
this.isBasicEdit = true;
}
handleOk(): void {
this.isBasicEdit = false;
}
handleCancel(): void {
this.isBasicEdit = false;
}
}
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