import{c as K}from"./crud-BDJksExS.js";import{_ as M,am as N,aq as R,a as j,E as F,e as c,o as d,g as b,c as n,w as a,V as I,f as p,i as v,t as S,J as _,F as C,h as L,j as q,B as z,m as J,n as P,a3 as G,as as H,at as Q,v as W,aw as X,a2 as Y}from"./app-DNXD_-wA.js";import{A as Z,f as x}from"./AddEdit-Bfs-Uu2O.js";const $={props:{panelType:{type:String,default:"admin"}},components:{EditOutlined:N,DeleteOutlined:R,AddEdit:Z},setup(e){const{permsArray:i,appSetting:s}=j(),{url:t,addEditUrl:h,initData:g,columns:u,filterableColumns:r}=x(e.panelType),o=K();return F(()=>{o.tableUrl.value={url:t},o.table.filterableColumns=r,o.fetch({page:1}),o.crudUrl.value=h,o.langKey.value="currency",o.initData.value={...g},o.formData.value={...g}}),{permsArray:i,appSetting:s,columns:u,...o,filterableColumns:r}}},ee={class:"table-responsive"};function ne(e,i,s,t,h,g){const u=c("DeleteOutlined"),r=z,o=J,m=P,T=Y,k=G,w=H,E=Q,y=W,A=c("admin-page-filters"),D=c("AddEdit"),B=c("EditOutlined"),O=X,V=c("admin-page-table-content");return d(),b(C,null,[n(A,null,{default:a(()=>[n(y,{gutter:[16,16]},{default:a(()=>[n(m,{xs:24,sm:24,md:12,lg:10,xl:10},{default:a(()=>[n(o,null,{default:a(()=>[I(e.$slots,"actionButtons"),e.table.selectedRowKeys.length>0&&(s.panelType=="superadmin"||t.permsArray.includes("currencies_delete")||t.permsArray.includes("admin"))?(d(),p(r,{key:0,type:"primary",onClick:e.showSelectedDeleteConfirm,danger:""},{icon:a(()=>[n(u)]),default:a(()=>[v(" "+S(e.$t("common.delete")),1)]),_:1},8,["onClick"])):_("",!0)]),_:3})]),_:3}),n(m,{xs:24,sm:24,md:12,lg:14,xl:14},{default:a(()=>[n(y,{gutter:[16,16],justify:"end"},{default:a(()=>[n(m,{xs:24,sm:24,md:16,lg:12,xl:10},{default:a(()=>[n(E,{compact:""},{default:a(()=>[n(k,{style:{width:"25%"},value:e.table.searchColumn,"onUpdate:value":i[0]||(i[0]=l=>e.table.searchColumn=l),placeholder:e.$t("common.select_default_text",[""])},{default:a(()=>[(d(!0),b(C,null,L(t.filterableColumns,l=>(d(),p(T,{key:l.key},{default:a(()=>[v(S(l.value),1)]),_:2},1024))),128))]),_:1},8,["value","placeholder"]),n(w,{style:{width:"75%"},value:e.table.searchString,"onUpdate:value":i[1]||(i[1]=l=>e.table.searchString=l),"show-search":"",onChange:e.onTableSearch,onSearch:e.onTableSearch,loading:e.table.filterLoading},null,8,["value","onChange","onSearch","loading"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:3})]),_:3}),n(V,null,{default:a(()=>[n(D,{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"]),n(y,null,{default:a(()=>[n(m,{span:24},{default:a(()=>[q("div",ee,[n(O,{"row-selection":{selectedRowKeys:e.table.selectedRowKeys,onChange:e.onRowSelectChange,getCheckboxProps:l=>({disabled:!((s.panelType=="admin"&&(t.permsArray.includes("currencies_delete")||t.permsArray.includes("admin"))||s.panelType=="superadmin")&&t.appSetting.x_currency_id!=l.xid),name:l.xid})},columns:t.columns,"row-key":l=>l.xid,"data-source":e.table.data,pagination:e.table.pagination,loading:e.table.loading,onChange:e.handleTableChange,bordered:"",size:"middle"},{bodyCell:a(({column:l,record:f})=>[l.dataIndex==="action"?(d(),b(C,{key:0},[s.panelType=="admin"&&(t.permsArray.includes("currencies_edit")||t.permsArray.includes("admin"))||s.panelType=="superadmin"?(d(),p(r,{key:0,type:"primary",onClick:U=>e.editItem(f),style:{"margin-left":"4px"}},{icon:a(()=>[n(B)]),_:2},1032,["onClick"])):_("",!0),(s.panelType=="admin"&&(t.permsArray.includes("currencies_delete")||t.permsArray.includes("admin"))||s.panelType=="superadmin")&&t.appSetting.x_currency_id!=f.xid?(d(),p(r,{key:1,type:"primary",onClick:U=>e.showDeleteConfirm(f.xid),style:{"margin-left":"4px"}},{icon:a(()=>[n(u)]),_:2},1032,["onClick"])):_("",!0)],64)):_("",!0)]),_:1},8,["row-selection","columns","row-key","data-source","pagination","loading","onChange"])])]),_:1})]),_:1})]),_:1})],64)}const oe=M($,[["render",ne]]);export{oe as C};
