diff --git a/src/pages/classList/components/searchPopup/index.tsx b/src/pages/classList/components/searchPopup/index.tsx index 2020db0..80b3868 100644 --- a/src/pages/classList/components/searchPopup/index.tsx +++ b/src/pages/classList/components/searchPopup/index.tsx @@ -37,21 +37,17 @@ const SearchPopup = (props: Props) => { const handCheckMode = (it) => { kindList.map((item) => { if (item.id == it.id) { - item.check = true - } - else { - item.check = false + item.check = !item.check } return item }) setKindList([...kindList]) - // const arr: number[] = [] + const arr: number[] = [] const res = kindList.filter((item) => { return item.check }) - // res.forEach((kb) => { - // arr.push(kb.id) - // }) - // setsearchObj(val => ({ ...val, product_kind_ids: arr.toString() })) - setsearchObj(val => ({ ...val, product_kind_ids: res[0]?.id })) + res.forEach((kb) => { + arr.push(kb.id) + }) + setsearchObj(val => ({ ...val, product_kind_ids: arr.toString() })) } const handBlur = (e, index) => {