2026-08-18 15:43:27 +03:30
|
|
|
import{_ as Z}from"./BasicMainCard-8da61c91.js";import{_ as ee}from"./BasicModal.vue_vue_type_style_index_0_lang-dce46cd2.js";import{_ as te,u as ae}from"./useBaseTable-a305524f.js";import{_ as ne}from"./button.vue_vue_type_style_index_0_lang-ae7cb173.js";import{I as B}from"./Icon-2a751d73.js";import{t as oe}from"./useDataTime-0e280561.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-64bb19a3.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-092715d8.js";import{_ as _e}from"./TextPreview.vue_vue_type_script_setup_true_lang-5d44ac6c.js";import{e as ve,g as he}from"./convert-2ad76038.js";import{M as z}from"./index-557a2985.js";import{C as xe}from"./index-a5e6bc16.js";import{I as ge}from"./index-6f7ee4ee.js";import{T as q}from"./isSymbol-77db9868.js";import{U as ye}from"./index-96a522ed.js";import"./Grid-d205a4b4.js";import"./index-fe1cc383.js";import"./_plugin-vue_export-helper-47756888.js";import"./shallowequal-a3fa20ee.js";import"./index-95a0af99.js";import"./vnode-a1a3bc0f.js";import"./index-b5f90115.js";import"./useState-45a66864.js";import"./useRefs-10844536.js";import"./_flatRest-6bd9fe69.js";import"./isMobile-e2e89480.js";import"./omit-41b1cee4.js";import"./index-53278d29.js";import"./Col-4cc66d2b.js";import"./styleChecker-44a60ba7.js";import"./isPlainObject-908a4d4b.js";import"./index-d19de556.js";import"./updateLocale-34973999.js";import"./index-7a73a23b.js";import"./index-bc659f42.js";import"./useMemo-fddb4a7a.js";import"./FormItemContext-78515ae9.js";import"./lodash-17ce3880.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-6148f843.js";import"./index-304c1b28.js";import"./Badge-6baddd17.js";import"./isNumeric-3f69e2aa.js";import"./index-2a5be533.js";import"./index-ff7b0bbe.js";import"./toArray-156bc105.js";import"./SearchOutlined-5a638563.js";import"./pickAttrs-ff8c51c6.js";import"./index-d5b53aee.js";import"./textUtils-c37780ad.js";import"./DialogWrap-c12b3672.js";import"./index-4ee722bc.js";import"./css-aae66f86.js";import"./index-43d38a3b.js";import"./index-6fd9e35d.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
|