Files
machartaa_admin_dist/dist/assets/index-9289d831.js
T

2 lines
11 KiB
JavaScript
Raw Normal View History

2026-07-26 16:24:36 +03:30
import{_ as Z}from"./BasicMainCard-1361ed38.js";import{_ as ee}from"./BasicModal.vue_vue_type_style_index_0_lang-acac591d.js";import{_ as te,u as ae}from"./useBaseTable-c2761680.js";import{_ as ne}from"./button.vue_vue_type_style_index_0_lang-c37c204f.js";import{I as B}from"./Icon-6b61a044.js";import{t as oe}from"./useDataTime-f3f5ea50.js";import{G as A,d as se,g as b,A as ie,o as T,i as le,w as d,a as m,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 f}from"./index-4dccb174.js";import{f as H,a as ce,b as de,c as fe,d as me,e as O}from"./supabaseTableQuery-95762ff3.js";import{b as pe}from"./pushNotification-929122f6.js";import{_ as _e}from"./TextPreview.vue_vue_type_script_setup_true_lang-243a4d0d.js";import{e as ve,g as he}from"./convert-2ad76038.js";import{M as z}from"./index-a34bba22.js";import{C as xe}from"./index-8f783c3c.js";import{I as ge}from"./index-4762b7d8.js";import{T as q}from"./isSymbol-80c521a5.js";import{U as ye}from"./index-bd458d30.js";import"./index-6f4a8a6b.js";import"./index-7a876d00.js";import"./_plugin-vue_export-helper-fc650ede.js";import"./useState-7760581d.js";import"./vnode-8e0d49aa.js";import"./useRefs-b5c660b2.js";import"./_flatRest-00780a2d.js";import"./index-7ce2783e.js";import"./Col-c87d3a9d.js";import"./styleChecker-133e2b1a.js";import"./isPlainObject-819f93b0.js";import"./index-f08752bf.js";import"./updateLocale-72f02bbd.js";import"./index-c7f692d2.js";import"./toArray-8c6d8405.js";import"./FormItemContext-d26e27b7.js";import"./pickAttrs-13d22210.js";import"./lodash-0f8911c3.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-c92640b4.js";import"./index-895cd0d7.js";import"./isNumeric-3f69e2aa.js";import"./index-00d83bfc.js";import"./index-6a54d8cb.js";import"./textUtils-c37780ad.js";import"./DialogWrap-715ad625.js";import"./index-ce6d92ba.js";import"./LeftOutlined-2d8ca514.js";import"./css-aae66f86.js";import"./index-495b789b.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"}],be=new Set(["text","file","pined","pined_at","created_at","updated_at","owner_id"]),ke=["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:k}=await A.from("channel_message").update(o).eq("id",e).select();if(k)throw k;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:k=1,search:S,filters:g}=o;let s=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);s=ce(s,S,ke,p,"owner_id")}if(g!=null&&g.length){for(const p of g)if(!(p.hidden||!p.field)){if(p.field==="owner_name"){if(["eq","has","like"].includes(p.op)){const h=await H(A,String(p.value));h.length?s=s.in("owner_id",h):s=s.eq("owner_id","00000000-0000-0000-0000-000000000000")}continue}be.has(p.field)&&(s=de(s,p))}}s=fe(s,o,"-id"