2 lines
9.2 KiB
JavaScript
2 lines
9.2 KiB
JavaScript
import{_ as Y}from"./BasicModal.vue_vue_type_style_index_0_lang-7803828f.js";import{_ as K}from"./BasicInput.vue_vue_type_style_index_0_lang-0a352870.js";import{u as O,_ as X}from"./useBaseTable-e4bbf0da.js";import{_ as Z}from"./button.vue_vue_type_style_index_0_lang-99dfcd06.js";import{I as k}from"./Icon-c9ad16b9.js";import{t as ee}from"./useDataTime-5442c624.js";import{v as te}from"./viewersColumns-f65e8a12.js";import{_ as ae,G as I,d as oe,g as _,E as se,Q as U,o as x,c as y,b as i,w as r,e as q,a as o,j as v,t as E,H as N,k as ie,D as h}from"./index-bc4edd51.js";import{g as le,a as ne}from"./itemViews-6e427b1e.js";import{M as re}from"./index-609e9a96.js";import{S as ce}from"./index-d4870df7.js";import{I as de}from"./index-49e2e544.js";import{T as V}from"./isSymbol-f9834f4f.js";import"./usePrice-bc935b83.js";import"./updateLocale-7b0be7e3.js";import"./index-9df7eaa1.js";import"./_plugin-vue_export-helper-c8347567.js";import"./index-bc659f42.js";import"./shallowequal-cad00b6e.js";import"./vnode-f2307909.js";import"./useState-47ff4833.js";import"./useMemo-8275a234.js";import"./FormItemContext-4e017a44.js";import"./omit-6f60253b.js";import"./lodash-3efc1909.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-9775c8a5.js";import"./index-5ea3cefd.js";import"./Badge-627fd6d3.js";import"./isNumeric-3f69e2aa.js";import"./index-34768277.js";import"./index-1d49b36b.js";import"./index-4e41e7b6.js";import"./styleChecker-bc667521.js";import"./index-393b875d.js";import"./index-47b6ba8f.js";import"./DialogWrap-f12e49af.js";import"./pickAttrs-1c46cfba.js";import"./css-aae66f86.js";import"./index-727535d5.js";import"./toArray-b01cb1f9.js";import"./SearchOutlined-4504ec77.js";import"./isMobile-e2e89480.js";import"./index-ae018072.js";import"./index-3aafac3f.js";import"./isPlainObject-ed8996b4.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-e64be55f.js"),["assets/buildSupabaseQuery-e64be55f.js","assets/index-bc4edd51.js","assets/index-c30c691c.css","assets/supabaseTableQuery-8ab5665d.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=o("span",null,"بازدیدها",-1),xe=o("span",null,"حذف",-1),ye=o("span",null,"ویرایش",-1),ke={class:"space-y-4"},Ve=o("div",{class:"mb-1 text-sm text-gray-600"},"عن
|