import{c as e,r as a,o as s,q as r,v as o,N as l,B as t,e as d,y as m,ab as n,a9 as p}from"./base-lib.js?v=1761009159";import{_ as i}from"./index103.js?v=1761009159";import{t as u,y as f,P as w,k as c}from"./utils-lib.js?v=1761009159";import{setPassword as b,setsModulesPassword as _}from"./database.js?v=1761009159";import{g as j}from"./useStore2.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";const y=e({__name:"index",props:{compData:{default:()=>({username:"",password:"",id:0,name:""})}},setup(e,{expose:y}){const{refs:{tabActive:g},refreshTableList:v}=j(),x=e,{username:V,password:h,id:q}=x.compData,D=a(),k=s({id:q,password:h,username:V}),C={password:[{trigger:["blur"],required:!0,message:"请输入密码"}]};return r(()=>{u(D.value.$el,"password")}),y({onConfirm:async e=>{await D.value.validate();const{id:a,username:s,password:r}=k,o={id:a,name:s,password:r};await w({loading:"正在提交中，请稍后...",request:"mysql"===g.value?b({...o,data_name:x.compData.name}):_({data:JSON.stringify(o)},g.value),message:!0}),e(),v()}}),(e,a)=>{const s=c,r=n,u=i,w=p;return o(),l(w,{ref_key:"setDatabasePwdRef",ref:D,rules:C,model:m(k),class:"p-[2rem] flex flex-col justify-center","label-width":"auto"},{default:t(()=>[d(r,{label:"用户名",prop:"name"},{default:t(()=>[d(s,{width:"32rem",disabled:"",modelValue:m(k).username,"onUpdate:modelValue":a[0]||(a[0]=e=>m(k).username=e),textType:!1},null,8,["modelValue"])]),_:1}),d(r,{label:"密码",prop:"password"},{default:t(()=>[d(u,{icon:"el-refresh",modelValue:m(k).password,"onUpdate:modelValue":a[1]||(a[1]=e=>m(k).password=e),onIconClick:a[2]||(a[2]=()=>m(k).password=m(f)(16)),width:"32rem",name:"password"},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])}}});export{y as default};
