import{y as e,r as a,w as l,a as t,b as d,c as i,f as s,l as u,j as p,g as r,i as o,L as n,a4 as c}from"./index.5f1a5861.1761573291572.js";const m={style:{width:"100%",display:"flex","align-items":"center",gap:"10px"}},g={__name:"el-input-upload",props:{placeholder:{type:String,default:"请上传文件或输入网络文件地址"},modelValue:{type:String,default:""},disk:{type:String,default:"images"},dir:{type:String,default:""},api:{type:String,default:e.state.site.upload},accept:{type:String,default:"image/*"}},emits:["update:modelValue"],setup(e,{emit:g}){const f=g,y=e,h=a(y.modelValue),v=e=>{1===e.code&&f("update:modelValue",e.data.url)},V=e=>{f("update:modelValue",e)};return l((()=>y.modelValue),(e=>{e!==h.value&&(h.value=e)})),(a,l)=>{const g=t("el-image"),f=t("el-input"),y=t("el-button"),x=t("el-upload");return d(),i("div",m,[h.value?(d(),s(g,{key:0,src:h.value,style:{width:"32px",height:"32px","border-radius":"4px","flex-shrink":"0",background:"#e6e6e6"},"preview-src-list":[h.value]},null,8,["src","preview-src-list"])):u("",!0),p(f,{onChange:V,modelValue:h.value,"onUpdate:modelValue":l[0]||(l[0]=e=>h.value=e),placeholder:e.placeholder},null,8,["modelValue","placeholder"]),p(x,{data:{disk:e.disk,dir:e.dir},"show-file-list":!1,accept:e.accept,action:o(c)+e.api,"on-success":v},{trigger:r((()=>[p(y,{type:"primary"},{default:r((()=>l[1]||(l[1]=[n("上传文件",-1)]))),_:1,__:[1]})])),_:1},8,["data","accept","action"])])}}};export{g as _};
