Files
machartaa_admin_dist/dist/assets/index-5b982e91.js
T

2 lines
17 KiB
JavaScript
Raw Normal View History

2026-08-22 13:27:44 +03:30
import{_ as ce}from"./BasicMainCard-f06c4dad.js";import{_ as de}from"./BasicModal.vue_vue_type_style_index_0_lang-7cc4ab5d.js";import{_ as pe}from"./BasicTextArea.vue_vue_type_style_index_0_lang-a9793408.js";import{_ as me}from"./BasicInput.vue_vue_type_style_index_0_lang-ebcbbe1b.js";import{_ as _e,u as ve}from"./useBaseTable-01dc558f.js";import{_ as fe}from"./button.vue_vue_type_style_index_0_lang-86273660.js";import{_ as ge,G as he,H as xe,I as ye,d as be,g as x,A as we,v as ke,o as $,c as I,b as c,w as y,a as t,e as Ce,J as Ue,j as B,k as R,y as j,t as J,F as Me,n as $e,D as P,K as X}from"./index-d718011e.js";import{t as Ie}from"./useDataTime-5a09f654.js";import{I as A}from"./Icon-cc126d0d.js";import{e as T,g as N}from"./convert-2ad76038.js";import{_ as De}from"./TextPreview.vue_vue_type_script_setup_true_lang-2590f9d7.js";import{M as Le}from"./index-eb860757.js";import{T as Q}from"./isSymbol-e219d64b.js";import{S as Se}from"./index-5ade1644.js";import{U as W}from"./index-c895ada9.js";import"./Grid-162208a5.js";import"./index-68cba126.js";import"./_plugin-vue_export-helper-0ed48b96.js";import"./shallowequal-c9e151d3.js";import"./index-5b828516.js";import"./vnode-0b482026.js";import"./index-7eae579c.js";import"./useState-d226846a.js";import"./useRefs-373e2aeb.js";import"./_flatRest-e8ea393e.js";import"./isMobile-e2e89480.js";import"./omit-86fc1094.js";import"./index-44f8c87e.js";import"./Col-7aad654b.js";import"./styleChecker-351d08aa.js";import"./isPlainObject-63126d02.js";import"./index-ba4d9879.js";import"./SearchOutlined-31f9ef0b.js";import"./FormItemContext-6bb05345.js";import"./index-12b8b726.js";import"./usePrice-bc935b83.js";import"./updateLocale-dac04afb.js";import"./useMemo-9e09b0c8.js";import"./lodash-02d12c59.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-e23cf95b.js";import"./index-cbb71dc1.js";import"./Badge-bf61afe1.js";import"./isNumeric-3f69e2aa.js";import"./index-9747fd4d.js";import"./index-6fc61bbd.js";import"./index-59898946.js";import"./DialogWrap-944b6cdf.js";import"./pickAttrs-49bc9c67.js";import"./css-aae66f86.js";import"./index-4e5c2990.js";import"./toArray-02b8a08a.js";import"./index-7a44352f.js";import"./textUtils-c37780ad.js";import"./index-7a1bd658.js";import"./index-a2e0d559.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-ad024d1e.js"),["assets/buildSupabaseQuery-ad024d1e.js","assets/index-d718011e.js","assets/index-a54d32f7.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