Files
machartaa_admin_dist/dist/assets/index-9881e0ed.js
T

2 lines
12 KiB
JavaScript
Raw Normal View History

2026-08-18 16:19:11 +03:30
import{_ as Z}from"./BasicMainCard-0ad7dc72.js";import{_ as ee}from"./BasicModal.vue_vue_type_style_index_0_lang-4b1d1ef5.js";import{_ as te,u as ae}from"./useBaseTable-f8894810.js";import{_ as ne}from"./button.vue_vue_type_style_index_0_lang-bc3a48f6.js";import{I as B}from"./Icon-767d2866.js";import{t as oe}from"./useDataTime-4be5c5cf.js";import{G as A,d as ie,g as k,A as se,o as T,i as le,w as d,a as f,b as u,e as L,c as D,j as C,H as re,k as N,y as ue,t as F,D as m}from"./index-24cdd011.js";import{fetchMatchingUserIds as H,applyEmbeddedUserSearch as ce,applySupabaseFilter as de,applySupabaseSort as me,applySupabasePagination as fe,formatTableResult as O}from"./supabaseTableQuery-8ab5665d.js";import{c as pe}from"./pushNotification-51c3065a.js";import{_ as _e}from"./TextPreview.vue_vue_type_script_setup_true_lang-630b180a.js";import{e as ve,g as he}from"./convert-2ad76038.js";import{M as z}from"./index-5eb1b262.js";import{C as xe}from"./index-39621559.js";import{I as ge}from"./index-942dc2ed.js";import{T as q}from"./isSymbol-e7ce9b5a.js";import{U as ye}from"./index-5477dee9.js";import"./Grid-ce03674d.js";import"./index-bcc6b780.js";import"./_plugin-vue_export-helper-06d65383.js";import"./shallowequal-59945f6f.js";import"./index-4057f476.js";import"./vnode-562ae89f.js";import"./index-fec9c5bc.js";import"./useState-bb6abd58.js";import"./useRefs-2bd76cbf.js";import"./_flatRest-28f96ed6.js";import"./isMobile-e2e89480.js";import"./omit-08db5ef5.js";import"./index-ef7f0d13.js";import"./Col-8ec8a751.js";import"./styleChecker-aeb3f501.js";import"./isPlainObject-25081d35.js";import"./index-d68d1b34.js";import"./updateLocale-58c30845.js";import"./index-cbf3fafb.js";import"./index-bc659f42.js";import"./useMemo-5fb6706d.js";import"./FormItemContext-a07e1be1.js";import"./lodash-3126ec34.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-5acaa0f7.js";import"./index-3078e65c.js";import"./Badge-aa4916ac.js";import"./isNumeric-3f69e2aa.js";import"./index-38d9344c.js";import"./index-0ceac0d6.js";import"./toArray-e3c28da8.js";import"./SearchOutlined-3570b8ac.js";import"./pickAttrs-64381c06.js";import"./index-559e3814.js";import"./textUtils-c37780ad.js";import"./DialogWrap-4e2453b1.js";import"./index-093e137a.js";import"./css-aae66f86.js";import"./index-3867b2dc.js";import"./index-9df579ce.js";const we=[{title:"ردیف",dataIndex:"id",key:"id",filterable:!1,width:70,align:"center",customRender:e=>e.record.index+1},{title:"نام ارسال کننده",dataIndex:"owner_name",key:"owner_name",filterField:"owner_name",customRender:e=>e.record.owner_name||"-"},{title:"متن پیام",dataIndex:"text",key:"text",slot:"text"},{title:"فایل",dataIndex:"file",key:"file",align:"center",width:120,slot:"file"},{title:"وضعیت پین",dataIndex:"pined",key:"pined",align:"center",width:100,customRender:e=>e.record.pined?"پین شده":"-"},{title:"زمان ایجاد",dataIndex:"created_at",key:"created_at",customRender:e=>oe(e.record.created_at)},{title:"عملیات",dataIndex:"action",key:"action",slot:"action",filterable:!1,align:"center"}],ke=new Set(["text","file","pined","pined_at","created_at","updated_at","owner_id"]),be=["text"];async function Ie(e){const{data:o,error:v}=await A.from("channel_message").insert([e]).select();if(v)throw v;return o}async function G(e,o){const{data:v,error:b}=await A.from("channel_message").update(o).eq("id",e).select();if(b)throw b;return v}async function Se(e){const{error:o}=await A.from("channel_message").delete().eq("id",e);if(o)throw o}function Ce(e){let o=null;if(e.owner_id){const v=Array.isArray(e.users)?e.users[0]:e.users;v?o=`${v.first_name||""} ${v.last_name||""}`.trim()||v.phone||`کاربر ${e.owner_id}`:o=`کاربر ${e.owner_id}`}return{...e,owner_name:o,text:e.text??"",file:e.file??null,pined:e.pined??!1,pined_at:e.pined_at??null,created_at:e.created_at??"",updated_at:e.updated_at??""}}async function Me(e){const o={...e};!o.sort&&!o.order&&(o.order="-id");const{limit:v=20,page:b=1,search:S,filters:g}=o;let i=A.from("channel_message").select("*, users!owner_id(first_name, last_na