index-f532aa07.js 5.15 KB
var ee=Object.defineProperty,te=Object.defineProperties;var oe=Object.getOwnPropertyDescriptors;var M=Object.getOwnPropertySymbols;var ne=Object.prototype.hasOwnProperty,ae=Object.prototype.propertyIsEnumerable;var V=(n,e,o)=>e in n?ee(n,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[e]=o,T=(n,e)=>{for(var o in e||(e={}))ne.call(e,o)&&V(n,o,e[o]);if(M)for(var o of M(e))ae.call(e,o)&&V(n,o,e[o]);return n},D=(n,e)=>te(n,oe(e));var K=(n,e,o)=>new Promise((r,m)=>{var C=i=>{try{g(o.next(i))}catch(P){m(P)}},b=i=>{try{g(o.throw(i))}catch(P){m(P)}},g=i=>i.done?r(i.value):Promise.resolve(i.value).then(C,b);g((o=o.apply(n,e)).next())});import{h as U,j as re,_ as X,aB as se,ak as ie,aK as ce,p as h,aG as le,aj as Z}from"./index.js";import{d as J,_ as E,$ as z,a0 as A,R as F,a2 as x,u as f,ag as O,k as w,w as Q,q as N,G as ue,M as fe,ah as ge,p as pe,e as y,a9 as G,ae as de,ab as he,aa as W,ad as me,ac as q,aj as _e,ak as He,F as ve,E as ye,a1 as Fe}from"./vue-5a35c3f5.js";import{a as be}from"./useContentViewHeight-d0a5c58e.js";import{o as Pe}from"./onMountedOrActivated-52afb7a7.js";import{u as ke}from"./useWindowSizeFn-cc2fb57c.js";import{K as L,bl as Ce}from"./antd-6b087f69.js";const $e=J({name:"PageFooter",inheritAttrs:!1,__name:"PageFooter",setup(n){const{prefixCls:e}=U("page-footer"),{getCalcContentWidth:o}=re();return(r,m)=>(E(),z("div",{class:x(f(e)),style:O({width:f(o)})},[A("div",{class:x(`${f(e)}__left`)},[F(r.$slots,"left",{},void 0,!0)],2),F(r.$slots,"default",{},void 0,!0),A("div",{class:x(`${f(e)}__right`)},[F(r.$slots,"right",{},void 0,!0)],2)],6))}});const Y=X($e,[["__scopeId","data-v-482361d0"],["__file","E:/allcode/erp/test7901/order-erp-front/src/components/Page/src/PageFooter.vue"]]);function Re(n,e,o,r,m=0,C=w(0)){const b=w(null),{footerHeightRef:g}=be();let i={useLayoutFooter:!0};const P=s=>{i=s};function j(){N(()=>{R()})}function k(s,S="all"){var v,a,d,H;function _(t){return Number(t.replace(/[^\d]/g,""))}let l=0;const p="0px";if(s){const t=getComputedStyle(s),u=_((v=t==null?void 0:t.marginTop)!=null?v:p),c=_((a=t==null?void 0:t.marginBottom)!=null?a:p),B=_((d=t==null?void 0:t.paddingTop)!=null?d:p),I=_((H=t==null?void 0:t.paddingBottom)!=null?H:p);S==="all"?(l+=u,l+=c,l+=B,l+=I):S==="top"?(l+=u,l+=B):(l+=c,l+=I)}return l}function $(s){return s==null?null:s instanceof HTMLDivElement?s:s.$el}function R(){return K(this,null,function*(){var H;if(!n.value)return;yield N();const s=$(f(e));if(!s)return;const{bottomIncludeBody:S}=se(s);let _=0;o.forEach(t=>{var u,c;_+=(c=(u=$(f(t)))==null?void 0:u.offsetHeight)!=null?c:0});let l=(H=k(s))!=null?H:0;r.forEach(t=>{l+=k($(f(t)))});let p=0;function v(t,u){if(t&&u){const c=t.parentElement;c&&(ie(u)?c.classList.contains(u)?p+=k(c,"bottom"):(p+=k(c,"bottom"),v(c,u)):ce(u)&&u>0&&(p+=k(c,"bottom"),v(c,--u)))}}ue(m)?v(s,f(m)):v(s,m);let a=S-f(g)-f(C)-_-l-p;const d=()=>{var t;(t=i.elements)==null||t.forEach(u=>{var c,B;a+=(B=(c=$(f(u)))==null?void 0:c.offsetHeight)!=null?B:0})};i.useLayoutFooter&&f(g)>0,d(),b.value=a})}return Pe(()=>{N(()=>{R()})}),ke(()=>{R()},{wait:50,immediate:!0}),Q(()=>[g.value],()=>{R()},{flush:"post",immediate:!0}),{redoHeight:j,setCompensation:P,contentHeight:b}}const Se=J({name:"PageWrapper",inheritAttrs:!1,__name:"PageWrapper",props:{title:h.string,dense:h.bool,ghost:h.bool,content:h.string,contentStyle:{type:Object},contentBackground:h.bool,contentFullHeight:h.bool.def(!1),contentClass:h.string,fixedHeight:h.bool,upwardSpace:h.oneOfType([h.number,h.string]).def(0)},setup(n){const e=n,o=fe(),r=ge(),m=w(null),C=w(null),b=w(null),g=w(null),{prefixCls:i}=U("page-wrapper");pe(le,y(()=>e.fixedHeight));const P=y(()=>e.contentFullHeight),j=y(()=>e.upwardSpace),{redoHeight:k,setCompensation:$,contentHeight:R}=Re(P,m,[C,g],[b],j);$({useLayoutFooter:!0,elements:[g]});const s=y(()=>{var a;return[i,{[`${i}--dense`]:e.dense},(a=o.class)!=null?a:{}]}),S=y(()=>e.content||(r==null?void 0:r.headerContent)||e.title||l.value.length),_=y(()=>(r==null?void 0:r.leftFooter)||(r==null?void 0:r.rightFooter)),l=y(()=>Object.keys(L(r,"default","leftFooter","rightFooter","headerContent"))),p=y(()=>{const{contentFullHeight:a,contentStyle:d,fixedHeight:H}=e;if(!a)return T({},d);const t=`${f(R)}px`;return T(D(T({},d),{minHeight:t}),H?{height:t}:{})}),v=y(()=>{const{contentBackground:a,contentClass:d}=e;return[`${i}-content`,d,{[`${i}-content-bg`]:a}]});return Q(()=>[_.value],()=>{k()},{flush:"post",immediate:!0}),(a,d)=>(E(),z("div",{class:x(s.value),ref_key:"wrapperRef",ref:m},[S.value?(E(),G(f(Ce),me({key:0,ghost:n.ghost,title:n.title},f(L)(a.$attrs,"class"),{ref_key:"headerRef",ref:C}),de({default:W(()=>[n.content?(E(),z(ve,{key:0},[ye(Fe(n.content),1)],64)):F(a.$slots,"headerContent",{key:1})]),_:2},[he(l.value,H=>({name:H,fn:W(t=>[F(a.$slots,H,_e(He(t||{})))])}))]),1040,["ghost","title"])):q("v-if",!0),A("div",{class:x(["overflow-hidden",v.value]),style:O(p.value),ref_key:"contentRef",ref:b},[F(a.$slots,"default")],6),_.value?(E(),G(Y,{key:1,ref_key:"footerRef",ref:g},{left:W(()=>[F(a.$slots,"leftFooter")]),right:W(()=>[F(a.$slots,"rightFooter")]),_:3},512)):q("v-if",!0)],2))}});const we=X(Se,[["__file","E:/allcode/erp/test7901/order-erp-front/src/components/Page/src/PageWrapper.vue"]]);Z(Y);const ze=Z(we);export{ze as P};