Files
machartaa_admin_dist/dist/assets/index-803920ce.js
T

2 lines
11 KiB
JavaScript
Raw Normal View History

2026-06-29 11:42:39 +03:30
import{_ as ee}from"./BasicMainCard-66b390aa.js";import{_ as te}from"./BasicModal.vue_vue_type_style_index_0_lang-5ab3ab1e.js";import{_ as ae}from"./BasicInput.vue_vue_type_style_index_0_lang-bfc1e6f7.js";import{_ as ne,u as oe}from"./useBaseTable-d9c20676.js";import{_ as le}from"./button.vue_vue_type_style_index_0_lang-9acb6bbb.js";import{I as A}from"./Icon-c317d0f6.js";import{t as ie}from"./useDataTime-d5dc0b88.js";import{_ as se,H as O,d as re,g as x,o as B,c as $,b as i,w as d,a as l,e as E,G as ue,j as f,t as ce,k as L,y as de,D as v,I as me}from"./index-6d795230.js";import{g as P}from"./convert-67c23be8.js";import{n as H}from"./textUtils-c37780ad.js";import{g as N}from"./index-79b789c5.js";import{M as _e}from"./index-5ffa18ef.js";import{S as pe}from"./index-b10e6723.js";import{C as he}from"./index-5d1c7ac1.js";import{I as ve}from"./index-31dc1979.js";import{T as z}from"./shallowequal-703850b3.js";import{U as fe}from"./index-a7a377ad.js";import"./index-559c3270.js";import"./index-b336da6d.js";import"./_plugin-vue_export-helper-f50b9772.js";import"./styleChecker-4390889b.js";import"./vnode-464346d5.js";import"./useState-3687f263.js";import"./useRefs-f311b0d7.js";import"./Col-899793db.js";import"./index-200d409a.js";import"./isPlainObject-3687c6e5.js";import"./usePrice-bc935b83.js";import"./fa_IR-18867896.js";import"./toArray-ae995052.js";import"./FormItemContext-cfd53c8f.js";import"./pickAttrs-954d14dc.js";import"./lodash-0405a701.js";import"./index-bb96f0e2.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:c}=await O.from("announcements").insert([s]).select();if(c)throw c;return p}async function F(s,p){const{data:c,error:h}=await O.from("announcements").update({...p,updated_at:new Date().toISOString()}).eq("id",s).select();if(h)throw h;return c}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-2d496a2c.js"),["assets/buildSupabaseQuery-2d496a2c.js","assets/index-6d795230.js","assets/index-1d8b7a70.css","assets/supabaseTableQuery-95762ff3.js"]),c={...s};!c.sort&&!c.order&&(c.order="-id");const h=await p(c,"announcements");try{if(Array.isArray(h==null?void 0:h.rows)){const y=c.page||1,R=c.limit||20,k=(y-1)*R,T=h.rows.map((m,g)=>({...m,title:m.title??"",description:m.description??"",video_title:m.video_title??"",thumbnail:m.thumbnail??null,aparat_embed_code:m.aparat_embed_code??"",show_on_home:m.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 text-sm text-gray-600"},"کد embed آپارات *",-1),Se=l("div",{class:"mb-1 text-sm text-gray-600"},"تامنیل",-1),Le={key:0},Pe=l("div",null,"آپلود تامنیل",-1),ze={key:0,class:"mt-1"},Oe={class:"h-2 rounded bg-gray-200 ov