2026-08-09 13:07:17 +03:30
|
|
|
import{_ as K}from"./BasicModal.vue_vue_type_style_index_0_lang-661b0a06.js";import{_ as Q}from"./BasicInput.vue_vue_type_style_index_0_lang-17ae6919.js";import{u as O,_ as X}from"./useBaseTable-3c30fe12.js";import{_ as Z}from"./button.vue_vue_type_style_index_0_lang-f6f5b6a0.js";import{I as k}from"./Icon-889d6eab.js";import{t as ee}from"./useDataTime-5a269444.js";import{v as te}from"./viewersColumns-1421d40f.js";import{_ as ae,G as I,d as se,g as _,E as oe,O as U,o as x,c as y,b as i,w as r,e as q,a as s,j as v,t as E,H as N,k as ie,D as h}from"./index-f8ee37b9.js";import{g as le,a as ne}from"./itemViews-44b2d0a4.js";import{M as re}from"./index-ef1f8a61.js";import{S as ce}from"./index-0e72b27c.js";import{I as de}from"./index-1ab617ae.js";import{T as V}from"./isSymbol-cdcd460d.js";import"./usePrice-bc935b83.js";import"./updateLocale-d5a764a4.js";import"./index-bc659f42.js";import"./index-b8cc71e2.js";import"./vnode-b0e810ae.js";import"./omit-bdd3cea5.js";import"./_plugin-vue_export-helper-775bc553.js";import"./useState-f5985d90.js";import"./index-f923b666.js";import"./toArray-53a55fc4.js";import"./FormItemContext-5821e8c8.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"./isPlainObject-6382de01.js";const ue=[{title:"ردیف",dataIndex:"id",key:"id",filterable:!1,width:70,align:"center",customRender:a=>a.record.index+1},{title:"عنوان",dataIndex:"title",key:"title"},{title:"کد embed",dataIndex:"embed_code",key:"embed_code",customRender:a=>a.record.embed_code?"دارد":"-"},{title:"ترتیب",dataIndex:"sort_order",key:"sort_order",align:"center"},{title:"نمایش",dataIndex:"show",key:"show",align:"center",customRender:a=>a.record.show===!1?"مخفی":"نمایش"},{title:"زمان ایجاد",dataIndex:"created_at",key:"created_at",customRender:a=>ee(a.record.created_at)},{title:"عملیات",dataIndex:"action",key:"action",slot:"action",filterable:!1,align:"center"}],z="music_macharta_video";async function me(a){const{data:c,error:n}=await I.from("music_macharta_videos").insert([a]).select();if(n)throw n;return c}async function _e(a,c){const{data:n,error:l}=await I.from("music_macharta_videos").update({...c,updated_at:new Date().toISOString()}).eq("id",a).select();if(l)throw l;return n}async function ve(a,c){const{data:n,error:l}=await I.from("music_macharta_videos").update({show:c,updated_at:new Date().toISOString()}).eq("id",a).select();if(l)throw l;return n}async function pe(a){const{error:c}=await I.from("music_macharta_videos").delete().eq("id",a);if(c)throw c}function fe(a){return ne(a,z)}function j(a,c){return le(a,c,z)}async function he(a){const{TableEngineRequest:c}=await ae(()=>import("./buildSupabaseQuery-6dd7a8c2.js"),["assets/buildSupabaseQuery-6dd7a8c2.js","assets/index-f8ee37b9.js","assets/index-8e1e8848.css","assets/supabaseTableQuery-95762ff3.js"]),n={...a};!n.sort&&!n.order&&(n.sort={key:"sort_order",order:"desc"});const l=await c(n,"music_macharta_videos");try{if(Array.isArray(l==null?void 0:l.rows)){const g=n.page||1,p=n.limit||20,w=(g-1)*p,b=l.rows.map((u,m)=>({...u,title:u.title??"",embed_code:u.embed_code??"",show:u.show??!0,sort_order:u.sort_order??0,index:w+m}));return{...l,rows:b}}}catch(g){console.error("[getMusicMachartaVideosTable]",g)}return l}const we={class:"h-full"},be={class:"gap-2 flex justify-center"},ge=s("span",null,"بازدیدها",-1),xe=s("span",null,"حذف",-1),ye=s("span",null,"ویرایش",-1),ke={class:"space-y-4"},Ve=s("div",{class:"mb-1 text-sm text-gray-600"},"عنوان *",-1),Ie=s("div",{class:"mb-1 text-sm text-gray-600"},"ترتیب نمایش",-1),Me=s("div",{class:"mb-1 text-sm text-gray-600"},"کد embed *",-1),Te={class:"flex justify-end"},Ce={key:0,class:"space-y-4"},E
|