import{g as E,u as h,a as F}from"./account-C850CBTF.js";import{d as O,r as v,u as T,b as V,V as M,aw as P,c as $,o as y,U as j,w as n,j as a,t as q,_ as G,O as z,l as e,aH as A,N as H,fd as b,p as i,A as t,i as p,P as w,fe as R,ff as J,fg as K,fh as L,fi as U,h as Q,D as W,M as X,v as Y}from"./index-9PRMimni.js";const Z={class:"info"},ee={class:"info"},ae={class:"info"},ne={class:"info"},te={class:"info"},oe={class:"info"},se={class:"info"},le=["src"],ce=O({__name:"BasicSetting",setup(re){const o=v({avatar:"",signUrl:""}),m=v({url:""}),_=T(),x=V(),{t:r}=M();P(()=>{N()});async function N(){const s=await E();o.value=s}async function k({file:s}){const u=new FormData;u.append("file",s.file),m.value=await h(u),o.value.avatar=m.value.url,await f("avatar")}function B({file:s}){const u=["image/png","image/jpg","image/jpeg","image/gif","image/svg+xml"];return u.includes(s.file?.type)?!0:(_.error(`${r("common.file.uploadFormat")} ${u.join(",")}`),!1)}async function C(s){const u=new FormData;u.append("file",s.file?.file);try{m.value=await h(u),o.value.signUrl=m.value.url,await f("signUrl"),s.onFinish()}catch{s.onError()}}async function f(s){await F({[s]:o.value[s]}),await x.GetInfo(),_.success("Update successful!")}return(s,u)=>{const d=z,l=H,g=A,c=G,D=q,S=X,I=j;return y(),$(I,{cols:"1 s:1 m:1 l:4 xl:4 2xl:4",responsive:"screen"},{default:n(()=>[a(S,null,{default:n(()=>[a(D,{ref:"formRef","label-placement":"left"},{default:n(()=>[a(c,{label:"",path:"avatar",class:"avatar"},{default:n(()=>[a(d,{round:"",size:98,src:e(o).avatar},null,8,["src"]),a(g,{class:"upload","custom-request":k,headers:{"Content-Type":"multipart/form-data"},data:{},"show-file-list":!1},{default:n(()=>[a(l,{color:"#ffffff",component:e(b)},null,8,["component"])]),_:1})]),_:1}),a(c,{path:"name"},{label:n(()=>[i(t(e(o).nickname),1)]),_:1}),a(c,{path:"name"},{label:n(()=>[a(l,{component:e(w)},null,8,["component"]),i(" "+t(e(r)("system.account.userName")),1)]),default:n(()=>[p("span",Z,t(e(o).username),1)]),_:1}),a(c,{path:"nicknameEn"},{label:n(()=>[a(l,{component:e(w)},null,8,["component"]),i(" "+t(e(r)("system.account.nicknameEn")),1)]),default:n(()=>[p("span",ee,t(e(o).nicknameEn),1)]),_:1}),a(c,{path:"mobile"},{label:n(()=>[a(l,{component:e(R)},null,8,["component"]),i(" "+t(e(r)("system.account.phone")),1)]),default:n(()=>[p("span",ae,t(e(o).phone),1)]),_:1}),a(c,{label:"邮箱",path:"email"},{label:n(()=>[a(l,{component:e(J)},null,8,["component"]),i(" "+t(e(r)("system.account.email")),1)]),default:n(()=>[p("span",ne,t(e(o).email),1)]),_:1}),a(c,{label:"部门",path:"department"},{label:n(()=>[a(l,{component:e(K)},null,8,["component"]),i(" "+t(e(r)("system.account.department")),1)]),default:n(()=>[p("span",te,t(e(o).deptName),1)]),_:1}),a(c,{label:"角色",path:"role"},{label:n(()=>[a(l,{component:e(L)},null,8,["component"]),i(" "+t(e(r)("system.account.role")),1)]),default:n(()=>[p("span",oe,t(e(o).roleNames),1)]),_:1}),a(c,{label:"创建日期",path:"creation"},{label:n(()=>[a(l,{component:e(U)},null,8,["component"]),i(" "+t(e(r)("system.account.creationDate")),1)]),default:n(()=>[p("span",se,t(e(o).createTime),1)]),_:1}),a(c,null,{label:n(()=>[a(l,{component:e(U)},null,8,["component"]),i(" "+t(e(r)("system.account.signature")),1)]),default:n(()=>[e(o).signUrl?(y(),Q("img",{key:0,src:e(o).signUrl,class:"w-[100px] h-[80px] rounded-[4px]"},null,8,le)):W("",!0),a(g,{class:"upload","custom-request":C,headers:{"Content-Type":"multipart/form-data"},"show-file-list":!1,onBeforeUpload:B},{default:n(()=>[a(l,{color:"#ffffff",component:e(b)},null,8,["component"])]),_:1})]),_:1})]),_:1},512)]),_:1})]),_:1})}}}),pe=Y(ce,[["__scopeId","data-v-b7df7eac"]]);export{pe as default};
