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

2 lines
7.0 KiB
JavaScript
Raw Normal View History

2026-10-10 13:28:46 +03:30
import{_ as M}from"./BasicMainCard-4c879cc2.js";import{_ as S}from"./BasicModal.vue_vue_type_style_index_0_lang-c3b69d02.js";import{_ as O,u as V}from"./useBaseTable-e35ecaa9.js";import{_ as U}from"./button.vue_vue_type_style_index_0_lang-b32e1136.js";import{I}from"./Icon-85823aa3.js";import{t as z}from"./useDataTime-c7be2668.js";import{_ as L,I as N,J as j,K as J,d as q,i as g,E as H,o as K,c as F,e as r,w as s,b as d,f as G,L as Q,l as h,H as p}from"./index-90ac1a44.js";import{_ as W}from"./TextPreview.vue_vue_type_script_setup_true_lang-acd6228c.js";import{M as T}from"./index-a413fea1.js";import{I as X}from"./index-027c2128.js";import{T as b}from"./isSymbol-9094e8b7.js";import"./Grid-839ef6d1.js";import"./index-4d938e91.js";import"./_plugin-vue_export-helper-8ee86600.js";import"./shallowequal-36516cfd.js";import"./index-9869a66e.js";import"./vnode-b0455438.js";import"./index-c0eeee91.js";import"./useState-64f2823f.js";import"./useRefs-2a883b79.js";import"./_flatRest-f2577aae.js";import"./isMobile-e2e89480.js";import"./omit-84d71e15.js";import"./index-109c99be.js";import"./Col-fddaa6b7.js";import"./styleChecker-1445806f.js";import"./isPlainObject-aab367ce.js";import"./index-93d9312f.js";import"./updateLocale-cec40f3d.js";import"./index-cfa536c5.js";import"./useMemo-9928f29b.js";import"./FormItemContext-64f846db.js";import"./lodash-07b825be.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-fb5041dc.js";import"./index-95b42b3e.js";import"./Badge-54a9cc4e.js";import"./isNumeric-3f69e2aa.js";import"./index-5f5223b4.js";import"./index-788f312f.js";import"./index-90f5ddad.js";import"./DialogWrap-6616a498.js";import"./pickAttrs-ba13e92c.js";import"./css-aae66f86.js";import"./index-a2503c07.js";import"./toArray-3936b2d5.js";import"./SearchOutlined-0eaaa97a.js";import"./index-bb804fdd.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 N("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 J("comments",t)}async function te(t){const{TableEngineRequest:c}=await L(()=>import("./buildSupabaseQuery-c046d1a6.js"),["assets/buildSupabaseQuery-c046d1a6.js","assets/index-90ac1a44.js","assets/index-0643191e.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