1 |
- import{a as G,aB as K,r as Q,q as W,aj as Z,c as n,o as r,b as e,S as J,K as O,M as c,Q as d,R as x,a9 as N,G as m}from"./vue.D1BjjNmv.js";import{_ as X}from"./_plugin-vue_export-helper.DlAUqK2U.js";const Y={class:"page-container"},ee={class:"content-container"},se={class:"max-w-4xl mx-auto p-6"},te={key:0,class:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative",role:"alert"},oe={class:"block sm:inline"},ae={key:1,class:"flex flex-col items-center justify-center py-12 bg-gray-50 rounded-lg"},ie={key:2,class:"space-y-4"},ne={class:"mb-4"},re={class:"flex items-start space-x-2"},de={class:"bg-blue-100 text-blue-800 px-2 py-1 rounded text-sm"},le={class:"bg-gray-100 text-gray-800 px-2 py-1 rounded text-sm"},ce={class:"flex-1"},_e={class:"font-semibold text-gray-800"},ue={key:0,class:"mt-4"},pe={class:"bg-white p-4 rounded-lg"},ve={key:0,class:"space-y-3"},he={class:"flex items-center justify-between"},ge={class:"flex-1"},xe={class:"text-gray-700"},me={class:"flex items-center space-x-2"},fe={key:0,class:"text-green-500"},ye={key:0,class:"text-blue-500"},we={class:"mt-4 flex justify-between items-center"},be={class:"text-gray-600"},ke={key:0},qe={key:1,class:"mt-4"},je={class:"flex space-x-4"},Ie={class:"w-2/3"},Le={class:"bg-white p-4 rounded-lg"},Ve={class:"mb-4"},Be={class:"flex items-start space-x-2"},Ce={class:"flex-1"},Re={class:"text-gray-700"},Fe={class:"flex items-start space-x-2"},Me={class:"flex-1"},Qe={class:"text-gray-600 m-0"},Ne={class:"mt-1 text-blue-500"},Se={class:"w-1/3"},$e={class:"video-container"},Ae=["src","poster"],He={key:0,class:"mt-4 pl-8 border-l-2 border-gray-200"},Te={class:"flex items-start space-x-2"},Ue={class:"flex-1"},ze={class:"font-medium text-gray-800"},De={class:"mt-2"},Pe={class:"flex space-x-4"},Ee={class:"w-2/3"},Ge={class:"bg-white p-4 rounded-lg"},Ke={class:"mb-4"},We={class:"flex items-start space-x-2"},Ze={class:"flex-1"},Je={class:"text-gray-700"},Oe={class:"flex items-start space-x-2"},Xe={class:"flex-1"},Ye={class:"text-gray-600 m-0"},es={class:"mt-1 text-blue-500"},ss={key:0,class:"w-1/3"},ts={class:"video-container"},os=["src","poster"],as={key:2,class:"mt-4"},is={class:"grid grid-cols-2 gap-4"},ns={class:"bg-white p-4 rounded-lg"},rs={class:"aspect-w-16 aspect-h-9 rounded-lg overflow-hidden bg-gray-100"},ds=["src"],ls={class:"bg-white p-4 rounded-lg"},cs={key:0,class:"space-y-3"},_s={class:"flex items-center justify-between"},us={class:"flex-1"},ps={class:"text-gray-700"},vs={class:"flex items-center space-x-2"},hs={key:0,class:"text-green-500"},gs={class:"mt-4 flex justify-between items-center"},xs={class:"text-gray-600"},ms=G({__name:"topic",setup(fs){const S=K(),f=Q([]),C=Q(!0),R=Q(""),p=Q("data:image/svg+xml;base64,PHN2ZyB..."),D=i=>{const t=i.target;t&&(t.src=p.value,t.onerror=null)},A=i=>{const t=i.target;t&&(t.readyState>=1?T(t):t.addEventListener("loadedmetadata",()=>{T(t)}))},H=i=>{const t=i.target;t&&(t.poster=p.value,console.error("视频加载错误"))},P=async()=>{var i;C.value=!0;try{const t=S.query.id||"1",_=S.query.tenant_id||"1",s=S.query.applicationId||"1",v=await(await fetch(`https://backend.qicai321.com/api/job/application_detail?tenant_id=1&application_id=${s}`)).json();if(v.code===2e3&&((i=v.data)!=null&&i.interview_progress)){const F=v.data.interview_progress.filter(o=>o.video_answer||o.answer_data).map(o=>{var u,h;const l={question:o.question_text||"未提供问题",answer:"",analysis:"",score:"",question_form:o.question_form,parent_question_id:o.parent_question_id,options:o.options,answer_data:o.answer_data,follow_up_questions:[],question_id:o.question_id};return o.video_answer&&(l.answer=o.video_answer.transcript||"",l.analysis=((u=o.video_answer.ai_analysis)==null?void 0:u.comment)||"",l.score=o.video_answer.ai_score?`${o.video_answer.ai_score}分`:"",l.videoUrl=o.video_answer.video_url||""),o.answer_data&&(l.answer=o.answer_data.text_answer||"",l.is_correct=((h=o.answer_data.selected_option_details)==null?void 0:h.some(M=>M.is_correct))||!1),o.question_form===3&&(l.question_image_url=o.question_image_url||""),l}),w=[],b=[];F.forEach(o=>{o.question_form===5&&o.parent_question_id?b.push(o):w.push(o)});const k=w.sort((o,l)=>{const u=h=>{switch(h){case 0:return 1;case 5:return 2;case 1:return 3;case 2:return 4;case 3:return 5;case 4:return 6;default:return 99}};return u(o.question_form||-1)-u(l.question_form||-1)});[...b].reverse().forEach(o=>{const l=k.find(u=>u.question_form===0&&u.question_id===o.parent_question_id);l&&(l.follow_up_questions||(l.follow_up_questions=[]),l.follow_up_questions.unshift(o))}),f.value=k}else R.value=v.msg||"获取数据失败"}catch(t){console.error("获取面试记录失败:",t),R.value="获取数据失败,请稍后重试"}finally{C.value=!1}},T=i=>{const t=()=>{try{if(i.readyState>=2){const _=document.createElement("canvas");_.width=i.videoWidth||320,_.height=i.videoHeight||240;const s=_.getContext("2d");if(s){i.currentTime=.1,s.drawImage(i,0,0,_.width,_.height);const y=_.toDataURL("image/jpeg");i.poster=y,i.removeEventListener("loadeddata",t)}}}catch(_){console.error("捕获视频第一帧失败:",_),i.poster=p.value}};i.addEventListener("loadeddata",t),i.readyState>=2&&t(),i.addEventListener("error",()=>{console.error("视频加载失败"),i.poster=p.value}),setTimeout(()=>{(!i.poster||i.poster==="")&&(i.poster=p.value)},3e3)},E=i=>({0:"视频问答题(AI面试官提问)",1:"单选题(知识检测)",2:"多选题(综合选择)",3:"图片选择题(场景判断)",4:"问卷题(个性测评)",5:"开放问答题(追问互动)"})[i]||"未知题型";return W(()=>{P()}),(i,t)=>{const _=Z("a-spin");return r(),n("div",Y,[e("div",ee,[e("div",se,[J(_,{spinning:C.value,tip:"加载中..."},{default:O(()=>[R.value?(r(),n("div",te,[t[0]||(t[0]=e("strong",{class:"font-bold"},"错误!",-1)),e("span",oe,d(R.value),1)])):!C.value&&(!f.value||f.value.length===0)?(r(),n("div",ae,t[1]||(t[1]=[e("svg",{class:"w-16 h-16 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1),e("h3",{class:"mt-4 text-lg font-medium text-gray-900"},"暂无面试记录",-1),e("p",{class:"mt-1 text-sm text-gray-500"},"当前没有任何面试记录数据",-1)]))):f.value.length>0?(r(),n("div",ie,[(r(!0),n(x,null,N(f.value,(s,y)=>{var v,F,w,b,k,$,o,l,u,h,M,U;return r(),n("div",{key:y,class:"bg-gray-50 rounded-lg p-4"},[e("div",ne,[e("div",re,[e("div",de,"第"+d(y+1)+"题",1),e("div",le,d(E(s.question_form||0)),1),e("div",ce,[e("h3",_e,d(s.question),1)])]),s.question_form===1||s.question_form===2||s.question_form===4?(r(),n("div",ue,[e("div",pe,[s.options&&s.options.length>0?(r(),n("div",ve,[(r(!0),n(x,null,N(s.options,(a,q)=>{var j,I,L,V,g,z;return r(),n("div",{key:q,class:m(["p-3 rounded border",(I=(j=s.answer_data)==null?void 0:j.selected_option_details)!=null&&I.some(B=>B.id===a.id)?"border-blue-300 bg-blue-50":"border-gray-200"])},[e("div",he,[e("div",ge,[e("span",xe,d(a.option_text),1)]),e("div",me,[s.question_form!==4?(r(),n(x,{key:0},[a.is_correct?(r(),n("span",fe,"✓ 正确答案")):c("",!0),(V=(L=s.answer_data)==null?void 0:L.selected_option_details)!=null&&V.some(B=>B.id===a.id)?(r(),n("span",{key:1,class:m(a.is_correct?"text-green-500":"text-red-500")},d(a.is_correct?"(已选 - 正确)":"(已选 - 错误)"),3)):c("",!0)],64)):(r(),n(x,{key:1},[(z=(g=s.answer_data)==null?void 0:g.selected_option_details)!=null&&z.some(B=>B.id===a.id)?(r(),n("span",ye," (已选) ")):c("",!0)],64))])])],2)}),128))])):c("",!0),e("div",we,[e("div",be," 候选人: "+d(((F=(v=s.answer_data)==null?void 0:v.selected_option_details)==null?void 0:F.map(a=>a.option_text).join(", "))||"未作答"),1),s.question_form!==4?(r(),n("div",ke,[e("span",{class:m(["px-3 py-1 rounded-full text-sm",(b=(w=s.answer_data)==null?void 0:w.selected_option_details)!=null&&b.every(a=>a.is_correct)?"bg-green-100 text-green-800":"bg-red-100 text-red-800"])},d(($=(k=s.answer_data)==null?void 0:k.selected_option_details)!=null&&$.every(a=>a.is_correct)?"正确":"错误"),3)])):c("",!0)])])])):s.question_form===0||s.question_form===5?(r(),n("div",qe,[e("div",je,[e("div",Ie,[e("div",Le,[e("div",Ve,[e("div",Be,[t[2]||(t[2]=e("div",{class:"bg-green-100 text-green-800 px-2 py-1 rounded text-sm"},"候选人",-1)),e("div",Ce,[e("p",Re,d(s.answer),1)])])]),e("div",null,[e("div",Fe,[t[3]||(t[3]=e("div",{class:"bg-yellow-100 text-yellow-800 px-2 py-1 rounded text-sm"},"AI评分",-1)),e("div",Me,[e("p",Qe,d(s.analysis),1),e("div",Ne,"得分:"+d(s.score),1)])])])])]),e("div",Se,[e("div",$e,[e("video",{class:"w-full h-full object-cover rounded-lg",controls:"",src:s.videoUrl,preload:"metadata",poster:p.value,onLoadeddata:A,onError:H}," 您的浏览器不支持视频播放。 ",40,Ae)])])]),s.follow_up_questions&&s.follow_up_questions.length>0?(r(),n("div",He,[(r(!0),n(x,null,N(s.follow_up_questions,(a,q)=>(r(),n("div",{key:q,class:"mb-4"},[e("div",Te,[t[6]||(t[6]=e("div",{class:"bg-purple-100 text-purple-800 px-2 py-1 rounded text-sm"},"追问题",-1)),e("div",Ue,[e("h4",ze,d(a.question),1),e("div",De,[e("div",Pe,[e("div",Ee,[e("div",Ge,[e("div",Ke,[e("div",We,[t[4]||(t[4]=e("div",{class:"bg-green-100 text-green-800 px-2 py-1 rounded text-sm"},"候选人",-1)),e("div",Ze,[e("p",Je,d(a.answer),1)])])]),e("div",null,[e("div",Oe,[t[5]||(t[5]=e("div",{class:"bg-yellow-100 text-yellow-800 px-2 py-1 rounded text-sm"},"AI评分",-1)),e("div",Xe,[e("p",Ye,d(a.analysis),1),e("div",es,"得分:"+d(a.score),1)])])])])]),a.videoUrl?(r(),n("div",ss,[e("div",ts,[e("video",{class:"w-full h-full object-cover rounded-lg",controls:"",src:a.videoUrl,preload:"metadata",poster:p.value,onLoadeddata:A,onError:H}," 您的浏览器不支持视频播放。 ",40,os)])])):c("",!0)])])])])]))),128))])):c("",!0)])):s.question_form===3?(r(),n("div",as,[e("div",is,[e("div",ns,[e("div",rs,[e("img",{src:s.question_image_url,alt:"题目图片",class:"w-full h-full object-contain",onError:D},null,40,ds)])]),e("div",ls,[s.options&&s.options.length>0?(r(),n("div",cs,[(r(!0),n(x,null,N(s.options,(a,q)=>{var j,I,L,V;return r(),n("div",{key:q,class:m(["p-3 rounded border",(I=(j=s.answer_data)==null?void 0:j.selected_option_details)!=null&&I.some(g=>g.id===a.id)?"border-blue-300 bg-blue-50":"border-gray-200"])},[e("div",_s,[e("div",us,[e("span",ps,d(a.option_text),1)]),e("div",vs,[a.is_correct?(r(),n("span",hs,"✓ 正确答案")):c("",!0),(V=(L=s.answer_data)==null?void 0:L.selected_option_details)!=null&&V.some(g=>g.id===a.id)?(r(),n("span",{key:1,class:m(a.is_correct?"text-green-500":"text-red-500")},d(a.is_correct?"(已选 - 正确)":"(已选 - 错误)"),3)):c("",!0)])])],2)}),128))])):c("",!0),e("div",gs,[e("div",xs," 答案: "+d(((l=(o=s.answer_data)==null?void 0:o.selected_option_details)==null?void 0:l.map(a=>a.option_text).join(", "))||"未作答"),1),e("div",null,[e("span",{class:m(["px-3 py-1 rounded-full text-sm",(h=(u=s.answer_data)==null?void 0:u.selected_option_details)!=null&&h.every(a=>a.is_correct)?"bg-green-100 text-green-800":"bg-red-100 text-red-800"])},d((U=(M=s.answer_data)==null?void 0:M.selected_option_details)!=null&&U.every(a=>a.is_correct)?"正确":"错误"),3)])])])])])):c("",!0)])])}),128))])):c("",!0)]),_:1},8,["spinning"])])])])}}}),bs=X(ms,[["__scopeId","data-v-ce7da24c"]]);export{bs as default};
|