Files
vueapp/dist/assets/profile.e1L0urBE.js
T
2026-06-13 06:06:07 +08:00

2 lines
3.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{C as e,D as t}from"./index-DR4MYR5F.js";import{a as n,A as r}from"./auth.CseBt7py.js";function o(){return d("/user/profile/")}function i(e={}){return d("/user/training-records/",{search:e.search,page:e.page})}function c(){return d("/user/analysis/")}function s(){return d("/user/competency-metrics/")}async function a(e){const t=function(e){if(e&&"object"==typeof e&&"data"in e){const t=e;if(t.code&&"OK"!==t.code&&"ok"!==t.code)throw new r(t.message||"请求失败",t.code);if(void 0!==t.data)return t.data}return e}(await d(`/v1/evaluations/${encodeURIComponent(String(e))}`));return function(e,t){const n=g(e.case)?e.case:{},r=l(e.total_score??e.score??e.current_score,0);return{evaluation_id:l(e.evaluation_id??e.id??e.record_id,t),session_id:l(e.session_id,0),case_id:l(e.case_id??n.id,0),case_title:y(e.case_title??e.caseTitle??n.title,"未命名病例"),score_type:_(e.score_type),total_score:r,dimension_scores:f(e.dimension_scores??e.radar),score_details:p(e.score_details),overall_comment:y(e.overall_comment??e.comment,"本次评价暂无详细点评。"),pdf_file_path:v(e.pdf_file_path??e.pdfFilePath),created_at:v(e.created_at??e.trained_at)}}(t,e)}function d(t,o){return new Promise(((i,c)=>{e({url:`${n}${m(t,o)}`,method:"GET",timeout:1e4,header:u(),success:e=>{if(e.statusCode>=200&&e.statusCode<300)return void i(e.data);const t=e.data,n="string"==typeof(null==t?void 0:t.code)?t.code:void 0;c(new r(function(e,t){if(e&&"object"==typeof e){const t=e,n=t.message||t.detail||t.error;if("string"==typeof n&&n.trim())return n}return t}(e.data,`请求失败(${e.statusCode}`),n,e.statusCode))},fail:e=>{c(new r(e.errMsg||"无法连接服务"))}})}))}function u(){const e={"Content-Type":"application/json",Accept:"application/json"},n=function(){try{const e=t("clinical-thinking-access-token");return"string"==typeof e?e.trim():""}catch{return""}}();return n&&(e.Authorization=`Bearer ${n}`),e}function m(e,t){if(!t)return e;const n=Object.entries(t).filter((([,e])=>null!=e&&""!==e)).map((([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(String(t))}`)).join("&");return n?`${e}?${n}`:e}function f(e){return Array.isArray(e)?e.map((e=>{const t=g(e)?e:{};return{dimension:y(t.dimension??t.label,"未命名维度"),score:l(t.score,0),max_score:l(t.max_score,100),comment:v(t.comment),evidence:Array.isArray(t.evidence)?t.evidence.map(String):void 0,deductions:Array.isArray(t.deductions)?t.deductions.map(String):void 0,improvement:v(t.improvement)}})):[]}function p(e){return Array.isArray(e)?e.map((e=>{const t=g(e)?e:{};return{dimension:y(t.dimension,"未命名维度"),score:l(t.score,0),deducted_reason:v(t.deducted_reason),ai_confidence:void 0===t.ai_confidence?void 0:l(t.ai_confidence,0),comment:v(t.comment)}})):[]}function _(e){return"five_point"===e?"five_point":"percentage"}function l(e,t=0){const n=Number(e);return Number.isFinite(n)?n:t}function y(e,t=""){return"string"==typeof e?e.trim()||t:"number"==typeof e?String(e):t}function v(e){return y(e)||void 0}function g(e){return Boolean(e&&"object"==typeof e&&!Array.isArray(e))}export{i as a,a as b,o as c,s as d,c as f};