2026-09-16 13:19:24 +03:30
|
|
|
import{_ as ce}from"./BasicMainCard-f6ac62ad.js";import{_ as de}from"./BasicModal.vue_vue_type_style_index_0_lang-00ba9225.js";import{_ as pe}from"./BasicTextArea.vue_vue_type_style_index_0_lang-1d0123fe.js";import{_ as me}from"./BasicInput.vue_vue_type_style_index_0_lang-a177b9a9.js";import{_ as _e,u as ve}from"./useBaseTable-ec30a97d.js";import{_ as fe}from"./button.vue_vue_type_style_index_0_lang-ad893796.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-01aa5506.js";import{t as Ie}from"./useDataTime-2f85c275.js";import{I as A}from"./Icon-84f282a9.js";import{e as T,g as N}from"./convert-2ad76038.js";import{_ as De}from"./TextPreview.vue_vue_type_script_setup_true_lang-cfaf2c27.js";import{M as Le}from"./index-276e15c5.js";import{T as Q}from"./isSymbol-89eeb898.js";import{S as Se}from"./index-3370fde6.js";import{U as W}from"./index-17cced78.js";import"./Grid-7825d16a.js";import"./index-d4ed5db7.js";import"./_plugin-vue_export-helper-2f0b925e.js";import"./shallowequal-a983431a.js";import"./index-fb8c26e7.js";import"./vnode-386fab8b.js";import"./index-54bdc419.js";import"./useState-074ca9f0.js";import"./useRefs-a26b26b0.js";import"./_flatRest-b81e40db.js";import"./isMobile-e2e89480.js";import"./omit-8a7495a3.js";import"./index-1c2d185c.js";import"./Col-42eabc6c.js";import"./styleChecker-4d07c514.js";import"./isPlainObject-838e96ea.js";import"./index-0db924de.js";import"./SearchOutlined-dadd531e.js";import"./FormItemContext-45e1fa89.js";import"./index-97e46aab.js";import"./usePrice-bc935b83.js";import"./updateLocale-4d53ac7e.js";import"./useMemo-83211a3c.js";import"./lodash-0f373afd.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-b0105976.js";import"./index-64f7c585.js";import"./Badge-f9f962a5.js";import"./isNumeric-3f69e2aa.js";import"./index-40e1be26.js";import"./index-750d03f7.js";import"./index-01db740f.js";import"./DialogWrap-784b5f45.js";import"./pickAttrs-841f485e.js";import"./css-aae66f86.js";import"./index-b91244f4.js";import"./toArray-e14b288d.js";import"./index-e013b18a.js";import"./textUtils-c37780ad.js";import"./index-d4e2041c.js";import"./index-7e2b6983.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-fd069c65.js"),["assets/buildSupabaseQuery-fd069c65.js","assets/index-01aa5506.js","assets/index-a1df3bc4.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
|