Files
machartaa_admin_dist/dist/assets/index-d53e355d.js
T

2 lines
6.0 KiB
JavaScript
Raw Normal View History

2025-11-04 20:52:55 +03:30
import{d as j,r as a,i as A,o as X,c as q,b as l,w as f,a as n,e as C,a2 as J,L as I,a0 as _,a3 as W}from"./index-c822befc.js";import{_ as z}from"./BasicModal.vue_vue_type_style_index_0_lang-fa4544ee.js";import{_ as G}from"./BasicMainCard-b6310d06.js";import{_ as H}from"./BaseTable.vue_vue_type_style_index_0_lang-f9e383e0.js";import{_ as K}from"./button.vue_vue_type_style_index_0_lang-5b65d3cd.js";import{g as B,a as Q}from"./competition-fa304f49.js";import{t as T}from"./useDataTime-a731f50b.js";import{u as Y}from"./useBaseTable-3aeb2499.js";import{I as E}from"./Icon-ff3adddf.js";import{_ as Z}from"./index-976673f9.js";import"./styleChecker-cf4483ca.js";import"./index-16f734d6.js";import"./index-81ddbbad.js";import"./colors-b3e52159.js";import"./raf-e9e40ecb.js";import"./index-69ae13da.js";import"./debounce-89f3cd70.js";import"./index-1f56a36b.js";import"./index-71609388.js";import"./pickAttrs-6fdf7ff0.js";import"./objectDestructuringEmpty-24e23e90.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./index-48058786.js";import"./index-122c3910.js";import"./useState-3b1f4886.js";import"./Col-25b75183.js";import"./usePrefix-93de78a0.js";import"./index-d11abaf6.js";import"./index-b00d1c6a.js";import"./SearchOutlined-8e71a0af.js";import"./EyeOutlined-b57fa33c.js";import"./eagerComputed-7892359b.js";import"./CheckOutlined-af96a0f7.js";const ee=[{title:"ردیف",dataIndex:"id",key:"id",filterable:!1,width:70,align:"center",customRender:s=>s.record.index+1},{title:"نام مسابقه",dataIndex:"match_title",key:"match_title"},{title:"شرح مسابقه",dataIndex:"match_description",key:"match_description",customRender:s=>{const d=s.record.match_description;return d?d.length>50?d.substring(0,50)+"...":d:"-"}},{title:"نام کاربر",dataIndex:"user_name",key:"user_name"},{title:"شماره همراه",dataIndex:"user_mobile",key:"user_mobile"},{title:"امتیاز کسب شده",dataIndex:"score",key:"score",align:"center",customRender:s=>s.record.score||0},{title:"تاریخ",dataIndex:"created_at",key:"created_at",customRender:s=>T(s.record.created_at)}],te={class:"flex justify-between items-center mb-4"},oe=n("h2",null,"امتیازات و برندگان مسابقات",-1),ae={class:"flex gap-2"},le={class:"space-y-4"},ne=n("div",{class:"mb-1 text-sm text-gray-600"},"انتخاب مسابقه",-1),se={class:"space-y-4"},re=n("div",{class:"mb-1 text-sm text-gray-600"},"انتخاب مسابقه",-1),Xe=j({__name:"index",setup(s){const d=Z,$=a(null),[R,ie]=Y(),g=a(!1),h=a(!1),r=a(void 0),i=a(void 0),u=a([]),b=a(!1),y=a(!1),F=a(!1),N=a({columns:ee,api:B,defaultPageLimit:20});async function k(){try{b.value=!0;const t=await Q();u.value=(t||[]).map(e=>({label:e.title||`مسابقه ${e.id}`,value:e.id}))}catch(t){console.error("Error loading matchs:",t),_.error("خطا در بارگذاری لیست مسابقات")}finally{b.value=!1}}function P(){r.value=void 0,g.value=!0,u.value.length===0&&k()}function L(){g.value=!1,r.value=void 0}function U(){i.value=void 0,h.value=!0,u.value.length===0&&k()}function M(){h.value=!1,i.value=void 0}function O(){if(!i.value){_.warning("لطفاً مسابقه را انتخاب کنید");return}const t=u.value.find(v=>v.value===i.value),e=encodeURIComponent((t==null?void 0:t.label)||`مسابقه_${i.value}`),m=`/lottery?matchId=${i.value}&title=${e}`;window.open(m,"_blank","width=1200,height=800"),M()}async function V(){if(!r.value){_.warning("لطفاً مسابقه را انتخاب کنید");return}try{y.value=!0;const t={page:1,limit:1e4,filters:[{field:"match_id",op:"eq",value:r.value,cr:"and",hidden:!1,type:"number"}]},m=(await B(t)).rows||[];if(m.length===0){_.warning("برای این مسابقه برنده‌ای یافت نشد");return}const v=m.map((c,S)=>({ردیف:S+1,"نام مسابقه":c.match_title||"","شرح مسابقه":c.match_description||"","نام کاربر":c.user_name||"","شماره همراه":c.user_mobile||"","امتیاز کسب شده":c.score||0,تاریخ:T(c.created_at||"")})),p=await W(()=>import("./xlsx-6ed613d4.js"),[]),x=p.utils.json_t