From ae683152942b40e02997be0d88ba32d62225b064 Mon Sep 17 00:00:00 2001 From: yuping <82253452@qq.com> Date: Sat, 4 Feb 2023 18:49:45 +0800 Subject: [PATCH] =?UTF-8?q?--fix=20=E5=A4=8D=E7=83=A4=E5=BC=80=E8=AF=BE?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/indexCourse.js | 1 + src/views/courselibrary/CoursewareManage.vue | 40 ++++---------------- 2 files changed, 8 insertions(+), 33 deletions(-) diff --git a/src/api/indexCourse.js b/src/api/indexCourse.js index 67b63073..15fd7983 100644 --- a/src/api/indexCourse.js +++ b/src/api/indexCourse.js @@ -31,6 +31,7 @@ export const detailPlan = (obj) => export const edit = (obj) => http.post("/admin/offcourse/edit", obj); //7新建或编辑面授课开课 export const editPlan = (obj) => http.post("/admin/offcourse/editPlan", obj); +export const copyCoursePlan = (params) => http.get("/admin/offcourse/copyCoursePlan", {params}); //8课程导出 export const exportP = (obj) => http.post("/admin/offcourse/export", obj); //9操作面授课(发布,撤回,删除,审核,停用) diff --git a/src/views/courselibrary/CoursewareManage.vue b/src/views/courselibrary/CoursewareManage.vue index 692d5c6e..21148a74 100644 --- a/src/views/courselibrary/CoursewareManage.vue +++ b/src/views/courselibrary/CoursewareManage.vue @@ -1514,7 +1514,7 @@ import { addStudent, studentExport, handleStudent, - getMemberInfoApi, + getMemberInfoApi, copyCoursePlan, // listReview, // studyRecordList, } from "@/api/indexCourse"; @@ -4039,38 +4039,12 @@ export default defineComponent({ if (state.copy_hs) { console.log(2222222); if (state.offcourseId && state.offcoursePlanId) { - console.log(87887); - // 拿数据 - const item = await detailPlan({ - offcoursePlanId: Number(state.offcoursePlanId), - }).then((res) => { - if (res.data.code === 200) return res.data.data; - }); - const obj = { - offcourseId: item.offcourseId, - offcoursePlanId: null, //开课ID,不传代表新增 - address: item.address, - applyFlag: item.applyFlag, - attach: item.attach, - beginTime: new Date(item.beginTime) / 1000, - completeType: item.completeType, - endTime: new Date(item.endTime) / 1000, - evalFlag: item.evalFlag, - name: item.name + "(1)", - signFlag: item.signFlag, //是否允许未报名的签到:1是0否 - //signWordFlag: item.signWordFlag, //签到是否需要口令:1是0否 - teacherId: item.teacherId, - teacher: item.teacher, - }; - console.log(obj); - editPlan(obj).then((res) => { - if (res.data.code === 200) { - message.destroy(); - message.success("复制成功"); - getTableDate3(); - delete_exit1(); - rest(); - } + copyCoursePlan({offcoursePlanId:state.offcourseId}).then(() => { + message.destroy(); + message.success("复制成功"); + getTableDate3(); + delete_exit1(); + rest(); }); } else if (state.offcourseId) { console.log(87887);