Files
tehran_taj/apps/admin-panel/dist/assets/autopromotion-Dz4BQXWR.js
T
mahmoodandCursor e51a068039 chore: include full admin-panel dist assets for Dokploy copy-only deploy
index.html was already in git pointing at hashed bundles, but the assets folder was missing from the image so nginx 404ed every JS/CSS request.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-16 12:10:55 +03:30

2 lines
2.1 KiB
JavaScript

import{d as w,v as x,x as _,f as B,g as r,A as C,r as m,y as f,e as o,o as N,c as s,h as V,l as z,z as v}from"./index-uaIxISOz.js";const M={class:"grid-3"},j=w({__name:"autopromotion",setup(S){const u=m(!1),l=m(!1),c=f({discount_percent:void 0}),i=f({});async function d(){var t,e;if(Object.keys(i).forEach(a=>delete i[a]),c.discount_percent===void 0||c.discount_percent===null){i.discount_percent="وارد کردن درصد تخفیف اتوماتیک الزامی است";return}try{u.value=!0,await _.post("autopromotion",{state:l.value,discount_percent:c.discount_percent}),v.success("اطلاعات با موفقیت به ثبت رسید.")}catch(a){v.error(((e=(t=a==null?void 0:a.response)==null?void 0:t.data)==null?void 0:e.message)??"خطا در ثبت اطلاعات.")}finally{u.value=!1}}return x(async()=>{try{const{data:t}=await _.get("autopromotion");l.value=!!t.state,c.discount_percent=t.discount_percent??void 0}catch(t){console.log(t)}}),(t,e)=>{const a=o("a-switch"),p=o("a-form-item"),b=o("a-input-number"),h=o("a-card"),y=o("a-spin"),g=o("a-button"),k=o("a-form");return N(),B(k,{layout:"vertical",onSubmit:C(d,["prevent"])},{default:r(()=>[s(y,{spinning:u.value},{default:r(()=>[s(h,{title:"تخفیف اتوماتیک یکبار مصرف ویژه مشتریان جدید",class:"mb-base"},{default:r(()=>[V("div",M,[s(p,{label:"وضعیت تخفیف اتوماتیک"},{default:r(()=>[s(a,{checked:l.value,"onUpdate:checked":e[0]||(e[0]=n=>l.value=n),size:"default"},null,8,["checked"])]),_:1}),s(p,{label:"درصد تخفیف اتوماتیک روی محصولات","validate-status":i.discount_percent?"error":"",help:i.discount_percent},{default:r(()=>[s(b,{value:c.discount_percent,"onUpdate:value":e[1]||(e[1]=n=>c.discount_percent=n),dir:"ltr",min:0,max:100,formatter:n=>`${n}%`,parser:n=>n.replace("%",""),style:{width:"100%"}},null,8,["value","formatter","parser"])]),_:1},8,["validate-status","help"])])]),_:1})]),_:1},8,["spinning"]),s(g,{type:"primary",class:"mr-4",onClick:d},{default:r(()=>[...e[2]||(e[2]=[z("ثبت اطلاعات",-1)])]),_:1})]),_:1})}}});export{j as default};