//全选、全不选
checkAllData(prop, bol){
function circle(data, prop, bol){
for(let i = 0, len = data.length; i < len; i++){
data[i][prop] = bol
if(data[i].children && data[i].children.length){
circle(data[i].children, prop, bol)
}
}
}
circle(this.tableList, prop, bol)
},
//调用
this.checkAllData('444', val) //勾选数据
//获取总选中数量
checkIfAll(prop){
let totalCount = 0, checkCount = 0;
function circle(data, prop){
for(let i = 0, len = data.length; i < len; i++){
totalCount++;
if(data[i][prop]){
checkCount++
}
if(data[i].children && data[i].children.length){
circle(data[i].children, prop)
}
}
}
circle(this.tableList, prop)
return totalCount === checkCount ? true : false;
},
//调用
this.checkIfAll('2222')
// 档案管理选一个
hasManageOneChange() {
if(this.checkRoleId()){
this.hasManageCheckAll = this.checkIfAll('hasManage') ? true : false
}else{
return false
}
}
05-12
5867
07-03