Files
machartaa_admin_dist/dist/assets/index-35778235.js
T

2 lines
8.3 KiB
JavaScript
Raw Normal View History

2026-08-09 13:07:17 +03:30
import{_ as X}from"./BasicMainCard-4b9ba85b.js";import{_ as G}from"./BasicModal.vue_vue_type_style_index_0_lang-661b0a06.js";import{_ as K}from"./BasicInput.vue_vue_type_style_index_0_lang-17ae6919.js";import{_ as Q,u as Y}from"./useBaseTable-3c30fe12.js";import{_ as Z}from"./button.vue_vue_type_style_index_0_lang-f6f5b6a0.js";import{I as T}from"./Icon-889d6eab.js";import{t as tt}from"./useDataTime-5a269444.js";import{getBooksTable as et,updateBook as ot,addBook as at,deleteBook as lt}from"./books-04d4b679.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-f8ee37b9.js";import{g as P}from"./convert-2ad76038.js";import{g as z}from"./index-8fee9afc.js";import{M as dt}from"./index-ef1f8a61.js";import{S as mt}from"./index-0e72b27c.js";import{T as N}from"./isSymbol-cdcd460d.js";import{U as pt}from"./index-c0e94d73.js";import"./Grid-30a17a21.js";import"./index-6e8a4b4f.js";import"./_plugin-vue_export-helper-775bc553.js";import"./index-b8cc71e2.js";import"./vnode-b0e810ae.js";import"./omit-bdd3cea5.js";import"./useState-f5985d90.js";import"./useRefs-bff35432.js";import"./_flatRest-6305d35d.js";import"./index-ee1b3469.js";import"./Col-97627e24.js";import"./styleChecker-c1fc9f39.js";import"./isPlainObject-6382de01.js";import"./usePrice-bc935b83.js";import"./index-1ab617ae.js";import"./FormItemContext-5821e8c8.js";import"./updateLocale-d5a764a4.js";import"./index-bc659f42.js";import"./index-f923b666.js";import"./toArray-53a55fc4.js";import"./pickAttrs-69f29e9c.js";import"./lodash-7c51d08d.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-2e892f80.js";import"./index-78e4e5e0.js";import"./Badge-47d7b0bb.js";import"./isNumeric-3f69e2aa.js";import"./index-89210322.js";import"./index-8bcedf66.js";import"./index-0441c4fc.js";import"./DialogWrap-192ddaf7.js";import"./css-aae66f86.js";import"./index-bf59f845.js";import"./index-9594c53b.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"},Be=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