import {Component, OnInit, ViewChild} from '@angular/core';
import {OverviewService} from '../overview.service';
import {ModuleConfigComponent} from '../modal/module-config/module-config.component';

@Component({
    selector: 'smart-my-follow',
    templateUrl: './my-follow.component.html',
    styles: []
})
export class MyFollowComponent implements OnInit {
    @ViewChild('smartModuleConfig') smartModuleConfig: ModuleConfigComponent;

    page = {
        list: null,
        isLoading: false,
    };

    constructor(private overViewSer: OverviewService) {
    }

    ngOnInit() {
        this.getAllModule();
    }

    //查询所有的工作模块
    getAllModule() {
        this.overViewSer.selectWorkModule(null).subscribe(
            (res) => {
                if (res.errCode == 10000) {
                    this.page.list = res.data;
                }
            }
        );
    }

    showModal() {
        this.smartModuleConfig.showModal('关注项配置', this.page.list);
    }

}
