import{E as V}from"./index-CCavIuTY.js";import{E as $}from"./el-table-DkdQ6gPU.js";import{d as B,G as D,c as T,e as _,w as o,g as C,y as p,o as v,s as a,q as i,x as b,aa as L,n as c,v as N,A as z}from"./index-CGB0A5x_.js";import{E as M}from"./index-BMrs0kLP.js";import"./el-tag-C_D80BPW.js";import"./el-checkbox-Ci1DH0Aj.js";import{D as y}from"./DataTablePage-CURtmoAI.js";import{_ as A}from"./ModelStatusTag.vue_vue_type_script_setup_true_lang-NhrqSCT2.js";import{g as G,d as P}from"./eval-CNlv4GHr.js";import{_ as R}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./el-scrollbar-p6_f_LH2.js";import"./index-DMVRI44M.js";import"./el-popper-DvBtRO32.js";import"./index-BPwPlcbL.js";import"./_baseClone-CX1E8HTZ.js";import"./_baseIteratee-uVh0OyD5.js";import"./castArray-Cgg396Sr.js";import"./debounce-Bqww2DS8.js";import"./toNumber-IRhFg6gN.js";import"./raf-CCivjDro.js";import"./validator-D7tSoy2w.js";import"./index-Coa9QRND.js";import"./clamp-BqqU4KQ-.js";import"./index-C5EKbiob.js";import"./scroll-C0BSy_Rk.js";import"./index-CbmPSBt0.js";import"./index-D2-3cnGo.js";import"./omit-DaFv1hTo.js";import"./el-card-BWcR1iD2.js";import"./el-pagination-DGQ0vO_O.js";import"./el-select-C59URVI0.js";import"./vnode-DFpZw5lG.js";import"./index-khuXz7sd.js";import"./directive-vzjADwzS.js";import"./el-tooltip-l0sNRNKZ.js";import"./status-Dl1fykxa.js";const S={class:"eval-page"},q={class:"capsule-tabs"},I={class:"capsule-tabs"},Q=B({__name:"EvalView",setup(j){const f=N(),s=p("tasks"),d=p(!1),n=p([]),w=p([{rank:1,name:"GPT-4",score:92.5},{rank:2,name:"Claude-3",score:90.1},{rank:3,name:"Qwen-Max",score:85.3}]);async function u(){d.value=!0;try{n.value=await G()||[]}catch{n.value=[]}finally{d.value=!1}}async function k(r){await M.confirm("确定要删除这个评测任务吗？","确认删除",{type:"warning"}),await P(r.id),n.value=n.value.filter(e=>e.id!==r.id),z.success("删除成功"),await u()}function E(){f.push("/model-eval/create")}function m(r){return s.value===r}function x(r){f.push({name:"model-eval-detail",params:{id:r.id}})}return D(()=>{u()}),(r,e)=>{const l=$,g=V;return v(),T("div",S,[s.value==="tasks"?(v(),_(y,{key:0,title:"",data:n.value,loading:d.value,"delete-fn":k,"create-text":"创建评测任务",onCreate:E,"row-key":"id",onRefresh:u},{title:o(()=>[i("div",q,[i("button",{class:c(["capsule-tab-item",{active:m("tasks")}]),onClick:e[0]||(e[0]=t=>s.value="tasks")},"评测任务",2),i("button",{class:c(["capsule-tab-item",{active:m("leaderboard")}]),onClick:e[1]||(e[1]=t=>s.value="leaderboard")},"排行榜",2)])]),columns:o(()=>[a(l,{label:"任务名称",prop:"eval_task_name",align:"center"}),a(l,{label:"评测模型",prop:"model_name",align:"center"}),a(l,{label:"数据集",prop:"dataset",align:"center"}),a(l,{label:"指标",prop:"metric",align:"center"}),a(l,{label:"评分",prop:"score",width:"100",align:"center"}),a(l,{label:"状态",width:"100",align:"center"},{default:o(({row:t})=>[a(A,{status:t.status},null,8,["status"])]),_:1}),a(l,{label:"创建时间",align:"center",width:"180"},{default:o(({row:t})=>[b(L(t.create_time?new Date(t.create_time).toLocaleString("zh-CN"):"-"),1)]),_:1})]),actions:o(({row:t})=>[a(g,{link:"",type:"primary",size:"small",onClick:h=>x(t)},{default:o(()=>[...e[4]||(e[4]=[i("i",{class:"fa fa-file-text-o",style:{"margin-right":"4px"}},null,-1),b("详情 ",-1)])]),_:1},8,["onClick"]),a(g,{link:"",type:"danger",size:"small",onClick:h=>k(t)},{default:o(()=>[...e[5]||(e[5]=[i("i",{class:"fa fa-trash-o",style:{"margin-right":"4px"}},null,-1),b("删除 ",-1)])]),_:1},8,["onClick"])]),_:1},8,["data","loading"])):C("",!0),s.value==="leaderboard"?(v(),_(y,{key:1,title:"",data:w.value,"row-key":"rank"},{title:o(()=>[i("div",I,[i("button",{class:c(["capsule-tab-item",{active:m("tasks")}]),onClick:e[2]||(e[2]=t=>s.value="tasks")},"评测任务",2),i("button",{class:c(["capsule-tab-item",{active:m("leaderboard")}]),onClick:e[3]||(e[3]=t=>s.value="leaderboard")},"排行榜",2)])]),columns:o(()=>[a(l,{label:"排名",prop:"rank",width:"80",align:"center"}),a(l,{label:"模型名称",prop:"name",align:"center"}),a(l,{label:"综合评分",prop:"score",align:"center"})]),_:1},8,["data"])):C("",!0)])}}}),Ve=R(Q,[["__scopeId","data-v-894b0bb7"]]);export{Ve as default};
