import{_ as C,T as h,U as w,d as l,o as y,e as _,w as s,h as n,R as k,N as g,ad as P,j as q,t as v}from"./index.cf09daef.js";import{Q as R}from"./QPage.17eab31b.js";import{u as r}from"./category.9b5d25c1.js";const S={data(){return{loading:!1,loaded:!1,selected:[],pagination:{sortBy:"name",descending:!1,page:1,filter:"",deleted:!1,rowsPerPage:15,rowsNumber:15,loaded:!1},useCategoryStore:r()}},methods:{...h(r,["get"]),onRequest(e){console.func("pages/admins/categories/CategoriesPage:methods.onRequest()",arguments);const{page:o,rowsPerPage:d,sortBy:c,descending:t}=e.pagination;this.pagination=e.pagination,this.loading=!0,this.get({...e.pagination,descending:t?"desc":"asc"}).then(({meta:a})=>{this.pagination.rowsNumber=a.total,this.pagination.page=o,this.pagination.rowsPerPage=d,this.pagination.sortBy=c,this.pagination.descending=t,this.pagination.loaded=!0,this.pagination.from=a.from,this.pagination.to=a.to,this.loading=!1}).catch(a=>{this.$core.error(a,{title:this.$t("dialog.title.error")})})},async actionClicked(e,o){console.func("pages/admins/categories/CategoriesPage:methods.actionClicked()",arguments)},async toolbarClicked(e,o){console.func("pages/admins/categories/CategoriesPage:methods.toolbarClicked()",arguments)},async rowClicked(e,o){console.func("pages/admins/categories/CategoriesPage:methods.rowClicked()",arguments),this.$router.push({name:"Category",params:{id:o.id},query:{action:"edit"}})}},computed:{...w(r,["actions","rows","columns","module","toolbar","filters"])}};function B(e,o,d,c,t,a){const u=l("base-thumbnail"),m=l("base-btn"),p=l("base-status"),b=l("base-table"),f=l("base-section");return y(),_(R,{padding:""},{default:s(()=>[n(f,{flat:"",bordered:"","no-row":""},{default:s(()=>[n(b,{store:t.useCategoryStore,module:e.module,columns:e.columns,rows:e.rows,actions:e.actions,toolbar:e.toolbar,loading:t.loading,pagination:t.pagination,onRequest:a.onRequest,selection:"multiple",onActionClicked:a.actionClicked,onToolbarClicked:a.toolbarClicked,onRowClicked:a.rowClicked,"no-data-label":e.$t("label.noCategoryAvaialble"),"table-key":"category",selected:t.selected,"onUpdate:selected":o[1]||(o[1]=i=>t.selected=i),"no-permissions":""},{"body-cell-name":s(i=>[n(k,{class:"q-pa-none",dense:""},{default:s(()=>[n(g,{avatar:""},{default:s(()=>[n(u,{size:40,media:i.row.thumbnail},null,8,["media"])]),_:2},1024),n(g,{avatar:""},{default:s(()=>[n(m,{onClick:o[0]||(o[0]=P(()=>{},["stop"])),link:"",size:"12px",tag:"a",to:{name:"Category",params:{id:i.row.id},query:{action:"edit"}}},{default:s(()=>[q(v(i.value),1)]),_:2},1032,["to"])]),_:2},1024)]),_:2},1024)]),"body-cell-status":s(i=>[n(p,{type:i.value},null,8,["type"])]),_:1},8,["store","module","columns","rows","actions","toolbar","loading","pagination","onRequest","onActionClicked","onToolbarClicked","onRowClicked","no-data-label","selected"])]),_:1})]),_:1})}var T=C(S,[["render",B]]);export{T as default};
