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

2 lines
6.5 KiB
JavaScript
Raw Normal View History

2026-10-20 16:52:05 +03:30
import{d as V,i as l,x as A,o as D,c as S,e as o,w as p,b as r,f as L,R as j,l as k,H as _,_ as J}from"./index-1ba0f9ec.js";import{_ as W}from"./BasicModal.vue_vue_type_style_index_0_lang-aed8f5e4.js";import{_ as X}from"./BasicMainCard-33e38576.js";import{_ as H,u as q}from"./useBaseTable-e7a67916.js";import{_ as z}from"./button.vue_vue_type_style_index_0_lang-f90e25b2.js";import{e as G,f as K,h as Q}from"./competition-5ebcfe0a.js";import{t as Y,a as Z}from"./useDataTime-6e234adb.js";import{I as C}from"./Icon-29e38d16.js";import{_ as ee}from"./TextPreview.vue_vue_type_script_setup_true_lang-c3abc1fa.js";import{_ as te}from"./index-e0664925.js";import"./index-4bff02a6.js";import"./isSymbol-355a1404.js";import"./_plugin-vue_export-helper-31e07528.js";import"./vnode-c4e67237.js";import"./index-ec322234.js";import"./DialogWrap-394d7eb0.js";import"./shallowequal-e0d9eafb.js";import"./omit-f5d28cd3.js";import"./pickAttrs-0ddf9a54.js";import"./index-8f2b7e91.js";import"./styleChecker-19ce40ea.js";import"./FormItemContext-33ef1221.js";import"./Grid-660f1a55.js";import"./index-f22a4554.js";import"./index-3f6d5caa.js";import"./index-73cafb1e.js";import"./useState-dcd360f8.js";import"./useRefs-5e33302c.js";import"./_flatRest-7877cdf8.js";import"./isMobile-e2e89480.js";import"./index-c136a321.js";import"./Col-f8806a10.js";import"./isPlainObject-e945bc1f.js";import"./updateLocale-a8654270.js";import"./useMemo-ee45fb46.js";import"./lodash-27f814e6.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-36a1ea6e.js";import"./index-aafc0fe2.js";import"./SearchOutlined-95278fe5.js";import"./index-c8127d4e.js";import"./Badge-8a8eeb58.js";import"./isNumeric-3f69e2aa.js";import"./index-a8579634.js";import"./index-e22339b6.js";import"./index-876da578.js";import"./LeftOutlined-93011b30.js";import"./css-aae66f86.js";import"./toArray-41940180.js";import"./index-175b83cf.js";import"./textUtils-c37780ad.js";const oe=[{title:"ردیف",dataIndex:"id",key:"id",filterable:!1,width:70,align:"center",customRender:m=>m.record.index+1},{title:"نام مسابقه",dataIndex:"match_title",key:"match_title"},{title:"شرح مسابقه",dataIndex:"match_description",key:"match_description",slot:"match_description"},{title:"نام کاربر",dataIndex:"user_name",key:"user_name"},{title:"شماره همراه",dataIndex:"user_mobile",key:"user_mobile"},{title:"امتیاز کسب شده",dataIndex:"score",key:"score",align:"center",customRender:m=>m.record.score||0},{title:"زمان",dataIndex:"created_at",key:"created_at",customRender:m=>Y(m.record.created_at)}],ae={class:"flex justify-between items-center mb-4"},le=r("h2",null,"امتیازات و برندگان مسابقات",-1),ie={class:"flex gap-2"},re={class:"space-y-4"},ne=r("div",{class:"mb-1 text-sm text-gray-600"},"انتخاب مسابقه",-1),se={class:"space-y-4"},ce=r("div",{class:"mb-1 text-sm text-gray-600"},"انتخاب مسابقه",-1),nt=V({__name:"index",setup(m){const w=te,B=l(null),[E,de]=q(),f=l(!1),g=l(!1),n=l(void 0),s=l(void 0),d=l([]),h=l(!1),b=l(!1),$=l(!1),T=l({columns:oe,api:G,defaultPageLimit:20});async function y(){try{h.value=!0;const t=await K();d.value=(t||[]).map(e=>({label:e.title||`مسابقه ${e.id}`,value:e.id}))}catch(t){console.error("Error loading matchs:",t),_.error("خطا در بارگذاری لیست مسابقات")}finally{h.value=!1}}function R(){n.value=void 0,f.value=!0,d.value.length===0&&y()}function I(){f.value=!1,n.value=void 0}function F(){s.value=void 0,g.value=!0,d.value.length===0&&y()}function M(){g.value=!1,s.value=void 0}function N(){if(!s.value){_.warning("لطفاً مسابقه را انتخاب کنید");return}const t=d.value.find(v=>v.value===s.value),e=encodeURIComponent((t==null?void 0:t.label)||`مسابقه_${s.value}`),i=`/lottery?matchId=${s.value}&title=${e}`;window.open(i,"_blank","width=1200,height=800"),M()}async function P(){if(!n.value){_.warning("لطفاً مسابقه را انتخاب کنید");return}try{b.value=!0;const t=await Q(n.value);if(t.length===0){_.warning("برای این مسابقه برند�