2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
import{_ as ee}from"./BasicMainCard-226652ff.js";import{_ as te}from"./BasicModal.vue_vue_type_style_index_0_lang-234112c9.js";import{_ as ae}from"./BasicInput.vue_vue_type_style_index_0_lang-78ced8eb.js";import{_ as oe,u as ne}from"./useBaseTable-e60ec4b8.js";import{_ as le}from"./button.vue_vue_type_style_index_0_lang-d41fbf64.js";import{I as A}from"./Icon-78d04a1c.js";import{t as ie}from"./useDataTime-0f66fcd9.js";import{_ as se,G as O,d as re,g as x,o as B,c as $,b as i,w as c,a as l,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-c3a83709.js";import{g as P}from"./convert-2ad76038.js";import{n as H}from"./textUtils-c37780ad.js";import{g as N}from"./index-9571b6c1.js";import{M as _e}from"./index-3cee424d.js";import{S as pe}from"./index-55899d99.js";import{C as he}from"./index-4987f49a.js";import{I as ve}from"./index-588aa217.js";import{T as z}from"./isSymbol-933af901.js";import{U as fe}from"./index-f68a6e65.js";import"./index-51e1e412.js";import"./index-6d9d7b65.js";import"./_plugin-vue_export-helper-9424d566.js";import"./useState-edde538a.js";import"./vnode-13aafe4d.js";import"./useRefs-c83745ad.js";import"./_flatRest-09ea8109.js";import"./index-133c097e.js";import"./Col-f98af73f.js";import"./styleChecker-5d75eaf5.js";import"./isPlainObject-e4dd5edb.js";import"./usePrice-bc935b83.js";import"./updateLocale-ff27ed8b.js";import"./index-ce887100.js";import"./toArray-fdd672d9.js";import"./FormItemContext-89798113.js";import"./pickAttrs-948566e5.js";import"./lodash-35a3e948.js";import"./index-795d795f.js";import"./isNumeric-3f69e2aa.js";import"./index-1b40f734.js";import"./DialogWrap-99990cc9.js";import"./index-c0c82e0d.js";import"./css-aae66f86.js";import"./index-42c94377.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=>ie(s.record.created_at)},{title:"عملیات",dataIndex:"action",key:"action",slot:"action",filterable:!1,align:"center"}];async function be(s){const{data:p,error:m}=await O.from("announcements").insert([s]).select();if(m)throw m;return p}async function F(s,p){const{data:m,error:h}=await O.from("announcements").update({...p,updated_at:new Date().toISOString()}).eq("id",s).select();if(h)throw h;return m}async function ge(s){const{error:p}=await O.from("announcements").delete().eq("id",s);if(p)throw p}async function we(s){const{TableEngineRequest:p}=await se(()=>import("./buildSupabaseQuery-693418f9.js"),["assets/buildSupabaseQuery-693418f9.js","assets/index-c3a83709.js","assets/index-6a736606.css","assets/supabaseTableQuery-9069679c.js"]),m={...s};!m.sort&&!m.order&&(m.order="-id");const h=await p(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=l("h2",null,"اطلاعرسانی ویدیویی",-1),ke=["src"],Ie={key:1},Te={class:"gap-2 flex justify-center"},Ce=l("span",null,"حذف",-1),Ue=l("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=l("div",{class:"mb-1 text-sm text-gray-600"},"عنوان *",-1),Me=l("div",{class:"mb-1 text-sm text-gray-600"},"عنوان ویدیو",-1),Ae=l("div",{class:"mb-1 text-sm text-gray-600"},"توضیحات *",-1),Re=l("div",{class:"mb-1 tex
|