From 249ebff4ed0915aba9b012f331773e10b9f18f4a Mon Sep 17 00:00:00 2001 From: 18571350067 Date: Sun, 7 Nov 2021 17:16:36 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=98=E7=9B=AE=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/course/question/question.js | 18 +- src/views/course/CourseAdd.vue | 35 +- src/views/course/CourseList.vue | 2 - src/views/course/CoursewareAddOrUpdate.vue | 154 +++++++ src/views/course/CoursewareList.vue | 15 +- src/views/course/courseware/coursewareAdd.Vue | 0 src/views/course/question/QuestionAdd.vue | 392 ++++++++++++++++++ src/views/course/question/QuestionList.vue | 31 +- src/views/course/question/examQuestion.Vue | 3 - 9 files changed, 612 insertions(+), 38 deletions(-) create mode 100644 src/views/course/CoursewareAddOrUpdate.vue delete mode 100644 src/views/course/courseware/coursewareAdd.Vue create mode 100644 src/views/course/question/QuestionAdd.vue delete mode 100644 src/views/course/question/examQuestion.Vue diff --git a/src/api/course/question/question.js b/src/api/course/question/question.js index 1664445..1257718 100644 --- a/src/api/course/question/question.js +++ b/src/api/course/question/question.js @@ -1,7 +1,7 @@ import request from '@/utils/request' const questionApi = { -// add: 'sys/menu/add', + add: 'courseManagement/question/addOrUpdate', get: '/courseManagement/question/details', // update: 'sys/menu/update', // del: 'courseManagement/course/delete', @@ -12,13 +12,15 @@ const questionApi = { } -// export function menuAdd (params) { -// return request({ -// url: menuApi.add, -// method: 'post', -// data: params -// }) -// } + +// 题目新增 +export function questionAdd (params) { + return request({ + url: questionApi.add, + method: 'post', + data: params + }) +} // export function menuGet (params) { // return request({ // url: menuApi.get, diff --git a/src/views/course/CourseAdd.vue b/src/views/course/CourseAdd.vue index 22db19b..e844101 100644 --- a/src/views/course/CourseAdd.vue +++ b/src/views/course/CourseAdd.vue @@ -1,6 +1,9 @@ @@ -118,10 +121,12 @@ export default { { id: '2', name: '人员类别2' }, { id: '3', name: '人员类别3' }, ], - + previewVisible: false, - fileList: [] + fileList: [], + previewImage :[ + ] } }, @@ -164,6 +169,11 @@ export default { }) }, + //返回 + goback(){ + this.$router.push({path:"/course/CourseList",query:{} }) + }, + getToken() { let hreader = {}; hreader[ACCESS_TOKEN] = storage.get(ACCESS_TOKEN); @@ -188,5 +198,18 @@ export default { }, }, + } + +// 图片预览Base64 +function getBase64(file) { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.readAsDataURL(file); + reader.onload = () => resolve(reader.result); + reader.onerror = error => reject(error); + }); +} + + diff --git a/src/views/course/CourseList.vue b/src/views/course/CourseList.vue index be21017..90924b6 100644 --- a/src/views/course/CourseList.vue +++ b/src/views/course/CourseList.vue @@ -1,5 +1,4 @@ - diff --git a/src/views/course/CoursewareList.vue b/src/views/course/CoursewareList.vue index 3490a3a..acd442e 100644 --- a/src/views/course/CoursewareList.vue +++ b/src/views/course/CoursewareList.vue @@ -1,9 +1,10 @@ - diff --git a/src/views/course/question/QuestionList.vue b/src/views/course/question/QuestionList.vue index 2073d34..55d55ef 100644 --- a/src/views/course/question/QuestionList.vue +++ b/src/views/course/question/QuestionList.vue @@ -8,17 +8,21 @@

题序

-
{{ index+1 }}
+
+ {{ index+1 }} +

+ 批量导入

课程题目库预览

({{ questionDetail.questionType }}){{questionDetail.questionName}} - 编辑 + 编辑 + 删除

A. {{ questionDetail.answerA }}
B. {{ questionDetail.answerB }}
@@ -44,16 +48,15 @@ import { getQuestionDeatil } from '@/api/course/question/question' export default { data() { return { - queryParam: { id: this.$route.query.id }, quesitonList: [], questionDetail: {}, } }, created: function () { - let parameter = {} + let parameter = {id : this.$route.query.id} // 查询所有题目id列表 - getQuestionListByCourseId(Object.assign(parameter, this.queryParam)).then((res) => { + getQuestionListByCourseId(parameter).then((res) => { this.quesitonList = res.data if (!res.data.length) return @@ -75,18 +78,24 @@ export default { this.$router.push({ path: '/course/CourseList', query: { - // courseName: this.$$router.query.courseName, - // PageNum: this.$$router.query.PageNum, - // courseUserOrgId : this.$$router.query.courseUserOrgId, }, }) }, questionSave() { - alert('還在對接中~~~') + this.$router.push({ + path: '/course/question/QuestionAdd', query :{ + courseId: this.$route.query.id, + }}); }, - edit: function (i) { - alert('题目ID:' + i) + edit(record) { + console.log(record) + this.$router.push({ path : '/course/question/QuestionAdd', query:{ id: record , questionType:this.questionDetail.questionType ,courseId:this.$route.query.id}}); }, + //批量导入 + questionBatch(){ + alert('批量导入') + courseId:this.$route.query.id + } }, } diff --git a/src/views/course/question/examQuestion.Vue b/src/views/course/question/examQuestion.Vue deleted file mode 100644 index 1852865..0000000 --- a/src/views/course/question/examQuestion.Vue +++ /dev/null @@ -1,3 +0,0 @@ -

- hello World -

\ No newline at end of file