vue-pure-admin/dist/static/js/refresh-C_Q4NAC5.js
2024-04-18 13:50:05 +08:00

2 lines
8.5 KiB
JavaScript

var oe=Object.defineProperty;var O=Object.getOwnPropertySymbols;var ie=Object.prototype.hasOwnProperty,ce=Object.prototype.propertyIsEnumerable;var q=(e,r,a)=>r in e?oe(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a,H=(e,r)=>{for(var a in r||(r={}))ie.call(r,a)&&q(e,a,r[a]);if(O)for(var a of O(r))ce.call(r,a)&&q(e,a,r[a]);return e};var K=(e,r,a)=>new Promise((V,u)=>{var x=c=>{try{h(a.next(c))}catch(s){u(s)}},b=c=>{try{h(a.throw(c))}catch(s){u(s)}},h=c=>c.done?V(c.value):Promise.resolve(c.value).then(x,b);h((a=a.apply(e,r)).next())});import{S as ue}from"./sortable.esm-6WsHlDA5.js";import{f as C,k as w,g as y,d as se,a as v,a1 as de,aj as g,fy as he,ag as fe,ap as E,p as F,i as l,a8 as ve,F as L,B as M,A as R,e as i,h as D,u as G,af as p,aD as ge,cU as be,y as me,a0 as pe}from"./index-BoJRq02v.js";import{u as xe}from"./epTheme-rmczjPLR.js";const _e={width:"32",height:"32",fill:"currentColor","aria-hidden":"true","data-icon":"holder",viewBox:"64 64 896 896"},Ce=y("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),we=[Ce];function ye(e,r){return C(),w("svg",_e,[...we])}const ke={render:ye},Ae={width:"32",height:"32",viewBox:"0 0 24 24"},$e=y("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),Be=[$e];function Ee(e,r){return C(),w("svg",Ae,[...Be])}const Me={render:Ee},Re={width:"32",height:"32",viewBox:"0 0 24 24"},De=y("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),Ve=[De];function Se(e,r){return C(),w("svg",Re,[...Ve])}const Te={render:Se},je={width:"32",height:"32",viewBox:"0 0 24 24"},ze=y("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),Ne=[ze];function He(e,r){return C(),w("svg",je,[...Ne])}const Fe={render:He},Pe={width:"32",height:"32",viewBox:"0 0 24 24"},Ie=y("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),Oe=[Ie];function qe(e,r){return C(),w("svg",Pe,[...Oe])}const Ke={render:qe};function Le(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!ge(e)}const Ge={title:{type:String,default:"列表"},tableRef:{type:Object},columns:{type:Array,default:()=>[]},isExpandAll:{type:Boolean,default:!0},tableKey:{type:[String,Number],default:"0"}},Ue=se({name:"PureTableBar",props:Ge,emits:["refresh"],setup(e,{emit:r,slots:a,attrs:V}){const u=v("default"),x=v(!1),b=v(!0),h=v(!1),c=de(),s=v(e.isExpandAll),P=g(e==null?void 0:e.columns).filter(t=>he(t==null?void 0:t.hide)?!t.hide:!(fe(t==null?void 0:t.hide)&&(t!=null&&t.hide())));let m=E(g(e==null?void 0:e.columns),"label");const k=v(E(g(P),"label")),d=v(g(e==null?void 0:e.columns)),S=F(()=>t=>({background:t===u.value?xe().epThemeColor:"",color:t===u.value?"#fff":"var(--el-text-color-primary)"})),A=F(()=>["text-black","dark:text-white","duration-100","hover:!text-primary","cursor-pointer","outline-none"]),U=F(()=>["flex","justify-between","pt-[3px]","px-[11px]","border-b-[1px]","border-solid","border-[#dcdfe6]","dark:border-[#303030]"]);function W(){x.value=!0,r("refresh"),be(500).then(()=>x.value=!1)}function Z(){s.value=!s.value,I(e.tableRef.data,s.value)}function I(t,o){t.forEach(n=>{e.tableRef.toggleRowExpansion(n,o),n.children!==void 0&&n.children!==null&&I(n.children,o)})}function J(t){k.value=t?m:[],h.value=!1,d.value.map(o=>t?o.hide=!1:o.hide=!0)}function Q(t){k.value=t;const o=t.length;b.value=o===m.length,h.value=o>0&&o<m.length}function X(t,o){d.value.filter(n=>p(n.label)===p(o))[0].hide=!t}function Y(){return K(this,null,function*(){b.value=!0,h.value=!1,d.value=g(e==null?void 0:e.columns),m=[],m=yield E(g(e==null?void 0:e.columns),"label"),k.value=E(g(P),"label")})}const ee={dropdown:()=>l(i("el-dropdown-menu"),{class:"translation"},{default:()=>[l(i("el-dropdown-item"),{style:S.value("large"),onClick:()=>u.value="large"},{default:()=>[D("宽松")]}),l(i("el-dropdown-item"),{style:S.value("default"),onClick:()=>u.value="default"},{default:()=>[D("默认")]}),l(i("el-dropdown-item"),{style:S.value("small"),onClick:()=>u.value="small"},{default:()=>[D("紧凑")]})]})},te=t=>{t.preventDefault(),me(()=>{var n;const o=((n=c==null?void 0:c.proxy)==null?void 0:n.$refs[`GroupRef${G(e.tableKey)}`]).$el.firstElementChild;ue.create(o,{animation:300,handle:".drag-btn",onEnd:({newIndex:_,oldIndex:f,item:ne})=>{const T=ne,j=T.parentNode,z=d.value[f],N=d.value[_];if(z!=null&&z.fixed||N!=null&&N.fixed){const B=j.children[f];_>f?j.insertBefore(T,B):j.insertBefore(T,B&&B.nextElementSibling);return}const re=d.value.splice(f,1)[0];d.value.splice(_,0,re)}})})},le=t=>!!d.value.filter(o=>p(o.label)===p(t))[0].fixed,$=t=>({content:t,offset:[0,18],duration:[300,0],followCursor:!0,hideOnClick:"toggle"}),ae={reference:()=>M(l(Fe,{class:["w-[16px]",A.value]},null),[[R("tippy"),$("列设置")]])};return()=>{var o;let t;return l(L,null,[l("div",ve(V,{class:"w-[99/100] mt-2 px-2 pb-2 bg-bg_color"}),[l("div",{class:"flex justify-between w-full h-[60px] p-4"},[a!=null&&a.title?a.title():l("p",{class:"font-bold truncate"},[e.title]),l("div",{class:"flex items-center justify-around"},[a!=null&&a.buttons?l("div",{class:"flex mr-4"},[a.buttons()]):null,(o=e.tableRef)!=null&&o.size?l(L,null,[M(l(Me,{class:["w-[16px]",A.value],style:{transform:s.value?"none":"rotate(-90deg)"},onClick:()=>Z()},null),[[R("tippy"),$(s.value?"折叠":"展开")]]),l(i("el-divider"),{direction:"vertical"},null)]):null,M(l(Te,{class:["w-[16px]",A.value,x.value?"animate-spin":""],onClick:()=>W()},null),[[R("tippy"),$("刷新")]]),l(i("el-divider"),{direction:"vertical"},null),M(l(i("el-dropdown"),{trigger:"click"},H({default:()=>[l(Ke,{class:["w-[16px]",A.value]},null)]},ee)),[[R("tippy"),$("密度")]]),l(i("el-divider"),{direction:"vertical"},null),l(i("el-popover"),{placement:"bottom-start","popper-style":{padding:0},width:"200",trigger:"click"},H({default:()=>[l("div",{class:[U.value]},[l(i("el-checkbox"),{class:"!-mr-1",label:"列展示",modelValue:b.value,"onUpdate:modelValue":n=>b.value=n,indeterminate:h.value,onChange:n=>J(n)},null),l(i("el-button"),{type:"primary",link:!0,onClick:()=>Y()},{default:()=>[D("重置")]})]),l("div",{class:"pt-[6px] pl-[11px]"},[l(i("el-scrollbar"),{"max-height":"36vh"},{default:()=>[l(i("el-checkbox-group"),{ref:`GroupRef${G(e.tableKey)}`,modelValue:k.value,onChange:n=>Q(n)},{default:()=>[l(i("el-space"),{direction:"vertical",alignment:"flex-start",size:0},Le(t=m.map((n,_)=>l("div",{class:"flex items-center"},[l(ke,{class:["drag-btn w-[16px] mr-2",le(n)?"!cursor-no-drop":"!cursor-grab"],onMouseenter:f=>te(f)},null),l(i("el-checkbox"),{key:_,label:n,value:n,onChange:f=>X(f,n)},{default:()=>[l("span",{title:p(n),class:"inline-block w-[120px] truncate hover:text-text_color_primary"},[p(n)])]})])))?t:{default:()=>[t]})]})]})])]},ae))])]),a.default({size:u.value,dynamicColumns:d.value})])])}}}),Ye=pe(Ue),We={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"/>'},et=We;export{Ye as P,et as R};