2026-08-22 14:52:19 +03:30
|
|
|
import{_ as ce}from"./BasicMainCard-aaaa8dc3.js";import{_ as de}from"./BasicModal.vue_vue_type_style_index_0_lang-20cc468f.js";import{_ as pe}from"./BasicTextArea.vue_vue_type_style_index_0_lang-69c0f21d.js";import{_ as me}from"./BasicInput.vue_vue_type_style_index_0_lang-4f908c47.js";import{_ as _e,u as ve}from"./useBaseTable-1184a002.js";import{_ as fe}from"./button.vue_vue_type_style_index_0_lang-cbfd9667.js";import{_ as ge,G as he,H as xe,I as ye,d as be,g as x,A as we,v as ke,o as $,c as I,b as c,w as y,a as t,e as Ce,J as Ue,j as B,k as R,y as j,t as J,F as Me,n as $e,D as P,K as X}from"./index-35c19078.js";import{t as Ie}from"./useDataTime-35d3ce8c.js";import{I as A}from"./Icon-0c226cc8.js";import{e as T,g as N}from"./convert-2ad76038.js";import{_ as De}from"./TextPreview.vue_vue_type_script_setup_true_lang-8b46377d.js";import{M as Le}from"./index-d1bea9c9.js";import{T as Q}from"./isSymbol-76912a30.js";import{S as Se}from"./index-c135e3cd.js";import{U as W}from"./index-b998e211.js";import"./Grid-5df717b4.js";import"./index-0b82077f.js";import"./_plugin-vue_export-helper-b8aa26f1.js";import"./shallowequal-336924ae.js";import"./index-e39a0c4e.js";import"./vnode-bd016db8.js";import"./index-81c6c557.js";import"./useState-0b0c0b26.js";import"./useRefs-d20fccdf.js";import"./_flatRest-ce9c6e5e.js";import"./isMobile-e2e89480.js";import"./omit-fea2187f.js";import"./index-5e048154.js";import"./Col-93e193e7.js";import"./styleChecker-5378d544.js";import"./isPlainObject-9fc066ac.js";import"./index-e2b66426.js";import"./SearchOutlined-fd97bf7f.js";import"./FormItemContext-c59740e7.js";import"./index-317dfb98.js";import"./usePrice-bc935b83.js";import"./updateLocale-674603f1.js";import"./useMemo-141475be.js";import"./lodash-e3d7e6b8.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-aa5cbf20.js";import"./index-9c958bd1.js";import"./Badge-5aec0f5b.js";import"./isNumeric-3f69e2aa.js";import"./index-597067d3.js";import"./index-3e7c49ac.js";import"./index-53a07be2.js";import"./DialogWrap-7ea92471.js";import"./pickAttrs-2a6a34d0.js";import"./css-aae66f86.js";import"./index-0cfe3fb2.js";import"./toArray-f7bbf4fe.js";import"./index-70f42a71.js";import"./textUtils-c37780ad.js";import"./index-727899c3.js";import"./index-1016d40d.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-d68eb591.js"),["assets/buildSupabaseQuery-d68eb591.js","assets/index-35c19078.js","assets/index-a54d32f7.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
|