forked from gzzfw/frontEnd/gzDyh

liuwh
2024-09-17 5aa4a814ab8d4aa194a9683ebefaefdfc6d92c3a
gz-customerSystem/src/components/Layout/Header.jsx
@@ -2,8 +2,8 @@
 * @Company: hugeInfo
 * @Author: ldh
 * @Date: 2022-03-11 11:33:21
 * @LastEditTime: 2024-08-08 20:18:53
 * @LastEditors: lwh
 * @LastEditTime: 2024-09-11 09:45:36
 * @LastEditors: dminyi 1301963064@qq.com
 * @Version: 1.0.0
 * @Description: 头部组件
 */
@@ -13,10 +13,11 @@
import { Menu, Badge, Avatar, Dropdown, Space, Form, Input, Button, Radio } from 'antd';
import { BellOutlined, LogoutOutlined, UserOutlined, FormOutlined, UserSwitchOutlined, DownCircleFilled } from '@ant-design/icons';
import { mediationCenter, mediationCenter_active, operateCenter, operateCenter_active } from '../../assets/images/icon';
import { yewu } from '../../assets/images';
import * as $$ from '../../utils/utility';
import MyMessage from '../../views/myMessage';
import MyModal from '../MyModal';
import logo_white from '../../assets/images/logo_white.png';
import {logo1} from '../../assets/images';
//修改密码api
function submitModifyInfoApi(data) {
@@ -36,10 +37,9 @@
 * handleClickMenu: function 头部导航点击
 * handleChangeRole: function 切换角色
 */
const Header = ({ roleActive, headerMenu, headerMenuActive, headerUserChange, handleClickMenu, handleChangeRole }) => {
  let navigate = useNavigate();
const Header = ({ roleActive, headerMenu, headerMenuActive, headerUserChange, handleClickMenu, handleChangeRole,userData }) => {
  const [data, setData] = useState([]);
  let navigate = useNavigate();
  // 修改密码窗口显示隐藏
  const [visible, setVisible] = useState(false);
@@ -51,7 +51,7 @@
  const [myMessageVisible, setMyMessageVisible] = useState(false);
  const headerMenuIcon = {
    'mediate': { icon: mediationCenter, iconActive: mediationCenter_active },
    'mediate': { icon: yewu, iconActive: yewu },
    'operation': { icon: operateCenter, iconActive: operateCenter_active },
  };
@@ -72,7 +72,7 @@
  const userMenu = (
    <Menu>
      {data?.ctUseroleList?.length > 1 && (
      {userData?.ctUseroleList?.length > 1 && (
        <>
          <Menu.Item key="changeRole" onClick={() => setRoleModal({ visible: true, value: roleActive.id })}>
            <UserSwitchOutlined style={{ marginRight: '8px' }} />
@@ -109,14 +109,11 @@
    }
  }
  useEffect(() => {
    setData($$.getLocal('customerSystemUser') || {});
  }, [headerUserChange]);
  return (
    <header className="header">
      <div className="header-logo">
        <img src={logo_white} alt="" />
        <img src={logo1} alt="" />
        <div className="header-logo-text" style={{ color: '#fff' }}>
          <div className="header-logo-title">广州市社会治安综合治理应用平台(综治中心模块)</div>
          {/* <div>Guangzhou Baiyun Diversified Dispute Resolution Platform</div> */}
@@ -154,9 +151,9 @@
            <div className="header-user-avatar">
              <Avatar icon={<UserOutlined />} />
              <div>
                <div className="header-user-name">{data?.trueName || '-'}</div>
                <div className="header-user-name">{userData?.trueName || '-'}</div>
                <div className="header-user-unit">
                  <span>{data?.unit || '-'}</span>
                  <span>{userData?.unit || '-'}</span>
                  <span className="public-rightBorder">{roleActive.roleName || '-'}</span>
                  <DownCircleFilled style={{ fontSize: '10px', marginLeft: '8px', color: '#ffffff' }} />
                </div>
@@ -172,7 +169,7 @@
            value={roleModal.value}
            onChange={(e) => setRoleModal({ visible: true, value: e.target.value, name: e.target.label, roleCode: e.target.roleCode })}
          >
            {data?.ctUseroleList?.map((x) => (
            {userData?.ctUseroleList?.map((x) => (
              <Radio key={x.roleId} value={x.roleId} label={x.roleName} roleCode={x.roleCode}>
                {x.roleName}
              </Radio>