"use strict";(self["webpackChunkTruckShop"]=self["webpackChunkTruckShop"]||[]).push([[6714],{5057:function(a,e,l){l.r(e),l.d(e,{default:function(){return F}});var t=l(6768),s=l(4232),n=l(5130);const u={class:"table-responsive"},c={class:"table table-hover tbl-product",id:"pc-dt-simple"},r={class:"d-flex justify-content-center"},i={"aria-label":"Page navigation"},o={class:"pagination"},d={key:1,class:"page-item",disabled:""},g=["onClick"],p={key:2,class:"page-item",disabled:""},v={class:"page-link",href:"javascript:void(0)"},k={class:"ms-0 search-number"},L=["max"];function P(a,e,l,P,b,f){const h=(0,t.g2)("BCardBody"),m=(0,t.g2)("BCard"),C=(0,t.g2)("BCol"),_=(0,t.g2)("BRow"),y=(0,t.g2)("Layout");return(0,t.uX)(),(0,t.Wv)(y,null,{default:(0,t.k6)((()=>[(0,t.bF)(_,null,{default:(0,t.k6)((()=>[(0,t.bF)(C,{class:"col-sm-12"},{default:(0,t.k6)((()=>[(0,t.bF)(m,{"no-body":"",class:"table-card"},{default:(0,t.k6)((()=>[(0,t.bF)(h,null,{default:(0,t.k6)((()=>[e[7]||(e[7]=(0,t.Lk)("div",{class:"text-end p-sm-4 pb-sm-2"},null,-1)),(0,t.Lk)("div",u,[(0,t.Lk)("table",c,[e[6]||(e[6]=(0,t.Lk)("thead",null,[(0,t.Lk)("tr",null,[(0,t.Lk)("th",null,"شناسه"),(0,t.Lk)("th",null,"تاریخ ایحاد"),(0,t.Lk)("th",null,"کد رهگیری"),(0,t.Lk)("th",null,"وضعیت")])],-1)),(0,t.Lk)("tbody",null,[((0,t.uX)(!0),(0,t.CE)(t.FK,null,(0,t.pI)(P.allOrders,(a=>((0,t.uX)(),(0,t.CE)("tr",{key:a?.id},[(0,t.Lk)("td",null,(0,s.v_)(a?.id),1),(0,t.Lk)("td",null,(0,s.v_)(P.convertToJalali(a?.created_at)),1),(0,t.Lk)("td",null,(0,s.v_)(a?.tracking_code),1),(0,t.Lk)("td",null,(0,s.v_)(a?.status),1)])))),128))])])])])),_:1,__:[7]})])),_:1})])),_:1})])),_:1}),(0,t.bF)(_,null,{default:(0,t.k6)((()=>[(0,t.bF)(C,{sm:"12"},{default:(0,t.k6)((()=>[(0,t.Lk)("div",r,[(0,t.Lk)("nav",i,[(0,t.Lk)("ul",o,[(0,t.Lk)("li",{class:(0,s.C4)(["page-item",{disabled:1===P.currentPage}])},[(0,t.Lk)("span",{class:"page-link",onClick:e[0]||(e[0]=(...a)=>P.prevPage&&P.prevPage(...a))},"قبلی")],2),P.currentPage>2?((0,t.uX)(),(0,t.CE)("li",{key:0,class:"page-item",onClick:e[1]||(e[1]=a=>P.page=1)},e[8]||(e[8]=[(0,t.Lk)("a",{class:"page-link",href:"javascript:void(0)"},"1",-1)]))):(0,t.Q3)("",!0),P.currentPage>3?((0,t.uX)(),(0,t.CE)("li",d,e[9]||(e[9]=[(0,t.Lk)("span",{class:"page-link"},"...",-1)]))):(0,t.Q3)("",!0),((0,t.uX)(!0),(0,t.CE)(t.FK,null,(0,t.pI)(P.visiblePages,(a=>((0,t.uX)(),(0,t.CE)("li",{key:a,class:(0,s.C4)(["page-item",{active:P.currentPage===a}])},[(0,t.Lk)("a",{class:"page-link",href:"javascript:void(0)",onClick:e=>P.page=a},(0,s.v_)(a),9,g)],2)))),128)),P.currentPage<P.totalPages-2?((0,t.uX)(),(0,t.CE)("li",p,e[10]||(e[10]=[(0,t.Lk)("span",{class:"page-link"},"...",-1)]))):(0,t.Q3)("",!0),P.currentPage<P.totalPages-1?((0,t.uX)(),(0,t.CE)("li",{key:3,class:"page-item",onClick:e[2]||(e[2]=a=>P.page=P.totalPages)},[(0,t.Lk)("a",v,(0,s.v_)(P.totalPages),1)])):(0,t.Q3)("",!0),(0,t.Lk)("li",{class:(0,s.C4)(["page-item",{disabled:P.currentPage===P.totalPages}])},[(0,t.Lk)("span",{class:"page-link",onClick:e[3]||(e[3]=(...a)=>P.nextPage&&P.nextPage(...a))},"بعدی")],2)])])])])),_:1}),(0,t.bF)(C,{sm:"4"},{default:(0,t.k6)((()=>[(0,t.Lk)("div",k,[(0,t.bo)((0,t.Lk)("input",{"onUpdate:modelValue":e[4]||(e[4]=a=>P.searchPage=a),type:"text",class:"form-control",placeholder:"برو به صفحه",max:P.totalPages,min:"1",onInput:e[5]||(e[5]=(...a)=>P.handlePageInput&&P.handlePageInput(...a))},null,40,L),[[n.Jo,P.searchPage]])])])),_:1})])),_:1})])),_:1})}l(4114);var b=l(281),f=l(9317),h=l(144),m=l(7366),C=l.n(m),_={name:"PRODUCT-LIST",components:{Layout:b.A},setup(){const a=(0,h.KR)(),e=(0,h.KR)(1),l=(0,h.KR)(1),s=(0,h.KR)(20),n=(0,h.KR)(1),u=(0,h.KR)(!1),c=(0,h.KR)([]),r=()=>{u.value=!0,f.A.get(`admin/orders?paginate=${s.value||10}&page=${n.value||1}`).then((a=>{console.log(a),c.value=a.data.data.data,e.value=a.data.data.current_page,l.value=a.data.data.last_page})).catch((a=>{console.log(a)}))},i=a=>C()(a,"YYYY-MM-DD HH:mm:ss").locale("fa").format("YYYY/MM/DD"),o=a=>{const e={waiting:"در انتظار",paid:"پرداخت‌شده",un_paid:"پرداخت‌نشده",approved:"تأیید‌شده",processing:"در حال پردازش",shipping:"در حال ارسال",delivered:"تحویل‌شده",canceled:"لغو‌شده"};return e[a]||"نامشخص"},d=(0,t.EW)((()=>{const a=[];if(l.value<=5)for(let e=1;e<=l.value;e++)a.push(e);else{let t=e.value-2,s=e.value+2;t<1&&(t=1),s>l.value&&(s=l.value);for(let e=t;e<=s;e++)a.push(e)}return a}));function g(){a.value<1?a.value=1:a.value>l.value&&(a.value=l.value),a.value>=1&&a.value<=l.value&&(n.value=a.value)}(0,t.wB)(n,(()=>{r()}));const p=()=>{e.value<l.value&&(n.value++,r())},v=()=>{e.value>1&&(n.value--,r())};return(0,t.sV)((()=>{r()})),{allOrders:c,visiblePages:d,nextPage:p,prevPage:v,handlePageInput:g,currentPage:e,totalPages:l,page:n,convertToJalali:i,searchPage:a,getStatusLabel:o}}},y=l(1241);const E=(0,y.A)(_,[["render",P],["__scopeId","data-v-2f147910"]]);var F=E}}]);
//# sourceMappingURL=6714.aa56bbd4.js.map