From 612846b052e9d0233242279749beac1154adfe72 Mon Sep 17 00:00:00 2001 From: Yuanjianghong Date: Fri, 5 Nov 2021 09:14:01 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E7=BB=88=E7=AB=AF=E5=9F=B9=E8=AE=AD?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/project/terminalTrainSign.js | 15 ++ .../terminalTrain/TerminalTrainDetail.vue | 21 ++- .../terminalTrain/TerminalTrainForm.vue | 11 +- .../terminalTrain/TerminalTrainList.vue | 28 +-- .../terminalTrain/TerminalTrainSignList.vue | 163 ++++++++++++++++++ 5 files changed, 208 insertions(+), 30 deletions(-) create mode 100644 src/api/project/terminalTrainSign.js create mode 100644 src/views/project/terminalTrain/TerminalTrainSignList.vue diff --git a/src/api/project/terminalTrainSign.js b/src/api/project/terminalTrainSign.js new file mode 100644 index 0000000..88b218b --- /dev/null +++ b/src/api/project/terminalTrainSign.js @@ -0,0 +1,15 @@ +import request from '@/utils/request' + +const terminalTrainSignApi = { + list: 'project/terminalTrain/list', + +} + +export function terminalTrainSignList(params) { + console.log("terminalTrainList------------{}", params) + return request({ + url: terminalTrainSignApi.list, + method: 'get', + params: params + }) +} \ No newline at end of file diff --git a/src/views/project/terminalTrain/TerminalTrainDetail.vue b/src/views/project/terminalTrain/TerminalTrainDetail.vue index b0c9562..b1836a4 100644 --- a/src/views/project/terminalTrain/TerminalTrainDetail.vue +++ b/src/views/project/terminalTrain/TerminalTrainDetail.vue @@ -16,8 +16,8 @@
- 修 改 信 息 - 会议签到信息 + 修 改 信 息 + 会议签到信息
@@ -54,6 +54,23 @@ export default { }, }) }, + editInfo(){ //修改信息按钮 + this.$router.push({ + path: '/project/terminalTrain/form', + query: { + id: this.detailData.id, + } + }) + }, + + signInfo(){ //跳转签到信息页面 + this.$router.push({ + path: '/project/terminalTrain/signList', + query: { + id: this.detailData.id, + } + }) + } }, } diff --git a/src/views/project/terminalTrain/TerminalTrainForm.vue b/src/views/project/terminalTrain/TerminalTrainForm.vue index 105ea96..a7564cf 100644 --- a/src/views/project/terminalTrain/TerminalTrainForm.vue +++ b/src/views/project/terminalTrain/TerminalTrainForm.vue @@ -1,6 +1,6 @@ @@ -66,7 +68,8 @@ export default { remark: '', status: 1, }, - titleName: '新增终端培训', + titleName: '终端培训表单', + layout: 'horizontal' } }, //计算属性 类似于data概念 diff --git a/src/views/project/terminalTrain/TerminalTrainList.vue b/src/views/project/terminalTrain/TerminalTrainList.vue index 4e68445..cd24188 100644 --- a/src/views/project/terminalTrain/TerminalTrainList.vue +++ b/src/views/project/terminalTrain/TerminalTrainList.vue @@ -78,40 +78,20 @@ export default { endDate: this.$route.query.terminalTrainEndDate || null, }, columns: [ - { - title: '序号', - width: 'auto', - align: 'center', - dataIndex: 'id', - key: 'id', - scopedSlots: { customRender: 'serial' }, - }, + { title: '序号', width: 'auto', align: 'center', dataIndex: 'id', key: 'id', scopedSlots: { customRender: 'serial' }, }, { title: '项目名称', width: 'auto', align: 'center', dataIndex: 'projectName', key: 'projectName' }, - { - title: '时间', - dataIndex: 'date', - key: 'date', + { title: '时间', dataIndex: 'date', key: 'date', customRender: (text, record, index) => { return record.startDate + ' - ' + record.endDate }, }, - { - title: '人数', - width: 'auto', - align: 'center', - dataIndex: 'num', - key: 'num', + { title: '人数', width: 'auto', align: 'center', dataIndex: 'num', key: 'num', customRender: (text, record, index) => { return record.signNum + ' / ' + record.personNum }, }, { title: '培训类型', width: 'auto', align: 'center', dataIndex: 'projectType', key: 'projectType' }, - { - title: '项目状态', - width: 'auto', - align: 'center', - dataIndex: 'status', - key: 'status', + { title: '项目状态', width: 'auto', align: 'center', dataIndex: 'status', key: 'status', customRender: (text, record, index) => { if (text == '1') return '未发布' else if (text == '2') return '未开始' diff --git a/src/views/project/terminalTrain/TerminalTrainSignList.vue b/src/views/project/terminalTrain/TerminalTrainSignList.vue new file mode 100644 index 0000000..b714af6 --- /dev/null +++ b/src/views/project/terminalTrain/TerminalTrainSignList.vue @@ -0,0 +1,163 @@ + + + + \ No newline at end of file From 249ebff4ed0915aba9b012f331773e10b9f18f4a Mon Sep 17 00:00:00 2001 From: 18571350067 Date: Sun, 7 Nov 2021 17:16:36 +0800 Subject: [PATCH 2/8] =?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 From eb13a01c2c5f05b18326d05f926af42ec655e9e5 Mon Sep 17 00:00:00 2001 From: Yuanjianghong Date: Mon, 8 Nov 2021 10:18:45 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/project/ProjectStepForm.vue | 2 +- src/views/project/form/ProjectCourseList.vue | 28 ++++++------------- .../project/form/ProjectCourseSelect.vue | 12 +++----- src/views/project/form/ProjectForm.vue | 4 +-- 4 files changed, 16 insertions(+), 30 deletions(-) diff --git a/src/views/project/ProjectStepForm.vue b/src/views/project/ProjectStepForm.vue index 9a64d7a..2627017 100644 --- a/src/views/project/ProjectStepForm.vue +++ b/src/views/project/ProjectStepForm.vue @@ -1,7 +1,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;