2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
import{_ as ee}from"./BasicMainCard-02aee5ac.js";import{_ as te}from"./BasicModal.vue_vue_type_style_index_0_lang-ca4aa0a6.js";import{_ as ae}from"./BasicInput.vue_vue_type_style_index_0_lang-7718018f.js";import{_ as oe,u as ie}from"./useBaseTable-8eb27015.js";import{_ as ne}from"./button.vue_vue_type_style_index_0_lang-b7b1a519.js";import{I as A}from"./Icon-82f6c95b.js";import{t as le}from"./useDataTime-785ab201.js";import{_ as se,G as j,d as re,g as x,o as B,c as $,b as l,w as c,a as n,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-b279599b.js";import{g as P}from"./convert-2ad76038.js";import{n as H}from"./textUtils-c37780ad.js";import{g as N}from"./index-f0a024ec.js";import{M as pe}from"./index-9c450bf9.js";import{S as _e}from"./index-86478c3f.js";import{C as he}from"./index-076900a0.js";import{I as ve}from"./index-e626bdbb.js";import{T as z}from"./isSymbol-4b8c1f3e.js";import{U as fe}from"./index-98405404.js";import"./Grid-ba9af77d.js";import"./index-5e6ef189.js";import"./_plugin-vue_export-helper-f38a7ea6.js";import"./shallowequal-59da3a36.js";import"./index-5f5b359c.js";import"./vnode-cc30a5f9.js";import"./index-cce68701.js";import"./useState-588c2312.js";import"./useRefs-72c4a0da.js";import"./_flatRest-cb9a1464.js";import"./isMobile-e2e89480.js";import"./omit-4c59a877.js";import"./index-60598d32.js";import"./Col-c7dcaed0.js";import"./styleChecker-e8fc6c1f.js";import"./isPlainObject-093495b2.js";import"./usePrice-bc935b83.js";import"./updateLocale-1fd95539.js";import"./index-9879659d.js";import"./index-bc659f42.js";import"./useMemo-39d0bfae.js";import"./FormItemContext-a76fbf7e.js";import"./lodash-98c01373.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-62e181b5.js";import"./index-7dd4f08a.js";import"./Badge-2dd91e64.js";import"./isNumeric-3f69e2aa.js";import"./index-cb1dea06.js";import"./index-6707c586.js";import"./toArray-b7e6b8ed.js";import"./SearchOutlined-3414d521.js";import"./pickAttrs-7db0f563.js";import"./index-2f258009.js";import"./DialogWrap-a7021269.js";import"./index-624f47cc.js";import"./css-aae66f86.js";import"./index-1fd3daba.js";import"./index-de855912.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 ge(s){const{data:_,error:m}=await j.from("announcements").insert([s]).select();if(m)throw m;return _}async function F(s,_){const{data:m,error:h}=await j.from("announcements").update({..._,updated_at:new Date().toISOString()}).eq("id",s).select();if(h)throw h;return m}async function be(s){const{error:_}=await j.from("announcements").delete().eq("id",s);if(_)throw _}async function we(s){const{TableEngineRequest:_}=await se(()=>import("./buildSupabaseQuery-7cbfb50c.js"),["assets/buildSupabaseQuery-7cbfb50c.js","assets/index-b279599b.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,b)=>({...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+b}));return{...h,rows:T}}}catch(y){console.error("[getAnnouncementsTable]",y)}return h}const xe={class:"flex justify-between items-center mb-4"},ye=n("h2",null,"اطلاعرسانی ویدیویی",-1),ke=["src"],Ie={key:1},Te={class:"gap-2 flex justify-center"},C
|