import{_ as a,r as e,b as t,cK as d,d as l,e as o,f as s,h as r,w as i,g as m,j as p,k as u,i as n,n as c,E as f,q as v,t as b,v as j}from"./index.286e9b79.js";import{v as _}from"./loading.c49775a6.js";import{E as h,a as V}from"./form.ad10dcd5.js";import{E as x,a as g}from"./tab-pane.1cc0f769.js";import{E as w}from"./switch.197584d0.js";import"./form-item.9355e6dc.js";import{E}from"./input.31de1b37.js";import{_ as y}from"./page-header.29890ed0.js";import{g as U,p as k}from"./http.f588794f.js";import"./_initCloneObject.fb8fbaea.js";import"./strings.8c60bfae.js";import"./event.776e7e11.js";import"./validator.18338d56.js";import"./index.ed3ed02e.js";import"./divider.948c4b18.js";const q=a=>(b("data-v-ae67d57b"),a=a(),j(),a),C={class:"editor-card"},M={class:"editor-card-box"},F=q((()=>r("div",{class:"form-item-tips"},"赠送的积分在用户注册成功后直接转入积分余额",-1))),I=q((()=>r("div",{class:"form-item-tips"},"赠送的金额在用户注册成功后直接转入余额",-1))),K={class:"tool"},O={class:"tool-box"},R=a({__name:"index",setup(a){let b=e(!1),j=e(!1),q=e("0"),R=e(),z=t({data:{point:"0",price:"0",status:1}});const A=t({});j.value=!0,U("promotion.award/index").then((a=>{j.value=!1,a.code&&!d(a.data)&&(z.data=a.data)}));const B=async()=>{R.value&&await R.value.validate(((a,e)=>{j.value=!1,a?(j.value=!0,k("promotion.award/index",z.data).then((a=>{j.value=!1,a.code?f.success("操作成功"):f.error(a.msg)})).catch((a=>{f.error(a)}))):f.error("请完善内容")}))};return(a,e)=>{const t=y,d=E,f=h,U=w,k=x,D=g,G=V,H=v,J=_;return l(),o("div",null,[s(t,{title:"奖励设置"}),r("div",C,[i((l(),p(G,{model:m(z).data,rules:m(A),ref_key:"ruleFormRef",ref:R},{default:u((()=>[r("div",M,[s(D,{modelValue:m(q),"onUpdate:modelValue":e[3]||(e[3]=a=>n(q)?q.value=a:q=a)},{default:u((()=>[s(k,{label:"基本信息",name:"0"},{default:u((()=>[s(f,{label:"赠送积分",prop:"point","label-width":"100px"},{default:u((()=>[s(d,{modelValue:m(z).data.point,"onUpdate:modelValue":e[0]||(e[0]=a=>m(z).data.point=a),modelModifiers:{number:!0},placeholder:"请输入赠送积分"},null,8,["modelValue"]),F])),_:1}),s(f,{label:"赠送金额",prop:"price","label-width":"100px"},{default:u((()=>[s(d,{modelValue:m(z).data.price,"onUpdate:modelValue":e[1]||(e[1]=a=>m(z).data.price=a),modelModifiers:{number:!0},placeholder:"请输入赠送金额"},null,8,["modelValue"]),I])),_:1}),s(f,{label:"状态",required:!0,"label-width":"100px"},{default:u((()=>[s(U,{modelValue:m(z).data.status,"onUpdate:modelValue":e[2]||(e[2]=a=>m(z).data.status=a),"active-value":1,"inactive-value":0},null,8,["modelValue"])])),_:1})])),_:1})])),_:1},8,["modelValue"])])])),_:1},8,["model","rules"])),[[J,m(b)]])]),r("div",K,[r("div",O,[s(H,{type:"primary",loading:m(j),onClick:B},{default:u((()=>[c("保存")])),_:1},8,["loading"])])])])}}},[["__scopeId","data-v-ae67d57b"]]);export{R as default};
