Newer
Older
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 = [];
allChecked;
indeterminate;
displayData = [];
constructor(private systemSer: SystemService,private message:NzMessageService) {
}
ngOnInit() {
this.getListAlready();
this.getListNo();
}
refreshStatus(): void {
const allChecked = this.noList.filter(value => !value.disabled).every(value => value.checked === true);
const allUnChecked = this.noList.filter(value => !value.disabled).every(value => !value.checked);
this.allChecked = allChecked;
this.indeterminate = (!allChecked) && (!allUnChecked);
}
checkAll(value: boolean): void {
this.noList.forEach(data => {
if (!data.disabled) {
data.checked = value;
}
});
this.refreshStatus();
}
if(res.errCode == 10000){
this.areadyList = res.data;
this.areadyList.forEach(e=>{
e.checked = false;
})
}else{
this.message.error(res.errMsg);
}
if(res.errCode == 10000){
this.noList = res.data;
this.noList.forEach(e=>{
e.checked = false;
})
}else{
this.message.error(res.errMsg);
}
//通过
passApproval(){
}
//退回
backApproval(){
}