物管理前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
12 KiB

  1. import{p as Ee,d as Fe,B as Q,c as P,s as he,D as de,t as V,v as ge,x as Ie,o as T,b as k,n as W,F as q,r as U,g as ue,Q as Be}from"./index-bVOhw2NF.js";function Oe(e){return{"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regExp","[object Undefined]":"undefined","[object Null]":"null","[object Object]":"object"}[Object.prototype.toString.call(e)]}function E(e){const a=Oe(e);let o;if(a==="array")o=[];else if(a==="object")o={};else return e;if(a==="array")for(let l=0;l<e.length;l++)o.push(E(e[l]));else if(a==="object")for(const l in e)o[l]=E(e[l]);return o}function A(e,a){for(const o in a){if(e[o]&&typeof e[o]=="object"){A(e[o],a[o]);continue}if(typeof a[o]=="object"){e[o]=E(a[o]);continue}e[o]=a[o]}return e}function Pe(e,a,o){let l;function m(){const g=this,r=arguments;function h(){l&&clearTimeout(l)}function n(){e.apply(g,r)}h(),l=setTimeout(n,a)}return m}function fe(e,a){return Pe(e,a)}function qe(e,a,o){const l=he(null),m=de({width:0,height:0});let g=null;function r(h=!0){Be().then(()=>{const n=l.value;m.width=n?n.clientWidth:0,m.height=n?n.clientHeight:0,n?(!m.width||!m.height)&&console.warn("fei-datav: Component width or height is 0px, rendering abnormality may occur!"):console.warn("fei-datav: Failed to get dom node, component rendering may be abnormal!"),typeof o=="function"&&h&&o()})}return V([e,a],()=>{g&&g()}),ge(()=>{setTimeout(()=>{r()},500),g=fe(r,100)}),{domRef:l,...Q(m),resize:r}}const Ue=["列1","列2","列3"],Qe=[["行1列1","行1列2","行1列3"],["行2列1","行2列2","行2列3"],["行3列1","行3列2","行3列3"],["行4列1","行4列2","行4列3"],["行5列1","行5列2","行5列3"],["行6列1","行6列2","行6列3"],["行7列1","行7列2","行7列3"],["行8列1","行8列2","行8列3"],["行9列1","行9列2","行9列3"],["行10列1","行10列2","行10列3"]],Ve=Fe({name:"EsScrollTable",props:{options:{type:Object,default:()=>({})},datasets:{type:[Object,Array],default:()=>[]},element:{type:Object,default:()=>({})}},emits:["mouseover","itemClick"],setup(e,{emit:a}){const{rowNum:o,headerBGC:l,oddRowBGC:m,evenRowBGC:g,waitTime:r,headerHeight:h,columnWidth:n,align:v,index:f,carousel:y,hoverPause:H,fontColor:R,headerFontColor:$,oddRowGradBG:b,evenRowGradBG:w,enableBorder:M,borderColor:L,enableCarousel:X,fontSize:ce,headerFontSize:me,onlyHeaderHoriBorder:pe,onlyOuterBorder:ve,onlyHeaderBorder:be,onlyBodyBorder:$e,bodyBorderStyle:we,onlyHoriBorder:Ce,tableBGC:He,clickHighlight:Y,highlightBGC:ye,highlightGradBG:Ge,highlightNumber:J,highlightFontColor:je}=Q(e.options),F=P(()=>{var u,p;const t=n.value.map(c=>c.colW),s=v.value.map(c=>c.align);return{header:((u=e.datasets)==null?void 0:u.headerDatas)||Ue,data:((p=e.datasets)==null?void 0:p.tableDatas)||Qe,rowNum:o.value,waitTime:r.value,headerBGC:l.value,oddRowBGC:m.value||b.value,evenRowBGC:g.value||w.value,headerHeight:h.value,columnWidth:t,align:s,index:f.value,carousel:y.value,hoverPause:H.value}}),K=P(()=>Number.parseInt(e.element.width)||0),Z=P(()=>Number.parseInt(e.element.height)||0),_=he({header:[],data:[],rowNum:5,headerBGC:"#00BAFF",oddRowBGC:"#003B51",evenRowBGC:"#0A2732",waitTime:2e3,headerHeight:35,columnWidth:[],align:[],index:!1,indexHeader:"#",carousel:"single",hoverPause:!0});function ee(){D(),Ne(),De(),Me(),ie(),oe(),Se(),N(!0)}const{domRef:Re,width:te,height:ne,resize:Te}=qe(K,Z,ee),i=de({mergedConfig:null,header:[],rowsData:[],rows:[],widths:[],heights:[],avgHeight:0,aligns:[],animationIndex:0,animationHandler:"",updater:0,needCalc:!1});function ke(t,s,u,p,c){t&&se("mouseover",s,u,p,c),i.mergedConfig.hoverPause&&(t?D():N(!0))}function xe(){i.mergedConfig&&(D(),ie(),oe(!0),N(!0))}function Ne(){i.mergedConfig=A(E(_.value),F.value||{})}function De(){let{header:t,index:s,indexHeader:u}=i.mergedConfig;if(!t.length){i.header=[];return}t=[...t],s&&t.unshift(u),i.header=t}function Me(){let{data:t,index:s,headerBGC:u,rowNum:p}=i.mergedConfig;s&&(t=t.map((d,C)=>{d=[...d];const G=`<span class="index" style="background-colo