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

2 lines
7.0 KiB
JavaScript
Raw Normal View History

2026-08-23 14:52:55 +03:30
import{_ as M}from"./BasicMainCard-774c1aa2.js";import{_ as S}from"./BasicModal.vue_vue_type_style_index_0_lang-c3017354.js";import{_ as O,u as V}from"./useBaseTable-6d1e031d.js";import{_ as U}from"./button.vue_vue_type_style_index_0_lang-29638cb6.js";import{I}from"./Icon-c8a211f1.js";import{t as z}from"./useDataTime-4239bab9.js";import{_ as N,H as j,I as J,J as L,d as q,i as g,B as H,o as K,c as F,e as r,w as s,b as d,f as G,K as Q,l as h,E as p}from"./index-a28be152.js";import{_ as W}from"./TextPreview.vue_vue_type_script_setup_true_lang-8e9148a1.js";import{M as T}from"./index-8cc4eae2.js";import{I as X}from"./index-f317ca53.js";import{T as b}from"./isSymbol-25ca88cb.js";import"./Grid-442881e7.js";import"./index-96443f0e.js";import"./_plugin-vue_export-helper-f8ecc290.js";import"./shallowequal-4c00a664.js";import"./index-4a3fe357.js";import"./vnode-4742fc96.js";import"./index-5222fc6e.js";import"./useState-277534ff.js";import"./useRefs-e22a3bf7.js";import"./_flatRest-08328244.js";import"./isMobile-e2e89480.js";import"./omit-8084e33b.js";import"./index-51b737a4.js";import"./Col-86738adb.js";import"./styleChecker-8c6ff79a.js";import"./isPlainObject-450bf3c7.js";import"./index-dd708aca.js";import"./updateLocale-619fe8a7.js";import"./index-3bdda65d.js";import"./useMemo-832cfde0.js";import"./FormItemContext-e50ee5a3.js";import"./lodash-5d3e4f7d.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-1d4fd99b.js";import"./index-61ef5439.js";import"./Badge-7dd6b925.js";import"./isNumeric-3f69e2aa.js";import"./index-dbebb139.js";import"./index-1e365e2e.js";import"./index-12d303fc.js";import"./DialogWrap-617bda84.js";import"./pickAttrs-38902005.js";import"./css-aae66f86.js";import"./index-2849b35f.js";import"./toArray-bdec6b87.js";import"./SearchOutlined-4a5562a8.js";import"./index-f3f71242.js";import"./textUtils-c37780ad.js";const Y=[{title:"ردیف",dataIndex:"id",key:"id",filterable:!1,width:70,align:"center",customRender:t=>t.record.index+1},{title:"نام کاربر",dataIndex:"owner_id",key:"owner_id",customRender:t=>t.record.owner_name||t.record.owner_id||"-"},{title:"متن نظر یا ایده",dataIndex:"text",key:"text",slot:"text"},{title:"زمان ایجاد",dataIndex:"created_at",key:"created_at",customRender:t=>z(t.record.created_at)},{title:"عملیات",dataIndex:"action",key:"action",slot:"action",filterable:!1,align:"center"},{title:"پین شده",dataIndex:"pined",key:"pined",type:"Boolean",filterable:!0,show:!1}];async function Z(t){const c=await j("comments",t);return Array.isArray(c)?c:[c]}async function A(t,c){const o=await J("comments",t,c);return Array.isArray(o)?o:[o]}async function ee(t){await L("comments",t)}async function te(t){const{TableEngineRequest:c}=await N(()=>import("./buildSupabaseQuery-7d0fcf16.js"),["assets/buildSupabaseQuery-7d0fcf16.js","assets/index-a28be152.js","assets/index-d7456b90.css"]),o={...t};!o.sort&&!o.order&&(o.order="-id"),o.select=["*","users!owner_id(first_name, last_name, phone)"];const l=await c(o,"comments");try{if(Array.isArray(l==null?void 0:l.rows)){const y=o.page||1,_=o.limit||200,x=(y-1)*_,v=l.rows.map((e,m)=>{let w=null;if(e.owner_id){const f=Array.isArray(e.users)?e.users[0]:e.users;f?w=`${f.first_name||""} ${f.last_name||""}`.trim()||f.phone||`کاربر ${e.owner_id}`:w=`کاربر ${e.owner_id}`}return{id:e.id,owner_id:e.owner_id??null,owner_name:w,text:e.text??"",created_at:e.created_at??"",updated_at:e.updated_at??"",index:x+m,...e}});return{...l,rows:v}}}catch(y){console.log("[getCommentsTable] normalize error:",y)}return l}const ne={class:"flex justify-between items-center mb-4"},oe=d("h2",null,"ایده و نظرات",-1),ae={class:"gap-2 flex justify-center"},re=d("span",null,"پین کردن",-1),ie=d("span",null,"حذف",-1),se=d("span",null,"ویرایش",-1),le={class:"space-y-4"},ce=d("div",{class:"mb-1 text-sm text-gray-600"},"متن پیام *",-1),at=q({__name:"index",setup(t){const{TextArea:c}=X,[o,l]=V(),y=g({columns:Y,api:te,defaultPageLimit:20}),_=g(!1),x=g(!1),v=g(null),e=H(),m=g({owner_id:null,text:""});async function w(){var n;x