vdi/web-fe/serve/dist/p__profile__index.async.js

2 lines
5.4 KiB
JavaScript

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[266],{21941:function(w,Z,s){s.r(Z),s.d(Z,{default:function(){return V}});var P=s(26068),d=s.n(P),I=s(48305),c=s.n(I),a=s(75271),m=s(39032),h=s(50661),r=s(74970),S=s(85106),p=s(49328),i=s(43041),j=s(25472),A=s(97102),F=s(31106),u=s(50850),o=s(66767),T=s(97315),D=s(67284),O=s(39290),H=s(3552),N=s(6300),L=s(30661),f=s(22789),e=s(52676),M=function(){var U=(0,a.useState)({username:"",email:"admin@example.com",phone:"138****8888",department:"\u6280\u672F\u90E8",role:"\u7BA1\u7406\u5458",lastLoginTime:"2024-01-20 15:30:00",createTime:"2023-01-01 00:00:00"}),B=c()(U,2),l=B[0],E=B[1],z=(0,a.useState)(!1),g=c()(z,2),K=g[0],x=g[1],$=(0,a.useState)(!1),C=c()($,2),b=C[0],v=C[1],G=(0,a.useState)([]),y=c()(G,2),J=y[0],Q=y[1];(0,a.useEffect)(function(){var t=localStorage.getItem("username")||"";E(function(n){return d()(d()({},n),{},{username:t})}),R()},[]);var R=function(){var n=[{id:"1",loginTime:"2024-01-20 15:30:00",ip:"192.168.1.100",location:"\u5317\u4EAC\u5E02",device:"Chrome 120.0.0.0"},{id:"2",loginTime:"2024-01-19 09:15:00",ip:"192.168.1.100",location:"\u5317\u4EAC\u5E02",device:"Chrome 120.0.0.0"},{id:"3",loginTime:"2024-01-18 14:20:00",ip:"192.168.1.100",location:"\u5317\u4EAC\u5E02",device:"Chrome 120.0.0.0"}];Q(n)},W=function(n){E(function(Y){return d()(d()({},Y),n)}),x(!1),m.ZP.success("\u4E2A\u4EBA\u4FE1\u606F\u66F4\u65B0\u6210\u529F")},X=function(n){if(n.newPassword!==n.confirmPassword){m.ZP.error("\u4E24\u6B21\u8F93\u5165\u7684\u5BC6\u7801\u4E0D\u4E00\u81F4");return}v(!1),m.ZP.success("\u5BC6\u7801\u4FEE\u6539\u6210\u529F")};return(0,e.jsxs)("div",{className:"profile-page",children:[(0,e.jsx)("div",{className:"page-header",children:(0,e.jsx)("h2",{children:"\u4E2A\u4EBA\u4E2D\u5FC3"})}),(0,e.jsxs)("div",{className:"profile-content",children:[(0,e.jsxs)(h.Z,{title:"\u57FA\u672C\u4FE1\u606F",extra:(0,e.jsx)(r.ZP,{type:"primary",icon:(0,e.jsx)(T.Z,{}),onClick:function(){return x(!0)},children:"\u7F16\u8F91\u4FE1\u606F"}),style:{marginBottom:24},children:[(0,e.jsxs)("div",{className:"profile-header",children:[(0,e.jsx)(S.Z,{size:80,icon:(0,e.jsx)(D.Z,{})}),(0,e.jsxs)("div",{className:"profile-info",children:[(0,e.jsx)("h3",{children:l.username}),(0,e.jsx)("p",{children:l.role})]})]}),(0,e.jsx)(p.Z,{}),(0,e.jsxs)(i.Z,{column:2,children:[(0,e.jsx)(i.Z.Item,{label:"\u7528\u6237\u540D",children:l.username}),(0,e.jsx)(i.Z.Item,{label:"\u90AE\u7BB1",children:l.email}),(0,e.jsx)(i.Z.Item,{label:"\u624B\u673A\u53F7",children:l.phone}),(0,e.jsx)(i.Z.Item,{label:"\u90E8\u95E8",children:l.department}),(0,e.jsx)(i.Z.Item,{label:"\u89D2\u8272",children:l.role}),(0,e.jsx)(i.Z.Item,{label:"\u6700\u540E\u767B\u5F55",children:l.lastLoginTime}),(0,e.jsx)(i.Z.Item,{label:"\u6CE8\u518C\u65F6\u95F4",children:l.createTime})]})]}),(0,e.jsx)(h.Z,{title:"\u5FEB\u6377\u64CD\u4F5C",style:{marginBottom:24},children:(0,e.jsxs)("div",{className:"quick-actions",children:[(0,e.jsx)(r.ZP,{type:"primary",icon:(0,e.jsx)(O.Z,{}),onClick:function(){return v(!0)},children:"\u4FEE\u6539\u5BC6\u7801"}),(0,e.jsx)(r.ZP,{icon:(0,e.jsx)(H.Z,{}),children:"\u6D88\u606F\u8BBE\u7F6E"}),(0,e.jsx)(r.ZP,{icon:(0,e.jsx)(N.Z,{}),children:"\u5B89\u5168\u8BBE\u7F6E"})]})}),(0,e.jsx)(h.Z,{title:"\u767B\u5F55\u5386\u53F2",extra:(0,e.jsx)(L.Z,{}),children:(0,e.jsx)(j.Z,{dataSource:J,renderItem:function(n){return(0,e.jsxs)(j.Z.Item,{children:[(0,e.jsx)(j.Z.Item.Meta,{title:"\u767B\u5F55\u65F6\u95F4\uFF1A".concat(n.loginTime),description:(0,e.jsxs)("div",{children:[(0,e.jsxs)("p",{children:["IP\u5730\u5740\uFF1A",n.ip]}),(0,e.jsxs)("p",{children:["\u767B\u5F55\u5730\u70B9\uFF1A",n.location]}),(0,e.jsxs)("p",{children:["\u8BBE\u5907\u4FE1\u606F\uFF1A",n.device]})]})}),(0,e.jsx)(A.Z,{color:"green",children:"\u6210\u529F"})]})}})})]}),(0,e.jsx)(F.Z,{title:"\u7F16\u8F91\u4E2A\u4EBA\u4FE1\u606F",open:K,onCancel:function(){return x(!1)},footer:null,children:(0,e.jsxs)(u.Z,{layout:"vertical",initialValues:l,onFinish:W,children:[(0,e.jsx)(u.Z.Item,{name:"email",label:"\u90AE\u7BB1",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u90AE\u7BB1"},{type:"email",message:"\u8BF7\u8F93\u5165\u6709\u6548\u7684\u90AE\u7BB1\u5730\u5740"}],children:(0,e.jsx)(o.Z,{})}),(0,e.jsx)(u.Z.Item,{name:"phone",label:"\u624B\u673A\u53F7",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u624B\u673A\u53F7"},{pattern:/^1[3-9]\d{9}$/,message:"\u8BF7\u8F93\u5165\u6709\u6548\u7684\u624B\u673A\u53F7"}],children:(0,e.jsx)(o.Z,{})}),(0,e.jsx)(u.Z.Item,{children:(0,e.jsx)(r.ZP,{type:"primary",htmlType:"submit",icon:(0,e.jsx)(f.Z,{}),block:!0,children:"\u4FDD\u5B58"})})]})}),(0,e.jsx)(F.Z,{title:"\u4FEE\u6539\u5BC6\u7801",open:b,onCancel:function(){return v(!1)},footer:null,children:(0,e.jsxs)(u.Z,{layout:"vertical",onFinish:X,children:[(0,e.jsx)(u.Z.Item,{name:"oldPassword",label:"\u5F53\u524D\u5BC6\u7801",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5F53\u524D\u5BC6\u7801"}],children:(0,e.jsx)(o.Z.Password,{})}),(0,e.jsx)(u.Z.Item,{name:"newPassword",label:"\u65B0\u5BC6\u7801",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u65B0\u5BC6\u7801"},{min:6,message:"\u5BC6\u7801\u957F\u5EA6\u4E0D\u80FD\u5C11\u4E8E6\u4F4D"}],children:(0,e.jsx)(o.Z.Password,{})}),(0,e.jsx)(u.Z.Item,{name:"confirmPassword",label:"\u786E\u8BA4\u65B0\u5BC6\u7801",rules:[{required:!0,message:"\u8BF7\u786E\u8BA4\u65B0\u5BC6\u7801"}],children:(0,e.jsx)(o.Z.Password,{})}),(0,e.jsx)(u.Z.Item,{children:(0,e.jsx)(r.ZP,{type:"primary",htmlType:"submit",icon:(0,e.jsx)(f.Z,{}),block:!0,children:"\u786E\u8BA4\u4FEE\u6539"})})]})})]})},V=M}}]);