import{d as B,u as N,r as m,o as S,k as n,w as a,a7 as V,p as s,q,v as r,h,m as b,y as v,i,l as u,L as A,a8 as L,E as j}from"./index-htML_UHV.js";const T={class:"inner-toolbar w-11/12 flex justify-between"},G={class:"toolbar-btns"},I={class:"toolbar-search"},J=B({__name:"packagePermissions",setup(x){const{t:d}=N(),y=q(),c=m(!1),t=m({page_no:1,page_size:10,keyword:""}),l=m({}),p=e=>!0,f=e=>{t.value.page_size=e,o()},C=e=>{t.value.page_no=e,o()},z=()=>{y.push({name:"packageAdd",query:{id:0}})},w=e=>{y.push({name:"packageAdd",query:{id:e.role_id}})},$=e=>{A.confirm(d("del_info"),d("prompt"),{type:"warning"}).then(()=>{L(e.role_id).then(()=>{j.success(d("del_success")+"！"),o()})}).catch(()=>{})},R=e=>{t.value.keyword=e,t.value.page_no=1,o()},o=()=>{c.value=!0,V(t.value).then(e=>{c.value=!1,l.value=e}).catch(()=>{c.value=!1})};return S(()=>{o()}),(e,F)=>{const _=s("el-button"),E=s("en-table-search"),g=s("el-table-column"),M=s("el-pagination"),D=s("en-table-layout");return r(),n(D,{tableData:l.value.records,loading:c.value},{toolbar:a(()=>[h("div",T,[h("div",G,[p(["roleManage:add"])?(r(),n(_,{key:0,size:"small",type:"primary",icon:"el-icon-circle-plus-outline",onClick:z},{default:a(()=>[b(v(e.$t("add")),1)]),_:1})):u("",!0)]),h("div",I,[i(E,{onSearch:R,placeholder:e.$t("search_placeholde")},null,8,["placeholder"])])])]),"table-columns":a(()=>[i(g,{prop:"role_name",label:e.$t("role_names")},null,8,["label"]),i(g,{prop:"role_describe",label:e.$t("role_describe")},null,8,["label"]),i(g,{label:e.$t("operate")},{default:a(k=>[p(["roleManage:edit"])?(r(),n(_,{key:0,size:"small",type:"primary",onClick:P=>w(k.row)},{default:a(()=>[b(v(e.$t("edit")),1)]),_:2},1032,["onClick"])):u("",!0),p(["roleManage:del"])?(r(),n(_,{key:1,size:"small",type:"danger",onClick:P=>$(k.row)},{default:a(()=>[b(v(e.$t("delete")),1)]),_:2},1032,["onClick"])):u("",!0)]),_:1},8,["label"])]),pagination:a(()=>[l.value?(r(),n(M,{key:0,onSizeChange:f,onCurrentChange:C,"current-page":l.value.page,"page-sizes":[10,20,50,100],"page-size":l.value.size,layout:"total, sizes, prev, pager, next, jumper",total:l.value.total},null,8,["current-page","page-size","total"])):u("",!0)]),_:1},8,["tableData","loading"])}}});export{J as default};
