Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

2 строки
1.5KB

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