Files
machartaa_admin_dist/dist/assets/index-fba691bb.js
T
2026-06-03 16:59:33 +03:30

2 lines
12 KiB
JavaScript

import{_ as M}from"./BasicMainCard-0a3c966a.js";import{_ as V}from"./BasicModal.vue_vue_type_style_index_0_lang-b6c04ed1.js";import{_ as q}from"./button.vue_vue_type_style_index_0_lang-9ce24083.js";import{_ as K,a as F,u as G}from"./useBaseTable-f0604f98.js";import{_ as J}from"./BasicInput.vue_vue_type_style_index_0_lang-5e5b83f8.js";import{_ as O}from"./BasicTextArea.vue_vue_type_style_index_0_lang-e48f6249.js";import{I as Y}from"./Icon-03d9588d.js";import{t as z}from"./useDataTime-0f06f32d.js";import{I as C,d as H,g as w,r as Q,h as W,x as X,o as c,c as d,b as p,w as g,j as b,G as Z,a as t,t as a,e as r,k as f,D as T}from"./index-108817e3.js";import{g as R}from"./convert-67c23be8.js";import{T as S}from"./index-d1557459.js";import{T as ee}from"./shallowequal-105194c4.js";import"./_plugin-vue_export-helper-ec62f026.js";import"./index-60d145d7.js";import"./Col-b2cbfe37.js";import"./vnode-9b8abbbf.js";import"./isPlainObject-a22b8354.js";import"./index-f0ba03aa.js";import"./index-0d047161.js";import"./pickAttrs-f899bdd0.js";import"./FormItemContext-cecaca7f.js";import"./index-802c3c8f.js";import"./toArray-a421612c.js";import"./useState-472505a2.js";import"./index-707b194d.js";import"./index-7c9c2b70.js";import"./usePrice-7afab779.js";import"./useRefs-eb5e3b2f.js";const te=[{title:"ردیف",dataIndex:"id",key:"id",filterable:!1,width:70,align:"center",customRender:n=>n.record.index+1},{title:"نام",dataIndex:"first_name",key:"first_name",customRender:n=>[n.record.first_name,n.record.last_name].filter(Boolean).join(" ")||n.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:n=>z(n.record.created_at)},{title:"عملیات",dataIndex:"action",key:"action",slot:"action",filterable:!1,align:"center",width:90}],ae={landing:"صفحه پرداخت",form_1:"اطلاعات فردی",form_2:"اطلاعات والدین",form_3:"توانایی‌ها",form_4:"درباره خودت",form_5:"عکس",form_6:"ویدئو",form_7:"تأیید والدین",review:"بازبینی",submitted:"ثبت نهایی"},ne={pending:"در انتظار",paid:"پرداخت شده",failed:"ناموفق",cancelled:"لغو شده"};function se(n,u){const s=Array.isArray(n.users)?n.users[0]:n.users,h=(s==null?void 0:s.name)||[s==null?void 0:s.first_name,s==null?void 0:s.last_name].filter(Boolean).join(" ").trim()||"—";return{...n,index:u,user_name:h,user_phone:(s==null?void 0:s.phone)||n.phone||"—",current_step_label:ae[n.current_step]||n.current_step,payment_status_label:ne[n.payment_status]||n.payment_status,registration_status_label:n.registration_status==="submitted"?"تکمیل شده":"پیش‌نویس"}}async function oe(n){const{limit:u=20,page:s=1,search:h}=n,{data:I,error:y}=await C.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,v)=>se(m,v));if(h!=null&&h.trim()){const m=h.trim().toLowerCase();e=e.filter(v=>(v.first_name||"").toLowerCase().includes(m)||(v.last_name||"").toLowerCase().includes(m)||(v.phone||"").toLowerCase().includes(m)||(v.city||"").toLowerCase().includes(m)||(v.user_name||"").toLowerCase().includes(m)||(v.user_phone||"").toLowerCase().includes(m))}const x=e.length,o=(s-1)*u;return{rows:e.slice(o,o+u).map((m,v)=>({...m,index:o+v})),total:x,query:{...n,total:x,page:s,limit:u}}}async function re(){const{data:n,error:u}=await C.from("choir_registration_config").select("*").eq("id",1).maybeSingle();if(u)throw u;return n}async function ie(n){const{data:u,error:s}=await C.from("choir_registration_config").upsert({id:1,...n,updated_at:new Date().toISOString()}).select().single();if(s)throw s;return u}async function le(n){const{data:u,error:s}=await C.from("choir_registrations").select("*, users(name, phone, first_name, last_name)").eq("id",n).single();if(s)throw s;return u}const _e=t("div",{class:"mb-4"},[t("h2",null,"لیست ثبت‌نام گروه سرود")],-1),ue=t("span",null,"جزئیات",-1),ce={class:"max-w-2xl space-y-4 py-2"},de=t("div",{class:"mb-1 text-sm text-gray-600"},"کد embed آپارات (معرفی)",-1),pe=t("div",{class:"mb-1 text-sm text-gray-600"},"کد embed آپارات (راهنمای آپلود)",-1),me={class:"mb-1 text-sm text-gray-600"},ve=t("div",{class:"mb-1 text-sm text-gray-600"},"متن قوانین",-1),fe={class:"flex items-center gap-2"},he=t("span",null,"ثبت‌نام باز است",-1),ge={key:0,class:"text-sm space-y-2 leading-7"},be=t("b",null,"نام:",-1),ye={key:0},xe=t("b",null,"پایه / مدرسه:",-1),ke=t("b",null,"محل:",-1),we={key:0},Ce={key:1},Ie={key:2},Be=t("b",null,"تولد:",-1),Te=t("b",null,"جنسیت:",-1),Le=t("p",{class:"font-700 mt-3"},"اطلاعات والدین",-1),Re=t("b",null,"پدر:",-1),Se=t("b",null,"مادر:",-1),je={key:0},Ae=t("b",null,"تماس اضطراری:",-1),De=t("p",{class:"font-700 mt-3"},"توانایی‌ها",-1),Ne=t("b",null,"سابقه گروه سرود:",-1),Ue={key:1,class:"whitespace-pre-wrap bg-gray-50 p-2 rounded"},Pe=t("b",null,"اجرای صحنه:",-1),$e={key:2,class:"whitespace-pre-wrap bg-gray-50 p-2 rounded"},Ee=t("b",null,"کلاس موسیقی:",-1),Me={key:3,class:"whitespace-pre-wrap bg-gray-50 p-2 rounded"},Ve=t("b",null,"نوازندگی:",-1),qe=t("b",null,"سازها:",-1),Ke=t("b",null,"علاقه‌مندی‌ها:",-1),Fe=t("p",{class:"font-700 mt-3"},"درباره هنرجو",-1),Ge=t("b",null,"علاقه‌مندی‌ها:",-1),Je=t("p",null,[t("b",null,"دلیل عضویت:")],-1),Oe={class:"whitespace-pre-wrap bg-gray-50 p-2 rounded"},Ye=t("p",null,[t("b",null,"آرزوی آینده:")],-1),ze={class:"whitespace-pre-wrap bg-gray-50 p-2 rounded"},He=t("b",null,"پرداخت:",-1),Qe=t("b",null,"مرحله:",-1),We={key:4},Xe=t("b",null,"عکس:",-1),Ze=["href"],et={key:5},tt=t("b",null,"ویدیو:",-1),at=["href"],nt={key:6},st=t("b",null,"تأیید والد:",-1),ot={key:0},Ut=H({__name:"index",setup(n){const u=S,s=S.TabPane,h=w("list"),[I]=G(),y=w(!1),e=w(null),x=w(!1),o=Q({intro_aparat_embed_code:"",upload_guide_aparat_embed_code:"",price_rial:499e4,terms_text:"",is_registration_open:!0}),L=W(()=>Math.round(Number(o.price_rial||0)/10).toLocaleString("fa-IR")),m={columns:te,api:oe,defaultPageLimit:20};async function v(_){try{e.value=await le(_.id),y.value=!0}catch(i){T.error((i==null?void 0:i.message)||"خطا")}}function k(_){return _===!0?"بله":_===!1?"خیر":"—"}async function j(){const _=await re();_&&(o.intro_aparat_embed_code=_.intro_aparat_embed_code||"",o.upload_guide_aparat_embed_code=_.upload_guide_aparat_embed_code||"",o.price_rial=_.price_rial??499e4,o.terms_text=_.terms_text||"",o.is_registration_open=_.is_registration_open!==!1)}async function A(){x.value=!0;try{await ie({...o,price_rial:Number(o.price_rial)}),T.success("تنظیمات ذخیره شد")}catch(_){T.error((_==null?void 0:_.message)||"خطا")}finally{x.value=!1}}return X(j),(_,i)=>{const D=K,B=O,N=J,U=F,P=q,$=V,E=M;return c(),d("div",null,[p(E,null,{default:g(()=>[p(b(u),{activeKey:h.value,"onUpdate:activeKey":i[5]||(i[5]=l=>h.value=l)},{default:g(()=>[p(b(s),{key:"list",tab:"ثبت‌نام‌ها"},{default:g(()=>[_e,p(D,Z(m,{onRegister:b(I)}),{action:g(({record:l})=>[p(b(ee),{class:"cursor-pointer"},{title:g(()=>[ue]),default:g(()=>[p(Y,{icon:"vuesax-linear:eye",color:"#1D4ED8",onClick:rt=>v(l)},null,8,["onClick"])]),_:2},1024)]),_:1},16,["onRegister"])]),_:1}),p(b(s),{key:"settings",tab:"تنظیمات صفحه"},{default:g(()=>[t("div",ce,[t("div",null,[de,p(B,{value:o.intro_aparat_embed_code,"onUpdate:value":i[0]||(i[0]=l=>o.intro_aparat_embed_code=l),placeholder:"کد embed از آپارات",rows:3},null,8,["value"])]),t("div",null,[pe,p(B,{value:o.upload_guide_aparat_embed_code,"onUpdate:value":i[1]||(i[1]=l=>o.upload_guide_aparat_embed_code=l),placeholder:"کد embed از آپارات",rows:3},null,8,["value"])]),t("div",null,[t("div",me,"مبلغ (ریال) — نمایش تومان: "+a(L.value),1),p(N,{value:o.price_rial,"onUpdate:value":i[2]||(i[2]=l=>o.price_rial=l),type:"number"},null,8,["value"])]),t("div",null,[ve,p(B,{value:o.terms_text,"onUpdate:value":i[3]||(i[3]=l=>o.terms_text=l),rows:4},null,8,["value"])]),t("div",fe,[p(U,{value:o.is_registration_open,"onUpdate:value":i[4]||(i[4]=l=>o.is_registration_open=l)},null,8,["value"]),he]),p(P,{type:"primary",loading:x.value,onClick:A},{default:g(()=>[r("ذخیره تنظیمات")]),_:1},8,["loading"])])]),_:1})]),_:1},8,["activeKey"]),p($,{visible:y.value,"onUpdate:visible":i[6]||(i[6]=l=>y.value=l),title:"جزئیات ثبت‌نام",width:"90%",footer:null},{default:g(()=>{var l;return[e.value?(c(),d("div",ge,[t("p",null,[be,r(" "+a(e.value.first_name)+" "+a(e.value.last_name)+" ",1),e.value.preferred_name?(c(),d("span",ye," ("+a(e.value.preferred_name)+")",1)):f("",!0)]),t("p",null,[xe,r(" "+a(e.value.grade_level||"—")+" — "+a(e.value.school||"—"),1)]),t("p",null,[ke,r(" "+a(e.value.province)+" / "+a(e.value.city)+" ",1),e.value.neighborhood?(c(),d("span",we," — "+a(e.value.neighborhood),1)):e.value.tehran_district?(c(),d("span",Ce," — "+a(e.value.tehran_district),1)):e.value.village?(c(),d("span",Ie," — "+a(e.value.village),1)):f("",!0)]),t("p",null,[Be,r(" "+a(e.value.birth_date||"—"),1)]),t("p",null,[Te,r(" "+a(e.value.gender==="male"?"پسر":e.value.gender==="female"?"دختر":"—"),1)]),Le,t("p",null,[Re,r(" "+a(e.value.father_name||"—")+" — "+a(e.value.father_phone||"—")+" — "+a(e.value.father_job||"—"),1)]),t("p",null,[Se,r(" "+a(e.value.mother_name||"—")+" — "+a(e.value.mother_phone||"—")+" — "+a(e.value.mother_job||"—"),1)]),e.value.emergency_phone?(c(),d("p",je,[Ae,r(" "+a(e.value.emergency_phone),1)])):f("",!0),De,t("p",null,[Ne,r(" "+a(k(e.value.had_choir_experience)),1)]),e.value.choir_experience?(c(),d("pre",Ue,a(e.value.choir_experience),1)):f("",!0),t("p",null,[Pe,r(" "+a(k(e.value.had_stage_performance)),1)]),e.value.stage_performance_details?(c(),d("pre",$e,a(e.value.stage_performance_details),1)):f("",!0),t("p",null,[Ee,r(" "+a(k(e.value.had_music_class)),1)]),e.value.training_courses?(c(),d("pre",Me,a(e.value.training_courses),1)):f("",!0),t("p",null,[Ve,r(" "+a(k(e.value.plays_instrument)),1)]),t("p",null,[qe,r(" "+a((e.value.instruments||[]).join("، ")||"—"),1)]),t("p",null,[Ke,r(" "+a((e.value.activity_interests||[]).join("، ")||"—"),1)]),Fe,t("p",null,[Ge,r(" "+a([e.value.interest_1,e.value.interest_2,e.value.interest_3].filter(Boolean).join("، ")||"—"),1)]),Je,t("pre",Oe,a(e.value.why_join||"—"),1),Ye,t("pre",ze,a(e.value.future_wish||"—"),1),t("p",null,[He,r(" "+a(e.value.payment_status)+" — "+a((l=e.value.final_price)==null?void 0:l.toLocaleString("fa-IR"))+" ریال",1)]),t("p",null,[Qe,r(" "+a(e.value.current_step)+" — "+a(e.value.registration_status),1)]),e.value.photo_url?(c(),d("p",We,[Xe,t("a",{href:b(R)(e.value.photo_url),target:"_blank",rel:"noopener"},"مشاهده عکس",8,Ze)])):f("",!0),e.value.video_url?(c(),d("p",et,[tt,t("a",{href:b(R)(e.value.video_url),target:"_blank",rel:"noopener"},"مشاهده ویدیو",8,at)])):f("",!0),e.value.parent_consent_name?(c(),d("p",nt,[st,r(" "+a(e.value.parent_consent_name)+" ",1),e.value.parent_consent_at?(c(),d("span",ot," — "+a(e.value.parent_consent_at),1)):f("",!0)])):f("",!0)])):f("",!0)]}),_:1},8,["visible"])]),_:1})])}}});export{Ut as default};