2026-08-18 16:19:11 +03:30
|
|
|
import{_ as ee}from"./BasicMainCard-0ad7dc72.js";import{_ as te}from"./BasicModal.vue_vue_type_style_index_0_lang-4b1d1ef5.js";import{_ as ae}from"./BasicInput.vue_vue_type_style_index_0_lang-f043e831.js";import{_ as oe,u as ne}from"./useBaseTable-f8894810.js";import{_ as ie}from"./button.vue_vue_type_style_index_0_lang-bc3a48f6.js";import{I as A}from"./Icon-767d2866.js";import{t as le}from"./useDataTime-4be5c5cf.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-24cdd011.js";import{g as P}from"./convert-2ad76038.js";import{n as H}from"./textUtils-c37780ad.js";import{g as N}from"./index-1ace681c.js";import{M as pe}from"./index-5eb1b262.js";import{S as _e}from"./index-d68d1b34.js";import{C as he}from"./index-39621559.js";import{I as ve}from"./index-942dc2ed.js";import{T as z}from"./isSymbol-e7ce9b5a.js";import{U as fe}from"./index-5477dee9.js";import"./Grid-ce03674d.js";import"./index-bcc6b780.js";import"./_plugin-vue_export-helper-06d65383.js";import"./shallowequal-59945f6f.js";import"./index-4057f476.js";import"./vnode-562ae89f.js";import"./index-fec9c5bc.js";import"./useState-bb6abd58.js";import"./useRefs-2bd76cbf.js";import"./_flatRest-28f96ed6.js";import"./isMobile-e2e89480.js";import"./omit-08db5ef5.js";import"./index-ef7f0d13.js";import"./Col-8ec8a751.js";import"./styleChecker-aeb3f501.js";import"./isPlainObject-25081d35.js";import"./usePrice-bc935b83.js";import"./updateLocale-58c30845.js";import"./index-cbf3fafb.js";import"./index-bc659f42.js";import"./useMemo-5fb6706d.js";import"./FormItemContext-a07e1be1.js";import"./lodash-3126ec34.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-5acaa0f7.js";import"./index-3078e65c.js";import"./Badge-aa4916ac.js";import"./isNumeric-3f69e2aa.js";import"./index-38d9344c.js";import"./index-0ceac0d6.js";import"./toArray-e3c28da8.js";import"./SearchOutlined-3570b8ac.js";import"./pickAttrs-64381c06.js";import"./index-559e3814.js";import"./DialogWrap-4e2453b1.js";import"./index-093e137a.js";import"./css-aae66f86.js";import"./index-3867b2dc.js";import"./index-9df579ce.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-856791d4.js"),["assets/buildSupabaseQuery-856791d4.js","assets/index-24cdd011.js","assets/index-a54d32f7.css","assets/supabaseTableQuery-8ab5665d.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"},C
|