2026-07-16 16:44:06 +03:30
|
|
|
import{_ as J}from"./BasicMainCard-d0e0118a.js";import{_ as G}from"./BasicModal.vue_vue_type_style_index_0_lang-78720926.js";import{_ as X}from"./BasicInput.vue_vue_type_style_index_0_lang-a3505492.js";import{_ as K,u as Q}from"./useBaseTable-ee2a5641.js";import{_ as Y}from"./button.vue_vue_type_style_index_0_lang-976922e0.js";import{I as P}from"./Icon-d2a333f8.js";import{t as Z}from"./useDataTime-42f03937.js";import{_ as tt,G as S,d as et,g as b,o as D,c as $,b as n,w as f,a as o,e as at,H as ot,j as B,k as R,y as it,t as st,D as g,I as rt}from"./index-c7cfb6d0.js";import{g as A}from"./convert-2ad76038.js";import{_ as lt}from"./TextPreview.vue_vue_type_script_setup_true_lang-281d8a7e.js";import{M as nt}from"./index-accfa387.js";import{S as ct}from"./index-5ce472da.js";import{I as ut}from"./index-ec42cf6b.js";import{T as E}from"./isSymbol-39130b1f.js";import{U as mt}from"./index-70ad7783.js";import"./index-f553b547.js";import"./index-e011592a.js";import"./_plugin-vue_export-helper-64344365.js";import"./useState-624b81a4.js";import"./vnode-d460d6f7.js";import"./useRefs-ac12ba74.js";import"./_flatRest-4bcfe4cb.js";import"./index-2c3e0423.js";import"./Col-85f675b3.js";import"./styleChecker-2280acc2.js";import"./isPlainObject-9edbc0c5.js";import"./usePrice-bc935b83.js";import"./updateLocale-4490df87.js";import"./index-a85f4e3c.js";import"./toArray-69a6a276.js";import"./FormItemContext-c66bbc76.js";import"./pickAttrs-a95b5777.js";import"./lodash-ccbe62b4.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-f1dbbf12.js";import"./index-2173586f.js";import"./isNumeric-3f69e2aa.js";import"./index-c22a9b5b.js";import"./index-394ef579.js";import"./index-f2204652.js";import"./LeftOutlined-91e9e8a5.js";import"./css-aae66f86.js";import"./DialogWrap-c08d6860.js";import"./index-234839ae.js";import"./textUtils-c37780ad.js";import"./index-0fdf0cd9.js";const dt=[{title:"ردیف",dataIndex:"id",key:"id",filterable:!1,width:70,align:"center",customRender:i=>i.record.index+1},{title:"عنوان",dataIndex:"title",key:"title"},{title:"توضیحات",dataIndex:"description",key:"description",slot:"description"},{title:"تصویر",dataIndex:"src_img",key:"src_img",customRender:i=>i.record.src_img||"-"},{title:"زمان ایجاد",dataIndex:"created_at",key:"created_at",customRender:i=>Z(i.record.created_at)},{title:"عملیات",dataIndex:"action",key:"action",slot:"action",filterable:!1,align:"center"}];async function pt(i){const{data:p,error:c}=await S.from("images_book").insert([i]).select();if(c)throw c;return p}async function _t(i,p){const{data:c,error:m}=await S.from("images_book").update(p).eq("id",i).select();if(m)throw m;return c}async function ft(i){const{error:p}=await S.from("images_book").delete().eq("id",i);if(p)throw p}async function gt(i){const{TableEngineRequest:p}=await tt(()=>import("./buildSupabaseQuery-51a5ddf9.js"),["assets/buildSupabaseQuery-51a5ddf9.js","assets/index-c7cfb6d0.js","assets/index-338b63e2.css","assets/supabaseTableQuery-9069679c.js"]),c={...i};!c.sort&&!c.order&&(c.order="-id");const m=await p(c,"images_book");try{if(Array.isArray(m==null?void 0:m.rows)){const T=c.page||1,k=c.limit||200,w=(T-1)*k,I=m.rows.map((u,v)=>({id:u.id,title:u.title??null,description:u.description??null,src_img:u.src_img??null,created_at:u.created_at??"",index:w+v,...u}));return{...m,rows:I}}}catch(T){console.log("[getImagesBookTable] normalize error:",T)}return m}const vt={class:"flex justify-between items-center mb-4"},ht=o("h2",null,"تصاویر کتاب",-1),xt={class:"gap-2 flex justify-center"},yt=o("span",null,"حذف",-1),bt=o("span",null,"ویرایش",-1),kt={class:"space-y-4 relative"},wt={key:0,class:"absolute inset-0 bg-white/60 z-10 flex items-center justify-center"},It=o("div",{class:"mb-1 text-sm text-gray-600"},"عنوان",-1),Bt=o("div",{class:"mb-1 text-sm text-gray-600"},"توضیحات",-1),Tt=o("div",{class:"mb-1 text-sm text-gray-600"},"آپلود تصویر",-1),Ct={key:0},Mt=o("div",null,"آپلود تصویر",-1),Ut={key:0,class:"mt-1"},Dt={class:"h-2 rounded bg-gray-200 overflow-hidden"},$t={
|