import{d as m,i as o,a as r,c as _,j as i,k as e,m as s,t as y,v as u,C as g,D as C,_ as h}from"./index-deffec86.js";const x={key:0,class:"file_container"},D={class:"left flex"},V={class:"right"},E={key:1},B=m({name:"FileViewItem"}),F=m({...B,props:{name:String,url:String},setup(n){const t=n,p=async()=>{t.url?window.open("https://qmjs.ynsport.cn/fileview/onlinePreview?url="+encodeURIComponent(g.encode(t.url))):C.warning("\u9884\u89C8\u5730\u5740\u65E0\u6548")},f=()=>{const a=document.createElement("a");a.href=t.url,a.download=t.name?t.name:"exportdata",a.click()};return(a,l)=>{const w=o("Document"),c=o("el-icon"),v=o("View"),d=o("el-link"),k=o("Download");return n.url?(r(),_("div",x,[i("div",D,[e(c,{class:"mr5"},{default:s(()=>[e(w)]),_:1}),i("span",null,y(n.name.length>20?n.name.slice(0,20)+"...":n.name),1)]),i("div",V,[e(d,{type:"primary",onClick:p,class:"mr10"},{default:s(()=>[e(c,{class:"mr5"},{default:s(()=>[e(v)]),_:1}),l[0]||(l[0]=u("\u9884\u89C8"))]),_:1}),e(d,{type:"primary",onClick:f,target:"_blank"},{default:s(()=>[e(c,{class:"mr5"},{default:s(()=>[e(k)]),_:1}),l[1]||(l[1]=u("\u4E0B\u8F7D"))]),_:1})])])):(r(),_("div",E,"\u6682\u65E0\u6587\u4EF6"))}}});const N=h(F,[["__scopeId","data-v-2edd5744"]]);export{N as default};
