
/**
 * 由 Fantastic-admin 提供技术支持
 * Powered by Fantastic-admin
 * Gitee  https://gitee.com/hooray/fantastic-admin
 * Github https://github.com/hooray/fantastic-admin
 */
  
import{_ as v}from"./index-7911c6db.js";import{a as f}from"./config-b4a9e7c0.js";import{d as M,Q as T,r as g,x as q,o as A,c as D,e,f as l,a as x,k as U,E as b,h as o,q as y}from"./index-4eef28ae.js";const h={class:"flex justify-between"},j=x("b",null,"分销系统基础设置",-1),E=M({__name:"base",setup(N){const a=T({salesBaseRatio:10,salesSeniorRatio:30,salesAllowDrawMoney:10,salesBaseTitle:"新秀分销商"}),w=g({salesBaseRatio:[{required:!0,trigger:"blur",message:"请填写默认佣金比例"}],salesSeniorRatio:[{required:!0,trigger:"blur",message:"请填写高级代理默认比例"}],salesBaseTitle:[{required:!0,trigger:"blur",message:"请填写默认用户推介等级名称"}]}),m=g();async function d(){const s=await f.queryConfig({keys:["salesBaseRatio","salesSeniorRatio","salesAllowDrawMoney","salesBaseTitle"]});Object.assign(a,s.data)}function V(){var s;(s=m.value)==null||s.validate(async t=>{if(t){try{await f.setConfig({settings:B(a)}),b.success("变更配置信息成功")}catch{}d()}else b.error("请填写完整信息")})}function B(s){return Object.keys(s).map(t=>({configKey:t,configVal:s[t]}))}return q(()=>{d()}),(s,t)=>{const c=o("el-alert"),R=v,C=o("el-button"),_=o("el-input-number"),r=o("el-form-item"),i=o("el-col"),u=o("el-row"),p=o("el-input"),S=o("el-form"),k=o("el-card");return A(),D("div",null,[e(R,null,{default:l(()=>[e(c,{closable:!1,"show-icon":"",title:"分销系统基础配置",description:"填写默认佣金比例和高级分销佣金比例会对应显示到客户端的分销页面、同时新用户将使用默认分销比例、允许提现额度限制用户最低提现金额、分销名称同样对应分销页面、高级代理可自定义名称！",type:"success"})]),_:1}),e(k,{style:{margin:"20px"}},{header:l(()=>[x("div",h,[j,e(C,{class:"button",text:"",onClick:V},{default:l(()=>[U(" 保存设置 ")]),_:1})])]),default:l(()=>[e(S,{ref_key:"formRef",ref:m,model:a,"label-width":"140px",rules:w.value},{default:l(()=>[e(u,null,{default:l(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"默认分销佣金比例",prop:"salesBaseRatio"},{default:l(()=>[e(_,{modelValue:a.salesBaseRatio,"onUpdate:modelValue":t[0]||(t[0]=n=>a.salesBaseRatio=n),max:100,min:0,step:5,"step-strictly":""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(u,null,{default:l(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"高级分销佣金比例",prop:"salesSeniorRatio"},{default:l(()=>[e(_,{modelValue:a.salesSeniorRatio,"onUpdate:modelValue":t[1]||(t[1]=n=>a.salesSeniorRatio=n),max:100,min:0,step:5,"step-strictly":""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(u,null,{default:l(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"允许最低提现金额",prop:"salesAllowDrawMoney"},{default:l(()=>[e(p,{modelValue:a.salesAllowDrawMoney,"onUpdate:modelValue":t[2]||(t[2]=n=>a.salesAllowDrawMoney=n),type:"number","step-strictly":""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(u,null,{default:l(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(r,{label:"默认等级分销名称",prop:"salesBaseTitle"},{default:l(()=>[e(p,{modelValue:a.salesBaseTitle,"onUpdate:modelValue":t[3]||(t[3]=n=>a.salesBaseTitle=n),placeholder:"请填写SecretKey",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1})])}}});typeof y=="function"&&y(E);export{E as default};
