Files
machartaa_admin_dist/dist/assets/index-5b530423.js
T

2 lines
7.0 KiB
JavaScript
Raw Normal View History

2026-10-19 15:32:02 +03:30
import{_ as M}from"./BasicMainCard-7b1fa79c.js";import{_ as O}from"./BasicModal.vue_vue_type_style_index_0_lang-3870ceab.js";import{_ as S,u as V}from"./useBaseTable-d607863f.js";import{_ as U}from"./button.vue_vue_type_style_index_0_lang-90a36b25.js";import{I}from"./Icon-16a7c1f0.js";import{t as z}from"./useDataTime-784b7128.js";import{_ as N,O as j,P as L,Q as q,d as H,i as g,E as J,o as Q,c as F,e as r,w as s,b as d,f as G,R as K,l as h,H as p}from"./index-0127add0.js";import{_ as W}from"./TextPreview.vue_vue_type_script_setup_true_lang-48ab571a.js";import{M as T}from"./index-a21bea9f.js";import{I as X}from"./index-30500426.js";import{T as b}from"./isSymbol-102dac7e.js";import"./Grid-6ef11710.js";import"./index-a1a9d49a.js";import"./_plugin-vue_export-helper-10c790be.js";import"./shallowequal-327a9d42.js";import"./index-a6785c60.js";import"./vnode-e48a529a.js";import"./index-5d23b372.js";import"./useState-ab7e8e52.js";import"./useRefs-5dfcc3e3.js";import"./_flatRest-56c6e14a.js";import"./isMobile-e2e89480.js";import"./omit-a9878f04.js";import"./index-087c87e8.js";import"./Col-8db1abbb.js";import"./styleChecker-6ecca756.js";import"./isPlainObject-cdd64a7d.js";import"./index-9c57cbfd.js";import"./updateLocale-1362a15b.js";import"./index-163f964f.js";import"./useMemo-531a1ef9.js";import"./FormItemContext-99d81d38.js";import"./lodash-572b39f3.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-1007497c.js";import"./index-e8339542.js";import"./Badge-8884c4f5.js";import"./isNumeric-3f69e2aa.js";import"./index-def9ba08.js";import"./index-c971ffa4.js";import"./index-83d7ccb3.js";import"./LeftOutlined-dfa284aa.js";import"./css-aae66f86.js";import"./DialogWrap-81711a5a.js";import"./pickAttrs-05046885.js";import"./index-55a09ddc.js";import"./toArray-2923cdda.js";import"./SearchOutlined-6c1cc274.js";import"./index-827c0a37.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 L("comments",t,c);return Array.isArray(o)?o:[o]}async function ee(t){await q("comments",t)}async function te(t){const{TableEngineRequest:c}=await N(()=>import("./buildSupabaseQuery-91e30fb5.js"),["assets/buildSupabaseQuery-91e30fb5.js","assets/index-0127add0.js","assets/index-ceed3b68.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),rt=H({__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=J(),m=g({owner_id:null,t