topic.DsLod6II.js 8.1 KB

1
  1. import{a as P,aB as Q,r as I,q as W,aj as Z,c as i,o as n,b as e,S as J,K as O,Q as d,R as j,a9 as V,M as _,G as g}from"./vue.D1BjjNmv.js";import{_ as X}from"./_plugin-vue_export-helper.DlAUqK2U.js";const Y={class:"page-container"},E={class:"content-container"},ee={class:"max-w-4xl mx-auto p-6"},se={key:0,class:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative",role:"alert"},te={class:"block sm:inline"},ae={key:1,class:"space-y-4"},oe={class:"mb-4"},ie={class:"flex items-start space-x-2"},ne={class:"bg-blue-100 text-blue-800 px-2 py-1 rounded text-sm"},re={class:"flex-1"},de={class:"font-semibold text-gray-800"},ce={key:0,class:"mt-4"},le={class:"bg-white p-4 rounded-lg"},_e={key:0,class:"space-y-3"},ue={class:"flex items-center justify-between"},pe={class:"flex-1"},ve={class:"text-gray-700"},ge={class:"flex items-center space-x-2"},he={key:0,class:"text-green-500"},me={key:0,class:"text-blue-500"},xe={class:"mt-4 flex justify-between items-center"},fe={class:"text-gray-600"},ye={key:0},we={key:1,class:"mt-4 flex space-x-4"},be={class:"w-2/3"},ke={class:"bg-white p-4 rounded-lg"},je={class:"mb-4"},Le={class:"flex items-start space-x-2"},qe={class:"flex-1"},Ie={class:"text-gray-700"},Be={class:"flex items-start space-x-2"},Ce={class:"flex-1"},Re={class:"text-gray-600 m-0"},Ve={class:"mt-1 text-blue-500"},Se={class:"w-1/3"},Fe={class:"video-container"},Ne=["src","poster"],Ue={key:2,class:"mt-4"},$e={class:"grid grid-cols-2 gap-4"},De={class:"bg-white p-4 rounded-lg"},He={class:"aspect-w-16 aspect-h-9 rounded-lg overflow-hidden bg-gray-100"},Me=["src"],Te={class:"bg-white p-4 rounded-lg"},ze={key:0,class:"space-y-3"},Ae={class:"flex items-center justify-between"},Ge={class:"flex-1"},Ke={class:"text-gray-700"},Pe={class:"flex items-center space-x-2"},Qe={key:0,class:"text-green-500"},We={class:"mt-4 flex justify-between items-center"},Ze={class:"text-gray-600"},Je=P({__name:"topic",setup(Oe){const B=Q(),S=I([]),C=I(!0),L=I(""),p=I("data:image/svg+xml;base64,PHN2ZyB..."),z=o=>{const t=o.target;t&&(t.src=p.value,t.onerror=null)},A=o=>{const t=o.target;t&&(t.readyState>=1?F(t):t.addEventListener("loadedmetadata",()=>{F(t)}))},G=o=>{const t=o.target;t&&(t.poster=p.value,console.error("视频加载错误"))},K=async()=>{var o;C.value=!0;try{const t=B.query.id||"1",c=B.query.tenant_id||"1",s=B.query.applicationId||"1",u=await(await fetch(`https://backend.qicai321.com/api/job/application_detail?tenant_id=1&application_id=${s}`)).json();u.code===2e3&&((o=u.data)!=null&&o.interview_progress)?S.value=u.data.interview_progress.filter(r=>r.video_answer||r.answer_data).map(r=>{var m,x;const l={question:r.question_text||"未提供问题",answer:"",analysis:"",score:"",question_form:r.question_form,options:r.options,answer_data:r.answer_data};return r.video_answer&&(l.answer=r.video_answer.transcript||"",l.analysis=((m=r.video_answer.ai_analysis)==null?void 0:m.comment)||"",l.score=r.video_answer.ai_score?`${r.video_answer.ai_score}分`:"",l.videoUrl=r.video_answer.video_url||""),r.answer_data&&(l.answer=r.answer_data.text_answer||"",l.is_correct=((x=r.answer_data.selected_option_details)==null?void 0:x.some(q=>q.is_correct))||!1),r.question_form===3&&(l.question_image_url=r.question_image_url||""),l}):L.value=u.msg||"获取数据失败"}catch(t){console.error("获取面试记录失败:",t),L.value="获取数据失败,请稍后重试"}finally{C.value=!1}},F=o=>{const t=()=>{try{if(o.readyState>=2){const c=document.createElement("canvas");c.width=o.videoWidth||320,c.height=o.videoHeight||240;const s=c.getContext("2d");if(s){o.currentTime=.1,s.drawImage(o,0,0,c.width,c.height);const h=c.toDataURL("image/jpeg");o.poster=h,o.removeEventListener("loadeddata",t)}}}catch(c){console.error("捕获视频第一帧失败:",c),o.poster=p.value}};o.addEventListener("loadeddata",t),o.readyState>=2&&t(),o.addEventListener("error",()=>{console.error("视频加载失败"),o.poster=p.value}),setTimeout(()=>{(!o.poster||o.poster==="")&&(o.poster=p.value)},3e3)};return W(()=>{K()}),(o,t)=>{const c=Z("a-spin");return n(),i("div",Y,[e("div",E,[e("div",ee,[J(c,{spinning:C.value,tip:"加载中..."},{default:O(()=>[L.value?(n(),i("div",se,[t[0]||(t[0]=e("strong",{class:"font-bold"},"错误!",-1)),e("span",te,d(L.value),1)])):(n(),i("div",ae,[(n(!0),i(j,null,V(S.value,(s,h)=>{var u,r,l,m,x,q,N,U,$,D,H,M;return n(),i("div",{key:h,class:"bg-gray-50 rounded-lg p-4"},[e("div",oe,[e("div",ie,[e("div",ne,"第"+d(h+1)+"题",1),e("div",re,[e("h3",de,d(s.question),1)])]),s.question_form===1||s.question_form===2||s.question_form===4?(n(),i("div",ce,[e("div",le,[s.options&&s.options.length>0?(n(),i("div",_e,[(n(!0),i(j,null,V(s.options,(a,R)=>{var f,y,w,b,v,T;return n(),i("div",{key:R,class:g(["p-3 rounded border",(y=(f=s.answer_data)==null?void 0:f.selected_option_details)!=null&&y.some(k=>k.id===a.id)?"border-blue-300 bg-blue-50":"border-gray-200"])},[e("div",ue,[e("div",pe,[e("span",ve,d(a.option_text),1)]),e("div",ge,[s.question_form!==4?(n(),i(j,{key:0},[a.is_correct?(n(),i("span",he,"✓ 正确答案")):_("",!0),(b=(w=s.answer_data)==null?void 0:w.selected_option_details)!=null&&b.some(k=>k.id===a.id)?(n(),i("span",{key:1,class:g(a.is_correct?"text-green-500":"text-red-500")},d(a.is_correct?"(已选 - 正确)":"(已选 - 错误)"),3)):_("",!0)],64)):(n(),i(j,{key:1},[(T=(v=s.answer_data)==null?void 0:v.selected_option_details)!=null&&T.some(k=>k.id===a.id)?(n(),i("span",me," (已选) ")):_("",!0)],64))])])],2)}),128))])):_("",!0),e("div",xe,[e("div",fe," 候选人: "+d(((r=(u=s.answer_data)==null?void 0:u.selected_option_details)==null?void 0:r.map(a=>a.option_text).join(", "))||"未作答"),1),s.question_form!==4?(n(),i("div",ye,[e("span",{class:g(["px-3 py-1 rounded-full text-sm",(m=(l=s.answer_data)==null?void 0:l.selected_option_details)!=null&&m.every(a=>a.is_correct)?"bg-green-100 text-green-800":"bg-red-100 text-red-800"])},d((q=(x=s.answer_data)==null?void 0:x.selected_option_details)!=null&&q.every(a=>a.is_correct)?"正确":"错误"),3)])):_("",!0)])])])):s.question_form===0||s.question_form===5?(n(),i("div",we,[e("div",be,[e("div",ke,[e("div",je,[e("div",Le,[t[1]||(t[1]=e("div",{class:"bg-green-100 text-green-800 px-2 py-1 rounded text-sm"},"候选人",-1)),e("div",qe,[e("p",Ie,d(s.answer),1)])])]),e("div",null,[e("div",Be,[t[2]||(t[2]=e("div",{class:"bg-yellow-100 text-yellow-800 px-2 py-1 rounded text-sm"},"AI评分",-1)),e("div",Ce,[e("p",Re,d(s.analysis),1),e("div",Ve,"得分:"+d(s.score),1)])])])])]),e("div",Se,[e("div",Fe,[e("video",{class:"w-full h-full object-cover rounded-lg",controls:"",src:s.videoUrl,preload:"metadata",poster:p.value,onLoadeddata:A,onError:G}," 您的浏览器不支持视频播放。 ",40,Ne)])])])):s.question_form===3?(n(),i("div",Ue,[e("div",$e,[e("div",De,[e("div",He,[e("img",{src:s.question_image_url,alt:"题目图片",class:"w-full h-full object-contain",onError:z},null,40,Me)])]),e("div",Te,[s.options&&s.options.length>0?(n(),i("div",ze,[(n(!0),i(j,null,V(s.options,(a,R)=>{var f,y,w,b;return n(),i("div",{key:R,class:g(["p-3 rounded border",(y=(f=s.answer_data)==null?void 0:f.selected_option_details)!=null&&y.some(v=>v.id===a.id)?"border-blue-300 bg-blue-50":"border-gray-200"])},[e("div",Ae,[e("div",Ge,[e("span",Ke,d(a.option_text),1)]),e("div",Pe,[a.is_correct?(n(),i("span",Qe,"✓ 正确答案")):_("",!0),(b=(w=s.answer_data)==null?void 0:w.selected_option_details)!=null&&b.some(v=>v.id===a.id)?(n(),i("span",{key:1,class:g(a.is_correct?"text-green-500":"text-red-500")},d(a.is_correct?"(已选 - 正确)":"(已选 - 错误)"),3)):_("",!0)])])],2)}),128))])):_("",!0),e("div",We,[e("div",Ze," 答案: "+d(((U=(N=s.answer_data)==null?void 0:N.selected_option_details)==null?void 0:U.map(a=>a.option_text).join(", "))||"未作答"),1),e("div",null,[e("span",{class:g(["px-3 py-1 rounded-full text-sm",(D=($=s.answer_data)==null?void 0:$.selected_option_details)!=null&&D.every(a=>a.is_correct)?"bg-green-100 text-green-800":"bg-red-100 text-red-800"])},d((M=(H=s.answer_data)==null?void 0:H.selected_option_details)!=null&&M.every(a=>a.is_correct)?"正确":"错误"),3)])])])])])):_("",!0)])])}),128))]))]),_:1},8,["spinning"])])])])}}}),Ee=X(Je,[["__scopeId","data-v-f189e67a"]]);export{Ee as default};