index.17121500168415.js 2.8 KB

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