
/**
 * 由 Fantastic-admin 提供技术支持
 * Powered by Fantastic-admin
 * Gitee  https://gitee.com/hooray/fantastic-admin
 * Github https://github.com/hooray/fantastic-admin
 */
  
import{_ as h}from"./index-7911c6db.js";import{a as f}from"./config-b4a9e7c0.js";import{d as k,Q as q,r as p,x as J,o as U,c as j,e,f as l,a as b,k as B,E as v,h as n,q as g}from"./index-4eef28ae.js";const E={class:"flex justify-between"},O=b("b",null,"访客模式设置",-1),R=k({__name:"visitor",setup(A){const t=q({visitorModel3Num:null,visitorModel4Num:null,visitorMJNum:null}),N=p({visitorModel3Num:[{required:!0,trigger:"blur",message:"请填写每日限制的基础模型积分"}],visitorModel4Num:[{required:!0,trigger:"blur",message:"请填写每日限制的高级模型积分"}],visitorMJNum:[{required:!0,trigger:"blur",message:"请填写每日限制的绘画额度积分"}]}),d=p();async function c(){const r=await f.queryConfig({keys:["visitorModel4Num","visitorModel3Num","visitorMJNum"]});Object.assign(t,r.data)}function M(){var r;(r=d.value)==null||r.validate(async o=>{if(o){try{await f.setConfig({settings:x(t)}),v.success("变更配置信息成功")}catch{}c()}else v.error("请填写完整信息")})}function x(r){return Object.keys(r).map(o=>({configKey:o,configVal:r[o]}))}return J(()=>{c()}),(r,o)=>{const _=n("el-alert"),y=h,V=n("el-button"),a=n("el-input"),u=n("el-form-item"),i=n("el-col"),m=n("el-row"),w=n("el-form"),C=n("el-card");return U(),j("div",null,[e(y,null,{default:l(()=>[e(_,{closable:!1,"show-icon":"",title:"访客模式设置",description:"设置为每日访客限制的访问积分额度、每日凌晨0点刷新新的额度！",type:"success"})]),_:1}),e(C,{style:{margin:"20px"}},{header:l(()=>[b("div",E,[O,e(V,{class:"button",text:"",onClick:M},{default:l(()=>[B(" 保存设置 ")]),_:1})])]),default:l(()=>[e(w,{ref_key:"formRef",ref:d,rules:N.value,model:t,"label-width":"130px"},{default:l(()=>[e(m,null,{default:l(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(u,{label:"基础模型额度",prop:"visitorModel3Num"},{default:l(()=>[e(a,{modelValue:t.visitorModel3Num,"onUpdate:modelValue":o[0]||(o[0]=s=>t.visitorModel3Num=s),type:"number",placeholder:"请填写每日限制基础模型积分",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(m,null,{default:l(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(u,{label:"高级模型额度",prop:"visitorModel4Num"},{default:l(()=>[e(a,{modelValue:t.visitorModel4Num,"onUpdate:modelValue":o[1]||(o[1]=s=>t.visitorModel4Num=s),type:"number",placeholder:"请填写每日限制的高级模型积分",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(m,null,{default:l(()=>[e(i,{xs:24,md:20,lg:15,xl:12},{default:l(()=>[e(u,{label:"绘画积分额度",prop:"visitorMJNum"},{default:l(()=>[e(a,{modelValue:t.visitorMJNum,"onUpdate:modelValue":o[2]||(o[2]=s=>t.visitorMJNum=s),type:"number",placeholder:"请填写每日限制的绘画额度积分",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["rules","model"])]),_:1})])}}});typeof g=="function"&&g(R);export{R as default};
