2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
import{_ as ee}from"./BasicMainCard-b5ec3265.js";import{_ as te}from"./BasicModal.vue_vue_type_style_index_0_lang-59e3a60f.js";import{_ as ae}from"./BasicInput.vue_vue_type_style_index_0_lang-0e70f28c.js";import{_ as oe,u as ne}from"./useBaseTable-37cc5c4e.js";import{_ as ie}from"./button.vue_vue_type_style_index_0_lang-f45a0e84.js";import{I as A}from"./Icon-1df01939.js";import{t as le}from"./useDataTime-d0312d21.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-4ed3ac6f.js";import{g as P}from"./convert-2ad76038.js";import{n as H}from"./textUtils-c37780ad.js";import{g as N}from"./index-2fe56cac.js";import{M as pe}from"./index-11cc1aef.js";import{S as _e}from"./index-59052094.js";import{C as he}from"./index-da74a8b6.js";import{I as ve}from"./index-9cf626d0.js";import{T as z}from"./isSymbol-affa2e59.js";import{U as fe}from"./index-f8e98698.js";import"./index-793108ce.js";import"./index-e2784e5a.js";import"./_plugin-vue_export-helper-63226944.js";import"./useState-8f767204.js";import"./vnode-89c9e7cb.js";import"./useRefs-68a2914e.js";import"./_flatRest-1f22619a.js";import"./index-a875f6da.js";import"./Col-a5f65985.js";import"./styleChecker-8552d8dc.js";import"./isPlainObject-28bd6686.js";import"./usePrice-bc935b83.js";import"./updateLocale-bc84b8d6.js";import"./index-a14f73db.js";import"./toArray-7ead3702.js";import"./FormItemContext-2461cbab.js";import"./pickAttrs-5db0ba14.js";import"./lodash-93f7118d.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-33c708c4.js";import"./index-634fb851.js";import"./isNumeric-3f69e2aa.js";import"./index-0555c827.js";import"./index-0259cd70.js";import"./DialogWrap-576e3f01.js";import"./index-23a87c32.js";import"./LeftOutlined-61414320.js";import"./css-aae66f86.js";import"./index-4208692b.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-11ebe2fd.js"),["assets/buildSupabaseQuery-11ebe2fd.js","assets/index-4ed3ac6f.js","assets/index-338b63e2.css","assets/supabaseTableQuery-9069679c.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-
|