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

2 lines
7.0 KiB
JavaScript
Raw Normal View History

2026-09-16 14:07:27 +03:30
import{_ as M}from"./BasicMainCard-2b216dd4.js";import{_ as S}from"./BasicModal.vue_vue_type_style_index_0_lang-39ca2ebd.js";import{_ as O,u as V}from"./useBaseTable-4f4d8248.js";import{_ as U}from"./button.vue_vue_type_style_index_0_lang-307c41e8.js";import{I}from"./Icon-daa4ada2.js";import{t as z}from"./useDataTime-e3db50db.js";import{_ as N,H as j,I as J,J as L,d as q,i as g,D as G,o as H,c as K,e as r,w as s,b as d,f as F,K as Q,l as h,G as p}from"./index-f44a958f.js";import{_ as W}from"./TextPreview.vue_vue_type_script_setup_true_lang-96830691.js";import{M as T}from"./index-234c79ba.js";import{I as X}from"./index-17909d47.js";import{T as b}from"./isSymbol-9ca68d9f.js";import"./Grid-dfc25885.js";import"./index-a485cd3f.js";import"./_plugin-vue_export-helper-9644f77d.js";import"./shallowequal-30316885.js";import"./index-1399904b.js";import"./vnode-bcebd00a.js";import"./index-120ad211.js";import"./useState-7cfb31a4.js";import"./useRefs-b0f27066.js";import"./_flatRest-e4351155.js";import"./isMobile-e2e89480.js";import"./omit-555d0220.js";import"./index-ae092da9.js";import"./Col-4af7c3cd.js";import"./styleChecker-d7256a22.js";import"./isPlainObject-f85be752.js";import"./index-00d02541.js";import"./updateLocale-4abe3bd4.js";import"./index-6f0218fe.js";import"./useMemo-3af68d99.js";import"./FormItemContext-801d31a4.js";import"./lodash-ba2547f0.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-9966573e.js";import"./index-5f6600aa.js";import"./Badge-daa269e5.js";import"./isNumeric-3f69e2aa.js";import"./index-432f8768.js";import"./index-7722f326.js";import"./index-5bb4f02b.js";import"./DialogWrap-ed1e42ab.js";import"./pickAttrs-6cecdc2a.js";import"./css-aae66f86.js";import"./index-2a7e74b5.js";import"./toArray-c3886d9c.js";import"./SearchOutlined-bf31e51b.js";import"./index-a5608fae.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-cbaa4453.js"),["assets/buildSupabaseQuery-cbaa4453.js","assets/index-f44a958f.js","assets/index-f80d3475.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=G(),m=g({owner_id:null,text:""});async function w(){var n;x