import{n as e,r as t,u as n}from"./es-DCOtnflc.js";import{$ as r,B as i,Ht as a,I as o,N as s,Q as c,V as l,_ as u,d,f,ht as p,m,p as h,st as g,t as _,v}from"./_plugin-vue_export-helper-D1RKUtCV.js";import{a as y,r as b}from"./trainManagement-TFX-G3Jl.js";var x={class:`model-list-page`},S={class:`card-header-row`},C={class:`params-text`},w={class:`loss-text`},T=_({__name:`index`,setup(_){let T=g([]),E=g(!1),D=async()=>{E.value=!0;try{T.value=await y()}finally{E.value=!1}},O=async n=>{try{await e.confirm(`确定删除模型"${n.model_name}"吗？删除后无法恢复。`,`提示`,{type:`warning`}),await b(n.id),t.success(`模型已删除`),await D()}catch{}},k=e=>e?[`seq=${e.seq_len}`,`hidden=${e.hidden_size}`,`layers=${e.num_layers}`,`epochs=${e.epochs}`,`lr=${e.learning_rate}`].join(` / `):`-`,A=e=>e.train_loss==null?`-`:`训练 ${Number(e.train_loss).toFixed(5)}`+(e.val_loss==null?``:` / 验证 ${Number(e.val_loss).toFixed(5)}`);return s(D),(e,t)=>{let s=i(`el-button`),g=i(`el-table-column`),_=i(`el-tooltip`),y=i(`el-table`),b=i(`el-empty`),j=i(`el-card`),M=l(`loading`);return o(),m(`div`,x,[v(j,{shadow:`hover`,class:`list-card`},{header:c(()=>[d(`div`,S,[t[1]||=d(`span`,{class:`card-title`},`已保存模型`,-1),v(s,{icon:p(n),size:`small`,plain:``,loading:E.value,onClick:D},{default:c(()=>[...t[0]||=[u(` 刷新 `,-1)]]),_:1},8,[`icon`,`loading`])])]),default:c(()=>[r((o(),f(y,{data:T.value,border:``,stripe:``,height:`calc(100vh - 160px)`},{default:c(()=>[v(g,{type:`index`,width:`55`,label:`#`,align:`center`}),v(g,{prop:`model_name`,label:`模型名称`,"min-width":`150`,"show-overflow-tooltip":``}),v(g,{prop:`package_name`,label:`训练数据包`,"min-width":`140`,"show-overflow-tooltip":``}),v(g,{label:`LSTM 参数`,"min-width":`280`,"show-overflow-tooltip":``},{default:c(({row:e})=>[v(_,{content:k(e.params),placement:`top`},{default:c(()=>[d(`span`,C,a(k(e.params)),1)]),_:2},1032,[`content`])]),_:1}),v(g,{label:`训练损失`,"min-width":`190`,"show-overflow-tooltip":``},{default:c(({row:e})=>[d(`span`,w,a(A(e)),1)]),_:1}),v(g,{prop:`created_at`,label:`保存时间`,width:`170`}),v(g,{label:`操作`,width:`90`,fixed:`right`,align:`center`},{default:c(({row:e})=>[v(s,{link:``,type:`danger`,onClick:t=>O(e)},{default:c(()=>[...t[2]||=[u(`删除`,-1)]]),_:1},8,[`onClick`])]),_:1})]),_:1},8,[`data`])),[[M,E.value]]),!E.value&&T.value.length===0?(o(),f(b,{key:0,description:`暂无已保存的模型，请先在模型训练页面完成训练并保存`,style:{padding:`40px 0`}})):h(``,!0)]),_:1})])}}},[[`__scopeId`,`data-v-c204d828`]]);export{T as default};