import{_ as C,T as P,U as k,d as r,o as v,e as S,w as s,h as n,j as R,t as l,g as d,ai as q,ad as g,al as y}from"./index.cf09daef.js";import{Q as B}from"./QPage.17eab31b.js";import{u as p}from"./shop.d7573bba.js";import{P as N}from"./ProductThumbnail.e8bbc6cd.js";const T={components:{ProductThumbnail:N},data(){return{loading:!1,loaded:!1,pagination:{sortBy:"CREATED_AT_DESC",descending:!1,page:1,filter:"",advancedFilter:{},deleted:!1,rowsPerPage:12,rowsNumber:12,active:!0,loaded:!1}}},methods:{...P(p,["products","addToCart"]),onRequest(o){console.func("admins/products/ShopPage:methods.onRequest()",arguments);const{page:e,rowsPerPage:c,sortBy:u,descending:i}=o.pagination;this.pagination=o.pagination,this.loading=!0,this.products({...o.pagination,direction:i?"desc":"asc"}).then(({meta:t})=>{this.pagination.rowsNumber=t.total,this.pagination.page=e,this.pagination.rowsPerPage=c,this.pagination.sortBy=u,this.pagination.descending=i,this.pagination.loaded=!0,this.pagination.from=t.from,this.pagination.to=t.to,this.loading=!1}).catch(t=>{this.$core.error(t,{title:this.$t("dialog.title.error")})})},async rowClicked(o,e){console.func("admins/products/ShopPage:methods.rowClicked()",arguments),this.$router.push({name:"Product",params:{slug:e.slug,title:e.title}})}},computed:{...k(p,["rows","columns","toolbar"])}},D={class:"q-table__grid-item cursor-pointer col-xs-12 col-sm-3"},Q={class:"ellipsis-2-lines"},$={class:"text-subtitle2"};function x(o,e,c,u,i,t){const m=r("base-info"),_=r("product-thumbnail"),h=r("base-btn"),f=r("base-table"),b=r("base-section");return v(),S(B,{padding:""},{default:s(()=>[n(m,{rounded:"",class:"q-mb-md"},{default:s(()=>[R(l(o.$t("shopNotice")),1)]),_:1}),n(b,{flat:"",bordered:"","no-row":""},{default:s(()=>[n(f,{columns:o.columns,rows:o.rows,toolbar:o.toolbar,loading:i.loading,pagination:i.pagination,onRequest:t.onRequest,onRowClicked:t.rowClicked,"no-data-label":o.$t("products.noData"),"no-bordered-items":"",grid:""},{item:s(a=>[d("div",D,[n(q,{onClick:g(w=>t.rowClicked(w,a.row),["stop"]),flat:"",bordered:"",props:a,class:""},{default:s(()=>[n(_,{media:a.row.thumbnail},null,8,["media"]),n(y,null,{default:s(()=>[n(h,{onClick:e[0]||(e[0]=g(()=>{},["stop"])),to:{name:"Product",params:{slug:a.row.slug,title:a.row.title}},size:"lg",link:""},{default:s(()=>[d("div",Q,l(a.row.title),1)]),_:2},1032,["to"]),d("div",$,l(a.row.price),1)]),_:2},1024)]),_:2},1032,["onClick","props"])])]),_:1},8,["columns","rows","toolbar","loading","pagination","onRequest","onRowClicked","no-data-label"])]),_:1})]),_:1})}var z=C(T,[["render",x]]);export{z as default};
