1 |
- import{r as l,u as e,b as a,c as t,d as s,e as o,F as r,f as c,g as i,h as n,n as u,t as d,T as f,k as v,j as p,av as g,ah as h,U as m}from"./index.1711290598880.js";const b={class:"background-addBox"},y={class:"bg-left flex flex-col relative"},x=o("div",{class:"mt-6 mb-1"},null,-1),w={class:"space-y-3 pr-1 pl-4 pb-4 overflow-y-scroll relative h-full w-full"},k=["onClick"],C={class:"flex-1 p-4 pt-0 grid grid-cols-4 gap-3",style:{"grid-template-rows":"max-content"}},_={style:{"aspect-ratio":"16 / 10"},class:"relative overflow-hidden rounded-md"},j=["src"],W={class:"absolute rounded-lg opacity-0 transition-all hover:opacity-100 inset-0 w-full h-full flex justify-center items-center",style:{"background-color":"rgba(0, 0, 0, 0.178)"}},z=["onClick"],F={class:"absolute z-10 right-0 bottom-0 w-full h-8 flex"},H=["href"],I={__name:"index",setup(I){const T=l([]),B=e(),S=l([]),U=l(),q=l=>{U.value=l.id,D=0,A=!1,S.value=[],G()};let A=!1;let D=0;const E=l=>{const{target:e}=l;A||e.scrollTop+e.clientHeight>=e.scrollHeight-100&&(A=!0,D+=1,G())},G=async()=>{try{const l=await m({url:"/Wallpaper/getFolderWallpaperClient",method:"post",data:{id:U.value,offset:D}});if(1===l.code){if(0===l.data.length)return void(A=!0);S.value.push(...l.data)}}catch(l){}A=!1};return(async()=>{const l=await m({url:"/Wallpaper/getFolderClient"});1===l.code&&(T.value=l.data,T.value.length>0&&q(T.value[0]))})(),(l,e)=>{const m=a("el-icon");return t(),s("div",b,[o("div",y,[x,o("div",w,[(t(!0),s(r,null,c(T.value,((l,e)=>(t(),i(f,{key:e},{default:n((()=>[o("div",{onClick:e=>q(l),class:u({selectWallpaperItem:U.value==l.id})},[o("span",null,d(l.name),1)],10,k)])),_:2},1024)))),128))])]),o("div",{class:"bg-right overflow-scroll",onScroll:E},[o("div",C,[(t(!0),s(r,null,c(S.value,(l=>(t(),i(f,null,{default:n((()=>[o("div",_,[o("img",{class:"rounded-md w-full h-full object-cover",src:l.cover},null,8,j),o("div",W,[o("div",{onClick:e=>(l=>{B.state.config.theme.backgroundImage=l.url,B.commit("updateConfig")})(l),class:"transition-all cursor-pointer bg-black bg-opacity-40 hover:opacity-100 hover:bg-blue-500 rounded-full flex justify-center items-center w-10 h-10"},[v(m,{size:"28px",color:"#fff"},{default:n((()=>[v(p(g))])),_:1})],8,z),o("div",F,[o("a",{target:"_blank",download:"background",href:l.url,class:"ml-auto transition-all cursor-pointer mr-2 hover:bg-blue-500 rounded-full w-6 mb-2 flex justify-center items-center"},[v(m,{size:"18px",color:"#fff"},{default:n((()=>[v(p(h))])),_:1})],8,H)])])])])),_:2},1024)))),256))])],32)])}}};export{I as default};
|