Files
machartaa_admin_dist/dist/assets/index-85935aac.js
T

2 lines
17 KiB
JavaScript
Raw Normal View History

2026-10-04 13:31:09 +03:30
import{_ as ce}from"./BasicMainCard-ff1543bd.js";import{_ as de}from"./BasicModal.vue_vue_type_style_index_0_lang-6296deb9.js";import{_ as pe}from"./BasicTextArea.vue_vue_type_style_index_0_lang-46e82d82.js";import{_ as me}from"./BasicInput.vue_vue_type_style_index_0_lang-06536e2e.js";import{_ as _e,u as ve}from"./useBaseTable-e18d3b32.js";import{_ as fe}from"./button.vue_vue_type_style_index_0_lang-fbfa965d.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-c678e119.js";import{t as Ie}from"./useDataTime-206d8d2e.js";import{I as A}from"./Icon-671f08f9.js";import{e as T,g as N}from"./convert-2ad76038.js";import{_ as Le}from"./TextPreview.vue_vue_type_script_setup_true_lang-25d2a150.js";import{M as De}from"./index-66da2c76.js";import{T as G}from"./isSymbol-5130882b.js";import{S as Se}from"./index-5203b45e.js";import{U as W}from"./index-ff90b762.js";import"./Grid-192c1e72.js";import"./index-88858982.js";import"./_plugin-vue_export-helper-edd5ed68.js";import"./shallowequal-93b92d94.js";import"./index-27b4bb6d.js";import"./vnode-34fe2aaf.js";import"./index-ea10bb13.js";import"./useState-fb1fd992.js";import"./useRefs-d469f03d.js";import"./_flatRest-89cece1c.js";import"./isMobile-e2e89480.js";import"./omit-30cc2465.js";import"./index-2a1871d2.js";import"./Col-65d77001.js";import"./styleChecker-c202e4d7.js";import"./isPlainObject-2f8cd8cc.js";import"./index-e517c667.js";import"./SearchOutlined-445bfd70.js";import"./FormItemContext-53695780.js";import"./index-c5016c96.js";import"./usePrice-bc935b83.js";import"./updateLocale-e9df593e.js";import"./useMemo-3527b8f5.js";import"./lodash-2343a0ae.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-0d6b57d1.js";import"./index-064013c2.js";import"./Badge-b566fed9.js";import"./isNumeric-3f69e2aa.js";import"./index-d768dcac.js";import"./index-05e85885.js";import"./index-d80ea252.js";import"./DialogWrap-0297f46d.js";import"./pickAttrs-09168c62.js";import"./css-aae66f86.js";import"./index-01af60d8.js";import"./toArray-acd138e5.js";import"./index-31ed7972.js";import"./textUtils-c37780ad.js";import"./index-679d69b0.js";import"./index-e3658ae2.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-72aac971.js"),["assets/buildSupabaseQuery-72aac971.js","assets/index-c678e119.js","assets/index-0d7ad6b5.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