From f013816d8b8024a7af0fbc18f374225ab6727e80 Mon Sep 17 00:00:00 2001 From: lijiaqi <1205620597@qq.com> Date: Sun, 11 Aug 2024 20:57:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/user/chapter.js | 2 +- src/api/user/object.js | 14 + src/views/course/basicCourseInformation.vue | 11 +- src/views/course/components/course-brief.vue | 4 +- .../course/components/course-chapters.vue | 60 +- src/views/course/components/course-object.vue | 570 +++++++----------- src/views/course/components/courseEdit.vue | 8 +- .../course/components/knowledge-graph.vue | 2 +- .../course/components/knowledge-statistic.vue | 68 ++- src/views/course/courseDetails.vue | 9 +- ....timestamp-1723300901027-675730089c647.mjs | 40 ++ 11 files changed, 387 insertions(+), 401 deletions(-) create mode 100644 src/api/user/object.js create mode 100644 vite.config.ts.timestamp-1723300901027-675730089c647.mjs diff --git a/src/api/user/chapter.js b/src/api/user/chapter.js index eb8aa9e..7405f75 100644 --- a/src/api/user/chapter.js +++ b/src/api/user/chapter.js @@ -6,6 +6,6 @@ export const getChaptersListApi = (params) => { // 添加课程章节 export const addChaptersApi = (params) => request.post('/chapter2/add', params) // 删除课程章节 -export const delChapterstApi = (id) => { +export const delChaptersApi = (id) => { return request.delete(`/chapter2/delete/${id}`) } diff --git a/src/api/user/object.js b/src/api/user/object.js new file mode 100644 index 0000000..8f065b2 --- /dev/null +++ b/src/api/user/object.js @@ -0,0 +1,14 @@ +import request from '@/utils/request' +// 获取目标类型 +export const getObjectType = () => request.get(`/api/objectives_type/list`) +// 修改目标内容 +export const updateContents = (params) => { + return request.put(`/api/objective_contents/update`, params) +} +// 获取目标列表 +export const getObjectList = (params) => { + return request({ + url: '/api/course_objectives/list/' + params.id, + params, + }) +} diff --git a/src/views/course/basicCourseInformation.vue b/src/views/course/basicCourseInformation.vue index 652b1f6..0493ede 100644 --- a/src/views/course/basicCourseInformation.vue +++ b/src/views/course/basicCourseInformation.vue @@ -69,7 +69,7 @@ const onSearch = () => { const onReset = () => { params.value.pageNo = 1 params.value.assessmenttype = '' - params.value.teacher = '' + // params.value.teacher = '' params.value.category = '' params.value.nature = '' getCourseList() @@ -198,7 +198,7 @@ const CloseCouresNameChangeEvent = () => { - + @@ -215,13 +215,6 @@ const CloseCouresNameChangeEvent = () => {

{{ course_name }}

-
  • diff --git a/src/views/course/components/course-brief.vue b/src/views/course/components/course-brief.vue index 2e6e069..53b487e 100644 --- a/src/views/course/components/course-brief.vue +++ b/src/views/course/components/course-brief.vue @@ -149,10 +149,12 @@ onMounted(() => { font-size: 14px; .pp { - margin-top: 10px; + line-height: 1.3; + margin-top: 9px; display: inline; padding-left: 35px; color: #2e2e2e; + letter-spacing: 1px; } } diff --git a/src/views/course/components/course-chapters.vue b/src/views/course/components/course-chapters.vue index 3b65b9d..017dc8a 100644 --- a/src/views/course/components/course-chapters.vue +++ b/src/views/course/components/course-chapters.vue @@ -6,21 +6,25 @@ import { useRoute } from 'vue-router' import { getChaptersListApi, addChaptersApi, - delchaptersApi, + delChaptersApi, } from '@/api/user/chapter' import { onMounted } from 'vue' -const route = useRoute() +// const route = useRoute() // const router = useRouter() -const courseId = ref() +// const courseId = ref() +const courseId = '719f91586a64413898253c5b7d046fd8' onMounted(() => { - courseId.value = route.query.id + // courseId.value = route.query.id + // courseId.value = '719f91586a64413898253c5b7d046fd8' + getChaptersList() }) // console.log(courseId.value, 'courseId.value') const getChaptersList = async () => { - console.log(courseId.value, 'courseId.value') - const res = await getChaptersListApi({ id: courseId.value }) + console.log(courseId, 'courseId.value') + const res = await getChaptersListApi({ id: courseId }) + console.log(res, 'get') const transformedData: Tree[] = res.data.map((item: any) => ({ id: item.id, name: item.name, @@ -30,15 +34,14 @@ const getChaptersList = async () => { name: children.name, pid: children.pid, - children: children.children.map((children: any) => ({ - id: children.id, - name: children.name, - pid: children.pid, + knowledgePoints: children.knowledgePoints.map((knowledgePoints: any) => ({ + id: knowledgePoints.id, + name: knowledgePoints.name, + pid: knowledgePoints.pid, })), })), })) dataSource.value = transformedData - console.log(res) } interface Tree { id: number @@ -57,14 +60,14 @@ const append = async (data: Tree) => { id: id++, name: `${value}`, pid: data.id, - courseId: courseId.value, + courseId: courseId, } if (!data.children) { data.children = [] } data.children.push(newChild) const res = await addChaptersApi(newChild) - console.log(res) + console.log(res, 'appendres') if (res.code === 200) { // 成功添加后更新本地数据源 dataSource.value = [...dataSource.value] @@ -83,22 +86,27 @@ const append = async (data: Tree) => { } // 删除 const remove = async (node: Node, data: Tree) => { - const res = await getChaptersListApi(data.id) - console.log(res, 'delres') - - ElMessageBox.confirm('确定删除本章节吗?', '提示', { - confirmButtonText: '确定', + console.log(node, data) + await ElMessageBox.confirm('您确定删除这条课程信息吗', '温馨提示', { + confirmButtonText: '确认', cancelButtonText: '取消', type: 'warning', - center: true, }) - const parent = node.parent - const children: Tree[] = parent.data.children || parent.data - const index = children.findIndex((d) => d.id === data.id) - children.splice(index, 1) - dataSource.value = [...dataSource.value] + await delChaptersApi(data.id) + .then(() => { + const parent = node.parent + const children: Tree[] = parent.data.children || parent.data + const index = children.findIndex((d) => d.id === data.id) + children.splice(index, 1) + dataSource.value = [...dataSource.value] + ElMessage.success('删除成功') + }) + .catch((err: any) => { + ElMessage.error(err.response.data.message) + }) } - +// 获取章节详情 +const getDetails = (id: any) => { } const dataSource = ref([ { id, @@ -130,7 +138,7 @@ const dataSource = ref([ :expand-on-click-node="false" empty-text="暂无章节">