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)
}
}
})
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步