import {Component, OnInit} from '@angular/core';
import {SystemService} from '../../system.service';
import {pageSize} from '../../../app.constants';

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

    pageSize = pageSize;
    //已审批
    pageNoAlready = 1;
    totalNumAlready;
    areadyList = [];

    //未审批
    pageNoNo = 1;
    totalNumNo;
    noList = [];

    constructor(private systemSer: SystemService) {
    }

    ngOnInit() {
        this.getListAlready();
        this.getListNo();
    }

    getListAlready() {
        const data1 = {
            pageNo: this.pageNoAlready,
            pageSize: this.pageSize
        };
        this.systemSer.approveListSafeManager(data1).subscribe(
            (res) => {
                this.areadyList = res.data;
            }
        );
    }

    getListNo() {
        const data1 = {
            pageNo: this.pageNoNo,
            pageSize: this.pageSize
        };
        this.systemSer.unapproveListSafeManager(data1).subscribe(
            (res) => {
                this.noList = res.data;
            }
        );
    }

}
