import{_ as J,__tla as L}from"./Dialog-4c2de357.js";import{d as P,P as R,r as s,o as S,C as q,A as r,f as _,a,D as p,a2 as F,B as d,d0 as E,d1 as G,bh as H,J as K,_ as M,__tla as N}from"./index-286756b9.js";import{u as O,__tla as Q}from"./useMessage-084b1e70.js";let b,T=Promise.all([(()=>{try{return L}catch{}})(),(()=>{try{return N}catch{}})(),(()=>{try{return Q}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),b=M(P({name:"InfraFileForm",__name:"FileForm",emits:["success"],setup(W,{expose:x,emit:k}){const{t:z}=R(),o=O(),l=s(!1),i=s(!1),h=s(),u=s([]),g=s({path:""}),n=s();x({open:async()=>{l.value=!0,B()}});const C=e=>{g.value.path=e.name},V=()=>{var e;u.value.length!=0?(h.value={Authorization:"Bearer "+E(),"tenant-id":G()},(e=a(n))==null||e.submit()):o.error("\u8BF7\u4E0A\u4F20\u6587\u4EF6")},j=k,w=()=>{var e;l.value=!1,i.value=!1,(e=a(n))==null||e.clearFiles(),o.success(z("common.createSuccess")),j("success")},A=()=>{o.error("\u4E0A\u4F20\u5931\u8D25\uFF0C\u8BF7\u60A8\u91CD\u65B0\u4E0A\u4F20\uFF01"),i.value=!1},B=()=>{var e;i.value=!1,(e=n.value)==null||e.clearFiles()},D=()=>{o.error("\u6700\u591A\u53EA\u80FD\u4E0A\u4F20\u4E00\u4E2A\u6587\u4EF6\uFF01")};return(e,t)=>{const U=H,y=K,I=J;return S(),q(I,{modelValue:a(l),"onUpdate:modelValue":t[2]||(t[2]=c=>F(l)?l.value=c:null),title:"\u4E0A\u4F20\u6587\u4EF6"},{footer:r(()=>[_(y,{disabled:a(i),type:"primary",onClick:V},{default:r(()=>[p("\u786E \u5B9A")]),_:1},8,["disabled"]),_(y,{onClick:t[1]||(t[1]=c=>l.value=!1)},{default:r(()=>[p("\u53D6 \u6D88")]),_:1})]),default:r(()=>[_(U,{ref_key:"uploadRef",ref:n,"file-list":a(u),"onUpdate:fileList":t[0]||(t[0]=c=>F(u)?u.value=c:null),action:a("https://pt.letcgo.com/admin-api/infra/file/upload"),"auto-upload":!1,data:a(g),disabled:a(i),headers:a(h),limit:1,"on-change":C,"on-error":A,"on-exceed":D,"on-success":w,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-admin/src/views/infra/file/FileForm.vue"]])});export{T as __tla,b as default};