var u=(n,c,o)=>new Promise((r,i)=>{var s=t=>{try{e(o.next(t))}catch(d){i(d)}},a=t=>{try{e(o.throw(t))}catch(d){i(d)}},e=t=>t.done?r(t.value):Promise.resolve(t.value).then(s,a);e((o=o.apply(n,c)).next())});import{d as w,C as p,f as _,g as l,h as f,i as y,t as k,l as v,j as m,K as x,_ as h,F as C}from"./index.9fabe127.js";const D={key:0,class:"accessory flex items-center flex-wrap"},N=y("span",null,"\u4E0B\u8F7D",-1),b={key:1},g=w({name:"accessory"}),B=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 c=n,o=()=>u(this,null,function*(){const s=yield C({fileId:c.fileId}),a=URL.createObjectURL(s),e=document.createElement("a");e.style.display="none",e.href=a,e.download=c.fileName,document.body.appendChild(e),e.click(),document.body.removeChild(e),window.URL.revokeObjectURL(a)}),r=p(),i=()=>{const s=r.resolve({path:"/fileView",query:{id:c.fileId}});window.open(s.href,"_blank")};return(s,a)=>{const e=_("svg-icon");return n.fileName&&n.fileId?(l(),f("div",D,[y("span",{class:"cursor-pointer",onClick:i},k(n.fileName||"-"),1),n.isDownLoad&&!n.isOnlyDownicon?(l(),f("p",{key:0,class:"ml-16 flex items-center btn cursor-pointer",onClick:o},[v(e,{name:"down-icon",class:"mr-2 text-14"}),N])):m("v-if",!0),n.isDownLoad&&n.isOnlyDownicon?(l(),x(e,{key:1,name:"down-icon",class:"ml-2 text-20 cursor-pointer",onClick:o})):m("v-if",!0)])):(l(),f("span",b,"-"))}}}),I=h(B,[["__file","/Users/chenlixin/Documents/work/NDKJ/MyProject/ls-project-v2.0/src/components/accessory/index.vue"]]);export{I as A};
