Files

2 lines
6.2 KiB
JavaScript
Raw Permalink Normal View History

import{t as C}from"./farsi-number-stB7JMN0.js";import{b as l,I as F,d as P,l as T,c as d,a as _,w as i,h as S,n as M,r as m,g as U,o,f as b,e as y,R as V,S as j,t as k,F as I,y as E,H as $,x as Q,B as H,_ as q}from"./index-BOpodV_K.js";var G={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M758.2 839.1C851.8 765.9 912 651.9 912 523.9 912 303 733.5 124.3 512.6 124 291.4 123.7 112 302.8 112 523.9c0 125.2 57.5 236.9 147.6 310.2 3.5 2.8 8.6 2.2 11.4-1.3l39.4-50.5c2.7-3.4 2.1-8.3-1.2-11.1-8.1-6.6-15.9-13.7-23.4-21.2a318.64 318.64 0 01-68.6-101.7C200.4 609 192 567.1 192 523.9s8.4-85.1 25.1-124.5c16.1-38.1 39.2-72.3 68.6-101.7 29.4-29.4 63.6-52.5 101.7-68.6C426.9 212.4 468.8 204 512 204s85.1 8.4 124.5 25.1c38.1 16.1 72.3 39.2 101.7 68.6 29.4 29.4 52.5 63.6 68.6 101.7 16.7 39.4 25.1 81.3 25.1 124.5s-8.4 85.1-25.1 124.5a318.64 318.64 0 01-68.6 101.7c-9.3 9.3-19.1 18-29.3 26L668.2 724a8 8 0 00-14.1 3l-39.6 162.2c-1.2 5 2.6 9.9 7.7 9.9l167 .8c6.7 0 10.5-7.7 6.3-12.9l-37.3-47.9z"}}]},name:"redo",theme:"outlined"};function A(c){for(var a=1;a<arguments.length;a++){var n=arguments[a]!=null?Object(arguments[a]):{},p=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(p=p.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),p.forEach(function(t){J(c,t,n[t])})}return c}function J(c,a,n){return a in c?Object.defineProperty(c,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):c[a]=n,c}var O=function(a,n){var p=A({},a,n.attrs);return l(F,A({},p,{icon:G}),null)};O.displayName="RedoOutlined";O.inheritAttrs=!1;const W={class:"sms-log-page"},X={class:"page-header-title"},Y={class:"table-header"},Z={class:"filters"},K={key:0,class:"num-cell"},ee={key:0,class:"code-badge"},te={key:1,class:"text-muted"},ae={key:0,class:"text-danger"},se={key:1,class:"text-muted"},oe={key:4,class:"date-cell"},le={key:1,class:"text-muted"},ne=P({__name:"SmsLogListView",setup(c){const a=S(!1),n=S([]),p=S(0),t=U({page:1,pageSize:10,mobile:"",status:void 0});async function f(){var g,e,v,x;a.value=!0;try{const u=await M.get("/admin/sms-logs",{params:{page:t.page,pageSize:t.pageSize,mobile:t.mobile||void 0,status:t.status||void 0}}),h=Array.isArray(u.data)?u.data:((g=u.data)==null?void 0:g.data)||[];n.value=h,p.value=((e=u.meta)==null?void 0:e.total)||((x=(v=u.data)==null?void 0:v.meta)==null?void 0:x.total)||h.length}finally{a.value=!1}}async function L(g){try{await M.post(`/admin/sms-logs/${g}/resend`),H.success("پیامک مجدداً در صف ارسال قرار گرفت."),f()}catch{}}const z=[{title:"شماره همراه",dataIndex:"mobile",key:"mobile",width:140},{title:"متن پیامک",dataIndex:"message",key:"message"},{title:"سرویس‌دهنده",dataIndex:"provider",key:"provider",width:120},{title:"شناسه پیامک",dataIndex:"providerMessageId",key:"providerMessageId",width:150},{title:"وضعیت",dataIndex:"status",key:"status",width:130,align:"center"},{title:"خطا",dataIndex:"errorMessage",key:"errorMessage",ellipsis:!0},{title:"زمان ثبت",dataIndex:"createdAt",key:"createdAt",width:160},{title:"عملیات",key:"actions",width:70,align:"center"}];function w(g){switch(g){case"SENT":return{text:"ارسال شد",color:"green",dotColor:"#10b981"};case"QUEUED":return{text:"در صف ارسال",color:"orange",dotColor:"#f59e0b"};case"FAILED":return{text:"خطا در ارسال",color:"red",dotColor:"#ef4444"};default:return{text:g,color:"default",dotColor:"#94a3b8"}}}return T(()=>{f()}),(g,e)=>{const v=m("a-button"),x=m("a-input-search"),u=m("a-select-option"),h=m("a-select"),D=m("a-tag"),N=m("a-tooltip"),R=m("a-table"),B=m("a-card");return o(),d("div",W,[_("div",X,[e[5]||(e[5]=_("div",null,[_("h1",{class:"title"},"لاگ‌های پیامک"),_("p",{class:"subtitle"},"تاریخچه ارسال پیامک‌های رمز یکبار مصرف (OTP) و اطلاع‌رسانی جوایز")],-1)),l(v,{onClick:f,loading:a.value},{icon:i(()=>[l(y(V))]),default:i(()=>[e[4]||(e[4]=b(" به‌روزرسانی ",-1)