2026-07-26 16:24:36 +03:30
|
|
|
import{_ as X}from"./BasicMainCard-1361ed38.js";import{_ as G}from"./BasicModal.vue_vue_type_style_index_0_lang-acac591d.js";import{_ as K}from"./BasicInput.vue_vue_type_style_index_0_lang-6c1f4129.js";import{_ as Q,u as Y}from"./useBaseTable-c2761680.js";import{_ as Z}from"./button.vue_vue_type_style_index_0_lang-c37c204f.js";import{I as T}from"./Icon-6b61a044.js";import{t as tt}from"./useDataTime-f3f5ea50.js";import{getBooksTable as et,updateBook as ot,addBook as at,deleteBook as lt}from"./books-d834e423.js";import{d as st,g as f,o as I,c as M,b as r,w as m,a,e as rt,H as it,j as x,k as $,y as nt,t as ut,D as c,I as ct}from"./index-4dccb174.js";import{g as P}from"./convert-2ad76038.js";import{g as z}from"./index-d825960e.js";import{M as dt}from"./index-a34bba22.js";import{S as mt}from"./index-f08752bf.js";import{T as N}from"./isSymbol-80c521a5.js";import{U as pt}from"./index-bd458d30.js";import"./index-6f4a8a6b.js";import"./index-7a876d00.js";import"./_plugin-vue_export-helper-fc650ede.js";import"./useState-7760581d.js";import"./vnode-8e0d49aa.js";import"./useRefs-b5c660b2.js";import"./_flatRest-00780a2d.js";import"./index-7ce2783e.js";import"./Col-c87d3a9d.js";import"./styleChecker-133e2b1a.js";import"./isPlainObject-819f93b0.js";import"./usePrice-bc935b83.js";import"./index-4762b7d8.js";import"./FormItemContext-d26e27b7.js";import"./updateLocale-72f02bbd.js";import"./index-c7f692d2.js";import"./toArray-8c6d8405.js";import"./pickAttrs-13d22210.js";import"./lodash-0f8911c3.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-c92640b4.js";import"./index-895cd0d7.js";import"./isNumeric-3f69e2aa.js";import"./index-00d83bfc.js";import"./index-8f783c3c.js";import"./index-ce6d92ba.js";import"./LeftOutlined-2d8ca514.js";import"./css-aae66f86.js";import"./DialogWrap-715ad625.js";import"./index-6a54d8cb.js";import"./index-495b789b.js";const vt=[{title:"ردیف",dataIndex:"id",key:"id",filterable:!1,width:70,align:"center",customRender:p=>p.record.index+1},{title:"عنوان",dataIndex:"title",key:"title"},{title:"زیرعنوان",dataIndex:"sub_title",key:"sub_title"},{title:"تعداد قصه ها",dataIndex:"total_storys",key:"total_storys",align:"center",width:120,customRender:p=>p.record.total_storys??0},{title:"تصویر کاور",dataIndex:"cover",key:"cover",customRender:p=>p.record.cover||"-"},{title:"زمان ایجاد",dataIndex:"created_at",key:"created_at",customRender:p=>tt(p.record.created_at)},{title:"عملیات",dataIndex:"action",key:"action",slot:"action",filterable:!1,align:"center"}],_t={class:"flex justify-between items-center mb-4"},ft=a("h2",null,"کتاب ها",-1),gt={class:"gap-2 flex justify-center"},ht=a("span",null,"حذف",-1),bt=a("span",null,"ویرایش",-1),yt={class:"space-y-4 relative"},xt={key:0,class:"absolute inset-0 bg-white/60 z-10 flex items-center justify-center"},kt=a("div",{class:"mb-1 text-sm text-gray-600"},"عنوان *",-1),wt=a("div",{class:"mb-1 text-sm text-gray-600"},"زیرعنوان",-1),Bt=a("div",{class:"mb-1 text-sm text-gray-600"},"آپلود تصویر کاور",-1),Ct={key:0},It=a("div",null,"آپلود کاور",-1),Mt={key:0,class:"mt-1"},Ut={class:"h-2 rounded bg-gray-200 overflow-hidden"},Tt={class:"text-xs text-gray-700 font-semibold text-center mt-1"},xe=st({__name:"index",setup(p){const D={authorization:`Bearer ${z()||localStorage.getItem("tamin_token")||""}`},[j,L]=Y(),O=f({columns:vt,api:et,defaultPageLimit:20}),b=f(!1),k=f(!1),w=f(null),g=f([]),h=f(0),v=f(0),u=f({title:"",sub_title:null,cover:null});function V(){g.value=[],k.value=!1,w.value=null,u.value={title:"",sub_title:null,cover:null},b.value=!0}function R(){b.value=!1}function q(o){return o.type.startsWith("image/")?o.size/1024/1024<5?!0:(c.error("حجم تصویر باید کمتر از 5MB باشد"),!1):(c.error("فقط فایلهای تصویری مجاز است"),!1)}async function E(o){const{file:t,onSuccess:i,onError:l,onProgress:d}=o,B=new FormData;B.append("file",t);const U=`${ct}/upload/machartaa-img`;v.value=0,h.value++,await new Promise((n,y)=>{const s=new XMLHttpRequest;
|