Files
machartaa_admin_dist/dist/assets/index-96e72ab6.js
T

2 lines
7.0 KiB
JavaScript
Raw Normal View History

2026-10-17 17:09:50 +03:30
import{_ as M}from"./BasicMainCard-d88efce1.js";import{_ as O}from"./BasicModal.vue_vue_type_style_index_0_lang-8b3762d2.js";import{_ as S,u as V}from"./useBaseTable-b65e968f.js";import{_ as U}from"./button.vue_vue_type_style_index_0_lang-dc7b87c6.js";import{I}from"./Icon-b5a365b6.js";import{t as z}from"./useDataTime-4da2f466.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-f7911a6d.js";import{_ as W}from"./TextPreview.vue_vue_type_script_setup_true_lang-c8c339ed.js";import{M as T}from"./index-6f289e55.js";import{I as X}from"./index-31699bda.js";import{T as b}from"./isSymbol-b0715776.js";import"./Grid-d4d08bfb.js";import"./index-10c207c0.js";import"./_plugin-vue_export-helper-a59ccce4.js";import"./shallowequal-1fb084f0.js";import"./index-2e819d27.js";import"./vnode-160a3584.js";import"./index-c48ccee5.js";import"./useState-2a09ed7b.js";import"./useRefs-2e02a4a6.js";import"./_flatRest-dd0446c0.js";import"./isMobile-e2e89480.js";import"./omit-19fd03e3.js";import"./index-c5c3e497.js";import"./Col-a3b51974.js";import"./styleChecker-10d88d72.js";import"./isPlainObject-72a97f79.js";import"./index-c7e434df.js";import"./updateLocale-0c609c95.js";import"./index-fd54b9e9.js";import"./useMemo-dd1208f0.js";import"./FormItemContext-e8070c30.js";import"./lodash-38d75800.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-c915f24e.js";import"./index-53f009ba.js";import"./index-af05d1fd.js";import"./Badge-1e5825d4.js";import"./isNumeric-3f69e2aa.js";import"./index-aafb52b8.js";import"./index-da7ed9ea.js";import"./index-4a17ebf7.js";import"./DialogWrap-157169f5.js";import"./pickAttrs-d4e89cbd.js";import"./css-aae66f86.js";import"./index-317bbaff.js";import"./toArray-a2b9a939.js";import"./SearchOutlined-9cce5c32.js";import"./index-79a6c7d7.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-69b5fd5d.js"),["assets/buildSupabaseQuery-69b5fd5d.js","assets/index-f7911a6d.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,text:""}