2026-08-25 16:12:17 +03:30
|
|
|
import{_ as ce}from"./BasicMainCard-9a9b0e82.js";import{_ as de}from"./BasicModal.vue_vue_type_style_index_0_lang-0db8aa6c.js";import{_ as pe}from"./BasicTextArea.vue_vue_type_style_index_0_lang-87cbd165.js";import{_ as me}from"./BasicInput.vue_vue_type_style_index_0_lang-75e51b7f.js";import{_ as _e,u as ve}from"./useBaseTable-0fdb84ad.js";import{_ as fe}from"./button.vue_vue_type_style_index_0_lang-0b499337.js";import{_ as ge,H as he,I as xe,J as ye,d as be,i as x,D as we,x as ke,o as $,c as I,e as c,w as y,b as t,f as Ce,K as Ue,l as B,n as R,B as j,t as J,F as Me,q as $e,G as P,L as X}from"./index-0ae7844c.js";import{t as Ie}from"./useDataTime-234977eb.js";import{I as A}from"./Icon-d1d29ca3.js";import{e as T,g as N}from"./convert-2ad76038.js";import{_ as De}from"./TextPreview.vue_vue_type_script_setup_true_lang-cae329b9.js";import{M as Le}from"./index-6d32dcba.js";import{T as Q}from"./isSymbol-d0ec885c.js";import{S as Se}from"./index-0309284c.js";import{U as W}from"./index-5936ec05.js";import"./Grid-1b086c47.js";import"./index-33c0557e.js";import"./_plugin-vue_export-helper-277b1c3f.js";import"./shallowequal-a089597b.js";import"./index-02b92135.js";import"./vnode-454b4aa7.js";import"./index-c2776ddf.js";import"./useState-80fd23c9.js";import"./useRefs-0b121885.js";import"./_flatRest-5e9bcb10.js";import"./isMobile-e2e89480.js";import"./omit-e036f60c.js";import"./index-3189b1a9.js";import"./Col-84747301.js";import"./styleChecker-918e9a0f.js";import"./isPlainObject-4659a577.js";import"./index-81a07cb9.js";import"./SearchOutlined-8b990494.js";import"./FormItemContext-e7b6ca96.js";import"./index-c2bca1e0.js";import"./usePrice-bc935b83.js";import"./updateLocale-15cba891.js";import"./useMemo-19000d17.js";import"./lodash-6746fa7b.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-630a739a.js";import"./index-ff77e42c.js";import"./Badge-3dfd39bb.js";import"./isNumeric-3f69e2aa.js";import"./index-6585bad2.js";import"./index-7d2db2fd.js";import"./index-0c08cf04.js";import"./DialogWrap-930ec585.js";import"./pickAttrs-2e870478.js";import"./css-aae66f86.js";import"./index-a2cfdf13.js";import"./toArray-592e82ea.js";import"./index-7090fbb0.js";import"./textUtils-c37780ad.js";import"./index-936e9d5d.js";import"./index-9d9cf8fd.js";async function Pe(p){const m={title:p.title,description:p.description,owner_id:p.owner_id,minute:p.minute,score:p.score,image_url:p.image_url||null,clip_url:p.clip_url||null,steps:p.steps||[]},_=await he("challenge",m);return Array.isArray(_)?_:[_]}async function Te(p,m){const _=await xe("challenge",p,{title:m.title,description:m.description,owner_id:m.owner_id,minute:m.minute,score:m.score,image_url:m.image_url||null,clip_url:m.clip_url||null,steps:m.steps||[]});return Array.isArray(_)?_:[_]}async function Be(p){await ye("challenge",p)}async function Re(p){const{TableEngineRequest:m}=await ge(()=>import("./buildSupabaseQuery-ef030906.js"),["assets/buildSupabaseQuery-ef030906.js","assets/index-0ae7844c.js","assets/index-71a80eb0.css"]),_={...p};!_.sort&&!_.order&&(_.order="-id");const k=await m(_,"challenge");try{if(Array.isArray(k==null?void 0:k.rows)){const C=_.page||1,b=_.limit||200,D=(C-1)*b,g=k.rows.map((v,M)=>({id:v.id,title:v.title??"",description:v.description??"",steps:v.steps??[],created_at:v.created_at??"",index:D+M,...v}));return{...k,rows:g}}}catch(C){console.log("[getChallengeTable] normalize error:",C)}return k}const Ae=[{title:"ردیف",dataIndex:"id",key:"id",filterable:!1,width:70,align:"center",customRender:p=>p.record.index+1},{title:"عنوان",dataIndex:"title",key:"title"},{title:"شرح",dataIndex:"description",key:"description",slot:"description"},{title:"مراحل",dataIndex:"steps",key:"steps",customRender:p=>{const m=p.record.steps||[];if(m.length===0)return"-";const _=m.reduce((C,b)=>C+(Number(b.minute)||0),0),k=m.reduce((C,b)=>C+(Number(b.score)||0),0);return`${m.length} مرحله / ${_} دقیقه / ${k} امتیاز`}},{title:"زمان ایجاد",dataIndex:"created_at",key:"created_at",customRender:p=>Ie(p.record.created_at)},{title:"عملیات",dataIndex:"actio
|