vue-pure-admin/dist/static/js/refresh-n06aYpv6.js
2024-01-24 15:59:56 +08:00

2 lines
8.9 KiB
JavaScript

var ee=Object.defineProperty;var j=Object.getOwnPropertySymbols;var te=Object.prototype.hasOwnProperty,le=Object.prototype.propertyIsEnumerable;var F=(e,o,a)=>o in e?ee(e,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[o]=a,D=(e,o)=>{for(var a in o||(o={}))te.call(o,a)&&F(e,a,o[a]);if(j)for(var a of j(o))le.call(o,a)&&F(e,a,o[a]);return e};var N=(e,o,a)=>new Promise((M,b)=>{var d=i=>{try{m(a.next(i))}catch(s){b(s)}},v=i=>{try{m(a.throw(i))}catch(s){b(s)}},m=i=>i.done?M(i.value):Promise.resolve(i.value).then(d,v);m((a=a.apply(e,o)).next())});import{u as ae}from"./epTheme-toeSqv07.js";import{e as x,k as _,f as k,d as ne,r as f,a8 as g,dh as oe,a5 as re,ah as A,V as H,i as t,X as ce,F as q,b as r,h as B,aA as ie,aH as ue,n as de,M as se}from"./index-GuFRd4Ob.js";import{S as he}from"./sortable.esm-FgMliyZc.js";const fe={width:"32",height:"32",fill:"currentColor","aria-hidden":"true","data-icon":"holder",viewBox:"64 64 896 896"},ve=k("path",{d:"M300 276.5a56 56 0 1 0 56-97 56 56 0 0 0-56 97m0 284a56 56 0 1 0 56-97 56 56 0 0 0-56 97M640 228a56 56 0 1 0 112 0 56 56 0 0 0-112 0m0 284a56 56 0 1 0 112 0 56 56 0 0 0-112 0M300 844.5a56 56 0 1 0 56-97 56 56 0 0 0-56 97M640 796a56 56 0 1 0 112 0 56 56 0 0 0-112 0"},null,-1),me=[ve];function ge(e,o){return x(),_("svg",fe,[...me])}const pe={render:ge},be={width:"32",height:"32",viewBox:"0 0 24 24"},xe=k("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.5V4z"},null,-1),_e=[xe];function ke(e,o){return x(),_("svg",be,[..._e])}const Ce={render:ke},we={width:"32",height:"32",viewBox:"0 0 24 24"},ye=k("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),Ae=[ye];function Be(e,o){return x(),_("svg",we,[...Ae])}const Me={render:Be},Ve={width:"32",height:"32",viewBox:"0 0 24 24"},Ee=k("path",{fill:"currentColor",d:"M3.34 17a10 10 0 0 1-.978-2.326 3 3 0 0 0 .002-5.347A10 10 0 0 1 4.865 4.99a3 3 0 0 0 4.631-2.674 10 10 0 0 1 5.007.002 3 3 0 0 0 4.632 2.672A10 10 0 0 1 20.66 7c.433.749.757 1.53.978 2.326a3 3 0 0 0-.002 5.347 10 10 0 0 1-2.501 4.337 3 3 0 0 0-4.631 2.674 10 10 0 0 1-5.007-.002 3 3 0 0 0-4.632-2.672A10 10 0 0 1 3.34 17m5.66.196a5 5 0 0 1 2.25 2.77q.75.071 1.499.001A5 5 0 0 1 15 17.197a5 5 0 0 1 3.525-.565q.435-.614.748-1.298A5 5 0 0 1 18 12c0-1.26.47-2.437 1.273-3.334a8 8 0 0 0-.75-1.298A5 5 0 0 1 15 6.804a5 5 0 0 1-2.25-2.77q-.75-.071-1.499-.001A5 5 0 0 1 9 6.803a5 5 0 0 1-3.525.565 8 8 0 0 0-.748 1.298A5 5 0 0 1 6 12a5 5 0 0 1-1.273 3.334 8 8 0 0 0 .75 1.298A5 5 0 0 1 9 17.196M12 15a3 3 0 1 1 0-6 3 3 0 0 1 0 6m0-2a1 1 0 1 0 0-2 1 1 0 0 0 0 2"},null,-1),$e=[Ee];function Re(e,o){return x(),_("svg",Ve,[...$e])}const ze={render:Re},De={width:"32",height:"32",viewBox:"0 0 24 24"},He=k("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 2m10 16H7a1 1 0 0 0 0 2h10a1 1 0 0 0 0-2"},null,-1),Se=[He];function Te(e,o){return x(),_("svg",De,[...Se])}const je={render:Te};function Fe(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!ie(e)}const Ne={title:{type:String,default:"列表"},tableRef:{type:Object},columns:{type:Array,default:()=>[]}},qe=ne({name:"PureTableBar",props:Ne,emits:["refresh"],setup(e,{emit:o,slots:a,attrs:M}){const b=f(),d=f("default"),v=f(!0),m=f(!1),i=f(!0),s=f(!1),S=g(e==null?void 0:e.columns).filter(l=>oe(l==null?void 0:l.hide)?!l.hide:!(re(l==null?void 0:l.hide)&&(l!=null&&l.hide())));let p=A(g(e==null?void 0:e.columns),"label");const C=f(A(g(S),"label")),u=f(g(e==null?void 0:e.columns)),V=H(()=>l=>({background:l===d.value?ae().epThemeColor:"",color:l===d.value?"#fff":"var(--el-text-color-primary)"})),w=H(()=>["text-black","dark:text-white","duration-100","hover:!text-primary","cursor-pointer","outline-none"]),P=H(()=>["flex","justify-between","pt-[3px]","px-[11px]","border-b-[1px]","border-solid","border-[#dcdfe6]","dark:border-[#303030]"]);function L(){m.value=!0,o("refresh"),ue(500).then(()=>m.value=!1)}function O(){v.value=!v.value,T(e.tableRef.data,v.value)}function T(l,c){l.forEach(n=>{e.tableRef.toggleRowExpansion(n,c),n.children!==void 0&&n.children!==null&&T(n.children,c)})}function I(l){C.value=l?p:[],s.value=!1,u.value.map(c=>l?c.hide=!1:c.hide=!0)}function U(l){const c=l.length;i.value=c===p.length,s.value=c>0&&c<p.length}function X(l,c){u.value.filter(n=>n.label===c)[0].hide=!l}function Z(){return N(this,null,function*(){i.value=!0,s.value=!1,u.value=g(e==null?void 0:e.columns),p=[],p=yield A(g(e==null?void 0:e.columns),"label"),C.value=A(g(S),"label")})}const G={dropdown:()=>t(r("el-dropdown-menu"),{class:"translation"},{default:()=>[t(r("el-dropdown-item"),{style:V.value("large"),onClick:()=>d.value="large"},{default:()=>[B("宽松")]}),t(r("el-dropdown-item"),{style:V.value("default"),onClick:()=>d.value="default"},{default:()=>[B("默认")]}),t(r("el-dropdown-item"),{style:V.value("small"),onClick:()=>d.value="small"},{default:()=>[B("紧凑")]})]})},J=l=>{l.preventDefault(),de(()=>{const c=document.querySelector(".el-checkbox-group>div");he.create(c,{animation:300,handle:".drag-btn",onEnd:({newIndex:n,oldIndex:h,item:W})=>{const E=W,$=E.parentNode,R=u.value[h],z=u.value[n];if(R!=null&&R.fixed||z!=null&&z.fixed){const y=$.children[h];n>h?$.insertBefore(E,y):$.insertBefore(E,y&&y.nextElementSibling);return}const Y=u.value.splice(h,1)[0];u.value.splice(n,0,Y)}})})},K=l=>!!u.value.filter(c=>c.label===l)[0].fixed,Q={reference:()=>t(ze,{class:["w-[16px]",w.value],onMouseover:l=>b.value=l.currentTarget},null)};return()=>{var c;let l;return t(q,null,[t("div",ce(M,{class:"w-[99/100] mt-2 px-2 pb-2 bg-bg_color"}),[t("div",{class:"flex justify-between w-full h-[60px] p-4"},[a!=null&&a.title?a.title():t("p",{class:"font-bold truncate"},[e.title]),t("div",{class:"flex items-center justify-around"},[a!=null&&a.buttons?t("div",{class:"flex mr-4"},[a.buttons()]):null,(c=e.tableRef)!=null&&c.size?t(q,null,[t(r("el-tooltip"),{effect:"dark",content:v.value?"折叠":"展开",placement:"top"},{default:()=>[t(Ce,{class:["w-[16px]",w.value],style:{transform:v.value?"none":"rotate(-90deg)"},onClick:()=>O()},null)]}),t(r("el-divider"),{direction:"vertical"},null)]):null,t(r("el-tooltip"),{effect:"dark",content:"刷新",placement:"top"},{default:()=>[t(Me,{class:["w-[16px]",w.value,m.value?"animate-spin":""],onClick:()=>L()},null)]}),t(r("el-divider"),{direction:"vertical"},null),t(r("el-tooltip"),{effect:"dark",content:"密度",placement:"top"},{default:()=>[t(r("el-dropdown"),{trigger:"click"},D({default:()=>[t(je,{class:["w-[16px]",w.value]},null)]},G))]}),t(r("el-divider"),{direction:"vertical"},null),t(r("el-popover"),{placement:"bottom-start","popper-style":{padding:0},width:"200",trigger:"click"},D({default:()=>[t("div",{class:[P.value]},[t(r("el-checkbox"),{class:"!-mr-1",label:"列展示",modelValue:i.value,"onUpdate:modelValue":n=>i.value=n,indeterminate:s.value,onChange:n=>I(n)},null),t(r("el-button"),{type:"primary",link:!0,onClick:()=>Z()},{default:()=>[B("重置")]})]),t("div",{class:"pt-[6px] pl-[11px]"},[t(r("el-scrollbar"),{"max-height":"36vh"},{default:()=>[t(r("el-checkbox-group"),{modelValue:C.value,"onUpdate:modelValue":n=>C.value=n,onChange:n=>U(n)},{default:()=>[t(r("el-space"),{direction:"vertical",alignment:"flex-start",size:0},Fe(l=p.map(n=>t("div",{class:"flex items-center"},[t(pe,{class:["drag-btn w-[16px] mr-2",K(n)?"!cursor-no-drop":"!cursor-grab"],onMouseenter:h=>J(h)},null),t(r("el-checkbox"),{key:n,label:n,onChange:h=>X(h,n)},{default:()=>[t("span",{title:n,class:"inline-block w-[120px] truncate hover:text-text_color_primary"},[n])]})])))?l:{default:()=>[l]})]})]})])]},Q))]),t(r("el-tooltip"),{"popper-options":{modifiers:[{name:"computeStyles",options:{adaptive:!1,enabled:!1}}]},placement:"top","virtual-ref":b.value,"virtual-triggering":!0,trigger:"hover",content:"列设置"},null)]),a.default({size:d.value,dynamicColumns:u.value})])])}}}),Ze=se(qe),Pe={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"/>'},Ge=Pe,Le={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"/>'},Je=Le;export{Ge as D,Ze as P,Je as R};