Files
machartaa_admin_dist/dist/assets/index-46659da0.js
T

2 lines
7.0 KiB
JavaScript
Raw Normal View History

2026-08-25 16:12:17 +03:30
import{_ as M}from"./BasicMainCard-9a9b0e82.js";import{_ as S}from"./BasicModal.vue_vue_type_style_index_0_lang-0db8aa6c.js";import{_ as O,u as V}from"./useBaseTable-0fdb84ad.js";import{_ as U}from"./button.vue_vue_type_style_index_0_lang-0b499337.js";import{I}from"./Icon-d1d29ca3.js";import{t as z}from"./useDataTime-234977eb.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-0ae7844c.js";import{_ as W}from"./TextPreview.vue_vue_type_script_setup_true_lang-cae329b9.js";import{M as T}from"./index-6d32dcba.js";import{I as X}from"./index-81a07cb9.js";import{T as b}from"./isSymbol-d0ec885c.js";import"./Grid-1b086c47.js";import"./index-33c0557e.js";import"./_plugin-vue_export-helper-277b1c3f.js";import"./shallowequal-a089597b.js";import"./index-02b92135.js";import"./vnode-454b4aa7.js";import"./index-c2776ddf.js";import"./useState-80fd23c9.js";import"./useRefs-0b121885.js";import"./_flatRest-5e9bcb10.js";import"./isMobile-e2e89480.js";import"./omit-e036f60c.js";import"./index-3189b1a9.js";import"./Col-84747301.js";import"./styleChecker-918e9a0f.js";import"./isPlainObject-4659a577.js";import"./index-0309284c.js";import"./updateLocale-15cba891.js";import"./index-c2bca1e0.js";import"./useMemo-19000d17.js";import"./FormItemContext-e7b6ca96.js";import"./lodash-6746fa7b.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-630a739a.js";import"./index-ff77e42c.js";import"./Badge-3dfd39bb.js";import"./isNumeric-3f69e2aa.js";import"./index-6585bad2.js";import"./index-7d2db2fd.js";import"./index-0c08cf04.js";import"./DialogWrap-930ec585.js";import"./pickAttrs-2e870478.js";import"./css-aae66f86.js";import"./index-a2cfdf13.js";import"./toArray-592e82ea.js";import"./SearchOutlined-8b990494.js";import"./index-7090fbb0.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-ef030906.js"),["assets/buildSupabaseQuery-ef030906.js","assets/index-0ae7844c.js","assets/index-71a80eb0.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