import{c as e,o as a,r as o,v as r,x as s,e as t,B as l,y as d,R as u,ab as m,a9 as i}from"./base-lib.js?v=1761009159";import{_ as n}from"./index103.js?v=1761009159";import{setAuthStatus as p,setupPassword as f}from"./database.js?v=1761009159";import{c4 as c,P as w}from"./utils-lib.js?v=1761009159";import{g as b}from"./useStore2.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";const g={class:"px-[20px] py-[20px]"},P=e({__name:"index",props:{compData:{default:()=>({rootPwd:"",refresh:()=>{}})}},setup(e,{expose:P}){const{refs:{tabActive:V},refreshTableList:_}=b(),v=e,x={rootPwdValue:[{required:!0,message:"请输入密码",trigger:"blur"},{min:6,message:"密码长度至少为6位",trigger:["blur","change"]}]},j=a({rootPwdValue:v.compData.rootPwd||""}),h=o();return P({onConfirm:async e=>{var a,o;await h.value.validate(),await w({loading:"正在设置密码, 请稍后...",request:"mongodb"==V.value?p({data:JSON.stringify({status:"1",password:j.rootPwdValue})}):f({password:j.rootPwdValue}),message:!0}),_(),null==(o=(a=v.compData).refresh)||o.call(a),e()}}),(e,a)=>{const o=n,p=m,f=i;return r(),s("div",g,[t(f,{model:d(j),ref_key:"rootPwdRef",ref:h,rules:x,onSubmit:a[2]||(a[2]=u(()=>{},["prevent"]))},{default:l(()=>[t(p,{label:"数据库密码",prop:"rootPwdValue"},{default:l(()=>[t(o,{icon:"el-refresh",modelValue:d(j).rootPwdValue,"onUpdate:modelValue":a[0]||(a[0]=e=>d(j).rootPwdValue=e),onIconClick:a[1]||(a[1]=()=>d(j).rootPwdValue=d(c)(16))},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])])}}});export{P as default};
