import React from 'react';
import { connect } from 'react-redux';
import { Spin, Card, Modal, TreeSelect, message } from 'antd';
import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect } from '@ant-design/pro-form';
import Title from 'antd/lib/skeleton/Title';
import Weather from './public/weather';
const Header = ({ dispatch, actions, user, module, setModule, history }) => {
return
{user?.name}
{
dispatch(actions.auth.logout(user));
history.push(`/signin`);
}}>退出
{[{ title: '基础信息', key: 'basis' },
{ title: '能耗监测', key: 'capacity' },
{ title: '电排远控', key: 'electrical' },
{ title: '实时监测', key: 'realTime' },].map(v => {
return
setModule(v.key)}>{v.title}
})}
}
function mapStateToProps(state) {
const { auth, global } = state;
return {
user: auth.user,
actions: global.actions,
clientHeight: global.clientHeight,
}
}
export default connect(mapStateToProps)(Header);