You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
1.1KB

  1. import{d as m,y as u,c as f,e as a,f as c,g as i,t as p,h as y,k as w,A as _}from"./index.88314652.js";const k={key:0,class:"accessory text-primary flex items-center flex-wrap"},v={key:1},x=m({name:"accessory"}),N=Object.assign(x,{props:{fileName:{type:String,default:""},fileId:{type:Number,default:void 0},isDownLoad:{type:Boolean,default:!0}},setup(t){const s=t,l=async()=>{const o=await _({fileId:s.fileId}),n=URL.createObjectURL(o),e=document.createElement("a");e.style.display="none",e.href=n,e.download=s.fileName,document.body.appendChild(e),e.click(),document.body.removeChild(e),window.URL.revokeObjectURL(n)},r=u(),d=()=>{const o=r.resolve({path:"/fileView",query:{id:s.fileId}});window.open(o.href,"_blank")};return(o,n)=>{const e=f("svg-icon");return t.fileName&&t.fileId?(a(),c("div",k,[i("span",{class:"cursor-pointer",onClick:d},p(t.fileName||"-"),1),t.isDownLoad?(a(),c("p",{key:0,class:"ml-16 flex items-center text-primary btn cursor-pointer",onClick:l},[y(e,{name:"down-icon",class:"mr-2 text-14"}),n[0]||(n[0]=i("span",null,"\u4E0B\u8F7D",-1))])):w("",!0)])):(a(),c("span",v,"-"))}}});export{N as _};