添加修改课程目标接口字段

develoop
xy 5 months ago
parent 0ffe772345
commit 894c303b9a
  1. 2
      src/api/courseChaptersApi.ts
  2. 6
      src/views/course/CourseObjectives.vue

@ -96,7 +96,7 @@ export const deleteCourse = (params: any) => {
// 获取详情 // 获取详情
export const getCourseInfo = (params: any) => { export const getCourseInfo = (params: any) => {
return request({ return request({
url: '/objective_contents/' + params.id, url: 'api/objective_contents/' + params.id,
method: "get", method: "get",
// params // params
}) })

@ -60,7 +60,7 @@ const handleClose = () => {
const submit = async () => { const submit = async () => {
if (flog.value) { if (flog.value) {
await editCourse({ await editCourse({
id: activeIndex.value, ...editdata.value,
content: formData.value.description, content: formData.value.description,
}) })
} else { } else {
@ -114,11 +114,13 @@ const filterTarger = (target) => {
return res.label return res.label
} }
const editdata = ref({ id: '', objectiveId:'' })
// //
const flog = ref(false) const flog = ref(false)
const editBook = async (obj) => { const editBook = async (obj) => {
const res = await getCourseInfo({ id: obj.id }) const res = await getCourseInfo({ id: obj.id })
editdata.value.id = res.data.id
editdata.value.objectiveId = res.data.objectiveId
flog.value = true flog.value = true
console.log(obj) console.log(obj)
activeIndex.value = res.data.id activeIndex.value = res.data.id

Loading…
Cancel
Save