From 93a89c6fa9701301783c21cf0ee7f32dfc79d105 Mon Sep 17 00:00:00 2001 From: lijiaqi <1205620597@qq.com> Date: Tue, 18 Jun 2024 18:30:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=9F=BA=E6=9C=AC=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=B7=B3=E8=BD=AC=E8=AF=BE=E7=A8=8B=E7=9B=AE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mock/user.ts | 5 +- src/api/user/crouse.js | 45 +- src/utils/{img.js => alioss.js} | 12 +- src/views/course/CourseObjectives.vue | 2 +- src/views/course/basicCourseInformation.vue | 454 +++++++++++------- src/views/course/components/KnowledgeEdit.vue | 61 --- src/views/course/components/courseEdit.vue | 321 +++++++++++-- src/views/course/knowledgePoints.vue | 114 +---- src/views/home/components/Status.vue | 1 - 9 files changed, 604 insertions(+), 411 deletions(-) rename src/utils/{img.js => alioss.js} (77%) delete mode 100644 src/views/course/components/KnowledgeEdit.vue diff --git a/mock/user.ts b/mock/user.ts index 14079f0..a0fc418 100644 --- a/mock/user.ts +++ b/mock/user.ts @@ -10,7 +10,6 @@ function createUserList() { desc: '平台管理员', roles: ['平台管理员'], buttons: ['cuser.detail'], -<<<<<<< HEAD routes: [ 'Home', 'Course', @@ -22,10 +21,8 @@ function createUserList() { 'CourseChapters', 'KnowledgePoints', 'CurriculumMap', + 'knowledgeAtlas', ], //老师权限 -======= - routes: ['Home', 'Course', 'Student', 'Group', 'Message','BasicCourseInformation','CourseObjectives','CourseChapters','KnowledgePoints','CurriculumMap','knowledgeAtlas'], //老师权限 ->>>>>>> c410b660ea058afeb8db74ec244fc38f8928cf30 token: 'Admin Token', }, { diff --git a/src/api/user/crouse.js b/src/api/user/crouse.js index b2f245d..581e336 100644 --- a/src/api/user/crouse.js +++ b/src/api/user/crouse.js @@ -1,28 +1,33 @@ import request from '@/utils/request' -export const getCourseListApi = () => { - return request.get('/coursesteacher/page?teacherId=2140110334') +// 获取课程列表 +export const getCourseListApi = (params) => { + return request.get('/coursesteacher/page', { + params, + }) } -export const editCourseApi = () => { - return request.put('/coursesTeacher') +// 编辑课程 +export const editCourseApi = (params) => { + return request.put('/coursesteacher', params) } +// 添加课程 export const addCourseApi = (data) => { - return request.post('/courseTeacher/addCourse', data) + return request.post(`/coursesteacher/addcourse`, data) } -export const fnName = (data) => { - return request({ - url: 'xxxxx', - method: 'POST', - data - }) +// 获取课程详情 +export const getCourseDetailApi = (id) => { + return request.get(`/coursesteacher/${id}`) } -export const fnNameGet = (params) => { - return request({ - url: 'xxxxx', - method: 'get', - params - }) + +// 删除课程 +export const deleteCourseApi = (id) => { + return request.delete(`/coursesteacher/${id}`) +} +// 获取课程id +export const getCourseObjectApi = (id) => { + return request.get(`/course_objectives/list/${id}`) +} +// 获取教师列表 +export const getTeacherListApi = () => { + return request.get('/user/get_teacherinf_list') } -// {id:1} -// http://127.0.0.1/getlist?id=1 -// http://127.0.0.1/setuser 载荷 body \ No newline at end of file diff --git a/src/utils/img.js b/src/utils/alioss.js similarity index 77% rename from src/utils/img.js rename to src/utils/alioss.js index 4fa8d95..bd49467 100644 --- a/src/utils/img.js +++ b/src/utils/alioss.js @@ -12,13 +12,19 @@ export const tool = { oss: { async upload(file) { // // console.log(11, file, client) + // 文件名 - const uuid = nanoid() // 文件后缀名 + const uuid = nanoid() + // 文件后缀名 const index = file.name.lastIndexOf('.') const suffix = file.name.substring(index + 1) let fileName = uuid + '.' + suffix - console.log(uuid, file, suffix) // return await client.multipartUpload(fileName, file, { - + console.log(uuid, file, suffix) + // return await client.multipartUpload(fileName, file, { + // progress: function (p) { + // console.log('进度', p) + // }, + // }) return await client.put(fileName, file) }, }, diff --git a/src/views/course/CourseObjectives.vue b/src/views/course/CourseObjectives.vue index 2a660ac..11ecde0 100644 --- a/src/views/course/CourseObjectives.vue +++ b/src/views/course/CourseObjectives.vue @@ -31,7 +31,7 @@ import {} from 'vue' - diff --git a/src/views/course/components/KnowledgeEdit.vue b/src/views/course/components/KnowledgeEdit.vue deleted file mode 100644 index 83b5751..0000000 --- a/src/views/course/components/KnowledgeEdit.vue +++ /dev/null @@ -1,61 +0,0 @@ - - diff --git a/src/views/course/components/courseEdit.vue b/src/views/course/components/courseEdit.vue index 2d1f213..f7e2c34 100644 --- a/src/views/course/components/courseEdit.vue +++ b/src/views/course/components/courseEdit.vue @@ -1,30 +1,64 @@ - - + diff --git a/src/views/course/knowledgePoints.vue b/src/views/course/knowledgePoints.vue index 8235f93..2393851 100644 --- a/src/views/course/knowledgePoints.vue +++ b/src/views/course/knowledgePoints.vue @@ -1,114 +1,6 @@ - + - + diff --git a/src/views/home/components/Status.vue b/src/views/home/components/Status.vue index aee3a41..c011650 100644 --- a/src/views/home/components/Status.vue +++ b/src/views/home/components/Status.vue @@ -2,7 +2,6 @@ import add from '@/assets/images/add.png' // import { Plus } from '@element-plus/icons-vue' import { userChangeService } from '@/api/user/user.js' -import { tool } from '@/utils/img' const dialogFormVisible = ref(false) import { ref } from 'vue' const props = defineProps({