2026-07-26 16:24:36 +03:30
|
|
|
import{_ as ee}from"./BasicMainCard-1361ed38.js";import{_ as te}from"./BasicModal.vue_vue_type_style_index_0_lang-acac591d.js";import{_ as ae}from"./BasicInput.vue_vue_type_style_index_0_lang-6c1f4129.js";import{_ as oe,u as ne}from"./useBaseTable-c2761680.js";import{_ as ie}from"./button.vue_vue_type_style_index_0_lang-c37c204f.js";import{I as A}from"./Icon-6b61a044.js";import{t as le}from"./useDataTime-f3f5ea50.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-4dccb174.js";import{g as P}from"./convert-2ad76038.js";import{n as H}from"./textUtils-c37780ad.js";import{g as N}from"./index-d825960e.js";import{M as pe}from"./index-a34bba22.js";import{S as _e}from"./index-f08752bf.js";import{C as he}from"./index-8f783c3c.js";import{I as ve}from"./index-4762b7d8.js";import{T as z}from"./isSymbol-80c521a5.js";import{U as fe}from"./index-bd458d30.js";import"./index-6f4a8a6b.js";import"./index-7a876d00.js";import"./_plugin-vue_export-helper-fc650ede.js";import"./useState-7760581d.js";import"./vnode-8e0d49aa.js";import"./useRefs-b5c660b2.js";import"./_flatRest-00780a2d.js";import"./index-7ce2783e.js";import"./Col-c87d3a9d.js";import"./styleChecker-133e2b1a.js";import"./isPlainObject-819f93b0.js";import"./usePrice-bc935b83.js";import"./updateLocale-72f02bbd.js";import"./index-c7f692d2.js";import"./toArray-8c6d8405.js";import"./FormItemContext-d26e27b7.js";import"./pickAttrs-13d22210.js";import"./lodash-0f8911c3.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-c92640b4.js";import"./index-895cd0d7.js";import"./isNumeric-3f69e2aa.js";import"./index-00d83bfc.js";import"./index-6a54d8cb.js";import"./DialogWrap-715ad625.js";import"./index-ce6d92ba.js";import"./LeftOutlined-2d8ca514.js";import"./css-aae66f86.js";import"./index-495b789b.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-6c90042d.js"),["assets/buildSupabaseQuery-6c90042d.js","assets/index-4dccb174.js","assets/index-338b63e2.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 text-gray-600"},"عنوان *",-1),Me=i("div",{class:"mb-1 text-sm text-gray-
|