import{d as N,a as i,f as a,m as e,n as _,t as o,e as d,b as c,J as p,c as k,h as C,I as S,a_ as F,F as I,r as L,j as y,C as f,a8 as r,aG as R,ah as j,_ as G}from"./index-3ac32eb9.js";import{_ as J}from"./_plugin-vue_export-helper-c27b6911.js";const $={class:"card-header"},q={class:"model-status"},A={class:"card-body"},H={class:"model-name"},K={class:"model-desc"},O={class:"model-info"},P={class:"info-item"},Q={class:"value version"},U={class:"info-item"},W={class:"value"},X={key:0,class:"version-tags"},Y=["onClick"],Z={key:0,class:"more-tag"},ee={class:"card-footer"},se={key:0,class:"metrics-preview"},te={class:"metric-item"},oe={class:"metric-value"},ne={class:"metric-item"},le={class:"metric-value"},ie={class:"card-actions"},ae=N({__name:"ModelCard",props:{model:{},isSelected:{type:Boolean}},emits:["select","deploy","viewDetail","versionClick"],setup(t,{emit:b}){const s=t,m=b,V=r(()=>({prediction:"type-prediction",classification:"type-classification",recognition:"type-recognition",detection:"type-detection",regression:"type-regression"})[s.model.type]||"type-default"),w=r(()=>({prediction:"[S] 预测模型",classification:"[C] 分类模型",recognition:"[R] 识别模型",detection:"[D] 检测模型",regression:"[Reg] 回归模型"})[s.model.type]||s.model.type),x=r(()=>({training:"warning",completed:"success",deploying:"primary",running:"success",stopped:"info",failed:"danger"})[s.model.status]||"info"),B=r(()=>({training:"训练中",completed:"训练完成",deploying:"部署中",running:"运行中",stopped:"已停止",failed:"失败"})[s.model.status]||s.model.status),v=r(()=>!s.model.versions||s.model.versions.length===0?null:s.model.versions.find(l=>l.version===s.model.currentVersion)||s.model.versions[0]),D=()=>{m("select",s.model)},E=()=>{m("deploy",s.model)},T=()=>{m("viewDetail",s.model)},z=l=>{m("versionClick",s.model,l)};return(l,n)=>{const M=R,g=j,h=G;return i(),a("div",{class:_(["model-card",{selected:t.isSelected}]),onClick:D},[e("div",$,[e("div",{class:_(["model-type-badge",V.value])},o(w.value),3),e("div",q,[d(M,{type:x.value,size:"small"},{default:c(()=>[p(o(B.value),1)]),_:1},8,["type"])])]),e("div",A,[e("h3",H,o(t.model.name),1),e("p",K,o(t.model.description||"暂无描述"),1),e("div",O,[e("div",P,[n[0]||(n[0]=e("span",{class:"label"},"当前版本",-1)),e("span",Q,o(t.model.currentVersion),1)]),e("div",U,[n[1]||(n[1]=e("span",{class:"label"},"部署环境",-1)),e("span",W,[t.model.deployEnvironment==="cloud"?(i(),k(g,{key:0,class:"env-icon"},{default:c(()=>[d(C(S))]),_:1})):(i(),k(g,{key:1,class:"env-icon"},{default:c(()=>[d(C(F))]),_:1})),p(" "+o(t.model.deployEnvironment==="cloud"?"云端":"边缘侧"),1)])])]),t.model.versions&&t.model.versions.length>0?(i(),a("div",X,[(i(!0),a(I,null,L(t.model.versions.slice(0,3),u=>(i(),a("span",{key:u.id,class:_(["version-tag",{active:u.version===t.model.currentVersion}]),onClick:y(de=>z(u),["stop"])},o(u.version),11,Y))),128)),t.model.versions.length>3?(i(),a("span",Z,"+"+o(t.model.versions.length-3),1)):f("",!0)])):f("",!0)]),e("div",ee,[v.value?(i(),a("div",se,[e("div",te,[n[2]||(n[2]=e("span",{class:"metric-label"},"准确率",-1)),e("span",oe,o((v.value.metrics.accuracy*100).toFixed(1))+"%",1)]),e("div",ne,[n[3]||(n[3]=e("span",{class:"metric-label"},"推理耗时",-1)),e("span",le,o(v.value.metrics.latency)+"ms",1)])])):f("",!0),e("div",ie,[d(h,{type:"primary",size:"small",link:"",onClick:y(E,["stop"])},{default:c(()=>[p(o(t.model.status==="running"?"停止":"部署"),1)]),_:1}),d(h,{type:"primary",size:"small",link:"",onClick:y(T,["stop"])},{default:c(()=>[...n[4]||(n[4]=[p("详情",-1)])]),_:1})])])],2)}}});const me=J(ae,[["__scopeId","data-v-a2df6d22"]]);export{me as default};
