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 c,a4 as n}from"./index.8821dc9f.1766672520393.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(n)+e.api,"on-success":v},{trigger:r((()=>[p(y,{type:"primary"},{default:r((()=>l[1]||(l[1]=[c("上传文件")]))),_:1})])),_:1},8,["data","accept","action"])])}}};export{g as _};
