Files
machartaa_admin_dist/dist/assets/index-82a2d208.js
T

2 lines
12 KiB
JavaScript
Raw Normal View History

2026-08-15 13:12:23 +03:30
import{_ as Z}from"./BasicMainCard-f046b61e.js";import{_ as ee}from"./BasicModal.vue_vue_type_style_index_0_lang-83760d3e.js";import{_ as te,u as ae}from"./useBaseTable-55ad5e52.js";import{_ as ne}from"./button.vue_vue_type_style_index_0_lang-bd596a6a.js";import{I as B}from"./Icon-d887a0f8.js";import{t as oe}from"./useDataTime-7241b1ee.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-885a0812.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{b as pe}from"./pushNotification-dea1f429.js";import{_ as _e}from"./TextPreview.vue_vue_type_script_setup_true_lang-60928929.js";import{e as ve,g as he}from"./convert-2ad76038.js";import{M as z}from"./index-9b411a61.js";import{C as xe}from"./index-22f9b99f.js";import{I as ge}from"./index-2ed626d8.js";import{T as q}from"./isSymbol-7a58081d.js";import{U as ye}from"./index-52ff6627.js";import"./Grid-a6ca9fb5.js";import"./index-667a03eb.js";import"./_plugin-vue_export-helper-b63d6b5b.js";import"./index-49e4db02.js";import"./vnode-70560f26.js";import"./index-7b5ec00b.js";import"./useState-90bb98a8.js";import"./useRefs-d4aed6f9.js";import"./_flatRest-0a2f05bf.js";import"./isMobile-e2e89480.js";import"./index-11c04e4f.js";import"./Col-46619619.js";import"./styleChecker-d1351987.js";import"./isPlainObject-6f4a3c75.js";import"./index-d4e74b97.js";import"./updateLocale-d7121807.js";import"./index-675e28c4.js";import"./useMemo-565770c1.js";import"./FormItemContext-9dda29cf.js";import"./lodash-3b12211b.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-a6c897ab.js";import"./index-32515dee.js";import"./Badge-1926c75c.js";import"./isNumeric-3f69e2aa.js";import"./index-572a9242.js";import"./index-89e03fc4.js";import"./toArray-64a01f73.js";import"./SearchOutlined-c7e22afc.js";import"./pickAttrs-bb97af78.js";import"./index-6c7f8dff.js";import"./textUtils-c37780ad.js";import"./DialogWrap-bea4ac16.js";import"./index-2c072252.js";import"./css-aae66f86.js";import"./index-8eeb3ce3.js";import"./index-8480e7e5.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_name, phone)",{count:"exact"});if(S!=null&&S.trim()){const p=await H(A,S);i=ce(i,S,be,p,"own