浏览代码

修改显示

yangg 2 月之前
父节点
当前提交
6dca1fe135
共有 2 个文件被更改,包括 38 次插入17 次删除
  1. 1 1
      .env.development
  2. 37 16
      src/views/JobApplication/report/index.vue

+ 1 - 1
.env.development

@@ -2,7 +2,7 @@
 ENV = 'development'
 #https://minlong.raycos.com.cn
 # 本地环境接口地址 121.36.251.245
-VITE_API_URL = 'https://minlong.raycos.com.cn'
+VITE_API_URL = 'http://192.168.66.187:8083'
 
 # 是否启用按钮权限
 VITE_PM_ENABLED = true

+ 37 - 16
src/views/JobApplication/report/index.vue

@@ -315,14 +315,31 @@ const updateCandidateInfo = (data: any) => {
   if (interview_progress && interview_progress.length > 0) {
     candidateInfo.value.interviewRecord = interview_progress
       .filter((q: any) => q.video_answer)
-      .map((q: any) => ({
-        question: q.question_text || '未提供问题',
-        answer: q.video_answer?.transcript || '未提供回答',
-        analysis: q.video_answer?.ai_analysis?.comment || '面试官正在评估中',
-        score: q.video_answer?.ai_score ? `${q.video_answer.ai_score}分` : '评估中',
-        videoUrl: q.video_answer?.video_url || '',
-        thumbnail: '/images/video-placeholder.jpg'
-      }))
+      .map((q: any) => {
+        // 处理答案文本
+        let answerText = q.video_answer?.transcript || '未提供回答';
+        let is_correct = false;
+        // 如果有answer_data且包含选项,则使用选项文本
+        if (q.answer_data && q.answer_data.selected_option_details && q.answer_data.selected_option_details.length > 0) {
+          answerText = q.answer_data.selected_option_details
+            .map((option: any) => option.option_text)
+            .join(', ');
+            is_correct = q.answer_data.selected_option_details
+            .map((option: any) => option.is_correct)
+          
+        }
+        console.log(q)
+        return {
+          question: q.question_text || '未提供问题',
+          answer: answerText,
+          analysis: q.video_answer?.ai_analysis?.comment || '面试官正在评估中',
+          score: q.video_answer?.ai_score ? `${q.video_answer.ai_score}分` : '评估中',
+          question_form: q.question_form,
+          is_correct:is_correct,
+          videoUrl: q.video_answer?.video_url || '',
+          thumbnail: '/images/video-placeholder.jpg'
+        }
+      })
   }
   
   // 更新DUV分析
@@ -646,7 +663,7 @@ const handleVideoError = (event: Event) => {
               <div class="mb-2">
                 <h3 class="font-semibold">问题:{{ record.question }}</h3>
                 <p class="text-gray-600 mt-2">答案:{{ record.answer }}</p>
-                <p class="text-gray-500 mt-2 text-sm">分析:{{ record.analysis }}</p>
+                <p class="text-gray-500 mt-2 text-sm" v-if="record.question_form === 0">分析:{{ record.analysis }}</p>
                 
                 <!-- 视频回放 -->
                 <div v-if="record.videoUrl" class="mt-4">
@@ -656,18 +673,22 @@ const handleVideoError = (event: Event) => {
                       controls
                       :src="record.videoUrl"
                       preload="metadata"
-                      :poster="record.thumbnail || fallbackImageBase64Ref.value"
+                      :poster="record.thumbnail || fallbackImageBase64Ref"
                       @loadeddata="handleVideoLoaded"
                       @error="handleVideoError"
                     >
-                      <source :src="record.videoUrl" type="video/mp4">
-                      您的浏览器不支持视频播放。
+                      <!-- <source src="http://121.36.251.245:9000/minlong/tenant_1/general_uploads/d9082487afc4499c97407aa3cebd1923.jpeg" type="video/mp4">
+                      您的浏览器不支持视频播放。 -->
                     </video>
                   </div>
                 </div>
                 
                 <div class="mt-2 flex justify-end">
-                  <span class="text-blue-500">得分:{{ record.score }}</span>
+                  <span class="text-blue-500" v-if="record.question_form === 0">得分:{{ record.score }}</span>
+                  <span class="text-gray-500" v-else>
+                    <span class="text-green-500" v-if="record.is_correct">正确</span>
+                    <span class="text-red-500" v-else>错误</span>
+                  </span>
                 </div>
               </div>
             </div>
@@ -688,12 +709,12 @@ const handleVideoError = (event: Event) => {
                       controls
                       :src="video.url"
                       preload="metadata"
-                      :poster="video.thumbnail || fallbackImageBase64Ref.value"
+                      :poster="video.thumbnail || fallbackImageBase64Ref"
                       @loadeddata="handleVideoLoaded"
                       @error="handleVideoError"
                     >
-                      <source :src="video.url" type="video/mp4">
-                      您的浏览器不支持视频播放。
+                    <!--   <source src="http://121.36.251.245:9000/minlong/tenant_1/general_uploads/d9082487afc4499c97407aa3cebd1923.jpeg" type="video/mp4">
+                      您的浏览器不支持视频播放。 -->
                     </video>
                   </div>
                   <p class="text-sm text-gray-600 mt-2">{{ video.description }}</p>