import{_ as I,__tla as L}from"./Dialog-2be588df.js";import{d as M,i as P,r as t,o as Q,x as R,w as r,g as _,a,q as p,Q as y,h as d,b8 as S,b9 as E,ba as G,D as H,_ as J,__tla as K}from"./index-7d5b26d3.js";import{u as N,__tla as O}from"./useMessage-c81eaa5b.js";let F,T=Promise.all([(()=>{try{return L}catch{}})(),(()=>{try{return K}catch{}})(),(()=>{try{return O}catch{}})()]).then(async()=>{let m,f,v;m=d("i",{class:"el-icon-upload"},null,-1),f=d("div",{class:"el-upload__text"},[p(" \u5C06\u6587\u4EF6\u62D6\u5230\u6B64\u5904\uFF0C\u6216 "),d("em",null,"\u70B9\u51FB\u4E0A\u4F20")],-1),v=d("div",{class:"el-upload__tip",style:{color:"red"}}," \u63D0\u793A\uFF1A\u4EC5\u5141\u8BB8\u5BFC\u5165 jpg\u3001png\u3001gif \u683C\u5F0F\u6587\u4EF6\uFF01 ",-1),F=J(M({name:"InfraFileForm",__name:"FileForm",emits:["success"],setup(W,{expose:x,emit:k}){const{t:w}=P(),o=N(),l=t(!1),i=t(!1),h=t(),u=t([]),g=t({path:""}),n=t();x({open:async()=>{l.value=!0,U()}});const z=e=>{g.value.path=e.name},V=()=>{var e;u.value.length!=0?(h.value={Authorization:"Bearer "+S(),"tenant-id":E()},(e=a(n))==null||e.submit()):o.error("\u8BF7\u4E0A\u4F20\u6587\u4EF6")},j=k,C=()=>{var e;l.value=!1,i.value=!1,(e=a(n))==null||e.clearFiles(),o.success(w("common.createSuccess")),j("success")},D=()=>{o.error("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u60A8\u91CD\u65B0\u4E0A\u4F20\uFF01"),i.value=!1},U=()=>{var e;i.value=!1,(e=n.value)==null||e.clearFiles()},q=()=>{o.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20\u4E00\u4E2A\u6587\u4EF6\uFF01")};return(e,s)=>{const A=G,b=H,B=I;return Q(),R(B,{modelValue:a(l),"onUpdate:modelValue":s[2]||(s[2]=c=>y(l)?l.value=c:null),title:"\u4E0A\u4F20\u6587\u4EF6"},{footer:r(()=>[_(b,{disabled:a(i),type:"primary",onClick:V},{default:r(()=>[p("\u786E \u5B9A")]),_:1},8,["disabled"]),_(b,{onClick:s[1]||(s[1]=c=>l.value=!1)},{default:r(()=>[p("\u53D6 \u6D88")]),_:1})]),default:r(()=>[_(A,{ref_key:"uploadRef",ref:n,"file-list":a(u),"onUpdate:fileList":s[0]||(s[0]=c=>y(u)?u.value=c:null),action:a("https://sh.letcgo.com/admin-api/infra/file/upload"),"auto-upload":!1,data:a(g),disabled:a(i),headers:a(h),limit:1,"on-change":z,"on-error":D,"on-exceed":q,"on-success":C,accept:".jpg, .png, .gif",drag:""},{tip:r(()=>[v]),default:r(()=>[m,f]),_:1},8,["file-list","action","data","disabled","headers"])]),_:1},8,["modelValue"])}}}),[["__file","D:/zx/mall-newfeifan-zx-business/src/views/infra/file/FileForm.vue"]])});export{T as __tla,F as default};
