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