1 |
- import{b as k,d as _,T as y}from"./baTable-MdxYOkAk.js";import{a as x,a1 as C,Y as T}from"./index-EwE51S_X.js";import{T as v}from"./index-K8IR974I.js";import w from"./popupForm-gGThqfs2.js";import{d as I,a as f,a2 as A,aC as D,av as G,o as B,K as L,e as i,f as N,u as n,y as b,C as g,j as u}from"./vue-A59npLRR.js";import"./echarts-cxb9vJr1.js";import"./index-XALue448.js";import"./index-r6iTpmP6.js";import"./validate-_EUdkMt3.js";const O={class:"default-main ba-table-box"},P=I({name:"auth/group",__name:"index",setup(R){const d=f(),m=f(),{t}=A(),h=x(),e=new k(new C("/admin/auth.Group/"),{expandAll:!0,dblClickNotEditColumn:[void 0],column:[{type:"selection",align:"center"},{label:t("auth.group.Group name"),prop:"name",align:"left",width:"200"},{label:t("auth.group.jurisdiction"),prop:"rules",align:"center"},{label:t("State"),prop:"status",align:"center",render:"tag",custom:{0:"danger",1:"success"},replaceValue:{0:t("Disable"),1:t("Enable")}},{label:t("Update time"),prop:"update_time",align:"center",width:"160",render:"datetime"},{label:t("Create time"),prop:"create_time",align:"center",width:"160",render:"datetime"},{label:t("Operate"),align:"center",width:"130",render:"buttons",buttons:_(["edit","delete"])}]},{defaultItems:{status:"1"}},{onSubmit:({formEl:a,operate:l,items:r})=>{var r=D(r);r.rules=d.value.getCheckeds();for(const o in r)r[o]===null&&delete r[o];l=l.replace(l[0],l[0].toLowerCase());let c=()=>{e.form.submitLoading=!0,e.api.postData(l,r).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 a?(e.form.ref=a,a.validate(o=>{o&&c()})):c(),!1},onTableDblclick:({row:a})=>e.table.extend.adminGroup.indexOf(a.id)===-1},{getIndex:({res:a})=>{e.table.extend.adminGroup=a.data.group;let l=T(e.table.column,"render","buttons");e.table.column[l].buttons.forEach(s=>{s.display=r=>a.data.group.indexOf(r.id)===-1})}});return G("baTable",e),B(()=>{e.table.ref=m.value,e.mount(),e.getIndex()}),(a,l)=>{const s=L("el-alert");return i(),N("div",O,[n(h).super?g("",!0):(i(),b(s,{key:0,class:"ba-table-alert",title:n(t)("auth.group.Manage subordinate role groups here"),type:"info","show-icon":""},null,8,["title"])),n(e).table.remark?(i(),b(s,{key:1,class:"ba-table-alert",title:n(e).table.remark,type:"info","show-icon":""},null,8,["title"])):g("",!0),u(v,{buttons:["refresh","add","edit","delete","unfold","quickSearch","columnDisplay"],"quick-search-placeholder":n(t)("Quick search placeholder",{fields:n(t)("auth.group.GroupName")})},null,8,["quick-search-placeholder"]),u(y,{ref_key:"tableRef",ref:m,pagination:!1},null,512),u(w,{ref_key:"formRef",ref:d},null,512)])}}});export{P as default};
|