From 93891d575e048e8c36f211f8f502b959dd21dffe Mon Sep 17 00:00:00 2001
From: "YOHO\\20373" <2037305722@qq.com>
Date: Thu, 29 May 2025 20:13:12 +0800
Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9=E8=AF=95=E5=8D=B7=E9=A1=B5=E9=9D=A2=EF=BC=8C=E5=85=B6?=
=?UTF-8?q?=E5=AE=83=E7=BB=86=E8=8A=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/paper/question/index.ts | 22 +-
src/api/system/paper/index.ts | 4 +-
src/views/paper/audit/BrowerForm.vue | 971 ++++++++++++++
src/views/paper/audit/ChoiceForm.vue | 18 +-
src/views/paper/audit/FileForm.vue | 993 ++++++++++++++
src/views/paper/audit/MysqlForm.vue | 1149 +++++++++++++++++
src/views/paper/audit/components/FileForm.vue | 107 ++
src/views/paper/audit/index.vue | 43 +-
src/views/paper/question/BrowerForm.vue | 11 +-
src/views/paper/question/ChoiceForm.vue | 19 +-
src/views/paper/question/FileForm.vue | 12 +-
src/views/paper/question/MysqlForm.vue | 16 +-
.../steps/step2/components/step-edit.vue | 791 +++++++++---
.../steps/step2/components/step-look.vue | 6 +-
.../exam/components/steps/step2/index.vue | 11 +-
.../exam/components/steps/step3/index.vue | 44 +-
.../ai/components/steps/step3/index.vue | 4 +-
.../components/steps/step3/index.vue | 42 +-
.../module/components/steps/step3/index.vue | 40 +-
.../random/components/steps/step3/index.vue | 40 +-
.../steps/step2/components/step-edit.vue | 791 +++++++++---
.../steps/step2/components/step-look.vue | 6 +-
.../components/steps/step2/index copy.vue | 211 ---
.../sprint/components/steps/step2/index.vue | 12 +-
.../sprint/components/steps/step3/index.vue | 45 +-
.../steps/step2/components/step-edit.vue | 791 +++++++++---
.../steps/step2/components/step-look.vue | 6 +-
.../trans/components/steps/step2/index.vue | 28 +-
.../trans/components/steps/step3/index.vue | 44 +-
29 files changed, 5340 insertions(+), 937 deletions(-)
create mode 100644 src/views/paper/audit/BrowerForm.vue
create mode 100644 src/views/paper/audit/FileForm.vue
create mode 100644 src/views/paper/audit/MysqlForm.vue
create mode 100644 src/views/paper/audit/components/FileForm.vue
delete mode 100644 src/views/task/sprint/components/steps/step2/index copy.vue
diff --git a/src/api/paper/question/index.ts b/src/api/paper/question/index.ts
index 0552510..3846f56 100644
--- a/src/api/paper/question/index.ts
+++ b/src/api/paper/question/index.ts
@@ -5,10 +5,16 @@ export interface QuestionQueryVO {
subjectName: string
}
-// 查询用户管理列表
+// 查询试题列表
export const getQuestionList = (params: QuestionQueryVO) => {
return request.get({ url: '/exam/question/list', params })
}
+// 查询试题列表(带答案)
+export const getQuestionlistAnswer = (params: QuestionQueryVO) => {
+ return request.get({ url: '/exam/question/listAnswer', params })
+}
+
+
export const getQuestionSendList = (params: QuestionQueryVO) => {
return request.get({ url: '/exam/question/sendList', params })
@@ -25,6 +31,12 @@ export async function auditQuestion(data) {
export async function rabbitmqConnect() {
return await request.post({ url: '/rabbitmq/connect' })
}
+export async function changePaperQu(data) {
+ return await request.post({ url: '/exam/qu/changePaperQu',data })
+}
+export async function changePaperQuRandom(data) {
+ return await request.post({ url: '/exam/qu/changePaperQuRandom',data })
+}
// 获取试题详情
export const getQuestion = (id: number) => {
@@ -63,7 +75,13 @@ export function editQuestionNoAudit(data: any) {
}
-
+// 更改状态
+export async function updateQuStatus(quId: string, status: number) {
+ return await request.put({
+ url: '/exam/question/updateQuStatus',
+ data: { quId, status } // 使用data
+ })
+}
export const getQuestionExamineList = (params: QuestionQueryVO) => {
return request.get({ url: '/exam/question/auditList', params })
diff --git a/src/api/system/paper/index.ts b/src/api/system/paper/index.ts
index 9577aa1..48b7d9b 100644
--- a/src/api/system/paper/index.ts
+++ b/src/api/system/paper/index.ts
@@ -72,7 +72,9 @@ export async function getPaperDetailByTaskId(paperId) {
return await request.get({ url: '/exam/qu/getPaper' , params:{paperId} })
}
-
+export async function getPaperDetailCenterByTaskId(paperId) {
+ return await request.get({ url: '/exam/qu/getPaperCenter' , params:{paperId} })
+}
export async function getPaperList(taskId) {
return await request.get({ url: '/exam/paper/getPaperByTaskId' , params:{taskId} })
diff --git a/src/views/paper/audit/BrowerForm.vue b/src/views/paper/audit/BrowerForm.vue
new file mode 100644
index 0000000..e083128
--- /dev/null
+++ b/src/views/paper/audit/BrowerForm.vue
@@ -0,0 +1,971 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/paper/audit/ChoiceForm.vue b/src/views/paper/audit/ChoiceForm.vue
index 3ae5f85..5d48839 100644
--- a/src/views/paper/audit/ChoiceForm.vue
+++ b/src/views/paper/audit/ChoiceForm.vue
@@ -349,9 +349,12 @@ const open = async (queryParams: any ,type: string, id?: number) => {
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
+ console.log(id+"idid")
// 修改时,设置数据
if (id) {
+
+
formLoading.value = true
try {
formData.value = await QuestionApi.getQuestionnotId(id)
@@ -419,13 +422,10 @@ const submitForm = async () => {
formLoading.value = true
try {
const data = formData.value as unknown
- if (formType.value === 'create') {
- await QuestionApi.addQuestion(data)
- message.success(t('common.createSuccess'))
- } else {
+
await QuestionApi.editQuestionNoAudit(data)
message.success(t('common.updateSuccess'))
- }
+
dialogVisible.value = false
// 发送操作成功的事件
emit('success')
@@ -449,8 +449,14 @@ const resetForm = () => {
audit: '',
subjectName: '',
status: '',
- resourceValue: ''
+ resourceValue: '',
+
}
+ radio.value = 'A',
+ // 清空 optionsContent 的属性
+ Object.keys(optionsContent).forEach(key => {
+ delete optionsContent[key]
+ })
formRef.value?.resetFields()
}
diff --git a/src/views/paper/audit/FileForm.vue b/src/views/paper/audit/FileForm.vue
new file mode 100644
index 0000000..e1967c9
--- /dev/null
+++ b/src/views/paper/audit/FileForm.vue
@@ -0,0 +1,993 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/paper/audit/MysqlForm.vue b/src/views/paper/audit/MysqlForm.vue
new file mode 100644
index 0000000..9d6a215
--- /dev/null
+++ b/src/views/paper/audit/MysqlForm.vue
@@ -0,0 +1,1149 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/paper/audit/components/FileForm.vue b/src/views/paper/audit/components/FileForm.vue
new file mode 100644
index 0000000..12552c5
--- /dev/null
+++ b/src/views/paper/audit/components/FileForm.vue
@@ -0,0 +1,107 @@
+
+
+
+
diff --git a/src/views/paper/audit/index.vue b/src/views/paper/audit/index.vue
index acce65b..a5f0641 100644
--- a/src/views/paper/audit/index.vue
+++ b/src/views/paper/audit/index.vue
@@ -295,6 +295,12 @@
+
+
+
+
+
+
-
\ No newline at end of file
+
+ try {
+ QuestionApi.changePaperQu( payload); // 根据实际路径修改
+
+ message.success('换题成功');
+
+ } catch (error) {
+ console.error('换题请求出错:', error);
+ message.error('请求失败,请稍后重试');
+ }
+
+ // 关闭弹窗
+ visibleChange.value = false;
+
+
+
+};
+
+
+
+const choiceSubjects = ["选择题", "单选题", "多选题"];
+const programmingSubjects = ["程序设计"];
+
+function isChoiceQuestion(subjectName) {
+ return choiceSubjects.some(item => subjectName.includes(item));
+}
+
+function isProgrammingQuestion(subjectName) {
+ return programmingSubjects.some(item => subjectName.includes(item));
+}
+const isCodingTestQuestion = (subjectName: string): boolean => {
+ return subjectName === '编程题';
+};
+
+function optionLabel(index) {
+ return String.fromCharCode(65 + index); // A, B, C, D ...
+}
+
+
+
+
diff --git a/src/views/task/exam/components/steps/step2/components/step-look.vue b/src/views/task/exam/components/steps/step2/components/step-look.vue
index 0c2ad17..b4bf2e1 100644
--- a/src/views/task/exam/components/steps/step2/components/step-look.vue
+++ b/src/views/task/exam/components/steps/step2/components/step-look.vue
@@ -44,13 +44,13 @@
style="background-color: #f5f5f5; padding: 10px; border-radius: 4px; overflow-x: auto;"
>{{ item.analysis }}
-
- 测试用例 {{ aIndex + 1 }}:输入: {{ answer.contentIn }} | 输出: {{ answer.content }} | 占比: {{ answer.scoreRate }}%
-
+ 测试用例 {{ aIndex + 1 }}:输入: {{ answer.contentIn }} | 输出: {{ answer.content }} | 占比: {{ answer.scoreRate }}
+ -->
diff --git a/src/views/task/exam/components/steps/step2/index.vue b/src/views/task/exam/components/steps/step2/index.vue
index 031308e..5819ae6 100644
--- a/src/views/task/exam/components/steps/step2/index.vue
+++ b/src/views/task/exam/components/steps/step2/index.vue
@@ -162,6 +162,7 @@
v-model="showEdit"
:data="current"
ref="taskEditRef"
+ :paper-Id="currentPaperId"
@done="reload"
/>
{
}
};
// 打开编辑弹窗
-const openEdit = (type: string, row?: object) => {
+const openEdit = (type: string, row?: any)=> {
+ if (row?.counts > 0) {
+ ElMessage.warning('当前试卷使用次数大于0,不允许更换试题');
+ return;
+ }
showEdit.value = true;
- current.value = row;
+ currentPaperId.value = row.paperId ?? null;
nextTick(() => {
- taskEditRef.value?.open(type, row);
+ taskEditRef.value?.open(type, row.paperId);
});
};
const currentPaperId = ref(null);
diff --git a/src/views/task/exam/components/steps/step3/index.vue b/src/views/task/exam/components/steps/step3/index.vue
index 2dbe3f0..c082321 100644
--- a/src/views/task/exam/components/steps/step3/index.vue
+++ b/src/views/task/exam/components/steps/step3/index.vue
@@ -128,26 +128,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/src/views/task/selftrans/ai/components/steps/step3/index.vue b/src/views/task/selftrans/ai/components/steps/step3/index.vue
index 8ff3f11..9eb040c 100644
--- a/src/views/task/selftrans/ai/components/steps/step3/index.vue
+++ b/src/views/task/selftrans/ai/components/steps/step3/index.vue
@@ -147,12 +147,12 @@
/>
-
+
diff --git a/src/views/task/selftrans/collegeexam/components/steps/step3/index.vue b/src/views/task/selftrans/collegeexam/components/steps/step3/index.vue
index 9832579..e2f31bd 100644
--- a/src/views/task/selftrans/collegeexam/components/steps/step3/index.vue
+++ b/src/views/task/selftrans/collegeexam/components/steps/step3/index.vue
@@ -129,25 +129,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+
+
+
+
+
+
+
diff --git a/src/views/task/selftrans/module/components/steps/step3/index.vue b/src/views/task/selftrans/module/components/steps/step3/index.vue
index 9832579..0420a8e 100644
--- a/src/views/task/selftrans/module/components/steps/step3/index.vue
+++ b/src/views/task/selftrans/module/components/steps/step3/index.vue
@@ -130,24 +130,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
+
+
+
+
+
+
+
diff --git a/src/views/task/selftrans/random/components/steps/step3/index.vue b/src/views/task/selftrans/random/components/steps/step3/index.vue
index 8ae0fb6..884cb48 100644
--- a/src/views/task/selftrans/random/components/steps/step3/index.vue
+++ b/src/views/task/selftrans/random/components/steps/step3/index.vue
@@ -130,23 +130,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/src/views/task/sprint/components/steps/step2/components/step-edit.vue b/src/views/task/sprint/components/steps/step2/components/step-edit.vue
index 2d2e50c..715811a 100644
--- a/src/views/task/sprint/components/steps/step2/components/step-edit.vue
+++ b/src/views/task/sprint/components/steps/step2/components/step-edit.vue
@@ -1,181 +1,634 @@
+