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 y,e as A,_ as F,i as g,ah as s,o as w,c as k,V as e,P as o,T as x,bh as S,bf as E,a as I}from"./@vue-6dabbe94.js";import{_ as B}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 N=c=>(S("data-v-202dc45c"),c=c(),E(),c),U={class:"personal"},j=N(()=>I("div",{class:"personal-edit-title mb15"},"评论设置",-1)),q=y({name:"attachSet"}),K=y({...q,setup(c){const p=A(),u=v(),t=F({fit:"fill",ruleForm:{enableArticleComment:!0,enableArticleCommentAdminVerify:!1,enableArticleCommentVerifyCode:!0},rules:{}}),b=()=>{p.value.validate(i=>{if(i){let r=_.stringify(t.ruleForm,{arrayFormat:"repeat"});u.saveConfig(r).then(()=>{f.success("保存成功")}).catch(l=>{f({showClose:!0,message:l.message?l.message:"系统错误",type:"error"})})}})};return g(()=>{let i=new Array;Object.keys(t.ruleForm).forEach(m=>{i.push(m)});let l=_.stringify({configKeys:i},{arrayFormat:"repeat"});u.getConfigList(l).then(m=>{m.data.forEach(a=>{t.ruleForm[a.key]=a.jsonValue})})}),(i,r)=>{const l=s("el-switch"),m=s("el-form-item"),a=s("el-col"),d=s("el-row"),C=s("el-button"),V=s("el-form"),h=s("el-card");return w(),k("div",U,[e(d,null,{default:o(()=>[e(a,{span:24},{default:o(()=>[e(h,{shadow:"hover"},{default:o(()=>[e(V,{model:t.ruleForm,rules:t.rules,ref_key:"myRefForm",ref:p,"label-width":"150px",class:"mt35 mb35"},{default:o(()=>[j,e(d,{gutter:35},{default:o(()=>[e(a,{class:"mb20"},{default:o(()=>[e(m,{label:"是否开启评论功能"},{default:o(()=>[e(l,{modelValue:t.ruleForm.enableArticleComment,"onUpdate:modelValue":r[0]||(r[0]=n=>t.ruleForm.enableArticleComment=n),"active-color":"#13ce66"},null,8,["modelValue"])]),_:1})]),_:1}),e(a,{class:"mb20"},{default:o(()=>[e(m,{label:"评论是否必须经过管理员审核"},{default:o(()=>[e(l,{modelValue:t.ruleForm.enableArticleCommentAdminVerify,"onUpdate:modelValue":r[1]||(r[1]=n=>t.ruleForm.enableArticleCommentAdminVerify=n),"active-color":"#13ce66"},null,8,["modelValue"])]),_:1})]),_:1}),e(a,{class:"mb20"},{default:o(()=>[e(m,{label:"启用评论验证码功能"},{default:o(()=>[e(l,{modelValue:t.ruleForm.enableArticleCommentVerifyCode,"onUpdate:modelValue":r[2]||(r[2]=n=>t.ruleForm.enableArticleCommentVerifyCode=n),"active-color":"#13ce66"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(a,null,{default:o(()=>[e(m,null,{default:o(()=>[e(C,{type:"primary",onClick:b,size:"default"},{default:o(()=>[x("保 存")]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1})]),_:1})]),_:1})])}}});const Ve=B(K,[["__scopeId","data-v-202dc45c"]]);export{Ve as default};
