UploadFile-1ba1f2d0.js 1.5 KB

1
  1. import{d as g,i as v,r as x,x as I,o as U,C as w,A as r,B as z,aO as D,f as F,D as A,a as t,J as B,bh as S,_ as j,__tla as q}from"./index-286756b9.js";import{b as C,a as E,U as H,H as J,__tla as O}from"./upload-062e6093.js";import{u as P,__tla as $}from"./useMessage-084b1e70.js";import{U as i,__tla as k}from"./useUpload-3c8bb42c.js";let _,G=Promise.all([(()=>{try{return q}catch{}})(),(()=>{try{return O}catch{}})(),(()=>{try{return $}catch{}})(),(()=>{try{return k}catch{}})()]).then(async()=>{let l;l={class:"el-upload__tip",style:{"margin-left":"5px"}},_=j(g({__name:"UploadFile",props:{type:{type:String,required:!0}},emits:["uploaded"],setup(n,{emit:p}){const e=P(),d=n,c=v("accountId"),o=x([]),u=p,s=I({type:i.Image,title:"",introduction:"",accountId:c}),m=d.type===i.Image?C:E,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,K)=>{const h=B,b=S;return U(),w(b,{action:t(H),headers:t(J),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,[D(a.$slots,"default",{},void 0,!0)])]),default:r(()=>[F(h,{type:"primary",plain:""},{default:r(()=>[A(" \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{G as __tla,_ as default};