unis_crm/frontend1/dist/assets/index-dtusW7QT.js

2 lines
5.0 KiB
JavaScript
Raw Normal View History

2026-04-13 01:35:05 +00:00
import{u as _,r as i,j as e,A as R,R as U,T as M,B as m,x as D,y as E,a as L,z as $,c as q,C,e as z,D as H,E as V,s as u,k as X,F as G}from"./index-D2cxrzyv.js";import{P as K}from"./index-DICUnuN_.js";import{F as r}from"./index-KuslyOWx.js";import{R as W,C as P}from"./row-C5EMotZ4.js";import{C as v,T as J}from"./index-BFDbUxK1.js";import{T as p}from"./index-C8Xnkbw4.js";import{I as l}from"./index-4zw5l6IX.js";import{A as O}from"./index-CZjIc_CA.js";import{D as Q}from"./index-mWRDSnlC.js";import"./useForm-CaItC8xb.js";const{Paragraph:I,Title:Y,Text:Z}=M;function me(){const{t:s}=_(),[S,f]=i.useState(!1),[x,n]=i.useState(!1),[ee,y]=i.useState(!1),[T,h]=i.useState(!1),[o,k]=i.useState(null),[a,j]=i.useState(null),[c]=r.useForm(),[d]=r.useForm(),b=async()=>{f(!0);try{const t=await z();k(t),c.setFieldsValue(t)}finally{f(!1)}},B=async()=>{y(!0);try{const t=await H();j(t)}finally{y(!1)}};i.useEffect(()=>{b(),B()},[]);const F=async()=>{try{const t=await c.validateFields();n(!0),await V(t),u.success(s("common.success")),b()}finally{n(!1)}},N=async()=>{try{const t=await d.validateFields();n(!0),await X(t),u.success(s("common.success")),d.resetFields()}finally{n(!1)}},A=async()=>{try{h(!0);const t=await G();j(t),u.success(s("common.success"))}finally{h(!1)}},g=t=>t||"-";return e.jsxs("div",{className:"app-page app-page--contained",style:{maxWidth:1024,width:"100%",margin:"0 auto"},children:[e.jsx(K,{title:s("profile.title"),subtitle:s("profile.subtitle")}),e.jsxs(W,{gutter:24,children:[e.jsx(P,{xs:24,lg:8,children:e.jsxs(v,{className:"app-page__content-card text-center",loading:S,children:[e.jsx(R,{size:80,icon:e.jsx(U,{}),style:{backgroundColor:"#1677ff",marginBottom:16}}),e.jsx(Y,{level:5,style:{margin:0},children:o==null?void 0:o.displayName}),e.jsxs(Z,{type:"secondary",children:["@",o==null?void 0:o.username]}),e.jsx("div",{className:"mt-4",children:o!=null&&o.isPlatformAdmin?e.jsx(p,{color:"gold",children:s("users.platformAdmin")}):e.jsx(p,{color:"blue",children:s("profile.standardUser")})})]})}),e.jsx(P,{xs:24,lg:16,children:e.jsx(v,{className:"app-page__content-card",children:e.jsx(J,{defaultActiveKey:"basic",items:[{key:"basic",label:e.jsxs("span",{children:[e.jsx(E,{})," ",s("profile.basicInfo")]}),children:e.jsxs(r,{form:c,layout:"vertical",onFinish:F,style:{marginTop:16},children:[e.jsx(r.Item,{label:s("users.displayName"),name:"displayName",rules:[{required:!0}],children:e.jsx(l,{})}),e.jsx(r.Item,{label:s("users.email"),name:"email",children:e.jsx(l,{})}),e.jsx(r.Item,{label:s("users.phone"),name:"phone",children:e.jsx(l,{})}),e.jsx("div",{className:"app-page__page-actions",style:{margin:"8px 0 0"},children:e.jsx(m,{type:"primary",icon:e.jsx(D,{}),loading:x,onClick:()=>c.submit(),children:s("profile.saveChanges")})})]})},{key:"password",label:e.jsxs("span",{children:[e.jsx(L,{})," ",s("profile.security")]}),children:e.jsxs(r,{form:d,layout:"vertical",onFinish:N,style:{marginTop:16},children:[e.jsx(r.Item,{label:s("profile.currentPassword"),name:"oldPassword",rules:[{required:!0}],children:e.jsx(l.Password,{})}),e.jsx(r.Item,{label:s("profile.newPassword"),name:"newPassword",rules:[{required:!0,min:6}],children:e.jsx(l.Password,{})}),e.jsx(r.Item,{label:s("profile.confirmNewPassword"),name:"confirmPassword",dependencies:["newPassword"],rules:[{required:!0},({getFieldValue:t})=>({validator(se,w){return!w||t("newPassword")===w?Promise.resolve():Promise.reject(new Error(s("profile.passwordsDoNotMatch")))}})],children:e.jsx(l.Password,{})}),e.jsx("div",{className:"app-page__page-actions",style:{margin:"8px 0 0"},children:e.jsx(m,{type:"primary",danger:!0,loading:x,onClick:()=>d.submit(),children:s("profile.updatePassword")})})]})},{key:"bot-credential",label:e.jsxs("span",{children:[e.jsx(C,{})," ",s("profile.botCredentialTab")]}),children:e.jsx("div",{style:{marginTop:16},children:e.jsxs($,{direction:"vertical",size:16,style:{width:"100%"},children:[e.jsx(O,{type:"info",showIcon:!0,message:s("profile.botCredentialHint"),description:s("profile.botCredentialHintDesc")}),e.jsx(Q,{bordered:!0,size:"middle",column:1,items:[{key