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