import{x as g,e as k,a7 as T,an as y,_ as v}from"./index-fNs72j9w.js";import{_ as w}from"./popupForm.vue_vue_type_script_setup_true_lang-CDAf8Gmt.js";import{b as S,d as A,T as C,a as D}from"./index-CgMrKa77.js";import{B as R,a8 as B,ar as E,o as I,I as L,C as f,D as H,u as o,O as q,W as O,H as c,n as m,as as N,au as V}from"./vue-DweYBrEc.js";import"./index-BlEwok4a.js";import"./validate-CEOscgyN.js";import"./index-DMA3A9_B.js";const $={class:"default-main ba-table-box"},M=R({name:"auth/rule",__name:"index",setup(U){const{t:a}=g.useI18n(),b=k(),s=B("tableRef"),t=new S(new T("/admin/auth.Rule/"),{expandAll:!1,dblClickNotEditColumn:[void 0,"keepalive","status"],column:[{type:"selection",align:"center"},{label:a("auth.rule.title"),prop:"title",align:"left",width:"200"},{label:a("auth.rule.Icon"),prop:"icon",align:"center",width:"60",render:"icon",default:"fa fa-circle-o"},{label:a("auth.rule.name"),prop:"name",align:"center",showOverflowTooltip:!0},{label:a("auth.rule.type"),prop:"type",align:"center",render:"tag",custom:{menu:"danger",menu_dir:"success",button:"info"},replaceValue:{menu:a("auth.rule.type menu"),menu_dir:a("auth.rule.type menu_dir"),button:a("auth.rule.type button")}},{label:a("auth.rule.cache"),prop:"keepalive",align:"center",width:"80",render:"switch"},{label:a("State"),prop:"status",align:"center",width:"80",render:"switch"},{label:a("Update time"),prop:"update_time",align:"center",width:"160",render:"datetime"},{label:a("Operate"),align:"center",width:"130",render:"buttons",buttons:A()}],dragSortLimitField:"pid"},{defaultItems:{type:"menu",menu_type:"tab",extend:"none",keepalive:0,status:1,icon:"fa fa-circle-o",buttons:["index","add","edit","del"]}}),d={expanded:[],scrollTop:0,scrollLeft:0,expandAll:!1};let n=d;const h=(e,l)=>{l?n.expanded.push(e):n.expanded=n.expanded.filter(r=>r.id!==e.id)},x=E(({scrollLeft:e,scrollTop:l})=>{n.scrollTop=l,n.scrollLeft=e},500),u=e=>{n.expandAll=e},_=()=>{m(()=>{var l,r;const e=n;n=N(d);for(const i in e.expanded)(r=(l=s.value)==null?void 0:l.getRef())==null||r.toggleRowExpansion(e.expanded[i],!0);m(()=>{var i,p;(e.scrollTop||e.scrollLeft)&&((p=(i=s.value)==null?void 0:i.getRef())==null||p.scrollTo({top:e.scrollTop||0,left:e.scrollLeft||0})),t.table.expandAll=e.expandAll,u(e.expandAll)})})};return t.before.getData=()=>{var e;t.table.expandAll=!!((e=t.table.filter)!=null&&e.quickSearch)},t.after.getEditData=()=>{t.form.items&&!t.form.items.icon&&(t.form.items.icon="fa fa-circle-o")},t.after.onTableHeaderAction=({event:e,data:l})=>{e=="unfold"&&u(l.unfold)},t.after.getData=()=>{_()},V("baTable",t),I(()=>{var e;t.table.ref=s.value,t.mount(),(e=t.getData())==null||e.then(()=>{t.dragSort()})}),(e,l)=>{const r=L("el-alert");return f(),H("div",$,[o(t).table.remark?(f(),q(r,{key:0,class:"ba-table-alert",title:o(t).table.remark,type:"info","show-icon":""},null,8,["title"])):O("",!0),c(C,{buttons:["refresh","add","edit","delete","unfold","quickSearch","columnDisplay"],"quick-search-placeholder":o(a)("Quick search placeholder",{fields:o(a)("auth.rule.title")})},null,8,["quick-search-placeholder"]),c(D,{ref_key:"tableRef",ref:s,"max-height":`calc(-${o(y)[o(b).layout.layoutMode]+75+16}px + 100vh)`,pagination:!1,onExpandChange:h,onScroll:o(x)},null,8,["max-height","onScroll"]),c(w)])}}}),K=v(M,[["__scopeId","data-v-3bc6c8ca"]]);export{K as default};
