var c=(m,s,a)=>new Promise((r,o)=>{var i=e=>{try{n(a.next(e))}catch(t){o(t)}},l=e=>{try{n(a.throw(e))}catch(t){o(t)}},n=e=>e.done?r(e.value):Promise.resolve(e.value).then(i,l);n((a=a.apply(m,s)).next())});import{bh as b,b8 as h,bC as v,al as g,bU as w}from"./bootstrap-Bqxdt4iG.js";import{a1 as f,P as S,E as d,ap as x,aj as _,p as u,a9 as p,ak as y,ax as N,L as k,aa as C,ai as A}from"../jse/index-index-BUJ_4tQs.js";const B=["onKeydown"],V=f({__name:"base-setting",props:{formSchema:{default:()=>[]}},emits:["submit"],setup(m,{expose:s,emit:a}){const r=m,o=a,[i,l]=b(S({commonConfig:{componentProps:{class:"w-full"}},layout:"horizontal",schema:d(()=>r.formSchema),showDefaultActions:!1}));function n(){return c(this,null,function*(){const{valid:e}=yield l.validate(),t=yield l.getValues();e&&o("submit",t)})}return s({getFormApi:()=>l}),(e,t)=>(_(),x("div",{onKeydown:v(g(n,["prevent"]),["enter"])},[u(p(i)),u(p(h),{type:"submit",class:"mt-4",onClick:n},{default:y(()=>[...t[0]||(t[0]=[N(" 更新基本信息 ",-1)])]),_:1})],40,B))}}),O=f({__name:"base-setting",setup(m){const s=k(),a=[{label:"管理员",value:"super"},{label:"用户",value:"user"},{label:"测试",value:"test"}],r=d(()=>[{fieldName:"realName",component:"Input",label:"姓名"},{fieldName:"username",component:"Input",label:"用户名"},{fieldName:"roles",component:"Select",componentProps:{mode:"tags",options:a},label:"角色"},{fieldName:"introduction",component:"Textarea",label:"个人简介"}]);return C(()=>c(null,null,function*(){const o=yield w();s.value.getFormApi().setValues(o)})),(o,i)=>(_(),A(p(V),{ref_key:"profileBaseSettingRef",ref:s,"form-schema":r.value},null,8,["form-schema"]))}});export{O as _};
