PageSourceSearch

https://payway.store/wp-content/plugins/payway-personal-6.1/assets/chunks/WithdrawalView-BVNWpvhr.js

js payway.store collected 2026-10-08 15:28:45 UTC 9,010 bytes, 1 lines download raw bytes

1import{s as O}from"./index-DgoTxctE.js";import{u as K,s as U}from"./toast-BgrsYMBe.js";import{s as h,_ as Y,a as G}from"./StatusBadge-DsMUv40f.js";import{s as C,a as J}from"./index-85WNFJPt.js";import{a as j}from"./index-HW7Yk54d.js";import{m as L,o,c as i,b as c,d as n,h as $,n as k,t as m,a as e,p as T,r as u,i as Q,_ as z,F as B,q as I,f as M,s as X,v as Z,g as D}from"../index-CSTdT1CA.js";import{u as tt}from"./user-BJMzqg8G.js";/* empty css                                                                             */import"./index-B7bdj9UN.js";import"./index-DVgQ0QZn.js";import"./index-mpLfY3np.js";import"./index-BvEFAR5J.js";import"./index-BAHdD7Ag.js";import"./index-qFyJwsfU.js";const et={class:"p-card p-4 w-30"},st={key:1},at={key:1,class:"flex align-items-center gap-2"},ot={key:1},V="/withdrawal",nt={__name:"WithdrawalTable",setup(E){const b=u(null),_=u([]),g=u(0),a=u(!1),v=u(1),d=u(10),w=u("time"),y=u(-1),f=[{label:"Отклонен",value:"rejected",severity:"danger"},{label:"На проверке",value:"review",severity:"warning"},{label:"Подтвержден",value:"approved",severity:"info"},{label:"Выплачено",value:"paid",severity:"success"}],l={swift:"pi pi-globe",cards:"pi pi-credit-card",cryptocurrency:"pi pi-bitcoin"},S=Q(()=>Array.from({length:d.value}).map((s,t)=>({id:`skeleton-${t}`})));function F(s){return l[s]||"pi pi-question-circle"}function P(s){const t=s||"Нет примечания";return t.length>55?`${t.substring(0,55)}...`:t}async function x(){var s;a.value=!0;try{const t=await j.get(V,{params:{page:v.value,per_page:d.value,order_by:w.value,order:y.value===-1?"DESC":"ASC"}});_.value=t.data.data||t.data,g.value=((s=t.data.meta)==null?void 0:s.total_records)||0}catch(t){console.error("Error fetching withdrawals:",t)}finally{a.value=!1}}function R(s){v.value=s.page+1,d.value=s.rows,x()}function A(s){w.value=s.sortField,y.value=s.sortOrder,x()}async function r(s){const{newData:t}=s;try{await j.put(`${V}/${t.id}`,t)}catch(p){console.error("Error updating row:",p)}}return L(()=>{x()}),(s,t)=>(o(),i("div",et,[c(n(O),{ref_key:"toastRef",ref:b},null,512),c(n(J),{value:a.value?S.value:_.value,paginator:!0,rows:d.value,totalRecords:g.value,lazy:!0,first:(v.value-1)*d.value,rowsPerPageOptions:[5,10,25],editMode:"row",dataKey:"id",loading:a.value,scrollable:!0,class:"text-sm",onPage:R,onSort:A,sortField:w.value,sortOrder:y.value,onRowEditSave:r},{default:$(()=>[c(n(C),{field:"time",header:"Дата/время",sortable:!0,style:{textAlign:"left",verticalAlign:"top"},headerStyle:"text-align: left",bodyStyle:"text-align: left; vertical-align: top"},{body:$(({data:p})=>[a.value?(o(),k(n(h),{key:0,width:"100%",height:"1.5rem"})):(o(),i("span",st,m(p.time),1))]),_:1}),c(n(C),{field:"amount",header:"Сумма",sortable:!0,style:{textAlign:"left",verticalAlign:"top"},headerStyle:"text-align: left",bodyStyle:"text-align: left; vertical-align: top"},{body:$(({data:p})=>[a.value?(o(),k(n(h),{key:0,width:"100%",height:"1.5rem"})):(o(),i("div",at,[e("span",null,"$"+m(p.amount),1),t[0]||(t[0]=e("i",{class:"pi pi-arrow-right",style:{"font-size":"1rem"}},null,-1)),e("i",{class:T(F(p.payment_type)),style:{"font-size":"1.5rem"}},null,2),e("span",null,m(p.payment_type),1)]))]),_:1}),c(n(C),{field:"comments",header:"Примечание",style:{width:"25rem",textAlign:"left",verticalAlign:"top"},headerStyle:"text-align: left",bodyStyle:"text-align: left; vertical-align: top"},{body:$(({data:p})=>[a.value?(o(),k(n(h),{key:0,width:"100%",height:"1.5rem"})):(o(),i("div",ot,m(P(p.comments)),1))]),_:1}),c(n(C),{field:"status",header:"Статус",sortable:!0,style:{textAlign:"left",verticalAlign:"top"},headerStyle:"text-align: left",bodyStyle:"text-align: left; vertical-align: top"},{body:$(({data:p})=>[a.value?(o(),k(n(h),{key:0,width:"100%",height:"1.5rem"})):(o(),k(Y,{key:1,rowData:p,statuses:f},null,8,["rowData"]))]),_:1})]),_:1},8,["value","rows","totalRecords","first","loading","sortField","sortOrder"])]))}},it={class:"mobile-withdrawal-list fade-in"},lt={key:0,class:"skeleton-container"},rt={class:"skeleton-header"},ct={class:"skeleton-body"},dt={key:1,class:"empty-state"},ut={key:2,class:"cards-container"},pt={class:"card-header"},mt={class:"date-time"},vt={class:"card-body"},_t={class:"amount-section"},gt={class:"amount"},ft={class:"payment-type"},yt={key:0,class:"card-footer"},ht={key:0,class:"comment"},bt={key:1,class:"rejection-reason"},wt={key:3,class:"pagination"},xt=["disabled"],$t=["disabled"],kt={class:"page-number"},St=["disabled"],Ct=["disabled"],W=10,Mt={__name:"MobileWithdrawalList",setup(E,{expose:b}){const _=u([]),g=u(!0),a=u(1),v=u(1),d=async()=>{var r;g.value=!0;try{const s=await j.get("/withdrawal",{params:{page:a.value,per_page:W,order_by:"time",order:"DESC"}});_.value=s.data.data||[],v.value=Math.ceil((((r=s.data.meta)==null?void 0:r.total_records)||0)/W)}catch(s){console.error("Error fetching withdrawals:",s),_.value=[]}finally{g.value=!1}},w={review:"На проверке",paid:"Выплачено",rejected:"Отклонен",approved:"Подтвержден"},y=r=>w[r]||r,f=r=>{const s=new Date(r),t=String(s.getDate()).padStart(2,"0"),p=String(s.getMonth()+1).padStart(2,"0"),N=s.getFullYear(),q=String(s.getHours()).padStart(2,"0"),H=String(s.getMinutes()).padStart(2,"0");return`${t}.${p}.${N} ${q}:${H}`},l=r=>`$${parseFloat(r).toFixed(2)}`,S=r=>({review:"status-review",paid:"status-paid",rejected:"status-rejected",approved:"status-approved"})[r]||"status-default",F=r=>({swift:"pi pi-globe",cards:"pi pi-credit-card",cryptocurrency:"pi pi-bitcoin"})[r.toLowerCase()]||"pi pi-info-circle",P=()=>{a.value>1&&(a.value--,d())},x=()=>
1{a.value<v.value&&(a.value++,d())},R=()=>{a.value=1,d()},A=()=>{a.value=v.value,d()};return L(()=>{d()}),b({fetchWithdrawals:d}),(r,s)=>(o(),i("div",it,[g.value?(o(),i("div",lt,[(o(),i(B,null,I(3,t=>e("div",{key:t,class:"skeleton-card"},[e("div",rt,[c(n(h),{width:"60%",height:"16px"}),c(n(h),{width:"80px",height:"24px"})]),e("div",ct,[c(n(h),{width:"100%",height:"20px",class:"mb-2"}),c(n(h),{width:"100%",height:"16px"})])])),64))])):_.value.length===0?(o(),i("div",dt,[...s[0]||(s[0]=[e("i",{class:"pi pi-inbox"},null,-1),e("p",null,"Нет заявок на вывод",-1)])])):(o(),i("div",ut,[(o(!0),i(B,null,I(_.value,t=>(o(),i("div",{key:t.id,class:"withdrawal-card"},[e("div",pt,[e("span",mt,m(f(t.time)),1),e("span",{class:T(["status-badge",S(t.status)])},m(y(t.status)),3)]),e("div",vt,[e("div",_t,[e("span",gt,m(l(t.amount)),1),s[1]||(s[1]=e("span",{class:"divider"},"→",-1)),e("i",{class:T(["payment-icon",F(t.payment_type)])},null,2),e("span",ft,m(t.payment_type),1)])]),t.comments||t.status==="rejected"&&t.rejected_comment?(o(),i("div",yt,[t.comments?(o(),i("p",ht,m(t.comments),1)):M("",!0),t.status==="rejected"&&t.rejected_comment?(o(),i("p",bt," Причина: "+m(t.rejected_comment),1)):M("",!0)])):M("",!0)]))),128))])),!g.value&&_.value.length>0?(o(),i("div",wt,[e("button",{class:"pagination-btn",disabled:a.value===1,onClick:R}," « ",8,xt),e("button",{class:"pagination-btn",disabled:a.value===1,onClick:P}," ‹ ",8,$t),e("span",kt,m(a.value),1),e("button",{class:"pagination-btn",disabled:a.value===v.value,onClick:x}," › ",8,St),e("button",{class:"pagination-btn",disabled:a.value===v.value,onClick:A}," » ",8,Ct)])):M("",!0)]))}},Ft=z(Mt,[["__scopeId","data-v-babf5bae"]]),Pt={key:0,class:"mobile-withdrawal-view"},Rt={class:"mobile-header-section"},At={class:"header-row"},Dt={class:"balance-display"},jt={class:"balance-value"},Tt={key:1,class:"p-5"},Lt={class:"grid grid-cols-2 gap-4 mb-3 items-end"},Et={class:"col"},Bt={class:"col text-right pt-4 text-lg"},It={class:"text-green-500"},Vt={__name:"WithdrawalView",setup(E){const b=u(null),_=u(null),g=tt(),a=K(),{balance:v}=X(g),{isMobile:d}=Z();L(async()=>{await g.fetchBalance(),w()});function w(){a.message&&(b.value&&b.value.show({severity:a.severity,summary:"Успешно",detail:a.message,life:3e3}),setTimeout(()=>a.clearToast(),3e3))}function y(f){return f==null?"...":`$${parseFloat(f).toFixed(2)}`}return(f,l)=>n(d)?(o(),i("div",Pt,[e("div",Rt,[l[3]||(l[3]=e("h2",{class:"page-title"},"Вывод средств",-1)),e("div",At,[e("button",{class:"create-btn",onClick:l[0]||(l[0]=S=>f.$router.push("/create-withdrawal"))},[...l[1]||(l[1]=[e("i",{class:"pi pi-plus"},null,-1),D(" Создать заявку ",-1)])]),e("div",Dt,[l[2]||(l[2]=D(" Баланс: ",-1)),e("span",jt,m(y(n(v))),1)])])]),c(Ft,{ref_key:"mobileListRef",ref:_},null,512)])):(o(),i("div",Tt,[c(n(O),{ref_key:"toastRef",ref:b},null,512),l[5]||(l[5]=e("div",{class:"text-3xl text-900 font-semibold text-lg mt-3"}," Заявки поданные на вывод средств ",-1)),c(n(U)),e("div",Lt,[e("div",Et,[c(G,{label:"Создать заявку",to:"/create-withdrawal"})]),e("div",Bt,[l[4]||(l[4]=D(" Баланс для вывода: ",-1)),e("span",It,m(y(n(v))),1)])]),c(nt)]))}},te=z(Vt,[["__scopeId","data-v-6ae7a218"]]);export{te as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.