From 5313c85ddb3188e2a707c887e3ddbf74a94bf419 Mon Sep 17 00:00:00 2001 From: Haiyi <1021441632@qq.com> Date: Wed, 14 Dec 2022 18:59:03 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(=E7=83=AD=E9=97=A8=E6=90=9C?= =?UTF-8?q?=E7=B4=A2):=E7=AD=9B=E9=80=89=E7=B3=BB=E5=88=97=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E5=A4=9A=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../classList/components/searchPopup/index.tsx | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) 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) => {