2026-09-19 11:51:19 +03:30
|
|
|
import{_ as ce}from"./BasicMainCard-5c80ef19.js";import{_ as de}from"./BasicModal.vue_vue_type_style_index_0_lang-73f8a39e.js";import{_ as pe}from"./BasicTextArea.vue_vue_type_style_index_0_lang-1ab1b286.js";import{_ as me}from"./BasicInput.vue_vue_type_style_index_0_lang-4e4a82fb.js";import{_ as _e,u as ve}from"./useBaseTable-fed341a8.js";import{_ as fe}from"./button.vue_vue_type_style_index_0_lang-76fea031.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-e064ffac.js";import{t as Ie}from"./useDataTime-ba62eb36.js";import{I as A}from"./Icon-66010218.js";import{e as T,g as N}from"./convert-2ad76038.js";import{_ as De}from"./TextPreview.vue_vue_type_script_setup_true_lang-f36f6b08.js";import{M as Le}from"./index-418d2c16.js";import{T as Q}from"./isSymbol-dc94e500.js";import{S as Se}from"./index-5791312b.js";import{U as W}from"./index-227d8909.js";import"./Grid-28c7683b.js";import"./index-69ceab84.js";import"./_plugin-vue_export-helper-c2b02d20.js";import"./shallowequal-9a59fe48.js";import"./index-01bd72a1.js";import"./vnode-43e0532a.js";import"./index-2f676c29.js";import"./useState-1df7da74.js";import"./useRefs-320b3f3d.js";import"./_flatRest-0e75a214.js";import"./isMobile-e2e89480.js";import"./omit-98a5c881.js";import"./index-7dcbad31.js";import"./Col-e0b57a55.js";import"./styleChecker-a89d8927.js";import"./isPlainObject-118a5a84.js";import"./index-3d02255e.js";import"./SearchOutlined-bce29925.js";import"./FormItemContext-ea5e629b.js";import"./index-c6cc46d7.js";import"./usePrice-bc935b83.js";import"./updateLocale-53d85368.js";import"./useMemo-118b7fdd.js";import"./lodash-77052907.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-094732f6.js";import"./index-a1f6487e.js";import"./Badge-31351815.js";import"./isNumeric-3f69e2aa.js";import"./index-6b63d7e6.js";import"./index-1320e6a3.js";import"./index-cf4a2322.js";import"./DialogWrap-934116e0.js";import"./pickAttrs-20fc50b7.js";import"./css-aae66f86.js";import"./index-020f9f38.js";import"./toArray-03404447.js";import"./index-4cde3ed4.js";import"./textUtils-c37780ad.js";import"./index-d6ed4c52.js";import"./index-def436d1.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-3ca34e46.js"),["assets/buildSupabaseQuery-3ca34e46.js","assets/index-e064ffac.js","assets/index-7c005fab.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
|