2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
import{_ as ee}from"./BasicMainCard-f046b61e.js";import{_ as te}from"./BasicModal.vue_vue_type_style_index_0_lang-83760d3e.js";import{_ as ae}from"./BasicInput.vue_vue_type_style_index_0_lang-a9616c22.js";import{_ as oe,u as ne}from"./useBaseTable-55ad5e52.js";import{_ as ie}from"./button.vue_vue_type_style_index_0_lang-bd596a6a.js";import{I as A}from"./Icon-d887a0f8.js";import{t as le}from"./useDataTime-7241b1ee.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-885a0812.js";import{g as P}from"./convert-2ad76038.js";import{n as H}from"./textUtils-c37780ad.js";import{g as N}from"./index-3769757a.js";import{M as pe}from"./index-9b411a61.js";import{S as _e}from"./index-d4e74b97.js";import{C as he}from"./index-22f9b99f.js";import{I as ve}from"./index-2ed626d8.js";import{T as z}from"./isSymbol-7a58081d.js";import{U as fe}from"./index-52ff6627.js";import"./Grid-a6ca9fb5.js";import"./index-667a03eb.js";import"./_plugin-vue_export-helper-b63d6b5b.js";import"./index-49e4db02.js";import"./vnode-70560f26.js";import"./index-7b5ec00b.js";import"./useState-90bb98a8.js";import"./useRefs-d4aed6f9.js";import"./_flatRest-0a2f05bf.js";import"./isMobile-e2e89480.js";import"./index-11c04e4f.js";import"./Col-46619619.js";import"./styleChecker-d1351987.js";import"./isPlainObject-6f4a3c75.js";import"./usePrice-bc935b83.js";import"./updateLocale-d7121807.js";import"./index-675e28c4.js";import"./useMemo-565770c1.js";import"./FormItemContext-9dda29cf.js";import"./lodash-3b12211b.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-a6c897ab.js";import"./index-32515dee.js";import"./Badge-1926c75c.js";import"./isNumeric-3f69e2aa.js";import"./index-572a9242.js";import"./index-89e03fc4.js";import"./toArray-64a01f73.js";import"./SearchOutlined-c7e22afc.js";import"./pickAttrs-bb97af78.js";import"./index-6c7f8dff.js";import"./DialogWrap-bea4ac16.js";import"./index-2c072252.js";import"./css-aae66f86.js";import"./index-8eeb3ce3.js";import"./index-8480e7e5.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-bf7d4f96.js"),["assets/buildSupabaseQuery-bf7d4f96.js","assets/index-885a0812.js","assets/index-d4e075d8.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"},Ce=i("span",null,"حذف",-1),Ue=i("span",null,"ویرایش",-1),Be={class:"space-y-4 rela
|