import{E}from"./index-CCavIuTY.js";import{E as T}from"./el-tag-C_D80BPW.js";import{E as L}from"./el-table-DkdQ6gPU.js";import{d as A,y as f,G as V,e as k,w as e,ac as $,j as B,o as y,q as r,s as l,x as i,g as N,aa as p,f as b,aY as P,aZ as S,n as w,v as M,A as R}from"./index-CGB0A5x_.js";import"./el-checkbox-Ci1DH0Aj.js";import{D as q}from"./DataTablePage-CURtmoAI.js";import{g as G,d as I,a as Y}from"./dataset-C_hkNkI5.js";import{_ as j}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"./omit-DaFv1hTo.js";import"./index-CbmPSBt0.js";import"./index-D2-3cnGo.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"./scroll-C0BSy_Rk.js";import"./clamp-BqqU4KQ-.js";import"./directive-vzjADwzS.js";import"./index-BMrs0kLP.js";import"./validator-D7tSoy2w.js";import"./index-Coa9QRND.js";import"./index-C5EKbiob.js";import"./el-tooltip-l0sNRNKZ.js";const O={class:"capsule-tabs"},U={class:"action-buttons"},Z=A({__name:"DatasetListView",setup(F){const C=M(),D=$(),c=f(!1),u=f([]),n=f(D.query.tab==="task"?"task":"upload"),h=B(()=>n.value==="task"?u.value.filter(s=>s.source==="task"):u.value.filter(s=>s.source!=="task"));async function d(){c.value=!0;try{u.value=await G()||[]}catch{}finally{c.value=!1}}async function _(s){await I(s.id),u.value=u.value.filter(a=>a.id!==s.id),await d(),R.success("删除成功")}function x(s){C.push(`/dataset/${s.id}/preview`)}function z(s){window.open(Y(s.id),"_blank")}return V(d),(s,a)=>{const o=L,v=T,m=E;return y(),k(q,{title:"数据集管理",data:h.value,loading:c.value,searchable:"","search-fields":["name","description"],"create-text":n.value==="upload"?"上传数据集":"","create-to":"/dataset/create","delete-fn":_,"row-key":"id",onRefresh:d},{title:e(()=>[r("div",O,[r("button",{class:w(["capsule-tab-item",{active:n.value==="upload"}]),onClick:a[0]||(a[0]=t=>n.value="upload")}," 上传任务 ",2),r("button",{class:w(["capsule-tab-item",{active:n.value==="task"}]),onClick:a[1]||(a[1]=t=>n.value="task")}," 数据任务 ",2)])]),columns:e(()=>[n.value==="task"?(y(),k(o,{key:0,label:"任务ID",prop:"task_id",align:"center",width:"100"})):N("",!0),l(o,{label:"数据集名称",prop:"name",align:"center"}),l(o,{label:"数据类型",align:"center",width:"110"},{default:e(({row:t})=>[l(v,{type:"primary",size:"small"},{default:e(()=>[i(p(b(P)[String(t.type).toLowerCase()]||t.type||"-"),1)]),_:2},1024)]),_:1}),l(o,{label:"存储位置",align:"center",width:"110"},{default:e(({row:t})=>[l(v,{type:"success",size:"small"},{default:e(()=>[i(p(b(S)[t.storage_type]||t.storage_type||"-"),1)]),_:2},1024)]),_:1}),l(o,{label:"大小",align:"center",width:"100"},{default:e(({row:t})=>[i(p(t.size&&t.size!=="0 B"&&t.size!=="0"?t.size:"-"),1)]),_:1}),l(o,{label:"数据条数",align:"center",width:"100"},{default:e(({row:t})=>[i(p(t.count||0),1)]),_:1}),l(o,{label:"描述",align:"center","show-overflow-tooltip":""},{default:e(({row:t})=>[i(p(t.description||"-"),1)]),_:1}),l(o,{label:"创建时间",align:"center",width:"180"},{default:e(({row:t})=>[i(p(t.create_time?new Date(t.create_time).toLocaleString("zh-CN"):"-"),1)]),_:1})]),actions:e(({row:t})=>[r("div",U,[l(m,{type:"primary",link:"",size:"small",onClick:g=>x(t)},{default:e(()=>[...a[2]||(a[2]=[r("i",{class:"fa fa-eye",style:{"margin-right":"4px"}},null,-1),i("详情 ",-1)])]),_:1},8,["onClick"]),l(m,{type:"success",link:"",size:"small",onClick:g=>z(t)},{default:e(()=>[...a[3]||(a[3]=[r("i",{class:"fa fa-download",style:{"margin-right":"4px"}},null,-1),i("下载 ",-1)])]),_:1},8,["onClick"]),l(m,{type:"danger",link:"",size:"small",onClick:g=>_(t)},{default:e(()=>[...a[4]||(a[4]=[r("i",{class:"fa fa-trash-o",style:{"margin-right":"4px"}},null,-1),i("删除 ",-1)])]),_:1},8,["onClick"])])]),_:1},8,["data","loading","create-text"])}}}),Tt=j(Z,[["__scopeId","data-v-75b95d11"]]);export{Tt as default};
