import{s as e,r as a,w as l,a as t,b as d,c as s,g as i,m as u,k as p,h as r,j as o,J as n,a1 as c}from"./index.51eb0e02.1749480002384.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 h=g,y=e,f=a(y.modelValue),v=e=>{1===e.code&&h("update:modelValue",e.data.url)},V=e=>{h("update:modelValue",e)};return l((()=>y.modelValue),(e=>{e!==f.value&&(f.value=e)})),(a,l)=>{const g=t("el-image"),h=t("el-input"),y=t("el-button"),x=t("el-upload");return d(),s("div",m,[f.value?(d(),i(g,{key:0,src:f.value,style:{width:"32px",height:"32px","border-radius":"4px","flex-shrink":"0",background:"#e6e6e6"},"preview-src-list":[f.value]},null,8,["src","preview-src-list"])):u("",!0),p(h,{onChange:V,modelValue:f.value,"onUpdate:modelValue":l[0]||(l[0]=e=>f.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},8,["data","accept","action"])])}}};export{g as _};
