Files
tehran_taj/apps/admin-panel/dist/assets/create-CDjMR2Q5.js
T
mahmoodandClaude Sonnet 5.5 5ddb225813 fix(ui): act-as strip no longer covers headers; customer type and slider permission
- apps: the fixed «در حال مشاهده به‌عنوان» strip (38px) sat over the fixed page
  headers, which still sat at top: 0 (the old 30px body padding was shorter than
  the strip too). The strip's height is now one variable, --aab-h, that the
  fixed headers (PageBar, home, dashboard, toasts) use as their top.
- admin: the customer form offers only «مغازه دار اپلیکیشن» to anyone but the
  super admin; bankers and walk-in shopkeepers are listed by super-admin-only
  endpoints, so ordinary admins lost the customers they created under them.
- admin: the mobile slider rid (custom.config.statics.slider) was only under the
  «سفارشی» branch, which the permission screen hides outside level 104. Same rid,
  now listed under «مدیریت ثابت ها». Display only: the slider routes are still
  gated by config.statics.

Rebuilds admin-panel, user-app and user-app-v2 dist.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-26 11:16:23 +03:30

2 lines
3.8 KiB
JavaScript

import{d as z,u as K,a,w as t,m as x,r as u,o as l,c as d,H as M,p as O,f,i as p,h as P,z as A,y as D,G as B,_ as E}from"./index-D8Sl1lAu.js";import{a as G,b as _,X as H}from"./model-qEyXFzcU.js";import"./filters-DgXlZ4wf.js";import"./index-DBCPuYKo.js";import"./SettingOutlined-BVtVPkyH.js";function I(){const r=new G("admin/misc/sms/list","لیست پیامک ها");return r.add(new _("id","شماره")),r.add(new _("text","متن پیامک").filterKey("body").filterText()),r.add(new _("mobile","گیرندگان").noSort()),r.add(new _("sent_count","تعداد").noSort()),r.add(new _("sender","ارسال کننده").noSort()),r.add(new _("caj","تاریخ").filterKey("createdAt").filterDate().noSort()),r}const $={class:"grid-2"},q=z({__name:"create",setup(r){const N=K(),c=y=>!!N.hasPermission(y),R=I(),g=x(null),k=x(!1),s=x(-1),m=x(""),b=x(""),o=A({});async function S(){var y,e,i;if(Object.keys(o).forEach(n=>delete o[n]),b.value||(o.text="متن پیامک الزامی است"),(s.value===-1||s.value===9)&&!m.value&&(o.mobile="شماره موبایل الزامی است"),!Object.keys(o).length)try{k.value=!0;const{data:n}=await D.post("sms",{type:s.value,mobile:m.value,text:b.value});B.success(`پیامک برای ${n.sentCount} شماره ثبت شد`),b.value="",m.value="",(y=g.value)==null||y.fetch()}catch(n){B.error(((i=(e=n==null?void 0:n.response)==null?void 0:e.data)==null?void 0:i.message)??"خطا در ارسال پیامک")}finally{k.value=!1}}return(y,e)=>{const i=u("a-select-option"),n=u("a-select"),w=u("a-form-item"),C=u("a-textarea"),T=u("a-input"),V=u("a-button"),X=u("a-form"),U=u("a-card"),j=u("a-spin");return l(),a(j,{spinning:k.value,class:"page-card"},{default:t(()=>[d(U,{title:"ارسال پیامک"},{default:t(()=>[d(X,{layout:"vertical",onSubmit:M(S,["prevent"])},{default:t(()=>[O("div",$,[d(w,{label:"ارسال برای"},{default:t(()=>[d(n,{value:s.value,"onUpdate:value":e[0]||(e[0]=v=>s.value=v)},{default:t(()=>[c("sms.create.single")?(l(),a(i,{key:0,value:-1},{default:t(()=>[...e[4]||(e[4]=[f(" شماره موبایل ",-1)])]),_:1})):p("",!0),c("sms.create.all")?(l(),a(i,{key:1,value:0},{default:t(()=>[...e[5]||(e[5]=[f(" همه مشتریان ",-1)])]),_:1})):p("",!0),c("sms.create.reagent")?(l(),a(i,{key:2,value:1},{default:t(()=>[...e[6]||(e[6]=[f(" کارشناسان فروش ",-1)])]),_:1})):p("",!0),c("sms.create.omde")?(l(),a(i,{key:3,value:2},{default:t(()=>[...e[7]||(e[7]=[f(" مشتریان عمده ",-1)])]),_:1})):p("",!0),c("sms.create.multiple")?(l(),a(i,{key:4,value:9},{default:t(()=>[...e[8]||(e[8]=[f(" شماره های موبایل ",-1)])]),_:1})):p("",!0)]),_:1},8,["value"])]),_:1}),s.value===-1||s.value===9?(l(),a(w,{key:0,label:s.value===9?"شماره های موبایل":"شماره موبایل","validate-status":o.mobile?"error":"",help:o.mobile},{default:t(()=>[s.value===9?(l(),a(C,{key:0,value:m.value,"onUpdate:value":e[1]||(e[1]=v=>m.value=v),"auto-size":{minRows:2,maxRows:6},placeholder:"هر شماره در یک خط"},null,8,["value"])):(l(),a(T,{key:1,value:m.value,"onUpdate:value":e[2]||(e[2]=v=>m.value=v)},null,8,["value"]))]),_:1},8,["label","validate-status","help"])):p("",!0)]),d(w,{label:"متن پیامک","validate-status":o.text?"error":"",help:o.text},{default:t(()=>[d(C,{value:b.value,"onUpdate:value":e[3]||(e[3]=v=>b.value=v),"auto-size":{minRows:4,maxRows:8}},null,8,["value"])]),_:1},8,["validate-status","help"]),d(V,{type:"primary",class:"form-submit",onClick:S},{default:t(()=>[...e[9]||(e[9]=[f("ارسال",-1)])]),_:1})]),_:1})]),_:1}),c("sms.list")?(l(),a(U,{key:0,title:"لیست پیامک ها",class:"mt-4"},{default:t(()=>[d(H,{ref_key:"tbl",ref:g,model:P(R),"mobile-cards":""},null,8,["model"])]),_:1})):p("",!0)]),_:1},8,["spinning"])}}}),Y=E(q,[["__scopeId","data-v-11fdeec9"]]);export{Y as default};