2026-08-23 20:07:06 +03:30
|
|
|
import{_ as ce}from"./BasicMainCard-b6358749.js";import{_ as de}from"./BasicModal.vue_vue_type_style_index_0_lang-e1cd5348.js";import{_ as pe}from"./BasicTextArea.vue_vue_type_style_index_0_lang-49ae04e4.js";import{_ as me}from"./BasicInput.vue_vue_type_style_index_0_lang-0f7fe263.js";import{_ as _e,u as ve}from"./useBaseTable-d7cd0f4c.js";import{_ as fe}from"./button.vue_vue_type_style_index_0_lang-5ec31ef5.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-ffa60a07.js";import{t as Ie}from"./useDataTime-fe4b1957.js";import{I as A}from"./Icon-98831d4d.js";import{e as T,g as N}from"./convert-2ad76038.js";import{_ as De}from"./TextPreview.vue_vue_type_script_setup_true_lang-0f4d1493.js";import{M as Le}from"./index-d1c80ae6.js";import{T as Q}from"./isSymbol-6d79c27a.js";import{S as Se}from"./index-567b7465.js";import{U as W}from"./index-8ca74419.js";import"./Grid-ac34307b.js";import"./index-c7f085be.js";import"./_plugin-vue_export-helper-30c9b7f0.js";import"./shallowequal-01dca49b.js";import"./index-cae1f6fd.js";import"./vnode-57257037.js";import"./index-321fdf78.js";import"./useState-377df27f.js";import"./useRefs-b02214fc.js";import"./_flatRest-337b9ea4.js";import"./isMobile-e2e89480.js";import"./omit-8be067f7.js";import"./index-0606b83a.js";import"./Col-89f9984b.js";import"./styleChecker-76ccead7.js";import"./isPlainObject-3a12fb85.js";import"./index-f396abcf.js";import"./SearchOutlined-6637041c.js";import"./FormItemContext-73e37c2d.js";import"./index-f66de646.js";import"./usePrice-bc935b83.js";import"./updateLocale-d02f2975.js";import"./useMemo-6bc58734.js";import"./lodash-f10c309b.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-df682920.js";import"./index-4ed74117.js";import"./Badge-697bc2f0.js";import"./isNumeric-3f69e2aa.js";import"./index-1fda93f9.js";import"./index-f5f9d56c.js";import"./index-771c6b16.js";import"./DialogWrap-c8f763fd.js";import"./pickAttrs-4d40f82c.js";import"./css-aae66f86.js";import"./index-4243bdee.js";import"./toArray-fdacf69b.js";import"./index-61d3d393.js";import"./textUtils-c37780ad.js";import"./index-8f583d38.js";import"./index-44c7d16f.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-a38f3089.js"),["assets/buildSupabaseQuery-a38f3089.js","assets/index-ffa60a07.js","assets/index-82ea5f16.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
|