两个数组集合取不同的放入另一个集合中
两个数组 selRow:供选择的文件目录 auFiles:要显示的目录
that.selRow.forEach((item, index) => {
console.log("11");
let isExist=false
if(that.auFiles.length==0){
that.auFiles.push(item)
}else{
console.log("0000");
// 判断文件是否存在目录中
// 1.存在
that.auFiles.some((aItem,aIndex)=>{
if(item.fileId==aItem.fileId){
that.$message({
message: '当前文件已存在',
type: 'warning'
});
isExist=true
return false;
}
})
// 2.不存在
if(!isExist){
console.log("不存在");
that.auFiles.push(item)
}
}
})