UploadFile-ad5120cf.js 1.6 KB

1
  1. import{d as b,aU as I,r as U,f as v,o as w,l as x,w as r,g as F,aF as H,i as S,j,a as t,J as k,bo as q,_ as z,__tla as D}from"./index-b2b3c6c4.js";import{b as E,a as J,U as P,H as R,__tla as X}from"./upload-8417e65b.js";import{u as $,__tla as A}from"./useMessage-a5edbb0f.js";import{U as i,__tla as B}from"./useUpload-fb27bbcc.js";let _,C=Promise.all([(()=>{try{return D}catch{}})(),(()=>{try{return X}catch{}})(),(()=>{try{return A}catch{}})(),(()=>{try{return B}catch{}})()]).then(async()=>{let l;l={class:"el-upload__tip",style:{"margin-left":"5px"}},_=z(b({__name:"UploadFile",props:{type:{type:String,required:!0}},emits:["uploaded"],setup(n,{emit:p}){const e=$(),u=n,d=I("accountId"),o=U([]),c=p,s=v({type:i.Image,title:"",introduction:"",accountId:d}),m=u.type===i.Image?E:J,f=a=>{if(a.code!==0)return e.alertError("\u4E0A\u4F20\u51FA\u9519\uFF1A"+a.msg),!1;o.value=[],s.title="",s.introduction="",e.notifySuccess("\u4E0A\u4F20\u6210\u529F"),c("uploaded")},y=a=>e.error("\u4E0A\u4F20\u5931\u8D25: "+a.message);return(a,G)=>{const g=k,h=q;return w(),x(h,{action:t(P),headers:t(R),multiple:"",limit:1,"file-list":t(o),data:t(s),"on-error":y,"before-upload":t(m),"on-success":f},{tip:r(()=>[F("span",l,[H(a.$slots,"default",{},void 0,!0)])]),default:r(()=>[S(g,{type:"primary",plain:""},{default:r(()=>[j(" \u70B9\u51FB\u4E0A\u4F20 ")]),_:1})]),_:3},8,["action","headers","file-list","data","before-upload"])}}}),[["__scopeId","data-v-9db5701b"],["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/mp/material/components/UploadFile.vue"]])});export{C as __tla,_ as default};