UploadFile-dd1efc70.js 1.5 KB

1
  1. import{d as h,bL as v,r as I,e as U,o as x,v as w,w as s,g as z,az as F,f as S,n as q,a as t,C,b2 as j,_ as D,__tla as E}from"./index-6d7b82ba.js";import{b as H,a as L,U as P,H as $,__tla as k}from"./upload-f2f8758d.js";import{u as A,__tla as B}from"./useMessage-be161634.js";import{U as i,__tla as G}from"./useUpload-917ff9fe.js";let _,J=Promise.all([(()=>{try{return E}catch{}})(),(()=>{try{return k}catch{}})(),(()=>{try{return B}catch{}})(),(()=>{try{return G}catch{}})()]).then(async()=>{let l;l={class:"el-upload__tip",style:{"margin-left":"5px"}},_=D(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,r=U({type:i.Image,title:"",introduction:"",accountId:c}),m=d.type===i.Image?H:L,f=a=>{if(a.code!==0)return e.alertError("\u4E0A\u4F20\u51FA\u9519\uFF1A"+a.msg),!1;o.value=[],r.title="",r.introduction="",e.notifySuccess("\u4E0A\u4F20\u6210\u529F"),u("uploaded")},y=a=>e.error("\u4E0A\u4F20\u5931\u8D25: "+a.message);return(a,K)=>{const b=C,g=j;return x(),w(g,{action:t(P),headers:t($),multiple:"",limit:1,"file-list":t(o),data:t(r),"on-error":y,"before-upload":t(m),"on-success":f},{tip:s(()=>[z("span",l,[F(a.$slots,"default",{},void 0,!0)])]),default:s(()=>[S(b,{type:"primary",plain:""},{default:s(()=>[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{J as __tla,_ as default};