From 6abd7c0c8cebe4d92f367fe2c2e3d262da6cb683 Mon Sep 17 00:00:00 2001 From: zty Date: Wed, 15 Oct 2025 10:02:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E5=85=B1=E4=BA=AB?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E8=80=83=E8=AF=95=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/views/exam/questionChoose.vue | 4 ++-- client/src/views/exam/testPaperCreate.vue | 18 +++++++++--------- server/apps/exam/exports.py | 3 +++ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/client/src/views/exam/questionChoose.vue b/client/src/views/exam/questionChoose.vue index 2c2e06b..b5114f3 100644 --- a/client/src/views/exam/questionChoose.vue +++ b/client/src/views/exam/questionChoose.vue @@ -182,8 +182,8 @@ }); }, getQuestioncatAll() { - getQuestioncatList().then(response => { - this.questioncatData = response.data.results; + getQuestioncatList({page:0}).then(response => { + this.questioncatData = response.data; }); }, changeSort(val) { diff --git a/client/src/views/exam/testPaperCreate.vue b/client/src/views/exam/testPaperCreate.vue index 8662e4e..4d84043 100644 --- a/client/src/views/exam/testPaperCreate.vue +++ b/client/src/views/exam/testPaperCreate.vue @@ -230,9 +230,9 @@ ); }, }, - created() { - this.getQuestioncat(); - }, + // created() { + // this.getQuestioncat(); + // }, methods: { updateQuestion(data){ this.qDialog = false; @@ -243,12 +243,12 @@ this.qid = item.id; this.currentEditIndex = index; }, - getQuestioncat() { - getQuestioncatList({page:0}).then(response => { - this.workscopeData = response.data; - this.type_list = response.data; - }); - }, + // getQuestioncat() { + // getQuestioncatList({page:0}).then(response => { + // this.workscopeData = response.data; + // this.type_list = response.data; + // }); + // }, handleChoose1(){ this.impDialogVisible = true; }, diff --git a/server/apps/exam/exports.py b/server/apps/exam/exports.py index 9558373..f27b202 100644 --- a/server/apps/exam/exports.py +++ b/server/apps/exam/exports.py @@ -17,6 +17,9 @@ def export_question(questions:object): row = ws1.row_dimensions[1] row.font = Font(bold=True) for i in questions: + if not i.questioncat: + print(f"没有分类{i.name}") + continue ws1.append([i.questioncat.name, i.type, i.name, json.dumps(i.options, ensure_ascii=False), ''.join(sorted(i.right)), i.resolution]) filename = 'questions' + datetime.now().strftime("%Y%m%d%H%M%S") +'.xlsx' path = '/media/temp/'