
/**
 * 由 Fantastic-admin 提供技术支持
 * Powered by Fantastic-admin
 * https://fantastic-admin.github.io
 */

import{_ as k}from"./index.vue_vue_type_script_setup_true_lang-BTce45WY.js";import{d as B,m as j,r as d,a as q,p as n,g as N,c as $,b as e,w as t,h as E,e as s,G as p,j as H,_ as I,k as g}from"./index-nGFMSQGw.js";import{a as v}from"./config-CYXO1pNF.js";const M=s("div",{class:"flex items-center gap-4"},"本地存储参数设置",-1),O=s("div",{class:"text-sm/6"},[s("div",null," 开启后将优先使用本地存储方式保存数据，有些场景需开启跨域访问，可能需额外自行解决读写权限问题。 "),s("div",null," 文件存储目录为 /public/file，更新迁移时请做好数据维护及备份。 ")],-1),R=B({__name:"localStorage",setup(A){const a=j({localStorageStatus:"",siteUrl:""}),c=d();async function i(){const o=await v.queryConfig({keys:["localStorageStatus","siteUrl"]});Object.assign(a,o.data)}const x=d({siteUrl:[{required:!0,message:"请输入网站地址",trigger:"blur"}]});function S(){var o;(o=c.value)==null||o.validate(async l=>{if(l){try{await v.setConfig({settings:b(a)}),p.success("变更配置信息成功")}catch{}i()}else p.error("请填写完整信息")})}function b(o){return Object.keys(o).map(l=>({configKey:l,configVal:o[l]}))}return q(()=>{i()}),(o,l)=>{const u=H,y=I,V=k,w=n("el-switch"),_=n("el-form-item"),m=n("el-col"),f=n("el-row"),U=n("el-input"),C=n("el-form"),h=n("el-card");return N(),$("div",null,[e(V,null,{title:t(()=>[M]),content:t(()=>[O]),default:t(()=>[e(y,{outline:"",onClick:S},{default:t(()=>[e(u,{name:"i-ri:file-text-line"}),E(" 保存设置 ")]),_:1})]),_:1}),e(h,{style:{margin:"20px"}},{default:t(()=>[e(C,{ref_key:"formRef",ref:c,model:a,"label-width":"120px",rules:x.value},{default:t(()=>[e(f,null,{default:t(()=>[e(m,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(_,{label:"启用状态",prop:"localStorageStatus"},{default:t(()=>[e(w,{modelValue:a.localStorageStatus,"onUpdate:modelValue":l[0]||(l[0]=r=>a.localStorageStatus=r),"active-value":"1","inactive-value":"0"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),e(f,null,{default:t(()=>[e(m,{xs:24,md:20,lg:15,xl:12},{default:t(()=>[e(_,{label:"网站地址",prop:"siteUrl"},{default:t(()=>[e(U,{modelValue:a.siteUrl,"onUpdate:modelValue":l[1]||(l[1]=r=>a.siteUrl=r),placeholder:"网站地址",clearable:""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["model","rules"])]),_:1})])}}});typeof g=="function"&&g(R);export{R as default};
