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 ? '必修' : '选修'}