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

2 lines
7.0 KiB
JavaScript
Raw Normal View History

2026-10-14 16:25:33 +03:30
import{_ as M}from"./BasicMainCard-104c14b2.js";import{_ as S}from"./BasicModal.vue_vue_type_style_index_0_lang-c75cb8ba.js";import{_ as O,u as V}from"./useBaseTable-dfbf3762.js";import{_ as U}from"./button.vue_vue_type_style_index_0_lang-5dd5fad9.js";import{I}from"./Icon-0c593d03.js";import{t as z}from"./useDataTime-9987a66e.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-a94f140f.js";import{_ as W}from"./TextPreview.vue_vue_type_script_setup_true_lang-0697c916.js";import{M as T}from"./index-cadfe89f.js";import{I as X}from"./index-9bf19e54.js";import{T as b}from"./isSymbol-0faad147.js";import"./Grid-33e7139e.js";import"./index-e5d8b47c.js";import"./_plugin-vue_export-helper-3751a4c9.js";import"./shallowequal-311bf7d9.js";import"./index-fa5a0887.js";import"./vnode-d8d89b8b.js";import"./index-d139af20.js";import"./useState-75e49d81.js";import"./useRefs-14e054ef.js";import"./_flatRest-38d88d03.js";import"./isMobile-e2e89480.js";import"./omit-09913e6a.js";import"./index-53e81bb5.js";import"./Col-098f825e.js";import"./styleChecker-cbf8a3c6.js";import"./isPlainObject-fa7524bd.js";import"./index-a08f6658.js";import"./updateLocale-63da7352.js";import"./index-da3c4531.js";import"./useMemo-e6667500.js";import"./FormItemContext-d446a85f.js";import"./lodash-b667f7ec.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-988f9693.js";import"./index-94f097c0.js";import"./Badge-64556311.js";import"./isNumeric-3f69e2aa.js";import"./index-a10a5cee.js";import"./index-02db9106.js";import"./index-6838bdc5.js";import"./DialogWrap-1f925fe5.js";import"./pickAttrs-d12003ac.js";import"./css-aae66f86.js";import"./index-1e5db048.js";import"./toArray-3323d384.js";import"./SearchOutlined-2c05f948.js";import"./index-f9445381.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-7024d485.js"),["assets/buildSupabaseQuery-7024d485.js","assets/index-a94f140f.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),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