|
@@ -53,7 +53,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- 右侧工作区域 -->
|
|
<!-- 右侧工作区域 -->
|
|
|
- <div class="main-work" :style="{ background: showExamDetail ? 'transparent' : '#ebf3ff', position: 'relative' }">
|
|
|
|
|
|
|
+ <div class="main-work" :style="{ background: showExamDetail ? '#f5f7fa' : '#ebf3ff', position: 'relative' }">
|
|
|
|
|
|
|
|
<!-- 头部 -->
|
|
<!-- 头部 -->
|
|
|
<div class="work-header" v-if="showExamDetail">
|
|
<div class="work-header" v-if="showExamDetail">
|
|
@@ -82,7 +82,7 @@
|
|
|
|
|
|
|
|
<div class="form-group" style="position: relative;">
|
|
<div class="form-group" style="position: relative;">
|
|
|
<label class="form-label">试卷名称</label>
|
|
<label class="form-label">试卷名称</label>
|
|
|
- <input type="text" class="form-control" v-model="examName" maxlength="32" placeholder="请输入试卷名称..." :disabled="isGenerating">
|
|
|
|
|
|
|
+ <input type="text" class="form-control" v-model="examName" maxlength="32" placeholder="请输入试卷名称(未输入将根据出题内容自动生成)..." :disabled="isGenerating">
|
|
|
<div class="char-count">{{ examName?.length || 0 }}/32</div>
|
|
<div class="char-count">{{ examName?.length || 0 }}/32</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -116,7 +116,13 @@
|
|
|
<!-- =============== 题型配置区域 开始 =============== -->
|
|
<!-- =============== 题型配置区域 开始 =============== -->
|
|
|
<div class="config-section">
|
|
<div class="config-section">
|
|
|
<div class="config-header">
|
|
<div class="config-header">
|
|
|
- <h3>题型配置</h3>
|
|
|
|
|
|
|
+ <div style="display: flex; align-items: center; gap: 24px;">
|
|
|
|
|
+ <h3>题型配置</h3>
|
|
|
|
|
+ <div class="require-basis-toggle" style="display: flex; align-items: center;">
|
|
|
|
|
+ <input type="checkbox" id="requireBasis" v-model="requireBasis" :disabled="isGenerating" style="margin-right: 8px; cursor: pointer; width: 16px; height: 16px;">
|
|
|
|
|
+ <label for="requireBasis" style="font-size: 14px; color: #666; cursor: pointer; user-select: none;">每题附带出题依据</label>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
<div class="total-score">试卷总分 {{ calculatedTotalScore }}</div>
|
|
<div class="total-score">试卷总分 {{ calculatedTotalScore }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -267,7 +273,7 @@
|
|
|
<!-- 题型列表 -->
|
|
<!-- 题型列表 -->
|
|
|
<div class="question-sections">
|
|
<div class="question-sections">
|
|
|
<!-- 单选题 -->
|
|
<!-- 单选题 -->
|
|
|
- <div class="question-section">
|
|
|
|
|
|
|
+ <div v-if="currentExam.singleChoice && currentExam.singleChoice.count > 0" class="question-section">
|
|
|
<div class="section-header" @click="isGenerating ? null : toggleSection('single')" :style="{ cursor: isGenerating ? 'not-allowed' : 'pointer' }">
|
|
<div class="section-header" @click="isGenerating ? null : toggleSection('single')" :style="{ cursor: isGenerating ? 'not-allowed' : 'pointer' }">
|
|
|
<div class="section-title">
|
|
<div class="section-title">
|
|
|
<span class="section-number">一</span>
|
|
<span class="section-number">一</span>
|
|
@@ -334,12 +340,16 @@
|
|
|
<span class="answer-label">正确答案:</span>
|
|
<span class="answer-label">正确答案:</span>
|
|
|
<span class="answer-value">{{ question.selectedAnswer || '未设置' }}</span>
|
|
<span class="answer-value">{{ question.selectedAnswer || '未设置' }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div v-if="question.basis" class="basis-section" style="margin-top: 12px; font-size: 14px; color: #666; background: #f8f9fa; padding: 10px 14px; border-radius: 6px; border-left: 3px solid #3e7bfa;">
|
|
|
|
|
+ <span style="font-weight: 600; color: #374151;">出题依据:</span>
|
|
|
|
|
+ <span style="line-height: 1.5;">{{ question.basis }}</span>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- 判断题 -->
|
|
<!-- 判断题 -->
|
|
|
- <div class="question-section">
|
|
|
|
|
|
|
+ <div v-if="currentExam.judge && currentExam.judge.count > 0" class="question-section">
|
|
|
<div class="section-header" @click="isGenerating ? null : toggleSection('judge')" :style="{ cursor: isGenerating ? 'not-allowed' : 'pointer' }">
|
|
<div class="section-header" @click="isGenerating ? null : toggleSection('judge')" :style="{ cursor: isGenerating ? 'not-allowed' : 'pointer' }">
|
|
|
<div class="section-title">
|
|
<div class="section-title">
|
|
|
<span class="section-number">二</span>
|
|
<span class="section-number">二</span>
|
|
@@ -405,12 +415,16 @@
|
|
|
<span class="answer-label">正确答案:</span>
|
|
<span class="answer-label">正确答案:</span>
|
|
|
<span class="answer-value">{{ question.selectedAnswer || '未设置' }}</span>
|
|
<span class="answer-value">{{ question.selectedAnswer || '未设置' }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div v-if="question.basis" class="basis-section" style="margin-top: 12px; font-size: 14px; color: #666; background: #f8f9fa; padding: 10px 14px; border-radius: 6px; border-left: 3px solid #3e7bfa;">
|
|
|
|
|
+ <span style="font-weight: 600; color: #374151;">出题依据:</span>
|
|
|
|
|
+ <span style="line-height: 1.5;">{{ question.basis }}</span>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- 多选题 -->
|
|
<!-- 多选题 -->
|
|
|
- <div class="question-section">
|
|
|
|
|
|
|
+ <div v-if="currentExam.multiple && currentExam.multiple.count > 0" class="question-section">
|
|
|
<div class="section-header" @click="isGenerating ? null : toggleSection('multiple')" :style="{ cursor: isGenerating ? 'not-allowed' : 'pointer' }">
|
|
<div class="section-header" @click="isGenerating ? null : toggleSection('multiple')" :style="{ cursor: isGenerating ? 'not-allowed' : 'pointer' }">
|
|
|
<div class="section-title">
|
|
<div class="section-title">
|
|
|
<span class="section-number">三</span>
|
|
<span class="section-number">三</span>
|
|
@@ -477,12 +491,16 @@
|
|
|
<span class="answer-label">正确答案:</span>
|
|
<span class="answer-label">正确答案:</span>
|
|
|
<span class="answer-value">{{ (question.selectedAnswers || []).join(', ') || '未设置' }}</span>
|
|
<span class="answer-value">{{ (question.selectedAnswers || []).join(', ') || '未设置' }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div v-if="question.basis" class="basis-section" style="margin-top: 12px; font-size: 14px; color: #666; background: #f8f9fa; padding: 10px 14px; border-radius: 6px; border-left: 3px solid #3e7bfa;">
|
|
|
|
|
+ <span style="font-weight: 600; color: #374151;">出题依据:</span>
|
|
|
|
|
+ <span style="line-height: 1.5;">{{ question.basis }}</span>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<!-- 简答题 -->
|
|
<!-- 简答题 -->
|
|
|
- <div class="question-section">
|
|
|
|
|
|
|
+ <div v-if="currentExam.short && currentExam.short.count > 0" class="question-section">
|
|
|
<div class="section-header" @click="isGenerating ? null : toggleSection('short')" :style="{ cursor: isGenerating ? 'not-allowed' : 'pointer' }">
|
|
<div class="section-header" @click="isGenerating ? null : toggleSection('short')" :style="{ cursor: isGenerating ? 'not-allowed' : 'pointer' }">
|
|
|
<div class="section-title">
|
|
<div class="section-title">
|
|
|
<span class="section-number">四</span>
|
|
<span class="section-number">四</span>
|
|
@@ -534,6 +552,10 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div v-if="question.basis" class="basis-section" style="margin-top: 12px; font-size: 14px; color: #666; background: #f8f9fa; padding: 10px 14px; border-radius: 6px; border-left: 3px solid #3e7bfa;">
|
|
|
|
|
+ <span style="font-weight: 600; color: #374151;">出题依据:</span>
|
|
|
|
|
+ <span style="line-height: 1.5;">{{ question.basis }}</span>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -661,8 +683,9 @@ import attachmentIcon from '@/assets/Chat/9.png'
|
|
|
// 响应式数据
|
|
// 响应式数据
|
|
|
const selectedFunction = ref("ai");
|
|
const selectedFunction = ref("ai");
|
|
|
const selectedProjectType = ref("bridge");
|
|
const selectedProjectType = ref("bridge");
|
|
|
-const examName = ref("桥梁工程施工技术考核");
|
|
|
|
|
|
|
+const examName = ref("");
|
|
|
const totalScore = ref(100);
|
|
const totalScore = ref(100);
|
|
|
|
|
+const requireBasis = ref(false);
|
|
|
const showExamDetail = ref(false);
|
|
const showExamDetail = ref(false);
|
|
|
const currentTime = ref("");
|
|
const currentTime = ref("");
|
|
|
|
|
|
|
@@ -1038,21 +1061,10 @@ const selectFunction = (functionType) => {
|
|
|
const selectProjectType = (typeKey) => {
|
|
const selectProjectType = (typeKey) => {
|
|
|
selectedProjectType.value = typeKey;
|
|
selectedProjectType.value = typeKey;
|
|
|
console.log("选择工程类型:", projectTypes[typeKey].name);
|
|
console.log("选择工程类型:", projectTypes[typeKey].name);
|
|
|
-
|
|
|
|
|
- // 自动更新试卷名称
|
|
|
|
|
- const projectTypeName = projectTypes[typeKey].name;
|
|
|
|
|
- examName.value = `${projectTypeName}工程施工技术考核`;
|
|
|
|
|
-
|
|
|
|
|
- // 同时更新当前试卷的标题
|
|
|
|
|
- if (currentExam.value) {
|
|
|
|
|
- currentExam.value.title = examName.value;
|
|
|
|
|
- }
|
|
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const clearSettings = () => {
|
|
const clearSettings = () => {
|
|
|
- // 根据当前选择的工程类型设置试卷名称
|
|
|
|
|
- const projectTypeName = projectTypes[selectedProjectType.value].name;
|
|
|
|
|
- examName.value = `${projectTypeName}工程施工技术考核`;
|
|
|
|
|
|
|
+ examName.value = "";
|
|
|
totalScore.value = 100; // 清空时配置总分恢复默认值 100
|
|
totalScore.value = 100; // 清空时配置总分恢复默认值 100
|
|
|
// 保留原数组引用,更新每个对象的属性,避免破坏 Vue 3 响应式绑定
|
|
// 保留原数组引用,更新每个对象的属性,避免破坏 Vue 3 响应式绑定
|
|
|
questionTypes.value.forEach(type => {
|
|
questionTypes.value.forEach(type => {
|
|
@@ -1109,16 +1121,6 @@ const adjustQuestionCount = (type, delta) => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const generateExam = async () => {
|
|
const generateExam = async () => {
|
|
|
- if (!examName.value.trim()) {
|
|
|
|
|
- ElMessage.warning("请输入试卷名称");
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (examName.value.trim().length === 0) {
|
|
|
|
|
- ElMessage.warning("试卷名称不能为空");
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
// 检查总分是否超过限制
|
|
// 检查总分是否超过限制
|
|
|
if (totalScore.value > 1000) {
|
|
if (totalScore.value > 1000) {
|
|
|
ElMessage.warning("试卷总分不能超过1000分");
|
|
ElMessage.warning("试卷总分不能超过1000分");
|
|
@@ -1325,7 +1327,8 @@ const fetchExamPrompt = async (mode = 'ai') => {
|
|
|
examTitle: examName.value,
|
|
examTitle: examName.value,
|
|
|
totalScore: totalScore.value,
|
|
totalScore: totalScore.value,
|
|
|
questionTypes: normalizedQuestionTypes,
|
|
questionTypes: normalizedQuestionTypes,
|
|
|
- pptContent: finalContentBasis
|
|
|
|
|
|
|
+ pptContent: finalContentBasis,
|
|
|
|
|
+ requireBasis: requireBasis.value
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
@@ -1549,6 +1552,7 @@ const normalizeQuestions = (questions = [], sectionKey) => {
|
|
|
options: normalizeOptions(question.options),
|
|
options: normalizeOptions(question.options),
|
|
|
selectedAnswer: question.selectedAnswer || question.correct_answer || question.answer || question['正确答案'] || question['答案'] || "",
|
|
selectedAnswer: question.selectedAnswer || question.correct_answer || question.answer || question['正确答案'] || question['答案'] || "",
|
|
|
analysis: question.analysis || question.explanation || question['解析'] || "",
|
|
analysis: question.analysis || question.explanation || question['解析'] || "",
|
|
|
|
|
+ basis: question.basis || question['出题依据'] || "",
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1557,6 +1561,7 @@ const normalizeQuestions = (questions = [], sectionKey) => {
|
|
|
text: question.text || question.question_text || question.question || question.title || question.content || question['题干'] || question['题目'] || "",
|
|
text: question.text || question.question_text || question.question || question.title || question.content || question['题干'] || question['题目'] || "",
|
|
|
selectedAnswer: question.selectedAnswer || question.correct_answer || question.answer || question['正确答案'] || question['答案'] || "",
|
|
selectedAnswer: question.selectedAnswer || question.correct_answer || question.answer || question['正确答案'] || question['答案'] || "",
|
|
|
analysis: question.analysis || question.explanation || question['解析'] || "",
|
|
analysis: question.analysis || question.explanation || question['解析'] || "",
|
|
|
|
|
+ basis: question.basis || question['出题依据'] || "",
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1567,6 +1572,7 @@ const normalizeQuestions = (questions = [], sectionKey) => {
|
|
|
options: normalizeOptions(question.options),
|
|
options: normalizeOptions(question.options),
|
|
|
selectedAnswers: Array.isArray(selectedAnswers) ? selectedAnswers : [selectedAnswers].filter(Boolean),
|
|
selectedAnswers: Array.isArray(selectedAnswers) ? selectedAnswers : [selectedAnswers].filter(Boolean),
|
|
|
analysis: question.analysis || question.explanation || question['解析'] || "",
|
|
analysis: question.analysis || question.explanation || question['解析'] || "",
|
|
|
|
|
+ basis: question.basis || question['出题依据'] || "",
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1574,6 +1580,7 @@ const normalizeQuestions = (questions = [], sectionKey) => {
|
|
|
text: question.text || question.question_text || question.question || question.title || question.content || question['题干'] || question['题目'] || "",
|
|
text: question.text || question.question_text || question.question || question.title || question.content || question['题干'] || question['题目'] || "",
|
|
|
outline: question.outline || question.answer_outline || question['答题要点'] || { keyFactors: question.answer || question['答案'] || "答题要点、关键因素、示例答案" },
|
|
outline: question.outline || question.answer_outline || question['答题要点'] || { keyFactors: question.answer || question['答案'] || "答题要点、关键因素、示例答案" },
|
|
|
analysis: question.analysis || question.explanation || question['解析'] || "",
|
|
analysis: question.analysis || question.explanation || question['解析'] || "",
|
|
|
|
|
+ basis: question.basis || question['出题依据'] || "",
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
@@ -1834,6 +1841,10 @@ const generateDefaultQuestions = (type, count) => {
|
|
|
// 更新当前试卷数据
|
|
// 更新当前试卷数据
|
|
|
const updateCurrentExam = (generatedExam) => {
|
|
const updateCurrentExam = (generatedExam) => {
|
|
|
currentExam.value = generatedExam;
|
|
currentExam.value = generatedExam;
|
|
|
|
|
+ // 如果用户没有输入试卷名称,自动使用生成的试卷名称
|
|
|
|
|
+ if (!examName.value.trim() && generatedExam.title) {
|
|
|
|
|
+ examName.value = generatedExam.title;
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// 返回配置页面
|
|
// 返回配置页面
|
|
@@ -3804,8 +3815,8 @@ onUnmounted(() => {
|
|
|
|
|
|
|
|
/* 工作头部 */
|
|
/* 工作头部 */
|
|
|
.work-header {
|
|
.work-header {
|
|
|
- background: transparent;
|
|
|
|
|
- padding: 40px 0px 0px 18px;
|
|
|
|
|
|
|
+ background: white; /* 恢复工作头部的白色背景 */
|
|
|
|
|
+ padding: 40px 0px 20px 18px; /* 增加底部内边距,使其不那么紧凑 */
|
|
|
|
|
|
|
|
h2 {
|
|
h2 {
|
|
|
margin: 0;
|
|
margin: 0;
|
|
@@ -4023,10 +4034,11 @@ onUnmounted(() => {
|
|
|
|
|
|
|
|
.config-header {
|
|
.config-header {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
- justify-content: center; /* 改为靠左对齐,而不是两端对齐 */
|
|
|
|
|
|
|
+ justify-content: space-between; /* 改为两端对齐以实现自适应 */
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
- gap: 960px; /* 控制“题型配置”和“试卷总分”之间的固定间距 */
|
|
|
|
|
- margin-bottom: 6px;
|
|
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ max-width: 1150px; /* 与输入框区域宽度保持一致 */
|
|
|
|
|
+ margin: 0 auto 6px auto; /* 居中并保持底部间距 */
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.config-header h3 {
|
|
.config-header h3 {
|
|
@@ -4985,34 +4997,38 @@ onUnmounted(() => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-/* 固定布局,支持横向滚动 */
|
|
|
|
|
|
|
+/* 界面外侧尺寸自适应 */
|
|
|
.chat-container {
|
|
.chat-container {
|
|
|
- min-width: 1428px;
|
|
|
|
|
|
|
+ min-width: 0;
|
|
|
|
|
+ width: 100%;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.work-content {
|
|
.work-content {
|
|
|
- min-width: 1428px;
|
|
|
|
|
|
|
+ min-width: 0;
|
|
|
|
|
+ width: 100%;
|
|
|
overflow-x: auto;
|
|
overflow-x: auto;
|
|
|
|
|
+ background: white; /* 恢复原有的白色背景 */
|
|
|
|
|
|
|
|
&.exam-detail-mode {
|
|
&.exam-detail-mode {
|
|
|
- background: transparent;
|
|
|
|
|
|
|
+ background: #f5f7fa; /* 详情模式使用浅灰色背景,避免变黑 */
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.exam-workshop-card {
|
|
.exam-workshop-card {
|
|
|
- min-width: 1428px; /* 与AI写作保持一致 */
|
|
|
|
|
|
|
+ min-width: 0; /* 移除与AI写作保持一致的固定宽度 */
|
|
|
|
|
+ width: 100%;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* 考试详情页样式 */
|
|
/* 考试详情页样式 */
|
|
|
.exam-detail-card {
|
|
.exam-detail-card {
|
|
|
- // background: white;
|
|
|
|
|
|
|
+ background: white; /* 恢复被注释掉的白色背景 */
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
min-height: 800px;
|
|
min-height: 800px;
|
|
|
- // padding: 32px;
|
|
|
|
|
|
|
+ padding: 32px; /* 恢复被注释掉的内边距 */
|
|
|
border-radius: 16px;
|
|
border-radius: 16px;
|
|
|
// box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
|
|
// box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
|
|
|
max-width: 1528px;
|
|
max-width: 1528px;
|
|
|
- min-width: 1428px;
|
|
|
|
|
|
|
+ min-width: 0;
|
|
|
|
|
|
|
|
.detail-header {
|
|
.detail-header {
|
|
|
display: flex;
|
|
display: flex;
|