let j = [1,2,3];
let g = [1,2,3];
let y = [
{
a:'人',
operationType:2
},
{
a:'人',
operationType:2
},
{
a:'人',
operationType:2
},
{
a:'交警1',
operationType:9
},
{
a:'交警2',
operationType:9
},
{
a:'交警3',
operationType:9
},
{
a:'归档1',
operationType:6
},
{
a:'归档2',
operationType:6
},
{
a:'归档3',
operationType:6
},
{
a:'责任1',
operationType:7
},
{
a:'责任2',
operationType:7
},
{
a:'责任3',
operationType:7
}
]
let OBJ = {},
OBJG = {},
OBJZ = {};
y.map((ith,iths) => {
if(ith.operationType==9){
let item = ith.operationType;
OBJ[item] = (OBJ[item] + 1) || 1;
if(OBJ[9]>1){
y.splice(iths,j.length-1)
}
}
})
y.map((ith,iths)=>{
if(ith.operationType==6){
let itemS = ith.operationType;
OBJG[itemS] = (OBJG[itemS] + 1) || 1;
if(OBJG[6]>1){
y.splice(iths,g.length-1)
}
}
})
y.map((ith,iths)=>{
if(ith.operationType==7){
let itemZ = ith.operationType;
OBJZ[itemZ] = (OBJZ[itemZ] + 1) || 1;
if(OBJZ[7]>1){
y.splice(iths,g.length-1)
}
}
})

浙公网安备 33010602011771号