2 lines
2.8 KiB
JavaScript
2 lines
2.8 KiB
JavaScript
|
import{ah as N,d as C,ae as T,O as v,ac as I,ag as L,r as x,ab as O,ax as S,aV as E,ar as h,bi as $,ay as V,aw as k,k as g,cC as o,y as R,cD as z,cE as Y,am as _,a8 as d}from"./index-ce293e15.js";const j=N({prefixCls:{type:String}}),P=C({name:"ElSpaceItem",props:j,setup(e,{slots:u}){const p=T("space"),r=v(()=>`${e.prefixCls||p.b()}__item`);return()=>I("div",{class:r.value},L(u,"default"))}}),A={small:8,default:12,large:16};function G(e){const u=T("space"),p=v(()=>[u.b(),u.m(e.direction),e.class]),r=x(0),i=x(0),m=v(()=>{const a=e.wrap||e.fill?{flexWrap:"wrap"}:{},n={alignItems:e.alignment},t={rowGap:`${i.value}px`,columnGap:`${r.value}px`};return[a,n,t,e.style]}),f=v(()=>e.fill?{flexGrow:1,minWidth:`${e.fillRatio}%`}:{});return O(()=>{const{size:a="small",wrap:n,direction:t,fill:l}=e;if(S(a)){const[s=0,c=0]=a;r.value=s,i.value=c}else{let s;E(a)?s=a:s=A[a||"small"]||A.small,(n||l)&&t==="horizontal"?r.value=i.value=s:t==="horizontal"?(r.value=s,i.value=0):(i.value=s,r.value=0)}}),{classes:p,containerStyle:m,itemStyle:f}}const B=N({direction:{type:String,values:["horizontal","vertical"],default:"horizontal"},class:{type:h([String,Object,Array]),default:""},style:{type:h([String,Array,Object]),default:""},alignment:{type:h(String),default:"center"},prefixCls:{type:String},spacer:{type:h([Object,String,Number,Array]),default:null,validator:e=>$(e)||E(e)||V(e)},wrap:Boolean,fill:Boolean,fillRatio:{type:Number,default:100},size:{type:[String,Array,Number],values:k,validator:e=>E(e)||S(e)&&e.length===2&&e.every(E)}}),F=C({name:"ElSpace",props:B,setup(e,{slots:u}){const{classes:p,containerStyle:r,itemStyle:i}=G(e);function m(f,a="",n=[]){const{prefixCls:t}=e;return f.forEach((l,s)=>{z(l)?S(l.children)&&l.children.forEach((c,y)=>{z(c)&&S(c.children)?m(c.children,`${a+y}-`,n):n.push(g(P,{style:i.value,prefixCls:t,key:`nested-${a+y}`},{default:()=>[c]},o.PROPS|o.STYLE,["style","prefixCls"]))}):Y(l)&&n.push(g(P,{style:i.value,prefixCls:t,key:`LoopKey${a+s}`},{default:()=>[l]},o.PROPS|o.STYLE,["style","prefixCls"]))}),n}return()=>{var f;const{spacer:a,direction:n}=e,t=L(u,"default",{key:0},()=>[]);if(((f=t.children)!=null?f:[]).length===0)return null;if(S(t.children)){let l=m(t.children);if(a){const s=l.length-1;l=l.reduce((c,y,b)=>{const w=[...c,y];return b!==s&&w.push(g("span",{style:[i.value,n==="vertical"?"width: 100%":null],key:b},[$(a)?a:R(a,o.TEXT)],o.STYLE)),w},[])}return g("div",{class:p.value,style:r.value},l,o.STYLE|o.CLASS)}return t.children}}}),D=_(F);const M=e=>d({url:"/scale/info/pageList",method:"get",params:e}),X=e=>d({url:"/scale/info/findAll",method:"get",params:e}),Z=e=>d({url:"/scale/info/"+e,method:"get"}),q=e=>d({url:"/scale/info",method:"post",data:e}),H=e=>d({url:"/scale/info",method:"put",data:e}),J=e=>d({url:"/scale/info/"+e,method:"delete"});export{D as E,q as a,J as d,X as f,Z as g,M as l,H as u};
|