|
@@ -1,13 +1,15 @@
|
|
|
import React, { PureComponent } from 'react';
|
|
|
-// import { connect } from 'react-redux';
|
|
|
+import { connect } from 'react-redux';
|
|
|
// import { BrowserRouter, Route,Link } from 'react-router-dom';
|
|
|
|
|
|
-// import { actionCreators } from './store';
|
|
|
+import { actionCreators } from './store';
|
|
|
|
|
|
class staffHeader extends PureComponent {
|
|
|
|
|
|
|
|
|
render() {
|
|
|
+ const { sectionName,staff } = this.props;
|
|
|
+ let staffDetail=staff.toJS();
|
|
|
return (
|
|
|
|
|
|
<header className="page-header" role="banner">
|
|
@@ -31,23 +33,23 @@ class staffHeader extends PureComponent {
|
|
|
</div>
|
|
|
|
|
|
<h1 className="subheader-title">
|
|
|
- 联系人
|
|
|
- {/* {handeName} */}
|
|
|
+ {sectionName}
|
|
|
</h1>
|
|
|
|
|
|
<div className="ml-auto d-flex">
|
|
|
|
|
|
<div>
|
|
|
- <a href="#" data-toggle="dropdown" className="header-icon d-flex align-items-center justify-content-center ml-2"><img src="/img/demo/avatars/avatar-admin.png" className="profile-image rounded-circle" /></a>
|
|
|
+ <a href="#" data-toggle="dropdown" className="header-icon d-flex align-items-center justify-content-center ml-2">
|
|
|
+ <img src={staffDetail.avatar} className="profile-image rounded-circle" /></a>
|
|
|
<div className="dropdown-menu dropdown-menu-animated dropdown-lg">
|
|
|
<div className="dropdown-header bg-trans-gradient d-flex flex-row py-4 rounded-top">
|
|
|
<div className="d-flex flex-row align-items-center mt-1 mb-1 color-white">
|
|
|
<span className="mr-2">
|
|
|
- <img src="/img/demo/avatars/avatar-admin.png" className="rounded-circle profile-image" alt="Dr. Codex Lantern"/>
|
|
|
+ <img src={staffDetail.avatar} className="rounded-circle profile-image" alt={staffDetail.username} />
|
|
|
</span>
|
|
|
<div className="info-card-text">
|
|
|
- <div className="fs-lg text-truncate text-truncate-lg">张三</div>
|
|
|
- <span className="text-truncate text-truncate-md opacity-80">工号:0001</span>
|
|
|
+ <div className="fs-lg text-truncate text-truncate-lg">{staffDetail.username}</div>
|
|
|
+ <span className="text-truncate text-truncate-md opacity-80">工号:{staffDetail.jobNumber}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -72,23 +74,34 @@ class staffHeader extends PureComponent {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ componentDidMount() {
|
|
|
+ // const { handleMenuActive } = this.props;
|
|
|
+ // let protocol = window.location.pathname;
|
|
|
+ // let sectionName='client';
|
|
|
+ // if(protocol==='/contact/company'){
|
|
|
+ // sectionName='company';
|
|
|
+ // }
|
|
|
+ // handleMenuActive(sectionName);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
const mapStateToProps = (state) => {
|
|
|
return {
|
|
|
- menuActive: state.getIn(['common', 'menuActive']),
|
|
|
+ sectionName: state.getIn(['common', 'sectionName']),
|
|
|
+ staff: state.getIn(['common', 'staff']),
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
const mapDispathToProps = (dispatch) => {
|
|
|
return {
|
|
|
- handleMenuActive(value) {
|
|
|
- dispatch(actionCreators.menuActive(value));
|
|
|
- },
|
|
|
+ // handleSectionName(value) {
|
|
|
+ // dispatch(actionCreators.menuActive(value));
|
|
|
+ // },
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
-export default staffHeader;
|
|
|
-// export default connect(mapStateToProps, mapDispathToProps)(staffHeader);
|
|
|
+// export default staffHeader;
|
|
|
+export default connect(mapStateToProps, mapDispathToProps)(staffHeader);
|