Files
machartaa_admin_dist/dist/assets/index-e09477de.js
T

2 lines
11 KiB
JavaScript
Raw Normal View History

2026-07-16 18:05:28 +03:30
import{_ as Z}from"./BasicMainCard-39c71fc4.js";import{_ as ee}from"./BasicModal.vue_vue_type_style_index_0_lang-62717bd0.js";import{_ as te,u as ae}from"./useBaseTable-a06f0b5f.js";import{_ as ne}from"./button.vue_vue_type_style_index_0_lang-1a640d2e.js";import{I as B}from"./Icon-d2ec8cda.js";import{t as oe}from"./useDataTime-9ed06ff7.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-413b1e47.js";import{f as H,a as ce,b as de,c as fe,d as me,e as O}from"./supabaseTableQuery-9069679c.js";import{b as pe}from"./pushNotification-d063ae47.js";import{_ as _e}from"./TextPreview.vue_vue_type_script_setup_true_lang-1927e860.js";import{e as ve,g as he}from"./convert-2ad76038.js";import{M as z}from"./index-2ebbed2a.js";import{C as xe}from"./index-dfbe7e5c.js";import{I as ge}from"./index-06f6280e.js";import{T as q}from"./isSymbol-86ce36f2.js";import{U as ye}from"./index-ae4a1552.js";import"./index-74d36557.js";import"./index-59759ca5.js";import"./_plugin-vue_export-helper-45f37eb1.js";import"./useState-90ae9741.js";import"./vnode-66c98e4d.js";import"./useRefs-32d594a2.js";import"./_flatRest-c0f9ecce.js";import"./index-f54bdedf.js";import"./Col-151a5dc7.js";import"./styleChecker-51e38a61.js";import"./isPlainObject-e0f2efff.js";import"./index-2a1cc68a.js";import"./updateLocale-7edd5cff.js";import"./index-7af4b7ee.js";import"./toArray-4793eb05.js";import"./FormItemContext-faddafe7.js";import"./pickAttrs-40baade3.js";import"./lodash-a9e7f026.js";import"./BaseSwitch.vue_vue_type_script_setup_true_lang-5ce452ba.js";import"./index-ed8959d3.js";import"./isNumeric-3f69e2aa.js";import"./index-dd520fef.js";import"./index-d42da2d6.js";import"./textUtils-c37780ad.js";import"./DialogWrap-7069c158.js";import"./index-85f33ea5.js";import"./LeftOutlined-7f9e3805.js";import"./css-aae66f86.js";import"./index-2e29ac6c.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"