UploadFile-a148bb96.js 1.5 KB

1
  1. import{d as h,bP as v,r as I,e as U,o as x,v as w,w as r,g as z,aG as F,f as S,m as q,a as t,C,bb as P,_ as j,__tla as D}from"./index-430b3151.js";import{b as E,a as G,U as H,H as $,__tla as k}from"./upload-e91ca8b5.js";import{u as A,__tla as B}from"./useMessage-d226ba89.js";import{U as i,__tla as J}from"./useUpload-d575fd30.js";let _,K=Promise.all([(()=>{try{return D}catch{}})(),(()=>{try{return k}catch{}})(),(()=>{try{return B}catch{}})(),(()=>{try{return J}catch{}})()]).then(async()=>{let l;l={class:"el-upload__tip",style:{"margin-left":"5px"}},_=j(h({__name:"UploadFile",props:{type:{type:String,required:!0}},emits:["uploaded"],setup(n,{emit:p}){const e=A(),d=n,c=v("accountId"),o=I([]),u=p,s=U({type:i.Image,title:"",introduction:"",accountId:c}),m=d.type===i.Image?E:G,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"),u("uploaded")},y=a=>e.error("\u4E0A\u4F20\u5931\u8D25: "+a.message);return(a,L)=>{const b=C,g=P;return x(),w(g,{action:t(H),headers:t($),multiple:"",limit:1,"file-list":t(o),data:t(s),"on-error":y,"before-upload":t(m),"on-success":f},{tip:r(()=>[z("span",l,[F(a.$slots,"default",{},void 0,!0)])]),default:r(()=>[S(b,{type:"primary",plain:""},{default:r(()=>[q(" \u70B9\u51FB\u4E0A\u4F20 ")]),_:1})]),_:3},8,["action","headers","file-list","data","before-upload"])}}}),[["__scopeId","data-v-9db5701b"],["__file","D:/zx/mall-newfeifan-zx-admin/src/views/mp/material/components/UploadFile.vue"]])});export{K as __tla,_ as default};