From b45eddb9ee379b569b372b54bf4c3365c320e5ab Mon Sep 17 00:00:00 2001 From: 18571350067 Date: Tue, 9 Nov 2021 09:14:29 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E9=A2=98=E5=BA=93=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=95=B4=E6=94=B9=E3=80=81=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/course/question/question.js | 13 +- src/api/sys/oss.js | 7 +- src/views/course/question/QuestionAdd.vue | 90 ++++---- src/views/course/question/QuestionList.vue | 240 +++++++++++++++------ 4 files changed, 240 insertions(+), 110 deletions(-) diff --git a/src/api/course/question/question.js b/src/api/course/question/question.js index fe72398..51c7556 100644 --- a/src/api/course/question/question.js +++ b/src/api/course/question/question.js @@ -4,11 +4,12 @@ const questionApi = { add: 'courseManagement/question/addOrUpdate', get: '/courseManagement/question/details', // update: 'sys/menu/update', - del: 'courseManagement/course/delete', + del: 'courseManagement/question/delete', // updateStatus: 'sys/menu/updateStatus', // list: '/courseManagement/course/listPage', // coursewareList:'/courseManagement/course/courseware/details', -// questionList:'/courseManagement/course/questionList' +// questionList:'/courseManagement/course/questionList', + importTemplate: "courseManagement/question/importTemplate" } @@ -54,5 +55,13 @@ export function getQuestionDeatil (params) { }) } +// 题目批量导入 +export function importTemplate (params) { + return request({ + url: questionApi.importTemplate, + method: 'post', + params: params + }) +} diff --git a/src/api/sys/oss.js b/src/api/sys/oss.js index 76f55d0..f844ecf 100644 --- a/src/api/sys/oss.js +++ b/src/api/sys/oss.js @@ -1,7 +1,8 @@ import request from '@/utils/request' const ossApi = { - list: '/sys/oss/list' + list: '/sys/oss/list', + upload: '/sys/oss/upload' } export function ossList (params) { @@ -11,3 +12,7 @@ export function ossList (params) { params: params }) } + +export function ossUpload () { + return process.env.VUE_APP_API_BASE_URL + ossApi.upload; +} diff --git a/src/views/course/question/QuestionAdd.vue b/src/views/course/question/QuestionAdd.vue index c48f99d..cf0dc7f 100644 --- a/src/views/course/question/QuestionAdd.vue +++ b/src/views/course/question/QuestionAdd.vue @@ -6,7 +6,7 @@ - + @@ -46,7 +46,7 @@ - + @@ -84,7 +84,7 @@ - + @@ -103,7 +103,7 @@ - + @@ -117,7 +117,7 @@ - + @@ -126,8 +126,8 @@ 添加一个新填空 刪除一个新填空 -
- +
+ @@ -155,21 +155,37 @@ export default { multiselect: {}, estimate: {}, shortAnswer: {}, - answerList: ["111","222","333"], - Completion: { }, + Completion: { answerList: [''] }, tabKey: this.$route.query.questionType ? this.$route.query.questionType : '1' - // tabKey, } }, created() { - if (this.$route.query.id) { + if (this.$route.query.id && !this.$route.query.opt) { + + this.radio.disabled = true; + this.multiselect.disabled = true; + this.estimate.disabled = true; + this.shortAnswer.disabled = true; + this.Completion.disabled = true; + getQuestionDeatil({ id: this.$route.query.id }).then((res) => { - console.log(this.tabKey) if (this.tabKey == '1') { - this.radio = res.data + this.radio = res.data; + this.radio.disabled = false; } else if (this.tabKey == '2') { - this.multiselect = res.data + this.multiselect = res.data; + this.multiselect.disabled = false; + this.getRightAnswer(); + } else if(this.tabKey == '3') { + this.estimate = res.data; + this.estimate.disabled = false; + } else if (this.tabKey == '4') { + this.shortAnswer = res.data; + this.shortAnswer.disabled = false; + } else if (this.tabKey == '5') { + this.Completion = res.data; + this.Completion.disabled = false; } }) } @@ -181,41 +197,36 @@ export default { path: '/course/question/QuestionList', query: { id: this.$route.query.courseId, + questionId: this.$route.query.id, + isactive: this.$route.query.isactive, }, }) }, - // getQuestionType() { - // if (!this.$route.query.questionType || this.$route.query.questionType === '') tabKey = '1' - // tabKey = this.$route.query.questionType - // }, - callback(key) { this.radio = {} this.multiselect = {} this.estimate = {} this.shortAnswer = {} - this.Completion = { answerSize: 2 } + this.Completion = { answerList: [''] } this.tabKey = key }, - onChangeInput(e) { - - }, + // 添加填空 addAnswerSize() { - if (this.answerList.length == 10) { + if (this.Completion.answerList.length == 10) { this.$message.error('填空数量最多不能超过10个') return } - this.answerList.push('') + this.Completion.answerList.push('') }, // 刪除填空 delAnswerSize() { - if (this.answerList.length == 1) { + if (this.Completion.answerList.length == 1) { this.$message.error('填空数量最少不能少于1个') return } - this.Completion.answerSize-- + this.Completion.answerList.splice(this.Completion.answerList.length-1, 1); }, // 确定 @@ -368,25 +379,20 @@ export default { this.$message.error('题干不能为空!') return false } - - console.log(this.Completion.conten) - // if (!this.Completion.rightAnswers || this.Completion.rightAnswers === '') { - // this.$message.error('正确答案不能为空!') - // return false - // } - - // let answer =[]; - // for(i in answerSize) { - // let daan ={}; - // } - - let tiank = this.Completion - console.log('tiank ', tiank) - let from = this.Completion from.questionType = 5 return from }, + + // 获取多选题的正确答案 + getRightAnswer(){ + if(this.multiselect.rightAnswers.indexOf('A') > -1) this.multiselect.a = true; + if(this.multiselect.rightAnswers.indexOf('B') > -1) this.multiselect.b = true; + if(this.multiselect.rightAnswers.indexOf('C') > -1) this.multiselect.c = true; + if(this.multiselect.rightAnswers.indexOf('D') > -1) this.multiselect.d = true; + console.log('1---', this.multiselect) + }, + }, } diff --git a/src/views/course/question/QuestionList.vue b/src/views/course/question/QuestionList.vue index 2a6c188..ecc501d 100644 --- a/src/views/course/question/QuestionList.vue +++ b/src/views/course/question/QuestionList.vue @@ -1,76 +1,138 @@ @@ -128,8 +232,14 @@ export default { border: 1px solid #000; margin: 5px 5px; cursor: pointer; + background-color: white; +} + +.active_color { background-color: wheat; } + +/* wheat */ .questionDetail { width: calc(100% - 300px - 20px); height: auto; @@ -158,7 +268,7 @@ export default { font-size: 23px; font: bold; background-color: gainsboro; - margin-top: 45px; + /* margin-top: 45px; */ } .questionContent { margin-left: 10px; From 8228dd9b0ffb625044f2c33db7785468f8a378d2 Mon Sep 17 00:00:00 2001 From: 18571350067 Date: Tue, 9 Nov 2021 19:08:12 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E9=A2=98=E5=BA=93=E7=BB=86=E8=8A=82?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/course/CourseAdd.vue | 22 +++- src/views/course/CourseList.vue | 126 ++++++++++++--------- src/views/course/CoursewareList.vue | 2 +- src/views/course/courseDetail.vue | 6 +- src/views/course/question/QuestionAdd.vue | 7 +- src/views/course/question/QuestionList.vue | 105 +++++++++-------- 6 files changed, 156 insertions(+), 112 deletions(-) diff --git a/src/views/course/CourseAdd.vue b/src/views/course/CourseAdd.vue index e844101..6754fbc 100644 --- a/src/views/course/CourseAdd.vue +++ b/src/views/course/CourseAdd.vue @@ -115,13 +115,15 @@ export default { data() { return { dataValue: 1, - form: {}, + form: { + coverPath:'', + }, personType: [ { id: '1', name: '人员类别1' }, { id: '2', name: '人员类别2' }, { id: '3', name: '人员类别3' }, ], - + url:'', previewVisible: false, fileList: [], previewImage :[ @@ -147,7 +149,6 @@ export default { } }, methods: { - //获取字典值 // getPersonType() { // return dictGet(Object.assign(parameter)).then((res) => { // return res @@ -171,7 +172,9 @@ export default { //返回 goback(){ - this.$router.push({path:"/course/CourseList",query:{} }) + this.$router.push({path:"/course/CourseList",query:{ + courseName:this.$route.query.courseName + } }) }, getToken() { @@ -195,6 +198,17 @@ export default { }, handleChange({ fileList }) { this.fileList = fileList; + console.log("fileList-------",fileList); + this.fileList.file=fileList[0]; + console.log('file``````',this.fileList.file) + console.log('response``````',this.fileList.file.response.url) + + + this.form.coverPath = this.fileList.file.response.url; + + console.log("url",this.form.coverPath) + + }, }, diff --git a/src/views/course/CourseList.vue b/src/views/course/CourseList.vue index 90924b6..d48a676 100644 --- a/src/views/course/CourseList.vue +++ b/src/views/course/CourseList.vue @@ -1,87 +1,109 @@ + \ No newline at end of file diff --git a/src/views/archives/certificate/Index.vue b/src/views/archives/certificate/Index.vue new file mode 100644 index 0000000..9871c8f --- /dev/null +++ b/src/views/archives/certificate/Index.vue @@ -0,0 +1,81 @@ + + + + \ No newline at end of file From 1ea56c73eccb0718b765e913988faadb26c10c2d Mon Sep 17 00:00:00 2001 From: 18571350067 Date: Wed, 10 Nov 2021 14:45:45 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=B8=A6=E5=8F=8D=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/course/CourseList.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/course/CourseList.vue b/src/views/course/CourseList.vue index d48a676..e0854dc 100644 --- a/src/views/course/CourseList.vue +++ b/src/views/course/CourseList.vue @@ -101,7 +101,7 @@ export default { query: { id: record.id, courseName: this.queryParam.courseName, - pageNum: this.$refs.table.pageNum + pageNum: this.$refs.table.localPagination.current }, }) },