Files
machartaa_admin_dist/dist/assets/index-2758d3b6.js
T

2 lines
13 KiB
JavaScript
Raw Normal View History

2026-06-03 19:51:45 +03:30
import{_ as G}from"./BasicMainCard-8123d7a5.js";import{_ as O}from"./BasicModal.vue_vue_type_style_index_0_lang-078ddd77.js";import{_ as Y}from"./button.vue_vue_type_style_index_0_lang-147050b5.js";import{_ as H,a as Q,u as W}from"./useBaseTable-e905173e.js";import{_ as X}from"./BasicInput.vue_vue_type_style_index_0_lang-f3e17581.js";import{_ as Z}from"./BasicTextArea.vue_vue_type_style_index_0_lang-856c5942.js";import{I as ee}from"./Icon-e19b6c6c.js";import{t as N,a as te}from"./useDataTime-2f3b2841.js";import{I as B,d as ae,g as b,r as ne,h as se,x as oe,o as u,c as d,b as c,w as f,j as w,G as le,a as t,t as a,e as _,k as v,D as R}from"./index-c6a4e685.js";import{g as ie}from"./convert-67c23be8.js";import{T as D}from"./index-b6b0f56b.js";import{T as re}from"./shallowequal-ee0267e4.js";import"./_plugin-vue_export-helper-58b6e008.js";import"./index-252f8dad.js";import"./Col-8b3564ce.js";import"./vnode-977fe706.js";import"./isPlainObject-a663ca44.js";import"./index-d3f71215.js";import"./index-334d46a3.js";import"./pickAttrs-e8130b6d.js";import"./FormItemContext-6df15dff.js";import"./index-03a51284.js";import"./toArray-5f8c3051.js";import"./useState-08abbf84.js";import"./index-4608391b.js";import"./index-633a27e5.js";import"./usePrice-7afab779.js";import"./useRefs-63b38e0f.js";const _e=[{title:"ردیف",dataIndex:"id",key:"id",filterable:!1,width:70,align:"center",customRender:o=>o.record.index+1},{title:"نام",dataIndex:"first_name",key:"first_name",customRender:o=>[o.record.first_name,o.record.last_name].filter(Boolean).join(" ")||o.record.user_name||"—"},{title:"موبایل",dataIndex:"user_phone",key:"user_phone"},{title:"استان",dataIndex:"province",key:"province"},{title:"وضعیت پرداخت",dataIndex:"payment_status_label",key:"payment_status_label"},{title:"مرحله",dataIndex:"current_step_label",key:"current_step_label"},{title:"ثبت‌نام",dataIndex:"registration_status_label",key:"registration_status_label"},{title:"تاریخ",dataIndex:"created_at",key:"created_at",customRender:o=>N(o.record.created_at)},{title:"عملیات",dataIndex:"action",key:"action",slot:"action",filterable:!1,align:"center",width:90}],ue={landing:"صفحه پرداخت",form_1:"اطلاعات فردی",form_2:"اطلاعات والدین",form_3:"توانایی‌ها",form_4:"درباره خودت",form_5:"عکس",form_6:"ویدئو",form_7:"تأیید والدین",review:"بازبینی",submitted:"ثبت نهایی"},de={pending:"در انتظار",paid:"پرداخت شده",failed:"ناموفق",cancelled:"لغو شده"};function ce(o,p){const i=Array.isArray(o.users)?o.users[0]:o.users,h=(i==null?void 0:i.name)||[i==null?void 0:i.first_name,i==null?void 0:i.last_name].filter(Boolean).join(" ").trim()||"—";return{...o,index:p,user_name:h,user_phone:(i==null?void 0:i.phone)||o.phone||"—",current_step_label:ue[o.current_step]||o.current_step,payment_status_label:de[o.payment_status]||o.payment_status,registration_status_label:o.registration_status==="submitted"?"تکمیل شده":"پیش‌نویس"}}async function pe(o){const{limit:p=20,page:i=1,search:h}=o,{data:I,error:y}=await B.from("choir_registrations").select("*, users(name, phone, first_name, last_name)").order("created_at",{ascending:!1});if(y)throw y;let e=(I||[]).map((m,n)=>ce(m,n));if(h!=null&&h.trim()){const m=h.trim().toLowerCase();e=e.filter(n=>(n.first_name||"").toLowerCase().includes(m)||(n.last_name||"").toLowerCase().includes(m)||(n.phone||"").toLowerCase().includes(m)||(n.city||"").toLowerCase().includes(m)||(n.user_name||"").toLowerCase().includes(m)||(n.user_phone||"").toLowerCase().includes(m))}const x=e.length,g=(i-1)*p;return{rows:e.slice(g,g+p).map((m,n)=>({...m,index:g+n})),total:x,query:{...o,total:x,page:i,limit:p}}}async function me(){const{data:o,error:p}=await B.from("choir_registration_config").select("*").eq("id",1).maybeSingle();if(p)throw p;return o}async function ve(o){const{data:p,error:i}=await B.from("choir_registration_config").upsert({id:1,...o,updated_at:new Date().toISOString()}).select().single();if(i)throw