import{g as R,h as i,x as P,P as M,r,o as h,c as F,b as t,w as l,s as C,bM as N,a as v,F as L,N as U,q as S,D,Y as I,e as j,p as T,f as q,_ as Y}from"./index.df7b46f6.js";const z=["src"],G=R({__name:"index",props:{modelValue:Array,multiple:{type:Boolean,default:!0},listType:{type:String,default:"picture-card"},showFileList:{type:Boolean,default:!0}},emits:["update"],setup(d,{emit:y}){const w=d;let f=i([]);const g=i(""),p=i(!1),$=(a,_)=>{console.log(a,_)},b=(a,_)=>new Promise((e,c)=>{var o=new FileReader;let u=/\.jpg$|\.jpeg$|\.gif$|\.png$/i;o.readAsDataURL(a);let s=a.name;u.test(s)?o.onload=n=>{f.value.push({name:s,url:n.target.result}),y("update",f.value),e(n.target.result)}:(U.error("\u8BF7\u4E0A\u4F20\u56FE\u7247"),c())}),B=a=>{g.value=a.url,p.value=!0};return P(()=>{M(()=>w.modelValue,a=>{f.value=a},{immediate:!0})}),(a,_)=>{const e=r("el-icon"),c=r("el-upload"),o=r("el-dialog");return h(),F(L,null,[t(c,{action:"","before-upload":b,"list-type":d.listType,multiple:d.multiple,"on-preview":B,"on-remove":$,"file-list":C(f)},{default:l(()=>[t(e,null,{default:l(()=>[t(C(N))]),_:1})]),_:1},8,["list-type","multiple","file-list"]),t(o,{modelValue:p.value,"onUpdate:modelValue":_[0]||(_[0]=u=>p.value=u),width:"50%",top:"80px"},{default:l(()=>[v("img",{"w-full":"",src:g.value,alt:"\u9884\u89C8\u56FE\u7247",style:{width:"100%"}},null,8,z)]),_:1},8,["modelValue"])],64)}}}),E=d=>(T("data-v-9665cd80"),d=d(),q(),d),H={class:"app-container"},J=E(()=>v("span",null,"\u6309\u94AE\u4E0A\u4F20",-1)),K={class:"demo-image__preview"},O={class:"upload-list"},Q=E(()=>v("span",null,"\u591A\u56FE\u7247\u4E0A\u4F20",-1)),W=E(()=>v("span",null,"\u62D6\u62FD\u4E0A\u4F20",-1)),X={class:"upload-list"},Z=E(()=>v("div",{class:"el-upload__text"},[j(" \u62D6\u62FD\u4E0A\u4F20 "),v("em",null,"\u6216\u8005\u70B9\u51FB\u4E0A\u4F20")],-1)),ee=R({__name:"index",setup(d){const y=i([{url:S,name:"female.png",uid:"1651408956803",status:"success"}]);i([]);const w=i(0),f=i(0),g=i([]),p=i([]),$=e=>{console.log("valll======",e)},b=e=>{w.value=e},B=e=>{w.value=e},a=(e,c)=>new Promise((o,u)=>{var s=new FileReader;let n=/\.jpg$|\.jpeg$|\.gif$|\.png$/i;s.readAsDataURL(e);let x=e.name;n.test(x)?s.onload=m=>{g.value.push(m.target.result),o(m.target.result)}:(U.error("\u8BF7\u4E0A\u4F20\u56FE\u7247"),u())}),_=(e,c)=>new Promise((o,u)=>{var s=new FileReader;let n=/\.jpg$|\.jpeg$|\.gif$|\.png$/i;s.readAsDataURL(e);let x=e.name;n.test(x)?s.onload=m=>{p.value.push(m.target.result),o(m.target.result)}:(U.error("\u8BF7\u4E0A\u4F20\u56FE\u7247"),u())});return(e,c)=>{const o=r("el-image"),u=r("el-button"),s=r("el-upload"),n=r("el-card"),x=r("upload-filled"),m=r("el-icon");return h(),F("div",H,[t(n,{style:{"margin-bottom":"10px"}},{header:l(()=>[J]),default:l(()=>[v("div",K,[(h(!0),F(L,null,D(g.value,(A,V)=>(h(),F("div",O,[t(o,{onClick:I(k=>b(V),["stop"]),style:{width:"100%",height:"100%"},src:A,"preview-src-list":g.value,"initial-index":w.value,fit:"cover"},null,8,["onClick","src","preview-src-list","initial-index"])]))),256))]),t(s,{action:"/",multiple:"","before-upload":a},{default:l(()=>[t(u,{type:"primary"},{default:l(()=>[j("\u70B9\u51FB\u4E0A\u4F20")]),_:1})]),_:1})]),_:1}),t(n,{style:{"margin-bottom":"10px"}},{header:l(()=>[Q]),default:l(()=>[t(G,{onUpdate:$,modelValue:y.value,"onUpdate:modelValue":c[0]||(c[0]=A=>y.value=A)},null,8,["modelValue"])]),_:1}),t(n,null,{header:l(()=>[W]),default:l(()=>[(h(!0),F(L,null,D(p.value,(A,V)=>(h(),F("div",X,[t(o,{onClick:I(k=>B(V),["stop"]),style:{width:"100%",height:"100%"},src:A,"preview-src-list":p.value,"initial-index":f.value,fit:"cover"},null,8,["onClick","src","preview-src-list","initial-index"])]))),256)),t(s,{class:"upload-demo",drag:"","before-upload":_,action:"/",multiple:""},{default:l(()=>[t(m,{class:"el-icon--upload"},{default:l(()=>[t(x)]),_:1}),Z]),_:1})]),_:1})])}}});const le=Y(ee,[["__scopeId","data-v-9665cd80"]]);export{le as default};
