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.e8ed5239.1778429407531.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 y=g,f=e,h=a(f.modelValue),v=e=>{1===e.code&&y("update:modelValue",e.data.url)},V=e=>{y("update:modelValue",e)};return l((()=>f.modelValue),(e=>{e!==h.value&&(h.value=e)})),(a,l)=>{const g=t("el-image"),y=t("el-input"),f=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(y,{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(f,{type:"primary"},{default:r((()=>l[1]||(l[1]=[n("上传文件")]))),_:1})])),_:1},8,["data","accept","action"])])}}};export{g as _};
