vue-pure-admin/dist/static/js/refresh-18356c56.js

2 lines
8.3 KiB
JavaScript

import{u as J}from"./epTheme-8586d48a.js";import{e as v,j as m,h as p,d as K,r as d,bI as D,x as w,y as $,f as e,aj as Q,F as S,b as o,g as C,aR as W,aB as X,n as ee,Y as te}from"./index-3eff57df.js";import{S as le}from"./sortable.esm-e674cde8.js";const ae={width:"32",height:"32",fill:"currentColor","aria-hidden":"true","data-icon":"holder",viewBox:"64 64 896 896"},ne=p("path",{d:"M300 276.5a56 56 0 1 0 56-97 56 56 0 0 0-56 97zm0 284a56 56 0 1 0 56-97 56 56 0 0 0-56 97zM640 228a56 56 0 1 0 112 0 56 56 0 0 0-112 0zm0 284a56 56 0 1 0 112 0 56 56 0 0 0-112 0zM300 844.5a56 56 0 1 0 56-97 56 56 0 0 0-56 97zM640 796a56 56 0 1 0 112 0 56 56 0 0 0-112 0z"},null,-1),oe=[ne];function re(t,s){return v(),m("svg",ae,oe)}const ce={render:re},ue={width:"32",height:"32",viewBox:"0 0 24 24"},ie=p("path",{fill:"currentColor",d:"M22 4V2H2v2h9v14.17l-5.5-5.5-1.42 1.41L12 22l7.92-7.92-1.42-1.41-5.5 5.5V4h9Z"},null,-1),de=[ie];function se(t,s){return v(),m("svg",ue,de)}const he={render:se},fe={width:"32",height:"32",viewBox:"0 0 24 24"},ve=p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4m-4 4a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"},null,-1),me=[ve];function pe(t,s){return v(),m("svg",fe,me)}const ge={render:pe},be={width:"32",height:"32",viewBox:"0 0 24 24"},xe=p("path",{fill:"currentColor",d:"M3.34 17a10.018 10.018 0 0 1-.978-2.326 3 3 0 0 0 .002-5.347A9.99 9.99 0 0 1 4.865 4.99a3 3 0 0 0 4.631-2.674 9.99 9.99 0 0 1 5.007.002 3 3 0 0 0 4.632 2.672A9.99 9.99 0 0 1 20.66 7c.433.749.757 1.53.978 2.326a3 3 0 0 0-.002 5.347 9.99 9.99 0 0 1-2.501 4.337 3 3 0 0 0-4.631 2.674 9.99 9.99 0 0 1-5.007-.002 3 3 0 0 0-4.632-2.672A10.018 10.018 0 0 1 3.34 17zm5.66.196a4.993 4.993 0 0 1 2.25 2.77c.499.047 1 .048 1.499.001A4.993 4.993 0 0 1 15 17.197a4.993 4.993 0 0 1 3.525-.565c.29-.408.54-.843.748-1.298A4.993 4.993 0 0 1 18 12c0-1.26.47-2.437 1.273-3.334a8.126 8.126 0 0 0-.75-1.298A4.993 4.993 0 0 1 15 6.804a4.993 4.993 0 0 1-2.25-2.77c-.499-.047-1-.048-1.499-.001A4.993 4.993 0 0 1 9 6.803a4.993 4.993 0 0 1-3.525.565 7.99 7.99 0 0 0-.748 1.298A4.993 4.993 0 0 1 6 12a4.99 4.99 0 0 1-1.273 3.334 8.126 8.126 0 0 0 .75 1.298A4.993 4.993 0 0 1 9 17.196zM12 15a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0-2a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"},null,-1),_e=[xe];function ke(t,s){return v(),m("svg",be,_e)}const we={render:ke},Ce={width:"32",height:"32",viewBox:"0 0 24 24"},ye=p("path",{fill:"currentColor",d:"M13.79 10.21a1 1 0 0 0 1.42 0 1 1 0 0 0 0-1.42l-2.5-2.5a1 1 0 0 0-.33-.21 1 1 0 0 0-.76 0 1 1 0 0 0-.33.21l-2.5 2.5a1 1 0 0 0 1.42 1.42l.79-.8v5.18l-.79-.8a1 1 0 0 0-1.42 1.42l2.5 2.5a1 1 0 0 0 .33.21.94.94 0 0 0 .76 0 1 1 0 0 0 .33-.21l2.5-2.5a1 1 0 0 0-1.42-1.42l-.79.8V9.41ZM7 4h10a1 1 0 0 0 0-2H7a1 1 0 0 0 0 2Zm10 16H7a1 1 0 0 0 0 2h10a1 1 0 0 0 0-2Z"},null,-1),ze=[ye];function Ae(t,s){return v(),m("svg",Ce,ze)}const Ve={render:Ae};function Be(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!W(t)}const Me={title:{type:String,default:"列表"},tableRef:{type:Object},columns:{type:Array,default:()=>[]}},$e=K({name:"PureTableBar",props:Me,emits:["refresh"],setup(t,{emit:s,slots:r,attrs:T}){const E=d(),h=d("default"),f=d(!0),y=d(!1),g=d(!0),b=d(!1);let u=D(w(t==null?void 0:t.columns),"label");const x=d(u),c=d(w(t==null?void 0:t.columns)),z=$(()=>a=>({background:a===h.value?J().epThemeColor:"",color:a===h.value?"#fff":"var(--el-text-color-primary)"})),_=$(()=>["text-black","dark:text-white","duration-100","hover:!text-primary","cursor-pointer","outline-none"]),j=$(()=>["flex","justify-between","pt-[3px]","px-[11px]","border-b-[1px]","border-solid","border-[#dcdfe6]","dark:border-[#303030]"]);function H(){y.value=!0,s("refresh"),X(500).then(()=>y.value=!1)}function F(){f.value=!f.value,R(t.tableRef.data,f.value)}function R(a,n){a.forEach(l=>{t.tableRef.toggleRowExpansion(l,n),l.children!==void 0&&l.children!==null&&R(l.children,n)})}function N(a){x.value=a?u:[],b.value=!1,c.value.map(n=>a?n.hide=!1:n.hide=!0)}function P(a){const n=a.length;g.value=n===u.length,b.value=n>0&&n<u.length}function Z(a,n){c.value.filter(l=>l.label===n)[0].hide=!a}async function I(){g.value=!0,b.value=!1,c.value=w(t==null?void 0:t.columns),u=[],u=await D(w(t==null?void 0:t.columns),"label"),x.value=u}const L={dropdown:()=>e(o("el-dropdown-menu"),{class:"translation"},{default:()=>[e(o("el-dropdown-item"),{style:z.value("large"),onClick:()=>h.value="large"},{default:()=>[C("宽松")]}),e(o("el-dropdown-item"),{style:z.value("default"),onClick:()=>h.value="default"},{default:()=>[C("默认")]}),e(o("el-dropdown-item"),{style:z.value("small"),onClick:()=>h.value="small"},{default:()=>[C("紧凑")]})]})},O=a=>{a.preventDefault(),ee(()=>{const n=document.querySelector(".el-checkbox-group>div");le.create(n,{animation:300,handle:".drag-btn",onEnd:({newIndex:l,oldIndex:i,item:q})=>{const A=q,V=A.parentNode,B=c.value[i],M=c.value[l];if(B!=null&&B.fixed||M!=null&&M.fixed){const k=V.children[i];l>i?V.insertBefore(A,k):V.insertBefore(A,k&&k.nextElementSibling);return}const G=c.value.splice(i,1)[0];c.value.splice(l,0,G)}})})},U=a=>!!c.value.filter(n=>n.label===a)[0].fixed,Y={reference:()=>e(we,{class:["w-[16px]",_.value],onMouseover:a=>E.value=a.currentTarget},null)};return()=>{var n;let a;return e(S,null,[e("div",Q(T,{class:"w-[99/100] mt-2 px-2 pb-2 bg-bg_color"}),[e("div",{class:"flex justify-between w-full h-[60px] p-4"},[r!=null&&r.title?r.title():e("p",{class:"font-bold truncate"},[t.title]),e("div",{class:"flex items-center justify-around"},[r!=null&&r.buttons?e("div",{class:"flex mr-4"},[r.buttons()]):null,(n=t.tableRef)!=null&&n.size?e(S,null,[e(o("el-tooltip"),{effect:"dark",content:f.value?"折叠":"展开",placement:"top"},{default:()=>[e(he,{class:["w-[16px]",_.value],style:{transform:f.value?"none":"rotate(-90deg)"},onClick:()=>F()},null)]}),e(o("el-divider"),{direction:"vertical"},null)]):null,e(o("el-tooltip"),{effect:"dark",content:"刷新",placement:"top"},{default:()=>[e(ge,{class:["w-[16px]",_.value,y.value?"animate-spin":""],onClick:()=>H()},null)]}),e(o("el-divider"),{direction:"vertical"},null),e(o("el-tooltip"),{effect:"dark",content:"密度",placement:"top"},{default:()=>[e(o("el-dropdown"),{trigger:"click"},{default:()=>[e(Ve,{class:["w-[16px]",_.value]},null)],...L})]}),e(o("el-divider"),{direction:"vertical"},null),e(o("el-popover"),{placement:"bottom-start","popper-style":{padding:0},width:"160",trigger:"click"},{default:()=>[e("div",{class:[j.value]},[e(o("el-checkbox"),{class:"!-mr-1",label:"列展示",modelValue:g.value,"onUpdate:modelValue":l=>g.value=l,indeterminate:b.value,onChange:l=>N(l)},null),e(o("el-button"),{type:"primary",link:!0,onClick:()=>I()},{default:()=>[C("重置")]})]),e("div",{class:"pt-[6px] pl-[11px]"},[e(o("el-checkbox-group"),{modelValue:x.value,"onUpdate:modelValue":l=>x.value=l,onChange:l=>P(l)},{default:()=>[e(o("el-space"),{direction:"vertical",alignment:"flex-start",size:0},Be(a=u.map(l=>e("div",{class:"flex items-center"},[e(ce,{class:["drag-btn w-[16px] mr-2",U(l)?"!cursor-no-drop":"!cursor-grab"],onMouseenter:i=>O(i)},null),e(o("el-checkbox"),{key:l,label:l,onChange:i=>Z(i,l)},{default:()=>[e("span",{title:l,class:"inline-block w-[120px] truncate hover:text-text_color_primary"},[l])]})])))?a:{default:()=>[a]})]})])],...Y})]),e(o("el-tooltip"),{"popper-options":{modifiers:[{name:"computeStyles",options:{adaptive:!1,enabled:!1}}]},placement:"top","virtual-ref":E.value,"virtual-triggering":!0,trigger:"hover",content:"列设置"},null)]),r.default({size:h.value,dynamicColumns:c.value})])])}}}),je=te($e),Ee={width:1024,height:1024,body:'<path fill="currentColor" d="M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32V256zm448-64v-64H416v64h192zM224 896h576V256H224v640zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32zm192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32z"/>'},He=Ee,Re={width:1024,height:1024,body:'<path fill="currentColor" d="M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"/>'},Fe=Re;export{He as D,je as P,Fe as R};