2026-08-17 13:34:14 +03:30
|
|
|
import{_ as Z}from"./BasicMainCard-a49bf313.js";import{_ as ee}from"./BasicModal.vue_vue_type_style_index_0_lang-050248e0.js";import{_ as te,u as ae}from"./useBaseTable-a962a6e3.js";import{_ as ne}from"./button.vue_vue_type_style_index_0_lang-cf170adf.js";import{I as B}from"./Icon-21c28098.js";import{t as oe}from"./useDataTime-64353302.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-e0c2af95.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-8ba0eed7.js";import{_ as _e}from"./TextPreview.vue_vue_type_script_setup_true_lang-c64dd012.js";import{e as ve,g as he}from"./convert-2ad76038.js";import{M as z}from"./index-ba1a268c.js";import{C as xe}from"./index-777eb3d4.js";import{I as ge}from"./index-ff6425ec.js";import{T as q}from"./isSymbol-16519357.js";import{U as ye}from"./index-75e285c0.js";import"./Grid-6f435e3e.js";import"./index-2170cfa5.js";import"./_plugin-vue_export-helper-ede5981c.js";import"./shallowequal-94cf06f1.js";import"./index-329abdc2.js";import"./vnode-1d9a5f19.js";import"./index-77288b74.js";import"./useState-9f37179f.js";import"./useRefs-f2d2b66f.js";import"./_flatRest-7f56bd12.js";import"./isMobile-e2e89480.js";import"./omit-ef5483a7.js";import"./index-d7731afc.js";import"./Col-f312538f.js";import"./styleChecker-fa192349.js";import"./isPlainObject-475d5f63.js";import"./index-55df0a19.js";import"./updateLocale-ddc4d420.js";import"./index-ccf41683.js";import"./index-bc659f42.js";import"./useMemo-8582dbbb.js";import"./FormItemContext-31ef74d8.js";import"./lodash-7e5e5813.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-751e37cd.js";import"./index-3be03c15.js";import"./Badge-0df70937.js";import"./isNumeric-3f69e2aa.js";import"./index-beff19b5.js";import"./index-71bd3b00.js";import"./toArray-590d8ecb.js";import"./SearchOutlined-9dbd40a5.js";import"./pickAttrs-e6a1c834.js";import"./index-f062f0ac.js";import"./index-4a6bfbb1.js";import"./textUtils-c37780ad.js";import"./DialogWrap-3bd23522.js";import"./index-89e8edb2.js";import"./css-aae66f86.js";import"./index-3f95615f.js";import"./index-fdf98d11.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!
|