import{q as _}from"./qs-c5b6dbf2.js";import{C as v}from"./index-a11a1806.js";import{a as f}from"./element-plus-91d6d961.js";import{H as b,e as F,_ as h,i as w,ah as s,o as P,c as k,V as e,P as o,T as x,bh as A,bf as S,a as E}from"./@vue-6dabbe94.js";import{_ as I}from"./_plugin-vue_export-helper-c27b6911.js";import"./@intlify-ea47d1db.js";import"./source-map-7d7e1c08.js";import"./side-channel-394f276c.js";import"./get-intrinsic-bd2830fd.js";import"./has-symbols-e8f3ca0e.js";import"./has-proto-f7d0b240.js";import"./function-bind-22e7ee79.js";import"./has-26d28e02.js";import"./call-bind-e5c1c8b0.js";import"./object-inspect-8fd4bade.js";import"./index-a6ee13d3.js";import"./pinia-b6f74250.js";import"./vue-router-c1461dfc.js";import"./vue-i18n-b3581196.js";import"./vue-b1ba6f14.js";import"./js-cookie-edb2da2a.js";import"./@element-plus-64e6e14a.js";import"./nprogress-08a53ce8.js";import"./axios-4a70c6fc.js";import"./mitt-f7ef348c.js";import"./vue-grid-layout-ec2a62c3.js";import"./lodash-es-9851428c.js";import"./@vueuse-e129c873.js";import"./@popperjs-c75af06c.js";import"./@ctrl-f8748455.js";import"./dayjs-f6fdf7b4.js";import"./async-validator-dee29e8b.js";import"./memoize-one-297ddbcb.js";import"./escape-html-b8998962.js";import"./normalize-wheel-es-ed76fb12.js";import"./@floating-ui-880a26aa.js";const B=p=>(A("data-v-eeb15411"),p=p(),S(),p),N={class:"personal"},U=B(()=>E("div",{class:"personal-edit-title mb15"},"评论设置",-1)),j=b({name:"pageSet"}),q=b({...j,setup(p){const u=v(),c=F(),t=h({fit:"fill",ruleForm:{enablePageComment:!0,enablePageCommentAdminVerify:!1,enablePageCommentVerifyCode:!0},rules:{}}),y=()=>{c.value.validate(n=>{if(n){let r=_.stringify(t.ruleForm,{arrayFormat:"repeat"});u.saveConfig(r).then(()=>{f.success("保存成功")}).catch(a=>{f({showClose:!0,message:a.message?a.message:"系统错误",type:"error"})})}})};return w(()=>{let n=new Array;Object.keys(t.ruleForm).forEach(l=>{n.push(l)});let a=_.stringify({configKeys:n},{arrayFormat:"repeat"});u.getConfigList(a).then(l=>{l.data.forEach(m=>{t.ruleForm[m.key]=m.jsonValue})})}),(n,r)=>{const a=s("el-switch"),l=s("el-form-item"),m=s("el-col"),d=s("el-row"),g=s("el-button"),C=s("el-form"),V=s("el-card");return P(),k("div",N,[e(d,null,{default:o(()=>[e(m,{span:24},{default:o(()=>[e(V,{shadow:"hover"},{default:o(()=>[e(C,{model:t.ruleForm,rules:t.rules,ref_key:"myRefForm",ref:c,"label-width":"150px",class:"mt35 mb35"},{default:o(()=>[U,e(d,{gutter:35},{default:o(()=>[e(m,{class:"mb20"},{default:o(()=>[e(l,{label:"是否开启评论功能"},{default:o(()=>[e(a,{modelValue:t.ruleForm.enablePageComment,"onUpdate:modelValue":r[0]||(r[0]=i=>t.ruleForm.enablePageComment=i),"active-color":"#13ce66"},null,8,["modelValue"])]),_:1})]),_:1}),e(m,{class:"mb20"},{default:o(()=>[e(l,{label:"评论是否必须经过管理员审核"},{default:o(()=>[e(a,{modelValue:t.ruleForm.enablePageCommentAdminVerify,"onUpdate:modelValue":r[1]||(r[1]=i=>t.ruleForm.enablePageCommentAdminVerify=i),"active-color":"#13ce66"},null,8,["modelValue"])]),_:1})]),_:1}),e(m,{class:"mb20"},{default:o(()=>[e(l,{label:"启用评论验证码功能"},{default:o(()=>[e(a,{modelValue:t.ruleForm.enablePageCommentVerifyCode,"onUpdate:modelValue":r[2]||(r[2]=i=>t.ruleForm.enablePageCommentVerifyCode=i),"active-color":"#13ce66"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(m,null,{default:o(()=>[e(l,null,{default:o(()=>[e(g,{type:"primary",onClick:y,size:"default"},{default:o(()=>[x("保 存")]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1})]),_:1})]),_:1})])}}});const Ce=I(q,[["__scopeId","data-v-eeb15411"]]);export{Ce as default};
