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.6KB

  1. 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,A as p,e as k,f as l,g as f,h as y,t as _,k as v,i as m,I as x,_ as h,C}from"./index.11dc4694.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=k("svg-icon");return n.fileName&&n.fileId?(l(),f("div",D,[y("span",{class:"cursor-pointer",onClick:i},_(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,"-"))}}}),O=h(B,[["__file","/Users/chenlixin/Documents/work/NDKJ/MyProject/ls-project-v2.0/src/components/accessory/index.vue"]]);export{O as A};