import{b as k,T as _,a as y}from"./index-434d719f.js";import{f as x,e as I,a4 as T,ai as v,W as w}from"./index-ba596ae9.js";import{b as C}from"./controllerUrls-941681c3.js";import A from"./popupForm-f4f81fac.js";import{h as g,y as m,ar as q,B,p as s,l as D,k as l,M as f,a4 as b,q as i,t as G,as as N}from"./vue-a39e6937.js";import"./index-7e56a0fa.js";import"./index-f0d8af94.js";import"./validate-4ecec794.js";const R={class:"default-main ba-table-box"},S=g({name:"auth/group"}),j=g({...S,setup(F){const u=m(),d=m(),{t:a}=x(),h=I(),e=new k(new T(C),{expandAll:!0,dblClickNotEditColumn:[void 0],column:[{type:"selection",align:"center"},{label:a("auth.group.Group name"),prop:"name",align:"left",width:"200"},{label:a("auth.group.jurisdiction"),prop:"rules",align:"center"},{label:a("state"),prop:"status",align:"center",render:"tag",custom:{0:"danger",1:"success"},replaceValue:{0:a("Disable"),1:a("Enable")}},{label:a("updatetime"),prop:"updatetime",align:"center",width:"160",render:"datetime"},{label:a("createtime"),prop:"createtime",align:"center",width:"160",render:"datetime"},{label:a("operate"),align:"center",width:"130",render:"buttons",buttons:v(["edit","delete"])}]},{defaultItems:{status:"1"}},{onSubmit:({formEl:r,items:t})=>{var t=q(t);t.rules=u.value.getCheckeds();for(const o in t)t[o]===null&&delete t[o];let n=()=>{e.form.submitLoading=!0,e.api.postData(e.form.operate,t).then(o=>{var p;e.onTableHeaderAction("refresh",{}),e.form.submitLoading=!1,(p=e.form.operateIds)==null||p.shift(),e.form.operateIds.length>0?e.toggleForm("edit",e.form.operateIds):e.toggleForm(),e.runAfter("onSubmit",{res:o})}).catch(()=>{e.form.submitLoading=!1})};return r?(e.form.ref=r,r.validate(o=>{o&&n()})):n(),!1},onTableDblclick:({row:r})=>e.table.extend.adminGroup.indexOf(r.id)===-1},{getIndex:({res:r})=>{e.table.extend.adminGroup=r.data.group;let c=w(e.table.column,"render","buttons");e.table.column[c].buttons.forEach(t=>{t.display=n=>r.data.group.indexOf(n.id)===-1})}});return N("baTable",e),B(()=>{e.table.ref=d.value,e.mount(),e.getIndex()}),(r,c)=>{const t=G("el-alert");return s(),D("div",R,[l(h).super?b("",!0):(s(),f(t,{key:0,class:"ba-table-alert",title:l(a)("auth.group.Manage subordinate role groups here"),type:"info","show-icon":""},null,8,["title"])),l(e).table.remark?(s(),f(t,{key:1,class:"ba-table-alert",title:l(e).table.remark,type:"info","show-icon":""},null,8,["title"])):b("",!0),i(_,{buttons:["refresh","add","edit","delete","unfold","quickSearch","columnDisplay"],"quick-search-placeholder":l(a)("quick Search Placeholder",{fields:l(a)("auth.group.GroupName")})},null,8,["quick-search-placeholder"]),i(y,{ref_key:"tableRef",ref:d,pagination:!1},null,512),i(A,{ref_key:"formRef",ref:u},null,512)])}}});export{j as default};
