diff --git a/package-lock.json b/package-lock.json index bfc9dbe..a503081 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4104,6 +4104,11 @@ "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-2.2.0.tgz", "integrity": "sha1-QGXiATz5+5Ft39gu+1Bq1MZ2kGI=" }, + "dayjs": { + "version": "1.11.12", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.12.tgz", + "integrity": "sha512-Rt2g+nTbLlDWZTwwrIXjy9MeiZmSDI375FvZs72ngxx8PDC6YXOeR3q5LAuPzjZQxhiWdRKac7RKV+YyQYfYIg==" + }, "de-indent": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz", diff --git a/package.json b/package.json index f5db8c1..52bd3aa 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "@tinymce/tinymce-vue": "^3.2.8", "axios": "^0.18.0", "babel-polyfill": "^6.26.0", + "dayjs": "^1.11.12", "echarts": "^4.8.0", "element-theme": "^2.0.1", "element-ui": "^2.13.0", diff --git a/src/api/index.js b/src/api/index.js index 5638376..6ae9fe6 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1,5 +1,5 @@ import Setting from '@/setting' -const host = 'http://192.168.31.51:9000' +const { apiBaseURL: host } = Setting export default { queryProfessional: `/exam/exam/professional/queryProfessional`, @@ -52,4 +52,11 @@ export default { examPaperTemplateList: `/exam/exam/paperTemplate/examPaperTemplateList`, saveExamPaperTemplate: `/exam/exam/paperTemplate/saveExamPaperTemplate`, templateDetails: `/exam/exam/paperTemplate/templateDetails`, + + addQuestion: `/exam/questions/addQuestion`, + findQuestion: `/exam/questions/findById`, + listQuestion: `/exam/questions/pagingQuery`, + updateQuestion: `/exam/questions/updateQuestion`, + batchImportQuestions: `${host}/exam/questions/batchImportQuestions`, + checkQuestion: `/exam/questions/checkQuestion`, } \ No newline at end of file diff --git a/src/components/ueditor/index.vue b/src/components/ueditor/index.vue index bbb60fc..cbb8467 100644 --- a/src/components/ueditor/index.vue +++ b/src/components/ueditor/index.vue @@ -25,6 +25,7 @@ export default { }, watch: { value: function (val, oldVal) { + console.log("🚀 ~ val:", val, this.ready) if (val != null && this.ready) { // eslint-disable-next-line no-undef this.instance = UE.getEditor(this.randomId) diff --git a/src/const/column.js b/src/const/column.js deleted file mode 100644 index 0304802..0000000 --- a/src/const/column.js +++ /dev/null @@ -1,3 +0,0 @@ -export default { - -} diff --git a/src/const/ques.js b/src/const/ques.js new file mode 100644 index 0000000..f073468 --- /dev/null +++ b/src/const/ques.js @@ -0,0 +1,42 @@ +export default { + difficults: [ + { + id: 'basic', + name: '基础' + }, + { + id: 'easy', + name: '普通' + }, + { + id: 'medium', + name: '较难' + }, + { + id: 'hard', + name: '难' + }, + ], + questionTypes: [ + { + id: 'single_choice', + name: '单选题' + }, + { + id: 'multiple_choice', + name: '多选题' + }, + { + id: 'judgement', + name: '判断题' + }, + { + id: 'fill_blank', + name: '填空题' + }, + { + id: 'essay', + name: '问答题' + }, + ], +} diff --git a/src/libs/util.js b/src/libs/util.js index d33a3f7..3cb61f1 100644 --- a/src/libs/util.js +++ b/src/libs/util.js @@ -133,7 +133,25 @@ const util = { k++; } return num > 9 && num < 20 ? re.slice(1) : re; - } + }, + // 阿拉伯数字转化为英文字母 + numToLetter (num) { + let result = '' + if (num > 26) { + result += numberToLetter((num / 26) >> 0 - 1) + } + result += String.fromCharCode(65 + (num % 26)) + return result + }, + // 去掉html里的标签及空格 + removeTag (list, prop = 'stem') { + list.map(e => { + const el = document.createElement('div') + el.innerHTML = e[prop] + e[prop] = el.innerText + }) + return list + }, }; export default util; \ No newline at end of file diff --git a/src/pages/ques/detail/index.vue b/src/pages/ques/detail/index.vue new file mode 100644 index 0000000..75288b6 --- /dev/null +++ b/src/pages/ques/detail/index.vue @@ -0,0 +1,551 @@ + + + + \ No newline at end of file diff --git a/src/pages/ques/index.vue b/src/pages/ques/index.vue deleted file mode 100644 index f93a7a4..0000000 --- a/src/pages/ques/index.vue +++ /dev/null @@ -1,694 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/pages/ques/list/index.vue b/src/pages/ques/list/index.vue new file mode 100644 index 0000000..a46587d --- /dev/null +++ b/src/pages/ques/list/index.vue @@ -0,0 +1,560 @@ + + + + + \ No newline at end of file diff --git a/src/pages/quesBank/index.vue b/src/pages/quesBank/index.vue index 28df574..56ec3b6 100644 --- a/src/pages/quesBank/index.vue +++ b/src/pages/quesBank/index.vue @@ -90,8 +90,8 @@ - 取 消 - 确 定 + 取消 + 确定 @@ -194,7 +194,7 @@ export default { this.initData() }, // 点击树节点查询列表数据 - handleNodeClick (data) { + handleNodeClick () { this.isNotJoin = '' this.initData() this.$refs.table.clearSelection() @@ -270,7 +270,7 @@ export default { }, // 试题管理 toQues (row) { - this.$router.push(`/ques?id=${row.id}&name=${row.questionBankName}`) + this.$router.push(`/ques?id=${row.id}&questionBankName=${row.questionBankName}&questionBankCategory=${row.questionBankCategory}`) }, // 编辑/复制 async edit (row, isCopy) { diff --git a/src/pages/quesBankType/index.vue b/src/pages/quesBankType/index.vue index 23903fa..9621334 100644 --- a/src/pages/quesBankType/index.vue +++ b/src/pages/quesBankType/index.vue @@ -53,7 +53,7 @@ 取消 - 确定 + 确定 diff --git a/src/pages/testPaper/detail/index.vue b/src/pages/testPaper/detail/index.vue index d615003..0082668 100644 --- a/src/pages/testPaper/detail/index.vue +++ b/src/pages/testPaper/detail/index.vue @@ -30,7 +30,7 @@
- + @@ -102,7 +102,7 @@
一键分配分值 - 批量添加 + 批量添加 批量删除试题
@@ -119,6 +119,7 @@