2026-08-09 13:07:17 +03:30
|
|
|
import{_ as pe}from"./BasicModal.vue_vue_type_style_index_0_lang-661b0a06.js";import{_ as _e}from"./BasicInput.vue_vue_type_style_index_0_lang-17ae6919.js";import{u as W,_ as fe}from"./useBaseTable-3c30fe12.js";import{_ as he}from"./button.vue_vue_type_style_index_0_lang-f6f5b6a0.js";import{I as D}from"./Icon-889d6eab.js";import{t as ge}from"./useDataTime-5a269444.js";import{v as we}from"./viewersColumns-1421d40f.js";import{_ as xe,G as P,d as be,g as _,E as ye,O as J,o as I,c as C,b as i,w as v,e as X,a as s,j as x,t as q,H as G,k as V,D as g,I as Y}from"./index-f8ee37b9.js";import{g as ke,a as Me}from"./itemViews-44b2d0a4.js";import{g as B}from"./convert-2ad76038.js";import{g as K}from"./index-8fee9afc.js";import{M as Ie}from"./index-ef1f8a61.js";import{S as Q}from"./index-0e72b27c.js";import{T as E}from"./isSymbol-cdcd460d.js";import{U as Z}from"./index-c0e94d73.js";import"./usePrice-bc935b83.js";import"./index-1ab617ae.js";import"./FormItemContext-5821e8c8.js";import"./omit-bdd3cea5.js";import"./vnode-b0e810ae.js";import"./isPlainObject-6382de01.js";import"./_plugin-vue_export-helper-775bc553.js";import"./updateLocale-d5a764a4.js";import"./index-bc659f42.js";import"./index-b8cc71e2.js";import"./useState-f5985d90.js";import"./index-f923b666.js";import"./toArray-53a55fc4.js";import"./pickAttrs-69f29e9c.js";import"./lodash-7c51d08d.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-2e892f80.js";import"./index-78e4e5e0.js";import"./Badge-47d7b0bb.js";import"./isNumeric-3f69e2aa.js";import"./index-89210322.js";import"./index-8bcedf66.js";import"./styleChecker-c1fc9f39.js";import"./index-0441c4fc.js";import"./DialogWrap-192ddaf7.js";import"./css-aae66f86.js";import"./index-bf59f845.js";import"./index-9594c53b.js";import"./_flatRest-6305d35d.js";import"./Col-97627e24.js";import"./useRefs-bff35432.js";const Ce=[{title:"ردیف",dataIndex:"id",key:"id",filterable:!1,width:70,align:"center",customRender:l=>l.record.index+1},{title:"عنوان",dataIndex:"title",key:"title"},{title:"زیرعنوان",dataIndex:"sub_title",key:"sub_title"},{title:"زمان",dataIndex:"time",key:"time",customRender:l=>{const m=l.record.time||{minutes:0,seconds:0},r=String(m.minutes??0).padStart(2,"0"),p=String(m.seconds??0).padStart(2,"0");return`${r}:${p}`}},{title:"صوت",dataIndex:"src",key:"src",customRender:l=>l.record.src?"دارد":"-"},{title:"ترتیب",dataIndex:"sort_order",key:"sort_order",align:"center"},{title:"نمایش",dataIndex:"show",key:"show",align:"center",customRender:l=>l.record.show===!1?"مخفی":"نمایش"},{title:"زمان ایجاد",dataIndex:"created_at",key:"created_at",customRender:l=>ge(l.record.created_at)},{title:"عملیات",dataIndex:"action",key:"action",slot:"action",filterable:!1,align:"center"}],te="music_macharta_audio";async function Te(l){const{data:m,error:r}=await P.from("music_macharta_audios").insert([l]).select();if(r)throw r;return m}async function Ue(l,m){const{data:r,error:p}=await P.from("music_macharta_audios").update({...m,updated_at:new Date().toISOString()}).eq("id",l).select();if(p)throw p;return r}async function Ae(l,m){const{data:r,error:p}=await P.from("music_macharta_audios").update({show:m,updated_at:new Date().toISOString()}).eq("id",l).select();if(p)throw p;return r}async function Re(l){const{error:m}=await P.from("music_macharta_audios").delete().eq("id",l);if(m)throw m}function Se(l){return Me(l,te)}function ee(l,m){return ke(l,m,te)}async function De(l){const{TableEngineRequest:m}=await xe(()=>import("./buildSupabaseQuery-6dd7a8c2.js"),["assets/buildSupabaseQuery-6dd7a8c2.js","assets/index-f8ee37b9.js","assets/index-8e1e8848.css","assets/supabaseTableQuery-95762ff3.js"]),r={...l};!r.sort&&!r.order&&(r.sort={key:"sort_order",order:"desc"});const p=await m(r,"music_macharta_audios");try{if(Array.isArray(p==null?void 0:p.rows)){const b=r.page||1,U=r.limit||20,A=(b-1)*U,T=p.rows.map((c,$)=>({...c,title:c.title??"",sub_title:c.sub_title??"",cover:c.cover??null,src:c.src??null,time:c.time??{minutes:0,seconds:0},show:c.show??!0,sort_order:c.sort_order??0,index:A+$}))
|