yifengyide/public/dist/assets/index-9220a626.js

2 lines
27 KiB
JavaScript
Raw Normal View History

import{d as ve,a as m,r as he,o as ye,T as ke,i as Ne,b as f,j as B,f as Y,k as ie,l as de,g as fe,m as ee,p as Ve,q as le,s as ne,u as we,v as xe,x as O,F as ue,y as se,e as d,w as c,z as Z,c as F,A as X,t as ge,B as re,C as Me,D as Be,E as Oe,G as ce,H as $e,I as pe,L as Ae,J as Fe,Y as Ke,V as Pe,K as He,M as Ye,N as E,O as De,P as Ge,Q as je,R as We,S as Re,W as Je,X as Qe,Z as qe,$ as Xe,a0 as Ze,a1 as el,a2 as ll,a3 as al,a4 as tl,U as ol,_ as nl}from"./index-7b3f5fdc.js";import{c as ul}from"./index-a832a56d.js";/* empty css */import{L as dl,g as Se,a as il}from"./index-e96dc078.js";import{w as sl}from"./index-81f068f9.js";import{V as rl}from"./index-a513db85.js";import{y as cl,f as pl}from"./index-4ab1e1d9.js";import{n as vl,b as ml}from"./index-c31677f3.js";import{j as hl}from"./index-d0b57c12.js";const yl={class:"layui-scroll-y"},be=ve({name:"LayScroll",__name:"index",props:{height:{default:"100%"},trackColor:{default:"rgba(0,0,0,0)"},thumbColor:{default:"#eeeeee"},thumbWidth:{default:6}},emits:["arrive"],setup(y,{emit:J}){const K=J,S=m(),L=m(),s=he({translateY:0,heightPre:0,barHeight:0,winWidth:document.body.clientWidth});let P,_=!1,I=0,b=0,j=0,$=0;ye(()=>{w(),V();const{stop:e}=ke(S.value,N);P=e,ke(L.value,N)}),Ne(()=>{window.clearInterval(void 0),P&&P()});const w=function(){let e;window.addEventListener("resize",()=>{s.winWidth=document.body.clientWidth,clearTimeout(e),e=setTimeout(()=>{N()},500)})},V=function(){new(window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver)(e=>{N()}).observe(S.value,{attributes:!0,childList:!0,subtree:!0})},N=function(){let e=S.value,x=L.value;e&&x&&($=e.scrollHeight,j=e.clientHeight,b=x.clientHeight,s.heightPre=j/$,s.barHeight=s.heightPre*b)},z=e=>{s.translateY=e.target.scrollTop*s.heightPre,s.translateY==0?h("top"):e.target.scrollTop+e.target.offsetHeight==e.target.scrollHeight&&h("bottom")},h=e=>{K("arrive",e)},T=e=>{_=!0,I=e.clientY-s.translateY,M(),D()},M=()=>{document.onmousemove=e=>{_&&(e.clientY-I>b-s.barHeight?s.translateY=b-s.barHeight:e.clientY-I<0?s.translateY=0:s.translateY=e.clientY-I,S.value&&(S.value.scrollTop=s.translateY/s.heightPre))}},D=function(){document.onmouseup=e=>{_&&(_=!1)}};return(e,x)=>(f(),B("div",{class:ee(["layui-scroll",{hide:s.winWidth<500}]),style:de({height:e.height})},[Y("div",yl,[Y("div",{ref_key:"scrollRef",ref:S,class:"layui-scroll-wrap",onScroll:z},[ie(e.$slots,"default")],544),Y("div",{ref_key:"barRef",ref:L,class:"layui-scroll-track",style:de({backgroundColor:s.heightPre==1?"transparent":e.trackColor})},[Y("div",{style:de({height:s.barHeight+"px",width:e.thumbWidth+"px",transform:"translateY("+s.translateY+"px)",backgroundColor:s.heightPre==1?"transparent":e.thumbColor}),class:"layui-scroll-thumb",onMousedown:fe(T,["stop","prevent"])},null,36)],4)])],6))}});Ve(be);function Ce(y){var J,K,S,L;const s=m([]),P=m(y.onlyLastLevel),_=m(y.multiple),I=m(y.decollator),b=m(new Map),j=m(y.alwaysLazy),$=m((J=y.style)==null?void 0:J.loadingTheme),w=m(y.checkStrictly),V=m(y.changeOnSelect),N=m([]),z=m(y.modelValue??[]),h=m(typeof z.value=="string"?z.value.split(I.value??"/"):Array.isArray(z.value)?[...z.value]:[]),T=m({label:((K=y.replaceFields)==null?void 0:K.label)??"label",value:((S=y.replaceFields)==null?void 0:S.value)??"value",children:((L=y.replaceFields)==null?void 0:L.children)??"children"}),M=(l,u)=>l.map(o=>{const n={label:o[T.value.label],value:o[T.value.value],loading:!1,slot:o.slot,indeterminate:!1,checked:!1,selected:!1,disabled:o.disabled,children:void 0,orig:void 0,parent:u};return n.children=o[T.value.children]?M(o[T.value.children],n):void 0,n.orig=o,n});s.value=M(y.options??[],void 0);const D=le(()=>{const l=_.value?[...b.value.values()].map(n=>x.value.find(p=>p.value===n.value)):h.value.map(n=>x.value.find(p=>p.value===n)),u=n=>{if(!n)return[];let p=[];return p=n.parent?[...u(n.parent),n.label]:[n.label],p},o=l.map(n=>y.fullpath&&_.value?u(n).join(y.decollator):(n==null?void 0:n.label)??"");return _.value?o:P.value?(o==null?void 0:o.pop())??"":o.join(` ${y.decollator} `)}),e=le(()=>(l=>{con