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 i,g as c,h as n,n as d,x as u,T as f,p,j as g,q as v,k as m,ax as b,an as h,m as y,Z as x}from"./index.1713442796762.js";const w={class:"background-addBox"},k={class:"bg-left flex flex-col relative"},j=o("div",{class:"mt-6 mb-1"},null,-1),C={class:"space-y-3 pr-1 pl-4 pb-4 overflow-y-scroll relative h-full w-full"},_=["onClick"],z={class:"flex-1 p-4 pt-0 grid grid-cols-1 xs:grid-cols-4 gap-3",style:{"grid-template-rows":"max-content"}},W={style:{"aspect-ratio":"16 / 10"},class:"relative overflow-hidden rounded-md"},F=["onLoad","src"],H={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)"}},I=["onClick"],L={class:"absolute z-10 right-0 bottom-0 w-full h-8 flex"},T=["href"],q={key:0,class:"absolute inset-0 w-full h-full z-10 bg-white bg-opacity-20 flex justify-center items-center text-white"},B={__name:"index",setup(B){const M=l([]),S=e(),Z=l([]),A=l(),D=l=>{A.value=l.id,G=0,E=!1,Z.value=[],K()};let E=!1;let G=0;const J=l=>{const{target:e}=l;E||e.scrollTop+e.clientHeight>=e.scrollHeight-100&&(E=!0,G+=1,K())},K=async()=>{try{const l=await x({url:"/Wallpaper/getFolderWallpaperClient",method:"post",data:{id:A.value,offset:G}});if(1===l.code){if(0===l.data.length)return void(E=!0);Z.value.push(...l.data)}}catch(l){}E=!1};return(async()=>{const l=await x({url:"/Wallpaper/getFolderClient"});1===l.code&&(M.value=l.data,M.value.length>0&&D(M.value[0]))})(),(l,e)=>{const x=a("el-icon");return t(),s("div",w,[o("div",k,[j,o("div",C,[(t(!0),s(r,null,i(M.value,((l,e)=>(t(),c(f,{key:e},{default:n((()=>[o("div",{onClick:e=>D(l),class:d({selectWallpaperItem:A.value==l.id})},[o("span",null,u(l.name),1)],10,_)])),_:2},1024)))),128))])]),o("div",{class:"bg-right overflow-scroll",onScroll:J},[o("div",z,[(t(!0),s(r,null,i(Z.value,(l=>(t(),c(f,null,{default:n((()=>[o("div",W,[o("img",{style:p({opacity:l.load?1:0,transition:"opacity 0.5s"}),class:"rounded-md w-full h-full object-cover",onLoad:e=>l.load=!0,src:g(v)(l.cover)},null,44,F),o("div",H,[o("div",{onClick:e=>(l=>{S.state.config.theme.backgroundImage=l.url,S.state.config.theme.backgroundMime=l.mime,S.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"},[m(x,{size:"28px",color:"#fff"},{default:n((()=>[m(g(b))])),_:1})],8,I),o("div",L,[o("a",{target:"_blank",download:"background",href:g(v)(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"},[m(x,{size:"18px",color:"#fff"},{default:n((()=>[m(g(h))])),_:1})],8,T)])]),l.load?y("",!0):(t(),s("div",q," 加载中 "))])])),_:2},1024)))),256))])],32)])}}};export{B as default};
|