diff --git a/src/api/index.js b/src/api/index.js index 8c87371..419284d 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -16,6 +16,7 @@ export default { questionBankSave: `/exam/questionBank/saveOrUpdate`, questionBankDisable: `/exam/questionBank/updateStatus`, copyQuestionBank: `/exam/questionBank/copyQuestionBank`, + questionBankStructureLevel: `/exam/question/bank/categories/questionBankStructureLevel`, TreeStructure: `/exam/knowledgeHierarchy/TreeStructure`, classificationTreeStructure: `/exam/knowledgeHierarchy/classificationTreeStructure`, @@ -48,6 +49,7 @@ export default { saveExamPaper: `/exam/exam/paper/saveExamPaper`, paperDisable: `/exam/exam/paper/updateStatus`, avgValues: `/exam/exam/paper/avgValues`, + examPaperDetails: `/exam/exam/paper/examPaperDetails`, deleteTemplate: `/exam/exam/paperTemplate/deleteTemplate`, examPaperTemplateList: `/exam/exam/paperTemplate/examPaperTemplateList`, @@ -66,4 +68,5 @@ export default { createNewVersion: `/exam/questions/createNewVersion`, disableOrEnableQuestion: `/exam/questions/disableOrEnableQuestion`, findAllByQuestionBank: `/exam/questions/findAllByQuestionBank`, + selectQuestionsByTypeAndDifficulty: `/exam/questions/selectQuestionsByTypeAndDifficulty`, } \ No newline at end of file diff --git a/src/pages/ques/detail/index.vue b/src/pages/ques/detail/index.vue index eac6ef1..815b46c 100644 --- a/src/pages/ques/detail/index.vue +++ b/src/pages/ques/detail/index.vue @@ -551,7 +551,7 @@ export default { form.knowledgePointIds = form.knowledgePointIds.map(e => { return e[e.length - 1] }) - form.givenYear = dayjs(form.givenYear).format('YYYY') + form.givenYear = form.givenYear ? dayjs(form.givenYear).format('YYYY') : '' form.questionAnswerVersions[0].answerAnalysis = answerAnalysis // 解析保存在选项里第一个对象里 if (this.$refs.uploadInstructions) form.uploadInstructions = this.$refs.uploadInstructions.getUEContent() if (form.questionType === 'essay' && this.$refs.referenceAnswer) form.questionAnswerVersions[0].referenceAnswer = this.$refs.referenceAnswer.getUEContent() // 参考答案保存在选项里第一个对象里(问答题才有) diff --git a/src/pages/ques/list/index.vue b/src/pages/ques/list/index.vue index 640297c..088e807 100644 --- a/src/pages/ques/list/index.vue +++ b/src/pages/ques/list/index.vue @@ -91,7 +91,7 @@ 批量导入 批量移除 - 批量删除 + 批量删除 @@ -125,7 +125,7 @@ 查看 编辑 移除 - 删除 + 删除 @@ -144,9 +144,24 @@
-
+

该试题已被以下试卷引用,确定删除?

-

删除后,此题库分类及其子分类将被删除,已关联题库将无分类

+
    +
  • +

    {{ item.name }}

    + +
  • +
+
@@ -266,6 +281,7 @@ export default { delVisible: false, curUsePapers: [], + curRow: {}, form: {}, importVisible: false, @@ -412,10 +428,6 @@ export default { this.quesVisible = true this.curRow = {} this.detailType = '' - }, - // 复制 - copy (row) { - }, // 编辑/查看 type: 1复制,2查看,3编辑 toDetail (row, type) { @@ -424,10 +436,12 @@ export default { this.detailType = type }, // 删除 - async del (row) { + async del (rows) { + const ids = rows.map(e => e.questionId) // 先查询是否有试卷引用了该试题 - const { list } = await this.$post(this.api.checkQuestionIsUse, [row.questionId]) + const { list } = await this.$post(this.api.checkQuestionIsUse, ids) if (list.length) { + this.curRow = rows this.curUsePapers = list this.delVisible = true } else { @@ -438,12 +452,26 @@ export default { type: 'warning', closeOnClickModal: false, }) - await this.$post(this.api.delQuestion, [row.questionId]) + await this.$post(this.api.delQuestion, ids) Util.successMsg('删除成功') this.getList() } catch (e) { } } }, + // 批量删除 + async delAllSelection () { + const list = this.multipleSelection + list.length ? this.del(list) : Util.warningMsg('请选择数据') + }, + // 删除提交 + async delSubmit () { + await this.$post(this.api.delQuestion, this.curRow.map(e => e.questionId)) + Util.successMsg('删除成功') + this.multipleSelection = [] + this.$refs.table.clearSelection() + this.delVisible = false + this.getData() + }, // 禁启用 async switchOff (val, row) { try { @@ -626,4 +654,21 @@ export default { } } } + +.papers { + margin-top: 10px; + + li { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 10px; + } + + i { + font-size: 14px; + color: #7a7a7a; + cursor: pointer; + } +} \ No newline at end of file diff --git a/src/pages/testPaper/detail/auto.vue b/src/pages/testPaper/detail/auto.vue new file mode 100644 index 0000000..f176704 --- /dev/null +++ b/src/pages/testPaper/detail/auto.vue @@ -0,0 +1,443 @@ + + + + \ No newline at end of file diff --git a/src/pages/testPaper/detail/index.vue b/src/pages/testPaper/detail/index.vue index 45e8eea..552c11d 100644 --- a/src/pages/testPaper/detail/index.vue +++ b/src/pages/testPaper/detail/index.vue @@ -8,7 +8,8 @@
- + @@ -54,7 +55,7 @@
- + @@ -86,10 +87,10 @@
-

选择试题

+
选择试题
一键分配分值 - 自动选题 + 自动选题
@@ -102,9 +103,8 @@
一键分配分值 - 批量添加 + 批量添加 批量删除试题 - {{ item.shrink }}
@@ -131,8 +131,8 @@ 编辑试题 - 更换试题 - 添加试题 + 更换试题 + 添加试题 移除试题 @@ -151,7 +151,8 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/pages/testPaper/list/index.vue b/src/pages/testPaper/list/index.vue index 95f677b..9b0ccd4 100644 --- a/src/pages/testPaper/list/index.vue +++ b/src/pages/testPaper/list/index.vue @@ -193,6 +193,15 @@ export default { components: { Breadcrumb }, data () { return { + crumbs: [ + { + name: this.$route.query.name || '中台试卷库', + route: '/testPaperLibrary' + }, + { + name: '试卷管理' + }, + ], questionTypes: QuesConst.questionTypes, difficults: TestPaperConst.difficults, paperTypes: TestPaperConst.paperTypes, @@ -269,16 +278,7 @@ export default { }, }, mounted () { - this.crumbs = [ - { - name: this.$route.query.name || '中台试卷库', - route: '/testPaperLibrary' - }, - { - name: '试卷管理' - }, - ], - this.getType() + this.getType() this.getProfessional() }, methods: { @@ -474,15 +474,7 @@ export default { }, // 编辑试卷 async edit (row) { - const { data } = await this.$post(`${this.api.knowledgeHierarchyFind}?id=${row.id}`) - this.knowledgeVisible = true - const path = data.path.split('/').map(e => +e) - this.form = { - id: row.id, - name: row.name, - parentId: path.slice(0, path.length - 1), - } - console.log(11, this.form) + this.$router.push(`detail?paperId=${row.paperId}&libraryId=${this.typeId}&classificationId=${this.$refs.typeTree.getCurrentKey() || ''}`) }, async delAllSelection () { const list = this.multipleSelection diff --git a/src/pages/testPaperLibrary/index.vue b/src/pages/testPaperLibrary/index.vue index ff3ecbf..bf5e46d 100644 --- a/src/pages/testPaperLibrary/index.vue +++ b/src/pages/testPaperLibrary/index.vue @@ -93,8 +93,8 @@ - 取 消 - 确 定 + 取消 + 确定