From c39dbc68475eebb489d34af26bdd5649ccf08414 Mon Sep 17 00:00:00 2001 From: king <2229249788@qq.com> Date: Thu, 10 Aug 2023 17:01:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E9=97=A8=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=20&=20=E6=B7=BB=E5=8A=A0=E8=AF=BE=E7=A8=8B=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/manage/addCur/addCur.tsx | 6 ++++-- src/pages/manage/depCur/depCur.module.scss | 19 +++++++++++++++++-- src/pages/manage/depCur/depCur.tsx | 3 ++- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/pages/manage/addCur/addCur.tsx b/src/pages/manage/addCur/addCur.tsx index 8023312..3600d87 100644 --- a/src/pages/manage/addCur/addCur.tsx +++ b/src/pages/manage/addCur/addCur.tsx @@ -43,7 +43,7 @@ const AddCur = () => { try { const is_required = confirm ? 1 : 0 Taro.showLoading() - await ManageApi.addCur({course_id: [cur_id], dep_id: [Number(id)], is_required}) + await ManageApi.addCur({course_id: [cur_id], dep_id: [Number(id)], is_required:[is_required]}) const oldData: Curriculum[] = JSON.parse(JSON.stringify(data)) oldData.splice(index, 1) setData(oldData) @@ -53,6 +53,8 @@ const AddCur = () => { Taro.hideLoading() } }) + + event?.stopImmediatePropagation() } return ( @@ -64,7 +66,7 @@ const AddCur = () => { <> { data.length ? - + {data?.map((d, index) => ( { return ( { - data.length ? + data.length > 0 ? data.map(d => {d.title} + {d.is_required ? '必修' : '选修'}