import{_ as V}from"./index.64fe6e0c.js";import{A as g,y as v,B as A,F as D,u as b}from"./element-plus.33d6376e.js";import{M as U}from"./picker.db5f2f9e.js";import{a as y,s as h}from"./index.80c2a703.js";import{d as k,r as P,$ as p,o as I,c as x,U as e,L as s,a as m,S as M}from"./@vue.230e89ba.js";import"./@vueuse.88988742.js";import"./dayjs.66926594.js";import"./axios.2d915936.js";import"./@element-plus.739f7923.js";import"./lodash-es.29c53eac.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./@popperjs.36402333.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./index.4107e0ad.js";import"./index.0e683277.js";import"./usePaging.4b232826.js";import"./index.ed42dcff.js";import"./index.vue_vue_type_script_setup_true_lang.b3f5bb6c.js";import"./vue3-video-play.1b377718.js";import"./vuedraggable.611a2338.js";import"./vue.1b105d76.js";import"./sortablejs.cd7e2c7e.js";import"./lodash.b68d77aa.js";import"./vue-router.c0281831.js";import"./pinia.1d1aade0.js";import"./vue-demi.bfae2336.js";import"./css-color-function.a8f9466d.js";import"./color.903ca10f.js";import"./clone.9d64bb7a.js";import"./color-convert.69e17089.js";import"./color-string.e356f5de.js";import"./color-name.e7a4e1d3.js";import"./nprogress.a96d99f2.js";import"./echarts.6ad8c478.js";import"./zrender.f91f2f01.js";import"./highlight.js.4ebdf9a4.js";import"./@highlightjs.b3d01323.js";const S={class:"user-setting"},N={class:"w-80"},q={class:"w-80"},R={class:"w-80"},L={class:"w-80"},T={class:"w-80"},$=M("\u4FDD\u5B58"),ho=k({__name:"setting",setup(j){const n=P(),d=y(),r=p({avatar:"",username:"",nickname:"",currPassword:"",password:"",passwordConfirm:""}),F=p({avatar:[{required:!0,message:"\u5934\u50CF\u4E0D\u80FD\u4E3A\u7A7A",trigger:["change"]}],nickname:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0",trigger:["blur"]}],currPassword:[{validator:(a,o,u)=>{r.password&&(o||u(new Error("\u8BF7\u8F93\u5165\u5F53\u524D\u5BC6\u7801"))),u()},trigger:"blur"}],password:[{validator:(a,o,u)=>{r.currPassword&&(o||u(new Error("\u8BF7\u8F93\u5165\u65B0\u7684\u5BC6\u7801"))),u()},trigger:"blur"}],passwordConfirm:[{validator:(a,o,u)=>{r.password&&(o||u(new Error("\u8BF7\u518D\u6B21\u8F93\u5165\u5BC6\u7801")),o!==r.password&&u(new Error("\u4E24\u6B21\u8F93\u5165\u5BC6\u7801\u4E0D\u4E00\u81F4!"))),u()},trigger:"blur"}]}),f=async()=>{const a=d.userInfo;console.log(a);for(const o in r)r[o]=a[o]},_=async()=>{await h(r),d.getUserInfo()},c=async()=>{var a;await((a=n.value)==null?void 0:a.validate()),_()};return f(),(a,o)=>{const u=U,l=g,i=v,w=A,B=D,E=b,C=V;return I(),x("div",S,[e(B,{class:"!border-none",shadow:"never"},{default:s(()=>[e(w,{ref_key:"formRef",ref:n,class:"ls-form",model:r,rules:F,"label-width":"100px"},{default:s(()=>[e(l,{label:"\u5934\u50CF\uFF1A",prop:"avatar"},{default:s(()=>[e(u,{modelValue:r.avatar,"onUpdate:modelValue":o[0]||(o[0]=t=>r.avatar=t),limit:1},null,8,["modelValue"])]),_:1}),e(l,{label:"\u8D26\u53F7\uFF1A",prop:"username"},{default:s(()=>[m("div",N,[e(i,{modelValue:r.username,"onUpdate:modelValue":o[1]||(o[1]=t=>r.username=t),disabled:""},null,8,["modelValue"])])]),_:1}),e(l,{label:"\u540D\u79F0\uFF1A",prop:"nickname"},{default:s(()=>[m("div",q,[e(i,{modelValue:r.nickname,"onUpdate:modelValue":o[2]||(o[2]=t=>r.nickname=t),placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"},null,8,["modelValue"])])]),_:1}),e(l,{label:"\u5F53\u524D\u5BC6\u7801\uFF1A",prop:"currPassword"},{default:s(()=>[m("div",R,[e(i,{modelValue:r.currPassword,"onUpdate:modelValue":o[3]||(o[3]=t=>r.currPassword=t),modelModifiers:{trim:!0},placeholder:"\u4FEE\u6539\u5BC6\u7801\u65F6\u5FC5\u586B, \u4E0D\u4FEE\u6539\u5BC6\u7801\u65F6\u7559\u7A7A",type:"password","show-password":""},null,8,["modelValue"])])]),_:1}),e(l,{label:"\u65B0\u7684\u5BC6\u7801\uFF1A",prop:"password"},{default:s(()=>[m("div",L,[e(i,{modelValue:r.password,"onUpdate:modelValue":o[4]||(o[4]=t=>r.password=t),modelModifiers:{trim:!0},placeholder:"\u4FEE\u6539\u5BC6\u7801\u65F6\u5FC5\u586B, \u4E0D\u4FEE\u6539\u5BC6\u7801\u65F6\u7559\u7A7A",type:"password","show-password":""},null,8,["modelValue"])])]),_:1}),e(l,{label:"\u786E\u5B9A\u5BC6\u7801\uFF1A",prop:"passwordConfirm"},{default:s(()=>[m("div",T,[e(i,{modelValue:r.passwordConfirm,"onUpdate:modelValue":o[5]||(o[5]=t=>r.passwordConfirm=t),modelModifiers:{trim:!0},placeholder:"\u4FEE\u6539\u5BC6\u7801\u65F6\u5FC5\u586B, \u4E0D\u4FEE\u6539\u5BC6\u7801\u65F6\u7559\u7A7A",type:"password","show-password":""},null,8,["modelValue"])])]),_:1})]),_:1},8,["model","rules"])]),_:1}),e(C,null,{default:s(()=>[e(E,{type:"primary",onClick:c},{default:s(()=>[$]),_:1})]),_:1})])}}});export{ho as default};
