Commit c5af5b3c authored by wangqinghua's avatar wangqinghua

update

parent 0fdd9f98
......@@ -34,7 +34,7 @@
<div nz-col nzSpan="3">
<nz-select style="width: 100%;" nzShowSearch nzAllowClear nzPlaceHolder="选择设备类型" [(ngModel)]="obj.equipmentType" >
<ng-container *ngFor="let item of warnCountList;">
<nz-option nzLabel="{{item.equipmentType}}" nzValue="{{item.equipmentType}}"></nz-option>
<nz-option nzLabel="{{item.equipmentType}}" nzValue="{{item.equipmentTypeId}}"></nz-option>
</ng-container>
</nz-select>
</div>
......@@ -61,7 +61,7 @@
</div>
</div>
<div nz-row class="search-form" style="border-top: none;padding: 0 0 15px 0;">
<input [(ngModel)]="obj.name" nz-input placeholder="告警信息">
<input style="width: 15%;" [(ngModel)]="obj.name" nz-input placeholder="告警信息">
<button (click)="searchValue()" nz-button nzType="default"><i class="anticon anticon-search"></i>搜索</button>
</div>
......
......@@ -117,7 +117,7 @@
</ng-container>
</td>
<td>
<td class="cursor">
<span (click)="goTOInventory(item?.inventory?.id)">{{item?.inventory?.name}}</span>
</td>
<!--<td class="round-tag tag-form" >-->
......@@ -227,7 +227,9 @@
</ng-container>
</td>
<td>{{item?.inventory?.name}}</td>
<td class="cursor">
<span (click)="goTOInventory(item?.inventory?.id)">{{item?.inventory?.name}}</span>
</td>
<!--<nz-tag *ngIf="item.status == 0" [nzColor]="color.green"></nz-tag>-->
<!--<nz-tag *ngIf="item.status == 1" [nzColor]="color.gray"></nz-tag>-->
<td class="default">
......@@ -323,8 +325,9 @@
</ng-container>
</td>
<td>{{item?.inventory?.name}}</td>
<td class="cursor">
<span (click)="goTOInventory(item?.inventory?.id)">{{item?.inventory?.name}}</span>
</td>
<td class="default">
<ng-container *ngIf="item.available == 0">
<nz-tag>AGENT</nz-tag>
......
......@@ -30,7 +30,7 @@ export interface TreeNodeInterface {
selector: 'jhi-basic',
templateUrl: './basic.component.html',
styles: [
`:host ::ng-deep .table-dropdown a{
`:host ::ng-deep .table-dropdown a {
font-weight: 300;
}`
]
......@@ -41,8 +41,8 @@ export class BasicComponent implements OnInit {
@ViewChild('basicEdit') basicEdit: BasicEditComponent;
@ViewChild('smartCheck') smartCheck: BasiCheckComponent;
@ViewChild('smartCreateGroup') smartCreateGroup: CreateGroupComponent;
@ViewChild('smartPause') smartPause:PauseComponent;
@ViewChild('smartAlarmModal') smartAlarmModal:AlarmModalComponent;
@ViewChild('smartPause') smartPause: PauseComponent;
@ViewChild('smartAlarmModal') smartAlarmModal: AlarmModalComponent;
color = color;
......@@ -76,8 +76,7 @@ export class BasicComponent implements OnInit {
searchData;
constructor(private fb: FormBuilder, private overAllSer: OverAllService, private router: Router,
private modalService: NzModalService, private message: NzMessageService,private main:JhiMainComponent
) {
private modalService: NzModalService, private message: NzMessageService, private main: JhiMainComponent) {
}
dataSet: any[];
......@@ -98,17 +97,17 @@ export class BasicComponent implements OnInit {
}
}
showInFullScreen(){
showInFullScreen() {
this.main.fullScreen();
}
convertTreeToList(root: any, groupId: string,index): TreeNodeInterface[] {
convertTreeToList(root: any, groupId: string, index): TreeNodeInterface[] {
const stack = [];
const array = [];
const hashMap = {};
if(root.host == index){
if (root.host == index) {
stack.push({...root, level: 0, expand: true});
}else{
} else {
stack.push({...root, level: 0, expand: false});
}
while (stack.length !== 0) {
......@@ -140,66 +139,66 @@ export class BasicComponent implements OnInit {
}
//搜索
search(status){
search(status) {
this.loading = true;
this.searchStatus = true;
this.frontPagination = false;
const data = {
search:{
status:status,
name:this.searchName
}
search: {
status: status,
name: this.searchName
}
};
this.overAllSer.find(data).subscribe(
(res)=>{
if(res.errCode == 10000){
(res) => {
if (res.errCode == 10000) {
this.searchData = res.data;
}
this.loading = false;
}
)
);
}
//backList
backList(){
backList() {
this.searchStatus = false;
this.frontPagination = true;
}
//查询设备状态
findOpStatus(){
findOpStatus() {
this.overAllSer.findHostCountByStatus(0).subscribe(
(res)=>{
if(res.errCode == 10000){
(res) => {
if (res.errCode == 10000) {
this.green = res.data.size;
}else{
} else {
this.message.info(res.Msg);
}
}
)
);
this.overAllSer.findHostCountByStatus(1).subscribe(
(res)=>{
(res) => {
this.gray = res.data.size;
}
)
);
this.overAllSer.findWarningByAll(1).subscribe(
(res)=>{
if(res.errCode == 10000){
(res) => {
if (res.errCode == 10000) {
this.yellow = res.data.size;
}else{
} else {
this.message.info(res.Msg);
}
}
)
);
this.overAllSer.findWarningByAll(0).subscribe(
(res)=>{
if(res.errCode == 10000){
(res) => {
if (res.errCode == 10000) {
this.red = res.data.size;
}else{
} else {
this.message.info(res.Msg);
}
}
)
);
}
//添加资源
......@@ -213,8 +212,8 @@ export class BasicComponent implements OnInit {
}
//添加监测点
showBasicCheckModal(hostid,host) {
this.smartCheck.showAddModal(hostid,host);
showBasicCheckModal(hostid, host) {
this.smartCheck.showAddModal(hostid, host);
}
//列表
......@@ -292,7 +291,7 @@ export class BasicComponent implements OnInit {
nzOkType: 'danger',
nzOnOk: () => {
const data = {
hostids:[]
hostids: []
};
data.hostids.push(item.hostid);
this.overAllSer.deleteHostPost(data).subscribe(
......@@ -312,8 +311,8 @@ export class BasicComponent implements OnInit {
}
//批量删除资源
batchDeleteConfirm(){
if(this.batchDelList.length == 0){
batchDeleteConfirm() {
if (this.batchDelList.length == 0) {
this.message.info('请选择需要删除的设备');
return false;
}
......@@ -324,7 +323,7 @@ export class BasicComponent implements OnInit {
nzOkType: 'danger',
nzOnOk: () => {
const data = {
hostids:this.batchDelList
hostids: this.batchDelList
};
this.overAllSer.deleteHostPost(data).subscribe(
(res) => {
......@@ -349,8 +348,8 @@ export class BasicComponent implements OnInit {
}
//编辑分组
updateGroup(item){
this.smartCreateGroup.showEditModal('修改分组',item);
updateGroup(item) {
this.smartCreateGroup.showEditModal('修改分组', item);
}
//删除分组
......@@ -380,7 +379,7 @@ export class BasicComponent implements OnInit {
}
//添加告警
showAlarm(){
showAlarm() {
this.smartAlarmModal.showAddModal('添加告警');
}
......@@ -390,10 +389,10 @@ export class BasicComponent implements OnInit {
//获取下级list
getChildren(item) {
if(item.list){
if(item.expand){
if (item.list) {
if (item.expand) {
item.expand = false;
}else{
} else {
item.expand = true;
}
return false;
......@@ -407,10 +406,10 @@ export class BasicComponent implements OnInit {
};
this.overAllSer.findDetail(data).subscribe(
(res) => {
if(res.data){
if (res.data) {
this.dataSet[item.host].list = res.data;
this.toTree(item.host);
}else{
} else {
this.message.info('该分组下无资源');
}
this.loading = false;
......@@ -419,25 +418,25 @@ export class BasicComponent implements OnInit {
}
//根据设备类型查询主机资源
getChildrenType(item){
if(item.list){
if(item.expand){
getChildrenType(item) {
if (item.list) {
if (item.expand) {
item.expand = false;
}else{
} else {
item.expand = true;
}
return false;
}
this.loading = true;
const data = {
type:item.equipmentTypeId
type: item.equipmentTypeId
};
this.overAllSer.findHostByType(data).subscribe(
(res) => {
if(res.data){
if (res.data) {
this.dataSet[item.host].list = res.data;
this.toTree(item.host);
}else{
} else {
this.message.info('该分组下无资源');
}
this.loading = false;
......@@ -446,21 +445,21 @@ export class BasicComponent implements OnInit {
}
//查看详情
goDetail(item){
goDetail(item) {
let type = 0;
if(item.hostExtend){
if(item.hostExtend.equipmentType == '交换机'){
if (item.hostExtend) {
if (item.hostExtend.equipmentType == '交换机') {
type = 1;
}
}
this.router.navigate(['app/main/basic-detail'],{
queryParams:{
hostId:item.hostid,
type:type,
name:item.name,
hostName:item.host
this.router.navigate(['app/main/basic-detail'], {
queryParams: {
hostId: item.hostid,
type: type,
name: item.name,
hostName: item.host
}
})
});
}
//监控设备数
......@@ -473,38 +472,38 @@ export class BasicComponent implements OnInit {
}
//临时暂停
showTempStop(item){
this.smartPause.showModal(item.hostid,'基础资源');
showTempStop(item) {
this.smartPause.showModal(item.hostid, '基础资源');
}
//选择
selectChecked(event,item){
if(event){
if(item.hostid){
selectChecked(event, item) {
if (event) {
if (item.hostid) {
this.batchDelList.push(item.hostid);
}
}else{
if(item.hostid){
} else {
if (item.hostid) {
const index = this.batchDelList.indexOf(item.hostid);
this.batchDelList.splice(index,1)
this.batchDelList.splice(index, 1);
}
}
}
//开启or停止监控
openHost(item){
openHost(item) {
this.modalService.confirm({
nzTitle: '监控',
nzContent: '确定开启监控设备'+item.name + '?',
nzContent: '确定开启监控设备' + item.name + '?',
nzOkText: '确定',
nzCancelText: '取消',
nzOnOk: () => {
let params1 = 0;
if(item.status == 0){
if (item.status == 0) {
params1 = 1;
}
const params2 = item.hostid;
this.overAllSer.stopOrOpen(params1,params2).subscribe(
this.overAllSer.stopOrOpen(params1, params2).subscribe(
(res) => {
if (res.errCode == 10000) {
this.message.info('修改成功');
......@@ -520,21 +519,21 @@ export class BasicComponent implements OnInit {
}
//批量开启or停止监控
openBatchHost(status,operation){
if(this.batchDelList.length == 0){
this.message.info('请选择需要'+ operation +'的设备');
openBatchHost(status, operation) {
if (this.batchDelList.length == 0) {
this.message.info('请选择需要' + operation + '的设备');
return false;
}
this.modalService.confirm({
nzTitle: '监控',
nzContent: '确定批量'+operation+'监控设备?',
nzContent: '确定批量' + operation + '监控设备?',
nzOkText: '确定',
nzCancelText: '取消',
nzOnOk: () => {
const data = {
status:status,
hostids:this.batchDelList
}
status: status,
hostids: this.batchDelList
};
this.overAllSer.batchStopOrOpen(data).subscribe(
(res) => {
if (res.errCode == 10000) {
......@@ -553,7 +552,11 @@ export class BasicComponent implements OnInit {
}
//资产页面
goTOInventory(id){
goTOInventory(id) {
this.router.navigate(['app/main/assetsDetail'], {
queryParams: {
invertoryId: id
}
});
}
}
......@@ -81,8 +81,8 @@ export class TypeAsetsComponent implements OnInit {
this.workSer.findType(id).subscribe(
(res)=>{
if(res.data.parentid){
this.isParent = 'primary';
this.isChildren = 'default';
this.isParent = 'default';
this.isChildren = 'primary';
}
this.validateForm.patchValue(res.data);
}
......
......@@ -103,7 +103,9 @@ export class EventComponent implements OnInit {
this.message.error("请选择人员");
return false;
}
this.validateForm.value.operators = this.operatorsList;
this.validateForm.patchValue({
operators: this.operatorsList
});
for (let i in this.validateForm.controls) {
this.validateForm.controls[i].markAsDirty();
this.validateForm.controls[i].updateValueAndValidity();
......@@ -132,7 +134,9 @@ export class EventComponent implements OnInit {
this.fileList.forEach((file: any) => {
formData.append('file', file);
});
this.validateForm.value.operators = this.operatorsList;
this.validateForm.patchValue({
operators: this.operatorsList
});
if(this.operatorsList.length == 0){
this.message.error("请选择人员");
......
......@@ -75,9 +75,9 @@
<div nz-col nzSpan="4">关联资产</div>
<div nz-col nzSpan="1"></div>
<div nz-col nzSpan="19">
<p *ngFor="let item of linkList;">
<span>资产编号</span>
<span>{{item.name}}</span>
<p *ngFor="let item of event?.inventorys;">
<span style="margin-right: 5px">{{item.inventoryNo}}</span>
<span style="margin-right: 5px">{{item.name}}</span>
<span>{{item.typeName}}</span>
</p>
</div>
......
......@@ -26,7 +26,6 @@ export class HandleDetailComponent implements OnInit {
eventId;
event;
linkList;
transforsList;
constructor(private workSer: WorkService, private message: NzMessageService,
......
......@@ -31,7 +31,7 @@ export class WorkService {
//根据事件编号查询
findByNo(params): Observable<any>{
return this.http.get(SERVER_API_URL + '/sysevent/find/' +params);
return this.http.get(SERVER_API_URL + '/sysevent/findTransferAndInventory/' +params);
}
//添加事件
......
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