Files
machartaa_admin_dist/dist/assets/index-053443c8.js
T

2 lines
13 KiB
JavaScript
Raw Normal View History

2026-07-08 13:26:38 +03:30
import{_ as pe}from"./BasicModal.vue_vue_type_style_index_0_lang-8927c0a8.js";import{_ as _e}from"./BasicInput.vue_vue_type_style_index_0_lang-180a57eb.js";import{u as W,_ as fe}from"./useBaseTable-9961a393.js";import{_ as he}from"./button.vue_vue_type_style_index_0_lang-08cdb61a.js";import{I as D}from"./Icon-b73f0ccd.js";import{t as ge}from"./useDataTime-024ee901.js";import{v as we}from"./viewersColumns-c0e7fc4e.js";import{_ as xe,H as P,d as be,g as _,E as ye,N 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,G,k as V,D as g,I as Y}from"./index-229ba0a3.js";import{g as ke,a as Me}from"./itemViews-7fa10714.js";import{g as B}from"./convert-67c23be8.js";import{g as K}from"./index-0cfab59c.js";import{M as Ie}from"./index-e82d9954.js";import{S as Q}from"./index-939f3031.js";import{T as E}from"./shallowequal-e16473e7.js";import{U as Z}from"./index-22f60073.js";import"./usePrice-bc935b83.js";import"./index-83597ea6.js";import"./FormItemContext-d2efc581.js";import"./vnode-29431c52.js";import"./isPlainObject-17ad1cae.js";import"./_plugin-vue_export-helper-5c7e4561.js";import"./fa_IR-3a494b17.js";import"./toArray-2b8ac8d2.js";import"./pickAttrs-a633b394.js";import"./useState-5d84a598.js";import"./lodash-6658ee3b.js";import"./css-ddfc5c90.js";import"./DialogWrap-81e16685.js";import"./index-fbe56609.js";import"./styleChecker-4d6469c9.js";import"./index-39bf83ec.js";import"./_flatRest-fbf51dda.js";import"./Col-f578b6a7.js";import"./useRefs-97fcf834.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-e75dcf37.js"),["assets/buildSupabaseQuery-e75dcf37.js","assets/index-229ba0a3.js","assets/index-210d4b6a.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+$}));return{...p,rows:T}}}catch(b){console.error("[getMusicMachartaAudiosTable]",b)}return p}const $e={class:"h-full"},Le={class:"gap-2 flex justify-center"},Ve=s("span",null,"بازدیدها",-1),Be=s("span",null,"حذف",-1),Ee=s("span",null,"ویرایش",-1),Pe={class:"space-y-4 relative"},Oe={key:0,class:"absolute inset-0 bg-white/60 z-10 flex items-center