物管理前端
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
1.9 KiB

  1. import{d as k,c as l,B as g,p as S,o as t,b as r,e as b,F as y,r as c,n as a}from"./index-bVOhw2NF.js";const T=k({name:"EsTableFrame",components:{},props:{options:{type:Object,default:()=>({})},datasets:{type:[Object,Array],default:()=>[]},element:{type:Object,default:()=>({})}},setup(o){const u=l(()=>{const e=o.options.header.rows;let n=0;return e.forEach(d=>{const C=d.columns.reduce((p,f)=>p+f.colspan,0);C>n&&(n=C)}),n}),i=l(()=>e=>{const n=o.options.header.style.noRowBorder;return{height:`${e.height}px`,"border-bottom":n?"none":`1px solid ${o.options.header.style.borderColor}`,"background-color":o.options.header.style.backgroundColor}}),h=l(()=>({borderRight:o.options.header.style.noColBorder?"none":`1px solid ${o.options.header.style.borderColor}`})),m=l(()=>({borderBottom:o.options.body.style.noRowBorder?"none":`1px solid ${o.options.body.style.borderColor}`,"background-color":o.options.body.style.backgroundColor})),B=l(()=>({borderRight:o.options.body.style.noColBorder?"none":`1px solid ${o.options.body.style.borderColor}`})),s=l(()=>({border:o.options.table.style.noBorder?"none":`1px solid ${o.options.table.style.borderColor}`,"background-color":o.options.table.style.backgroundColor}));return{...g(o.options),bodyCols:u,tableStyle:s,theaderTrStyle:i,theaderThStyle:h,tbodyTrStyle:m,tbodyTdStyle:B}}}),w={class:"es-table-frame"},$=["colspan"];function R(o,u,i,h,m,B){return t(),r("div",w,[b("table",{style:a(o.tableStyle)},[b("thead",null,[(t(!0),r(y,null,c(o.header.rows,(s,e)=>(t(),r("tr",{key:e,style:a(o.theaderTrStyle(s))},[(t(!0),r(y,null,c(s.columns,(n,d)=>(t(),r("th",{key:d,colspan:n.colspan,style:a(o.theaderThStyle)},null,12,$))),128))],4))),128))]),b("tbody",null,[(t(!0),r(y,null,c(o.body.rowsNum,(s,e)=>(t(),r("tr",{key:e,style:a(o.tbodyTrStyle)},[(t(!0),r(y,null,c(o.bodyCols,(n,d)=>(t(),r("td",{key:d,style:a(o.tbodyTdStyle)},null,4))),128))],4))),128))])],4)])}const x=S(T,[["render",R],["__scopeId","data-v-657d46ce"]]);export{x as default};