1. export const select = (one, two) => {
    2. const arr = []
    3. one.forEach((item) => {
    4. const idx = two.findIndex(term => {
    5. // eslint-disable-next-line eqeqeq
    6. if (item.id == term.id) {
    7. return true
    8. }
    9. })
    10. if (idx === -1) {
    11. arr.push(item)
    12. }
    13. })
    14. // 方法2(报错重复的键值,是因为后台数据的问题) // const arr = one.filter(function (one, two) {
    15. // return one.id !== two.id
    16. // })
    17. return arr
    18. }