2026-10-10 10:47:47 +03:30
|
|
|
import{_ as ce}from"./BasicMainCard-f15cc82d.js";import{_ as de}from"./BasicModal.vue_vue_type_style_index_0_lang-3186fd13.js";import{_ as pe}from"./BasicTextArea.vue_vue_type_style_index_0_lang-f7b2fc60.js";import{_ as me}from"./BasicInput.vue_vue_type_style_index_0_lang-8f3a56f0.js";import{_ as _e,u as ve}from"./useBaseTable-e684a9eb.js";import{_ as fe}from"./button.vue_vue_type_style_index_0_lang-de1581fe.js";import{_ as ge,I as he,J as xe,K as ye,d as be,i as x,E as we,x as ke,o as $,c as I,e as c,w as y,b as t,f as Ce,L as Ue,l as B,n as R,C as j,t as J,F as Me,q as $e,H as P,M as X}from"./index-185c08ed.js";import{t as Ie}from"./useDataTime-284d8334.js";import{I as A}from"./Icon-623de3ea.js";import{e as T,g as N}from"./convert-2ad76038.js";import{_ as Le}from"./TextPreview.vue_vue_type_script_setup_true_lang-fd9d13cd.js";import{M as De}from"./index-2573091c.js";import{T as G}from"./isSymbol-18d6b370.js";import{S as Se}from"./index-5a721f2f.js";import{U as W}from"./index-c950ff98.js";import"./Grid-337aeaf9.js";import"./index-c3741845.js";import"./_plugin-vue_export-helper-e26fbd9a.js";import"./shallowequal-6622fb79.js";import"./index-1f485cc0.js";import"./vnode-8a371720.js";import"./index-a2809ce1.js";import"./useState-50bb8c1f.js";import"./useRefs-b56c6fdc.js";import"./_flatRest-947e7901.js";import"./isMobile-e2e89480.js";import"./omit-d93eaa18.js";import"./index-229a6022.js";import"./Col-2d184441.js";import"./styleChecker-7bb1c6f5.js";import"./isPlainObject-5638f45d.js";import"./index-a29d0cc7.js";import"./SearchOutlined-d9b8def2.js";import"./FormItemContext-2d3e7341.js";import"./index-f463cb03.js";import"./usePrice-bc935b83.js";import"./updateLocale-d0f4ef4d.js";import"./useMemo-4f3c1eb4.js";import"./lodash-0633e973.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-e9f1c563.js";import"./index-9383b001.js";import"./Badge-51142f0a.js";import"./isNumeric-3f69e2aa.js";import"./index-9e9f857b.js";import"./index-33777d70.js";import"./index-975de3f6.js";import"./DialogWrap-9863a7c0.js";import"./pickAttrs-e062aa3e.js";import"./css-aae66f86.js";import"./index-0ee37254.js";import"./toArray-da31f78e.js";import"./index-77ae4c49.js";import"./textUtils-c37780ad.js";import"./index-82269ca5.js";import"./index-b2f5f66c.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-32cb26f7.js"),["assets/buildSupabaseQuery-32cb26f7.js","assets/index-185c08ed.js","assets/index-0643191e.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,L=(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:L+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
|