2026-08-09 11:26:51 +03:30
|
|
|
import{_ as ee}from"./BasicMainCard-d630ef89.js";import{_ as te}from"./BasicModal.vue_vue_type_style_index_0_lang-5f2a723d.js";import{_ as ae}from"./BasicInput.vue_vue_type_style_index_0_lang-fb48873c.js";import{_ as oe,u as ne}from"./useBaseTable-81e5e1c8.js";import{_ as ie}from"./button.vue_vue_type_style_index_0_lang-262761a9.js";import{I as A}from"./Icon-a5ae3f4f.js";import{t as le}from"./useDataTime-1b320de0.js";import{_ as se,G as O,d as re,g as x,o as B,c as $,b as l,w as c,a as i,e as E,H as ue,j as f,t as me,k as L,y as ce,D as v,I as de}from"./index-6d106dd0.js";import{g as P}from"./convert-2ad76038.js";import{n as H}from"./textUtils-c37780ad.js";import{g as N}from"./index-701052cc.js";import{M as pe}from"./index-f7555b21.js";import{S as _e}from"./index-e9a5bd4c.js";import{C as he}from"./index-47d62f0b.js";import{I as ve}from"./index-812ee0b9.js";import{T as z}from"./isSymbol-c370a0c8.js";import{U as fe}from"./index-6575d336.js";import"./Grid-f13e2170.js";import"./index-5fa2b8ab.js";import"./_plugin-vue_export-helper-7797a105.js";import"./index-96dcc83e.js";import"./vnode-62570e84.js";import"./omit-60677be5.js";import"./useState-7ef6eec1.js";import"./useRefs-779e4c26.js";import"./_flatRest-637ff229.js";import"./index-56a3533c.js";import"./Col-4cc0b984.js";import"./styleChecker-e3fb407e.js";import"./isPlainObject-7b16eb57.js";import"./usePrice-bc935b83.js";import"./updateLocale-9e7c96d6.js";import"./index-bc659f42.js";import"./index-432513d5.js";import"./toArray-f8613bd2.js";import"./FormItemContext-c47fa363.js";import"./pickAttrs-c39578ea.js";import"./lodash-eb35a796.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-3522768e.js";import"./index-6fd59bb9.js";import"./Badge-e97fb41c.js";import"./isNumeric-3f69e2aa.js";import"./index-3397bfbd.js";import"./index-281db256.js";import"./DialogWrap-e684398e.js";import"./index-0b1886ec.js";import"./css-aae66f86.js";import"./index-8789a773.js";const V=[{title:"ردیف",dataIndex:"id",key:"id",filterable:!1,width:70,align:"center",customRender:s=>s.record.index+1},{title:"عنوان",dataIndex:"title",key:"title"},{title:"عنوان ویدیو",dataIndex:"video_title",key:"video_title",customRender:s=>s.record.video_title||"-"},{title:"نمایش در صفحه اصلی",dataIndex:"show_on_home",key:"show_on_home",align:"center",width:140,customRender:s=>s.record.show_on_home?"بله":"خیر"},{title:"زمان ایجاد",dataIndex:"created_at",key:"created_at",customRender:s=>le(s.record.created_at)},{title:"عملیات",dataIndex:"action",key:"action",slot:"action",filterable:!1,align:"center"}];async function be(s){const{data:_,error:m}=await O.from("announcements").insert([s]).select();if(m)throw m;return _}async function F(s,_){const{data:m,error:h}=await O.from("announcements").update({..._,updated_at:new Date().toISOString()}).eq("id",s).select();if(h)throw h;return m}async function ge(s){const{error:_}=await O.from("announcements").delete().eq("id",s);if(_)throw _}async function we(s){const{TableEngineRequest:_}=await se(()=>import("./buildSupabaseQuery-28fb231d.js"),["assets/buildSupabaseQuery-28fb231d.js","assets/index-6d106dd0.js","assets/index-8e1e8848.css","assets/supabaseTableQuery-95762ff3.js"]),m={...s};!m.sort&&!m.order&&(m.order="-id");const h=await _(m,"announcements");try{if(Array.isArray(h==null?void 0:h.rows)){const y=m.page||1,R=m.limit||20,k=(y-1)*R,T=h.rows.map((d,g)=>({...d,title:d.title??"",description:d.description??"",video_title:d.video_title??"",thumbnail:d.thumbnail??null,aparat_embed_code:d.aparat_embed_code??"",show_on_home:d.show_on_home!==!1,index:k+g}));return{...h,rows:T}}}catch(y){console.error("[getAnnouncementsTable]",y)}return h}const xe={class:"flex justify-between items-center mb-4"},ye=i("h2",null,"اطلاعرسانی ویدیویی",-1),ke=["src"],Ie={key:1},Te={class:"gap-2 flex justify-center"},Ce=i("span",null,"حذف",-1),Ue=i("span",null,"ویرایش",-1),Be={class:"space-y-4 relative"},$e={key:0,class:"absolute inset-0 bg-white/60 z-10 flex items-center justify-center"},De=i("div",{class:"mb-1 text-sm te
|