sf_web_dist/js/demo.1760700575245Dqrm1FV-.js

2 lines
6.7 KiB
JavaScript
Raw Permalink Normal View History

2025-10-17 19:30:34 +08:00
import{d as e,b as t,a as l,F as r,ax as a,f as n,r as i,a9 as o,z as s,x as p,N as c,bG as u,O as d,bH as y,bI as f,bJ as h,bK as m,bL as g,y as w,h as b,v as k,b3 as x,c as v,e as S,w as C,m as _,al as A,bM as $,a7 as T,a8 as z,J as E,t as F,Q as N,an as O,bD as L,bN as R,bO as H,g as j}from"./index.1760700575245BCb_r222.js";import{E as I}from"./el-link.1760700575245CPL1g1tH.js";const P=e({name:"ElSpaceItem",props:t({prefixCls:{type:String}}),setup(e,{slots:t}){const i=l("space"),o=r(()=>`${e.prefixCls||i.b()}__item`);return()=>a("div",{class:o.value},n(t,"default"))}}),G={small:8,default:12,large:16};const W=k(e({name:"ElSpace",props:t({direction:{type:String,values:["horizontal","vertical"],default:"horizontal"},class:{type:b([String,Object,Array]),default:""},style:{type:b([String,Array,Object]),default:""},alignment:{type:b(String),default:"center"},prefixCls:{type:String},spacer:{type:b([Object,String,Number,Array]),default:null,validator:e=>y(e)||p(e)||w(e)},wrap:Boolean,fill:Boolean,fillRatio:{type:Number,default:100},size:{type:[String,Array,Number],values:g,validator:e=>p(e)||s(e)&&2===e.length&&e.every(p)}}),setup(e,{slots:t}){const{classes:a,containerStyle:g,itemStyle:w}=function(e){const t=l("space"),a=r(()=>[t.b(),t.m(e.direction),e.class]),n=i(0),c=i(0),u=r(()=>[e.wrap||e.fill?{flexWrap:"wrap"}:{},{alignItems:e.alignment},{rowGap:`${c.value}px`,columnGap:`${n.value}px`},e.style]),d=r(()=>e.fill?{flexGrow:1,minWidth:`${e.fillRatio}%`}:{});return o(()=>{const{size:t="small",wrap:l,direction:r,fill:a}=e;if(s(t)){const[e=0,l=0]=t;n.value=e,c.value=l}else{let e;e=p(t)?t:G[t||"small"]||G.small,(l||a)&&"horizontal"===r?n.value=c.value=e:"horizontal"===r?(n.value=e,c.value=0):(c.value=e,n.value=0)}}),{classes:a,containerStyle:u,itemStyle:d}}(e);function b(t,l="",r=[]){const{prefixCls:a}=e;return t.forEach((e,t)=>{f(e)?s(e.children)&&e.children.forEach((e,t)=>{f(e)&&s(e.children)?b(e.children,`${l+t}-`,r):y(e)&&(null==e?void 0:e.type)===h?r.push(e):r.push(c(P,{style:w.value,prefixCls:a,key:`nested-${l+t}`},{default:()=>[e]},u.PROPS|u.STYLE,["style","prefixCls"]))}):m(e)&&r.push(c(P,{style:w.value,prefixCls:a,key:`LoopKey${l+t}`},{default:()=>[e]},u.PROPS|u.STYLE,["style","prefixCls"]))}),r}return()=>{var l;const{spacer:r,direction:i}=e,o=n(t,"default",{key:0},()=>[]);if(0===(null!=(l=o.children)?l:[]).length)return null;if(s(o.children)){let e=b(o.children);if(r){const t=e.length-1;e=e.reduce((e,l,a)=>{const n=[...e,l];return a!==t&&n.push(c("span",{style:[w.value,"vertical"===i?"width: 100%":null],key:a},[y(r)?r:d(r,u.TEXT)],u.STYLE)),n},[])}return c("div",{class:a.value,style:g.value},e,u.STYLE|u.CLASS)}return o.children}}})),Y={key:0},B={key:4},D=["onClick"],J={key:9},K=x({__name:"comTable",props:{config:{type:Object,default:()=>{}},tableHeader:{type:Array,default:()=>[]},tableData:{type:Array,default:()=>[]}},emits:["link-click","selection-change","row-click","sort-change","slot-click"],setup(e,{emit:t}){const l=e,r=t,a=(e,t)=>{r("link-click",e,t)},i=e=>{r("selection-change",e)},o=e=>{l.config.isRowClick&&r("row-click",e)},s=e=>{e.order&&r("sort-change",e)},p=e=>{var t=String(e).indexOf(".");-1!=t&&(String(e).substring(t+1,e.length).length>2&&(e=e.toFixed(2)));return String(e).replace(/\d+/,function(e){return e.replace(/(\d)(?=(?:\d{3})+$)/g,"$1,")})};return(t,l)=>{const r=$,u=I,y=O,f=L,h=R,m=W,g=H;return S(),v("div",null,[c(g,E({style:[{width:"100%"},`height:${e.config.tableHeight}rem;`],"max-height":e.config.tableHeight,border:""},t.$attrs,{onRowClick:o,stripe:e.config.isStripe,"show-summary":e.config.isShowSummary,onSortChange:s,onSelectionChange:i}),{default:C(()=>[e.config.isSelection?(S(),_(r,{key:0,align:"center",type:"selection",width:"55"})):A("",!0),(S(!0),v(T,null,z(e.tableHeader.filter(e=>!e.noShow),(e,l)=>(S(),_(r,E({align:"center",key:l,prop:e.prop,"min-width":e.minWidth,width:e.width,label:e.label,sortable:!!e.isSort&&"custom","show-overflow-tooltip":""},{ref_for:!0},e.columnAttrs),{default:C(l=>["customIndex"===e.type?(S(),v("span",Y,F(l.row[e.prop]),1)):"link"===e.type?(S(),_(u,{key:1,type:"p