import{g as v,e as w}from"./config-6561e667.js";import{M as m,R as y,F as x,I as C,h as U,B as k,S as R,e as B,b as F}from"./ui-ba7aaa7e.js";import{e as I,l as M,P as N,a3 as S,a4 as o,f as e,H as u}from"./vue-bf422dc1.js";import"./index-c2dd6a24.js";import"./libs-51817cd7.js";import"./plugins-ca970193.js";import"./others-9f318174.js";import"./echarts-bf9d612c.js";import"./icons-a8498fb6.js";const T=I({__name:"index",setup(O){const a=M({spread_invite_code:"",is_need_invite_code:"",invite_code_get_url:"",spread_reward:"",spread_reward_money:"",spread_rebate_rate:""});(async()=>{const{data:r}=await v({field:Object.keys(a)});for(const t in r)a[t]=r[t]})();const p={site_domain:[{required:!0,message:"请输入主站域名"}]},c=async()=>{const r=await w({data:a});r.code===1?m.success("操作成功"):m.error(r.msg)},d=[{label:"开启",value:1},{label:"关闭",value:0}];return(r,t)=>{const s=y,n=x,f=C,_=U,i=k,b=R,V=B,g=F;return N(),S(g,{title:"推广设置",class:"basic-container",bordered:!1},{default:o(()=>[e(V,{ref:"formRef","label-align":"left",data:a,rules:p,"label-width":300},{default:o(()=>[e(n,{label:"邀请码模式",name:"spread_invite_code",tips:""},{default:o(()=>[e(s,{modelValue:a.spread_invite_code,"onUpdate:modelValue":t[0]||(t[0]=l=>a.spread_invite_code=l),options:d},null,8,["modelValue"])]),_:1}),e(n,{label:"邀请码必填",name:"is_need_invite_code",tips:""},{default:o(()=>[e(s,{modelValue:a.is_need_invite_code,"onUpdate:modelValue":t[1]||(t[1]=l=>a.is_need_invite_code=l),options:d},null,8,["modelValue"])]),_:1}),e(n,{label:"邀请码获取（购买）链接",name:"invite_code_get_url",tips:"邀请码模式开启且不为空，注册的时候会显示"},{default:o(()=>[e(f,{modelValue:a.invite_code_get_url,"onUpdate:modelValue":t[2]||(t[2]=l=>a.invite_code_get_url=l),clearable:"",placeholder:"请输入链接"},null,8,["modelValue"])]),_:1}),e(n,{label:"邀请注册奖励",name:"spread_reward",tips:"邀请注册奖励，0表示不奖励"},{default:o(()=>[e(s,{modelValue:a.spread_reward,"onUpdate:modelValue":t[3]||(t[3]=l=>a.spread_reward=l),options:d},null,8,["modelValue"])]),_:1}),e(n,{label:"邀请注册奖励金额",name:"spread_reward_money",tips:"邀请注册奖励金额，0表示不奖励"},{default:o(()=>[e(_,{modelValue:a.spread_reward_money,"onUpdate:modelValue":t[4]||(t[4]=l=>a.spread_reward_money=l),theme:"normal",min:0,clearable:"",placeholder:"请输入邀请注册奖励金额",suffix:"元"},null,8,["modelValue"])]),_:1}),e(n,{label:"推广返佣比例",name:"spread_rebate_rate",tips:"推广返佣比例，0表示不返佣"},{default:o(()=>[e(_,{modelValue:a.spread_rebate_rate,"onUpdate:modelValue":t[5]||(t[5]=l=>a.spread_rebate_rate=l),theme:"normal",min:0,max:100,clearable:"",placeholder:"请输入推广返佣比例",suffix:"%"},null,8,["modelValue"])]),_:1}),e(n,null,{default:o(()=>[e(b,{size:"small"},{default:o(()=>[e(i,{theme:"primary",onClick:c},{default:o(()=>[u("提交")]),_:1}),e(i,{theme:"default",variant:"base",type:"reset"},{default:o(()=>[u("重置")]),_:1})]),_:1})]),_:1})]),_:1},8,["data"])]),_:1})}}});export{T as default};
