Browse Source

font

release_0.0.1
巴林闲侠 2 years ago
parent
commit
bfba015319
  1. 0
      web/client/assets/fonts/YouSheBiaoTiHei-2.ttf
  2. 7
      web/client/src/index.less
  3. 170
      web/client/src/layout/components/header/index.jsx

0
web/client/fonts/YouSheBiaoTiHei-2.ttf → web/client/assets/fonts/YouSheBiaoTiHei-2.ttf

7
web/client/src/index.less

@ -67,7 +67,8 @@ body {
.semi-portal-inner {
position: fixed;
}
@font-face {
font-family: 'icomoon';//这个可以任意取,但是应与后面相对应eg:yxingguang
src: url('../fonts/YouSheBiaoTiHei-2.ttf');
}
font-family: 'icomoon'; //这个可以任意取,但是应与后面相对应eg:yxingguang
src: url('/assets/fonts/YouSheBiaoTiHei-2.ttf');
}

170
web/client/src/layout/components/header/index.jsx

@ -5,103 +5,103 @@ import { Nav, Avatar, Dropdown } from "@douyinfe/semi-ui";
import "./index.less";
const Header = (props) => {
const { dispatch, history, user, actions, socket ,headerItems,tochange} = props;
const { dispatch, history, user, actions, socket, headerItems, tochange } = props;
return (
<>
<div id="top-slider">
return (
<>
<div id="top-slider">
<Nav
mode={"horizontal"}
onClick={({ itemKey }) => {
if (itemKey == "logout") {
dispatch(actions.auth.logout(user));
if (socket) {
socket.disconnect();
mode={"horizontal"}
onClick={({ itemKey }) => {
if (itemKey == "logout") {
dispatch(actions.auth.logout(user));
if (socket) {
socket.disconnect();
}
history.push(`/signin`);
}
}}
style={{
height: 48,
minWidth: 520,
background: '#1D2343',
backgroundSize: "100% 100%",
color: "white",
}}
header={{
logo: (
<img
src="/assets/images/background/logo.png"
style={{ display: "inline-block", width: 280, height: 40 }}
/>
),
text: (
<div style={{ fontFamily: "icomoon", color: '#FFFFFF' }}>运维管理系统</div>
),
}}
footer={
<>
{headerItems.map((item, index) => {
if (item.hasOwnProperty('items')) {
return (
<Nav.Sub
key={index + 'a'}
itemKey={item.itemKey}
text={item.text}
dropdownStyle={{ color: '#F2F3F5' }}
>
{item.hasOwnProperty('items') && item.items.map((ite, idx) => (
<Nav.Item key={idx + 'd'} itemKey={ite.itemKey} text={ite.text} onClick={() => { tochange(ite); }} />
))}
</Nav.Sub>
)
}
history.push(`/signin`);
}
}}
style={{
height: 48,
minWidth: 520,
background: '#1D2343',
backgroundSize: "100% 100%",
color: "white",
}}
header={{
logo: (
<img
src="/assets/images/background/logo.png"
style={{ display: "inline-block", width: 280, height: 40 }}
/>
),
// text: (
// <div style={{fontFamily: "icomoon",color:'#FFFFFF'}}></div>
// ),
}}
footer={
<>
{headerItems.map((item,index)=>{
if(item.hasOwnProperty('items')){
return(
<Nav.Sub
key={index+'a'}
itemKey={item.itemKey}
text={item.text}
dropdownStyle={{color:'#F2F3F5'}}
>
{item.hasOwnProperty('items')&&item.items.map((ite,idx)=>(
<Nav.Item key={idx+'d'} itemKey={ite.itemKey} text={ite.text} onClick={()=>{tochange(ite);}}/>
))}
</Nav.Sub>
)
else {
return (
<Nav.Item key={index + 'a'} itemKey={item.itemKey} text={item.text} onClick={() => { tochange(item) }} />
)
}
else{
return(
<Nav.Item key={index+'a'} itemKey={item.itemKey} text={item.text} onClick={()=>{tochange(item)}} />
)
}
})}
<Nav.Sub
})}
<Nav.Sub
itemKey={"user"}
text={
<div
style={{
marginLeft: 20,
display: "inline-block",
color: "white",
}}
>
<Avatar size="small" color="light-blue" style={{marginRight:4}}>
<img src="/assets/images/avatar/6.png" />
</Avatar>
<div style={{
display: "inline-block", position: "relative",
top: 10,
left: 4,
marginRight: 4,
}}>
</div>
</div>
<div
style={{
marginLeft: 20,
display: "inline-block",
color: "white",
}}
>
<Avatar size="small" color="light-blue" style={{ marginRight: 4 }}>
<img src="/assets/images/avatar/6.png" />
</Avatar>
<div style={{
display: "inline-block", position: "relative",
top: 10,
left: 4,
marginRight: 4,
}}>
</div>
</div>
}
>
>
<Nav.Item itemKey={"logout"} text={"退出"} />
</Nav.Sub>
</>
}
</Nav.Sub>
</>
}
/>
</div>
</>
);
</div>
</>
);
};
function mapStateToProps (state) {
const { global, auth, webSocket } = state;
return {
actions: global.actions,
user: auth.user,
socket: webSocket.socket,
};
const { global, auth, webSocket } = state;
return {
actions: global.actions,
user: auth.user,
socket: webSocket.socket,
};
}
export default connect(mapStateToProps)(Header);

Loading…
Cancel
Save