2026-08-19 18:36:32 +03:30
|
|
|
|
import{d as O,g as l,v as S,o as V,c as j,b as o,w as p,a as r,e as L,H as A,j as k,D as _,_ as J}from"./index-b0561d74.js";import{_ as W}from"./BasicModal.vue_vue_type_style_index_0_lang-0121d908.js";import{_ as X}from"./BasicMainCard-c1077cbf.js";import{_ as H,u as q}from"./useBaseTable-7b78293f.js";import{_ as z}from"./button.vue_vue_type_style_index_0_lang-dcd86e7a.js";import{e as G,f as K,h as Q}from"./competition-ffcb9e9d.js";import{t as Y,a as Z}from"./useDataTime-a337f5c6.js";import{I as C}from"./Icon-8dedfa53.js";import{_ as ee}from"./TextPreview.vue_vue_type_script_setup_true_lang-7903e918.js";import{a as te}from"./index-482a46a3.js";import"./index-b7f1770d.js";import"./isSymbol-a4291d99.js";import"./_plugin-vue_export-helper-130a5518.js";import"./vnode-531f9d95.js";import"./index-12bdf78c.js";import"./DialogWrap-9c2d8a9c.js";import"./shallowequal-4f931fa5.js";import"./omit-e6701bfc.js";import"./pickAttrs-69dd58a4.js";import"./index-092c5981.js";import"./styleChecker-d39a1d44.js";import"./FormItemContext-5520cb52.js";import"./Grid-80c38bfa.js";import"./index-f9091817.js";import"./index-2dc7fe57.js";import"./index-5d725680.js";import"./useState-94528018.js";import"./useRefs-899ec8f3.js";import"./_flatRest-39f9ed6b.js";import"./isMobile-e2e89480.js";import"./index-9a77c0e9.js";import"./Col-08664037.js";import"./isPlainObject-3a5eccde.js";import"./updateLocale-b730d578.js";import"./index-bc659f42.js";import"./useMemo-0162b583.js";import"./lodash-9a3882db.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-71825e72.js";import"./index-d18c8f13.js";import"./SearchOutlined-ca6a4719.js";import"./index-46f9dc77.js";import"./Badge-d2c862d8.js";import"./isNumeric-3f69e2aa.js";import"./index-7febe226.js";import"./index-93c22234.js";import"./index-b618fa76.js";import"./css-aae66f86.js";import"./toArray-1ab9b01c.js";import"./index-840dd6b2.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=O({__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("برای این مسابقه برندها�
|