import{c as N}from"./crud-CjEsxyNP.js";import{_ as R,Z as U,am as z,aq as H,a as I,E as j,e as l,o as d,g as E,c as a,w as n,F as D,v as q,i,t as r,f as _,J as m,j as J,az as Z,aD as $,aE as G,n as L,B as Q,m as W,aw as X}from"./app-DGDivIsO.js";import{A as Y,f as x}from"./AddEdit-_a1AdlgA.js";import{S as ee}from"./SettingSidebar-CHvaoh8x.js";import{A as ae}from"./AdminPageHeader-ff2SFNbk.js";import"./datatable-Cnt5bvOi.js";import"./filter-_TPdNMe8.js";import"./apiAdmin-D4J8O5cP.js";import"./SaveOutlined-saF8VQQc.js";import"./TranslationOutlined-BagSv0t3.js";import"./UserOutlined-Cz46sReQ.js";import"./ShoppingCartOutlined-BJIcmyJ0.js";import"./ScheduleOutlined-CPLAH6Jp.js";import"./AppstoreAddOutlined-C6X3YU8a.js";import"./MailOutlined-BkPJOQow.js";import"./HistoryOutlined-_8ag_Mv5.js";import"./FormOutlined-YMDYF7hD.js";import"./index-C2QBqMxH.js";const ne={components:{PlusOutlined:U,EditOutlined:z,DeleteOutlined:H,AddEdit:Y,SettingSidebar:ee,AdminPageHeader:ae},setup(){const{permsArray:e}=I(),{url:C,addEditUrl:A,initData:t,columns:k,filterableColumns:g,preFetchData:f,getPreFetchData:y}=x(),o=N();return j(()=>{y(),o.tableUrl.value={url:C,filters:""},o.table.filterableColumns=g,o.fetch({page:1}),o.crudUrl.value=A,o.langKey.value="role",o.initData.value={...t},o.formData.value={...t}}),{permsArray:e,columns:k,...o,filterableColumns:g,preFetchData:f}}},te={class:"table-responsive"};function oe(e,C,A,t,k,g){const f=Z,y=l("router-link"),o=$,w=G,v=l("AdminPageHeader"),S=l("SettingSidebar"),c=L,O=l("PlusOutlined"),u=Q,h=l("DeleteOutlined"),P=W,b=q,T=l("admin-page-filters"),B=l("AddEdit"),V=l("EditOutlined"),F=X,K=l("admin-page-table-content");return d(),E(D,null,[a(v,null,{header:n(()=>[a(f,{title:e.$t("menu.roles"),class:"p-0"},null,8,["title"])]),breadcrumb:n(()=>[a(w,{separator:"-",style:{"font-size":"12px"}},{default:n(()=>[a(o,null,{default:n(()=>[a(y,{to:{name:"admin.dashboard.index"}},{default:n(()=>[i(r(e.$t("menu.dashboard")),1)]),_:1})]),_:1}),a(o,null,{default:n(()=>[i(r(e.$t("menu.settings")),1)]),_:1}),a(o,null,{default:n(()=>[i(r(e.$t("menu.roles")),1)]),_:1})]),_:1})]),_:1}),a(b,null,{default:n(()=>[a(c,{xs:24,sm:24,md:24,lg:4,xl:4,class:"bg-setting-sidebar"},{default:n(()=>[a(S)]),_:1}),a(c,{xs:24,sm:24,md:24,lg:20,xl:20},{default:n(()=>[a(T,null,{default:n(()=>[a(b,{gutter:[16,16]},{default:n(()=>[a(c,{xs:24,sm:24,md:12,lg:10,xl:10},{default:n(()=>[a(P,null,{default:n(()=>[t.permsArray.includes("roles_create")||t.permsArray.includes("admin")?(d(),_(u,{key:0,type:"primary",onClick:e.addItem},{default:n(()=>[a(O),i(" "+r(e.$t("role.add")),1)]),_:1},8,["onClick"])):m("",!0),e.table.selectedRowKeys.length>0&&(t.permsArray.includes("roles_delete")||t.permsArray.includes("admin"))?(d(),_(u,{key:1,type:"primary",onClick:e.showSelectedDeleteConfirm,danger:""},{icon:n(()=>[a(h)]),default:n(()=>[i(" "+r(e.$t("common.delete")),1)]),_:1},8,["onClick"])):m("",!0)]),_:1})]),_:1})]),_:1})]),_:1}),a(K,null,{default:n(()=>[a(B,{addEditType:e.addEditType,visible:e.addEditVisible,url:e.addEditUrl,onAddEditSuccess:e.addEditSuccess,onClosed:e.onCloseAddEdit,formData:e.formData,data:e.viewData,pageTitle:e.pageTitle,successMessage:e.successMessage},null,8,["addEditType","visible","url","onAddEditSuccess","onClosed","formData","data","pageTitle","successMessage"]),a(b,null,{default:n(()=>[a(c,{span:24},{default:n(()=>[J("div",te,[a(F,{"row-selection":{selectedRowKeys:e.table.selectedRowKeys,onChange:e.onRowSelectChange,getCheckboxProps:s=>({disabled:!((t.permsArray.includes("roles_delete")||t.permsArray.includes("admin"))&&s.name!="admin"),name:s.xid})},columns:t.columns,"row-key":s=>s.xid,"data-source":e.table.data,pagination:e.table.pagination,loading:e.table.loading,onChange:e.handleTableChange,bordered:"",size:"middle"},{bodyCell:n(({column:s,record:p})=>[s.dataIndex==="action"?(d(),E(D,{key:0},[(t.permsArray.includes("roles_edit")||t.permsArray.includes("admin"))&&p.name!="admin"?(d(),_(u,{key:0,type:"primary",onClick:M=>e.editItem(p),style:{"margin-left":"4px"}},{icon:n(()=>[a(V)]),_:2},1032,["onClick"])):m("",!0),(t.permsArray.includes("roles_delete")||t.permsArray.includes("admin"))&&p.name!="admin"?(d(),_(u,{key:1,type:"primary",onClick:M=>e.showDeleteConfirm(p.xid),style:{"margin-left":"4px"}},{icon:n(()=>[a(h)]),_:2},1032,["onClick"])):m("",!0)],64)):m("",!0)]),_:1},8,["row-selection","columns","row-key","data-source","pagination","loading","onChange"])])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})],64)}const Ee=R(ne,[["render",oe]]);export{Ee as default};
