Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled
52 lines
1.5 KiB
TypeScript
52 lines
1.5 KiB
TypeScript
import React, { useEffect } from 'react';
|
|
import { createPortal } from 'react-dom';
|
|
import { HomeOutlined, CameraOutlined } from '@ant-design/icons';
|
|
import { history } from '@umijs/max';
|
|
import portalLogo from '@/assets/logo.png';
|
|
import './index.less';
|
|
|
|
/** 人社门户首页地址 */
|
|
const PORTAL_HOME_URL = 'http://218.31.252.15:9081/hrss-web-vue/home';
|
|
|
|
const EnterpriseHeader: React.FC = () => {
|
|
useEffect(() => {
|
|
document.body.classList.add('has-enterprise-header');
|
|
return () => {
|
|
document.body.classList.remove('has-enterprise-header');
|
|
};
|
|
}, []);
|
|
|
|
const handleGoHome = () => {
|
|
window.open(PORTAL_HOME_URL);
|
|
};
|
|
|
|
const handleGoShowcase = () => {
|
|
history.push('/management/enterprise-showcase');
|
|
};
|
|
|
|
const header = (
|
|
<div className="enterprise-header">
|
|
<div className="header-left">
|
|
<img className="header-logo" src={portalLogo} alt="石城智慧就业" />
|
|
<div className="header-divider" />
|
|
<span className="header-system-name">石河子智慧就业 · 企业管理端</span>
|
|
</div>
|
|
|
|
<div className="header-right">
|
|
<div className="home-link-btn" onClick={handleGoShowcase}>
|
|
<CameraOutlined />
|
|
<span>企业风采</span>
|
|
</div>
|
|
<div className="home-link-btn" onClick={handleGoHome}>
|
|
<HomeOutlined />
|
|
<span>返回首页</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
|
|
return createPortal(header, document.body);
|
|
};
|
|
|
|
export default EnterpriseHeader;
|