Skip to content
ne-topology.component.ts 1.25 KiB
Newer Older
wangqinghua's avatar
wangqinghua committed
import {Component, OnInit} from '@angular/core';
import {TopologyService} from '../topology.service';
import {NzMessageService} from 'ng-zorro-antd';

@Component({
    selector: 'smart-ne-topology',
    templateUrl: './ne-topology.component.html',
    styles: []
})
export class NeTopologyComponent implements OnInit {

    dataSet;
    isVisible = false;
    image;

    constructor(private topologySer: TopologyService, private message: NzMessageService) {
    }

    ngOnInit() {
        this.getList();
    }

    //获取列表
    getList() {
        this.topologySer.find({}).subscribe(
            (res) => {
                if (res.errCode == 10000) {
                    this.dataSet = res.data;
                } else {
                    this.message.info(res.errMsg);
                }
            }
        );
    }

    //图表
    getImage(item) {
        this.isVisible = true;
        this.topologySer.findImage(item.sysmapid).subscribe(
            (res) => {
                if (res.errCode == 10000) {
                    this.image = res.data.image;
                } else {
                    this.message.info(res.errMsg);
                }
            }
        );
    }

    handleOk() {
        this.isVisible = false;
        this.image = null;
    }
}