UploadFile-7b26fc36.js 1.5 KB

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