2026-07-04 21:19:56 +03:30
|
|
|
import{_ as Q}from"./BasicModal.vue_vue_type_style_index_0_lang-d1e6a59e.js";import{_ as Y}from"./BasicInput.vue_vue_type_style_index_0_lang-35ed6fd8.js";import{_ as Z,u as tt}from"./useBaseTable-f680a0e2.js";import{_ as et}from"./button.vue_vue_type_style_index_0_lang-e0dea8bb.js";import{I as $}from"./Icon-199a922a.js";import{t as at}from"./useDataTime-bbfc6d86.js";import{_ as st,H as A,d as ot,g as x,o as C,c as D,b as u,w as _,e as it,a as i,j as I,t as lt,G as nt,k as L,D as b,I as q}from"./index-caf247db.js";import{g as T}from"./convert-67c23be8.js";import{g as E}from"./index-1bcf9f68.js";import{M as rt}from"./index-688f073d.js";import{S as ut}from"./index-70e9e671.js";import{T as B}from"./shallowequal-1ad8252c.js";import{U as N}from"./index-c1eb3aaf.js";import"./usePrice-bc935b83.js";import"./index-01e8bf20.js";import"./FormItemContext-d53141ed.js";import"./vnode-20d5d74c.js";import"./isPlainObject-16f1bdfa.js";import"./_plugin-vue_export-helper-438caba9.js";import"./fa_IR-3fc10d80.js";import"./toArray-ad006c19.js";import"./pickAttrs-d5fdda1c.js";import"./useState-74071817.js";import"./lodash-f5ffd720.js";import"./css-bff3ffda.js";import"./DialogWrap-7b83b14e.js";import"./index-7a128151.js";import"./styleChecker-477bfa11.js";import"./index-ec2e4f99.js";import"./_flatRest-a161204e.js";import"./Col-361122c0.js";import"./useRefs-22b2473f.js";const ct=[{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 d=l.record.time||{minutes:0,seconds:0},n=String(d.minutes??0).padStart(2,"0"),c=String(d.seconds??0).padStart(2,"0");return`${n}:${c}`}},{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=>at(l.record.created_at)},{title:"عملیات",dataIndex:"action",key:"action",slot:"action",filterable:!1,align:"center"}];async function dt(l){const{data:d,error:n}=await A.from("music_macharta_audios").insert([l]).select();if(n)throw n;return d}async function mt(l,d){const{data:n,error:c}=await A.from("music_macharta_audios").update({...d,updated_at:new Date().toISOString()}).eq("id",l).select();if(c)throw c;return n}async function pt(l,d){const{data:n,error:c}=await A.from("music_macharta_audios").update({show:d,updated_at:new Date().toISOString()}).eq("id",l).select();if(c)throw c;return n}async function vt(l){const{error:d}=await A.from("music_macharta_audios").delete().eq("id",l);if(d)throw d}async function ft(l){const{TableEngineRequest:d}=await st(()=>import("./buildSupabaseQuery-3f921c3d.js"),["assets/buildSupabaseQuery-3f921c3d.js","assets/index-caf247db.js","assets/index-210d4b6a.css","assets/supabaseTableQuery-95762ff3.js"]),n={...l};!n.sort&&!n.order&&(n.sort={key:"sort_order",order:"desc"});const c=await d(n,"music_macharta_audios");try{if(Array.isArray(c==null?void 0:c.rows)){const w=n.page||1,U=n.limit||20,S=(w-1)*U,y=c.rows.map((m,h)=>({...m,title:m.title??"",sub_title:m.sub_title??"",cover:m.cover??null,src:m.src??null,time:m.time??{minutes:0,seconds:0},show:m.show??!0,sort_order:m.sort_order??0,index:S+h}));return{...c,rows:y}}}catch(w){console.error("[getMusicMachartaAudiosTable]",w)}return c}const _t={class:"h-full"},ht={class:"gap-2 flex justify-center"},gt=i("span",null,"حذف",-1),xt=i("span",null,"ویرایش",-1),bt={class:"space-y-4 relative"},wt={key:0,class:"absolute inset-0 bg-white/60 z-10 flex items-center justify-center"},yt=i("div",{class:"mb-1 text-sm text-gray-600"},"عنوان *",-1),kt=i("div",{class:"mb-1 text-sm text-gray-600"},"زیرعنوان",-1),Mt=i("div",{class:"mb-1 text-sm text-gray-600"},"ترتیب نمایش",-1),It={class:"
|