← Back
Editing: index183.js
import{c as e,r as a,k as s,p as r,q as o,M as l,A as t,e as d,x as m,a9 as p,a7 as n}from"./base-lib.js?v=VERSION_NUMBER";import{_ as i}from"./index101.js?v=VERSION_NUMBER";import{t as u,x as f,K as w,k as c}from"./utils-lib.js?v=VERSION_NUMBER";import{setPassword as b,setsModulesPassword as _}from"./database.js?v=VERSION_NUMBER";import{g as x}from"./useStore2.js?v=VERSION_NUMBER";import"./__commonjsHelpers__.js?v=VERSION_NUMBER";const j=e({__name:"index",props:{compData:{default:()=>({username:"",password:"",id:0,name:""})}},setup(e,{expose:j}){const{refs:{tabActive:g},refreshTableList:v}=x(),y=e,{username:V,password:h,id:k}=y.compData,q=a(),D=s({id:k,password:h,username:V}),A={password:[{trigger:["blur"],required:!0,message:"请输入密码"}]};return r((()=>{u(q.value.$el,"password")})),j({onConfirm:async e=>{await q.value.validate();const{id:a,username:s,password:r}=D,o={id:a,name:s,password:r};await w({loading:"正在提交中,请稍后...",request:"mysql"===g.value?b({...o,data_name:y.compData.name}):_({data:JSON.stringify(o)},g.value),message:!0}),e(),v()}}),(e,a)=>{const s=c,r=p,u=i,w=n;return o(),l(w,{ref_key:"setDatabasePwdRef",ref:q,rules:A,model:m(D),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(D).username,"onUpdate:modelValue":a[0]||(a[0]=e=>m(D).username=e),textType:!1},null,8,["modelValue"])])),_:1}),d(r,{label:"密码",prop:"password"},{default:t((()=>[d(u,{icon:"el-refresh",modelValue:m(D).password,"onUpdate:modelValue":a[1]||(a[1]=e=>m(D).password=e),onIconClick:a[2]||(a[2]=()=>m(D).password=m(f)(16)),width:"32rem",name:"password"},null,8,["modelValue"])])),_:1})])),_:1},8,["model"])}}});export{j as default};
Save File
Cancel