2 lines
14 KiB
JavaScript
2 lines
14 KiB
JavaScript
import{_ as pe}from"./BasicModal.vue_vue_type_style_index_0_lang-234112c9.js";import{_ as _e}from"./BasicInput.vue_vue_type_style_index_0_lang-78ced8eb.js";import{u as W,_ as fe}from"./useBaseTable-e60ec4b8.js";import{_ as he}from"./button.vue_vue_type_style_index_0_lang-d41fbf64.js";import{I as D}from"./Icon-78d04a1c.js";import{t as ge}from"./useDataTime-0f66fcd9.js";import{v as we}from"./viewersColumns-e329f179.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-c3a83709.js";import{g as ke,a as Me}from"./itemViews-a3259ae6.js";import{g as B}from"./convert-2ad76038.js";import{g as K}from"./index-9571b6c1.js";import{M as Ie}from"./index-3cee424d.js";import{S as Q}from"./index-55899d99.js";import{T as E}from"./isSymbol-933af901.js";import{U as Z}from"./index-f68a6e65.js";import"./usePrice-bc935b83.js";import"./index-588aa217.js";import"./FormItemContext-89798113.js";import"./vnode-13aafe4d.js";import"./isPlainObject-e4dd5edb.js";import"./_plugin-vue_export-helper-9424d566.js";import"./updateLocale-ff27ed8b.js";import"./useState-edde538a.js";import"./index-ce887100.js";import"./toArray-fdd672d9.js";import"./pickAttrs-948566e5.js";import"./lodash-35a3e948.js";import"./index-795d795f.js";import"./isNumeric-3f69e2aa.js";import"./index-1b40f734.js";import"./index-4987f49a.js";import"./styleChecker-5d75eaf5.js";import"./index-c0c82e0d.js";import"./DialogWrap-99990cc9.js";import"./css-aae66f86.js";import"./index-42c94377.js";import"./_flatRest-09ea8109.js";import"./Col-f98af73f.js";import"./useRefs-c83745ad.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-693418f9.js"),["assets/buildSupabaseQuery-693418f9.js","assets/index-c3a83709.js","assets/index-6a736606.css","assets/supabaseTableQuery-9069679c.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",nu
|