index.a5d44002.js 3.5 KB

123456789101112
  1. import{u as y}from"./useNav.afbe69e0.js";import{b as C,p as u,e as E,j as e,K as _,ac as L,aM as T,F as m,k as l,an as d,l as f,b5 as A}from"./index.4d3e3847.js";const D=`
  2. <path class="path" d="
  3. M 30 15
  4. L 28 17
  5. M 25.61 25.61
  6. A 15 15, 0, 0, 1, 15 30
  7. A 15 15, 0, 1, 1, 27.99 7.5
  8. L 15 15
  9. "
  10. style="stroke-width: 4px; fill: rgba(0, 0, 0, 0)"
  11. />
  12. `,R={title:{type:String,default:"\u5217\u8868"},dataList:{type:Array,default:()=>[]},tableRef:{type:Object,default(){return{}}},loading:{type:Boolean,default:!1}},B=C({name:"TableProBar",props:R,emits:["refresh"],setup(o,{emit:h,slots:a,attrs:b}){const v=u(),s=u([]),r=u("default"),n=u(!0),p=E(()=>t=>({background:t===r.value?y().epThemeColor:"",color:t===r.value?"#fff":"var(--el-text-color-primary)"}));function x(){n.value=!n.value,g(o.dataList,n.value)}function g(t,i){t.forEach(c=>{o.tableRef.toggleRowExpansion(c,i),c.children!==void 0&&c.children!==null&&g(c.children,i)})}const w={dropdown:()=>e(l("el-dropdown-menu"),{class:"translation"},{default:()=>[e(l("el-dropdown-item"),{style:p.value("large"),onClick:()=>r.value="large"},{default:()=>[f("\u677E\u6563")]}),e(l("el-dropdown-item"),{style:p.value("default"),onClick:()=>r.value="default"},{default:()=>[f("\u9ED8\u8BA4")]}),e(l("el-dropdown-item"),{style:p.value("small"),onClick:()=>r.value="small"},{default:()=>[f("\u7D27\u51D1")]})]})},k={reference:()=>e(d,{class:"cursor-pointer",icon:"setting",width:"16",color:"text_color_regular",onMouseover:t=>v.value=t.currentTarget},null)};return()=>{var t;return e(m,null,[_(e("div",T(b,{class:"pl-3 pr-3 pt-1 pb-1 bg-white dark:bg-dark",style:"margin-top:5px;width:100%","element-loading-svg":D,"element-loading-svg-view-box":"-10, -10, 50, 50"}),[e("div",{class:"flex justify-between w-full h-60px p-3"},[e("p",{class:"font-bold truncate",style:"line-height: 40px;"},[o.title]),e("div",{class:"flex items-center justify-around"},[e("div",{class:"flex mr-4"},[a==null?void 0:a.buttons()]),(t=o.tableRef)!=null&&t.size?e(m,null,[e(l("el-tooltip"),{effect:"dark",content:n.value?"\u6298\u53E0":"\u5C55\u5F00",placement:"top"},{default:()=>[e(d,{class:"cursor-pointer",icon:n.value?"unExpand":"expand",width:"16",color:"text_color_regular",onClick:()=>x()},null)]}),e(l("el-divider"),{direction:"vertical"},null)]):void 0,e(l("el-tooltip"),{effect:"dark",content:"\u5237\u65B0",placement:"top"},{default:()=>[e(d,{class:"cursor-pointer",icon:"refresh-right",width:"16",color:"text_color_regular",onClick:()=>h("refresh")},null)]}),e(l("el-divider"),{direction:"vertical"},null),e(l("el-tooltip"),{effect:"dark",content:"\u5BC6\u5EA6",placement:"top"},{default:()=>[e(l("el-dropdown"),{trigger:"click"},{default:()=>[e(d,{class:"cursor-pointer",icon:"density",width:"16",color:"text_color_regular"},null)],...w})]}),e(l("el-divider"),{direction:"vertical"},null),e(l("el-popover"),{width:"200",trigger:"click"},{default:()=>[e(l("el-checkbox-group"),{modelValue:s.value,"onUpdate:modelValue":i=>s.value=i},{default:()=>[e(l("el-checkbox"),{label:"\u5E8F\u53F7\u5217"},null),e(l("el-checkbox"),{label:"\u52FE\u9009\u5217"},null)]}),a.toolbar&&a.toolbar()],...k})]),e(l("el-tooltip"),{"popper-options":{modifiers:[{name:"computeStyles",options:{adaptive:!1,enabled:!1}}]},placement:"top","virtual-ref":v.value,"virtual-triggering":!0,trigger:"hover",content:"\u5217\u8BBE\u7F6E"},null)]),o.dataList.length>0?a.default({size:r.value,checkList:s.value}):e(l("el-empty"),{description:"\u6682\u65E0\u6570\u636E"},null)]),[[L("loading"),o.loading]])])}}}),M=A(B);export{M as T};