Files
yusheng-admin/dist/static/js/index-CnAi1QxJ.js
2025-10-23 11:07:17 +08:00

2 lines
8.4 KiB
JavaScript

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