2 lines
9.4 KiB
JavaScript
2 lines
9.4 KiB
JavaScript
import{_ as J}from"./BasicMainCard-29eef376.js";import{_ as G}from"./BasicModal.vue_vue_type_style_index_0_lang-7803828f.js";import{_ as X}from"./BasicInput.vue_vue_type_style_index_0_lang-0a352870.js";import{_ as K,u as Q}from"./useBaseTable-e4bbf0da.js";import{_ as Y}from"./button.vue_vue_type_style_index_0_lang-99dfcd06.js";import{I as P}from"./Icon-c9ad16b9.js";import{t as Z}from"./useDataTime-5442c624.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-bc4edd51.js";import{g as A}from"./convert-2ad76038.js";import{_ as lt}from"./TextPreview.vue_vue_type_script_setup_true_lang-0733684f.js";import{M as nt}from"./index-609e9a96.js";import{S as ct}from"./index-d4870df7.js";import{I as ut}from"./index-49e2e544.js";import{T as E}from"./isSymbol-f9834f4f.js";import{U as mt}from"./index-368498f7.js";import"./Grid-08ee34b6.js";import"./index-627337a8.js";import"./_plugin-vue_export-helper-c8347567.js";import"./shallowequal-cad00b6e.js";import"./index-47b6ba8f.js";import"./vnode-f2307909.js";import"./index-1d49b36b.js";import"./useState-47ff4833.js";import"./useRefs-225197bd.js";import"./_flatRest-9adb1e9a.js";import"./isMobile-e2e89480.js";import"./omit-6f60253b.js";import"./index-7fcb5f91.js";import"./Col-96f7f23f.js";import"./styleChecker-bc667521.js";import"./isPlainObject-ed8996b4.js";import"./usePrice-bc935b83.js";import"./updateLocale-7b0be7e3.js";import"./index-9df7eaa1.js";import"./index-bc659f42.js";import"./useMemo-8275a234.js";import"./FormItemContext-4e017a44.js";import"./lodash-3efc1909.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-9775c8a5.js";import"./index-5ea3cefd.js";import"./Badge-627fd6d3.js";import"./isNumeric-3f69e2aa.js";import"./index-34768277.js";import"./index-4e41e7b6.js";import"./index-393b875d.js";import"./DialogWrap-f12e49af.js";import"./pickAttrs-1c46cfba.js";import"./css-aae66f86.js";import"./index-727535d5.js";import"./toArray-b01cb1f9.js";import"./SearchOutlined-4504ec77.js";import"./index-ae018072.js";import"./index-3aafac3f.js";import"./textUtils-c37780ad.js";import"./index-6d8a75c0.js";import"./index-60d2bcc6.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-e64be55f.js"),["assets/buildSupabaseQuery-e64be55f.js","assets/index-bc4edd51.js","assets/index-c30c691c.css","assets/supabaseTableQuery-8ab5665d.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 te
|