Files
vueapp/dist/assets/pages-assessment-assessment.CJJVYo9U.js
T

2 lines
13 KiB
JavaScript
Raw Normal View History

2026-06-11 12:12:55 +08:00
import{d as e,a,r as t,c as l,o as s,b as n,e as o,f as r,w as i,i as c,j as u,t as d,g as f,l as m,N as v,F as _,m as p,n as h,P as y,Q as w,D as b,G as g,s as k,C as x,U as $,y as N,z as T,x as j,u as E,S as P,H as C,q as D}from"./index-CoO0Bu96.js";import{_ as F}from"./config-doctor.TgARj_nM.js";import{F as M,a as U,r as A,f as S}from"./session.DpZWKT0-.js";import{_ as O}from"./_plugin-vue_export-helper.BCo6x5W8.js";async function R(e){const a=await fetch(`${M}/evaluations/${e}`,{method:"GET",headers:U()});if(!a.ok)throw new Error(await A(a));const t=await a.json();if("OK"!==t.code||!t.data)throw new Error(t.message||"评价详情加载失败");return t.data}async function I(e){var a;const t=await fetch(`${M}/evaluations/${e}/download-pdf`,{method:"GET",headers:U("application/pdf")});if(!t.ok)throw new Error(await A(t));const l=t.headers.get("Content-Type")||"",s=function(e,a){var t,l;const s=null==(t=e.match(/filename\*=UTF-8''([^;]+)/i))?void 0:t[1];if(s)return decodeURIComponent(s);const n=null==(l=e.match(/filename="?([^"]+)"?/i))?void 0:l[1];return n||`training_record_${a}.pdf`}(t.headers.get("Content-Disposition")||"",e);if(l.includes("application/json")){const e=await t.json();if("OK"!==e.code||!(null==(a=e.data)?void 0:a.file_path))throw new Error(e.message||"PDF 下载失败");return{filePath:e.data.file_path,fileName:L(e.data.file_path,s)}}return{blob:await t.blob(),fileName:s}}function L(e,a){return e.split("?")[0].split("#")[0].split("/").filter(Boolean).pop()||a}const Y=O(e({__name:"assessment",setup(e){const O=a({date:"生成中",no:"生成中",caseTitle:"",score:0,scoreText:"--",level:"生成中",overallComment:"评价生成中,请稍候。"}),L=t(!1),Y=t(""),B=t(!1),X=t(null),G=t(null),K=t(null),V=t(!1),q=t(!1),z=t(!1),H=l((()=>264-264*O.score/100)),J=l((()=>O.overallComment||Q.value)),Q=l((()=>z.value?"评价生成失败,请稍后重试。":q.value?"本次评价暂无详细点评。":"评价生成中,请稍候。")),W=l((()=>z.value?"评价生成失败,请稍后重试。":q.value?"暂无分项评分。":"分项评分生成中。")),Z=l((()=>z.value?"评价生成失败,暂无雷达图。":q.value?"暂无足够分项数据生成雷达图。":"雷达图生成中。")),ee=l((()=>{var e,a;const t=G.value||X.value;return t?Array.isArray(t.dimension_scores)&&t.dimension_scores.length>0?t.dimension_scores.map((e=>{const a=e.max_score>0?ce(Number(e.score)/Number(e.max_score)*100):ce(Number(e.score)),t=[e.comment,e.improvement?`改进建议:${e.improvement}`:""].filter(Boolean).join(" ");return{label:e.dimension,percent:a,displayScore:e.max_score>0?`${e.score}/${e.max_score}`:`${e.score}%`,analysis:t||"暂无分项解析。"}})):Array.isArray(t.score_details)&&t.score_details.length>0?t.score_details.map((e=>({label:e.dimension,percent:ce(Number(e.score)),displayScore:`${e.score}%`,analysis:e.comment||e.deducted_reason||"暂无分项解析。"}))):G.value&&Array.isArray(null==(e=X.value)?void 0:e.dimension_scores)&&X.value.dimension_scores.length>0?X.value.dimension_scores.map((e=>{const a=Number(e.score),t=Number(e.max_score),l=ce(t>0?a/t*100:a),s=[e.comment,e.improvement?`改进建议:${e.improvement}`:""].filter(Boolean).join(" ");return{label:e.dimension,percent:l,displayScore:t>0?`${e.score}/${e.max_score}`:`${e.score}%`,analysis:s||"暂无分项解析。"}})):G.value&&Array.isArray(null==(a=X.value)?void 0:a.score_details)&&X.value.score_details.length>0?X.value.score_details.map((e=>({label:e.dimension,percent:ce(Number(e.score)),displayScore:`${e.score}%`,analysis:e.comment||e.deducted_reason||"暂无分项解析。"}))):[]:[]})),ae=l((()=>{const e=ee.value.slice(0,6),a=e.length;return a<3?[]:e.map(((e,t)=>{const l=-Math.PI/2+2*Math.PI*t/a,s=e.percent/100*160,n=200+184*Math.cos(l),o=200+184*Math.sin(l);return{...e,axisX:ue(200+160*Math.cos(l)),axisY:ue(200+160*Math.sin(l)),labelX:ue(n),labelY:ue(o),pointX:ue(200+Math.cos(l)*s),pointY:ue(200+Math.sin(l)*s),anchor:n<170?"end":n>230?"start":"middle"}}))})),te=l((()=>ae.value.map((e=>`${e.pointX},${e.pointY}`)).join(" ")));let le=null;functio