|
@@ -3,78 +3,15 @@ import { connect } from 'react-redux';
|
|
import StaffHeader from '../../common/staffHeader';
|
|
import StaffHeader from '../../common/staffHeader';
|
|
import { actionCreators } from './store';
|
|
import { actionCreators } from './store';
|
|
|
|
|
|
-import { Table, Modal,Spin, Space, Tag } from 'antd';
|
|
|
|
|
|
+import { Table, Modal, Spin, Space, Tag } from 'antd';
|
|
import 'antd/dist/antd.css';
|
|
import 'antd/dist/antd.css';
|
|
import Popups from '../../common/popups';
|
|
import Popups from '../../common/popups';
|
|
|
|
|
|
-
|
|
|
|
-// import DataTable from '../../common/dataTable/dataTable.react';
|
|
|
|
-// const columns = [
|
|
|
|
-// {
|
|
|
|
-// title: '客户名称',
|
|
|
|
-// dataIndex: 'clientname',
|
|
|
|
-// key: 'clientname',
|
|
|
|
-// render: text => <a >{text}</a>,
|
|
|
|
-// },
|
|
|
|
-// {
|
|
|
|
-// title: '地区',
|
|
|
|
-// dataIndex: 'companyname',
|
|
|
|
-// key: 'companyname',
|
|
|
|
-// },
|
|
|
|
-// {
|
|
|
|
-// title: '标签',
|
|
|
|
-// dataIndex: 'telephone',
|
|
|
|
-// key: 'telephone',
|
|
|
|
-// },
|
|
|
|
-// {
|
|
|
|
-// title: '标签',
|
|
|
|
-// dataIndex: 'telephone',
|
|
|
|
-// key: 'telephone',
|
|
|
|
-// },
|
|
|
|
-// {
|
|
|
|
-// title: '标签',
|
|
|
|
-// dataIndex: 'telephone',
|
|
|
|
-// key: 'telephone',
|
|
|
|
-// },
|
|
|
|
-// {
|
|
|
|
-// title: '标签',
|
|
|
|
-// dataIndex: 'telephone',
|
|
|
|
-// key: 'telephone',
|
|
|
|
-// },
|
|
|
|
-// {
|
|
|
|
-// title: '标签',
|
|
|
|
-// dataIndex: 'telephone',
|
|
|
|
-// key: 'telephone',
|
|
|
|
-// },
|
|
|
|
-// {
|
|
|
|
-// title: '标签',
|
|
|
|
-// dataIndex: 'telephone',
|
|
|
|
-// key: 'telephone',
|
|
|
|
-// },
|
|
|
|
-// {
|
|
|
|
-// title: '标签',
|
|
|
|
-// dataIndex: 'telephone',
|
|
|
|
-// key: 'telephone',
|
|
|
|
-// },
|
|
|
|
-// {
|
|
|
|
-// title: '标签',
|
|
|
|
-// dataIndex: 'telephone',
|
|
|
|
-// key: 'telephone',
|
|
|
|
-// },
|
|
|
|
-// {
|
|
|
|
-// title: '标签',
|
|
|
|
-// dataIndex: 'telephone',
|
|
|
|
-// key: 'telephone',
|
|
|
|
-// },
|
|
|
|
-
|
|
|
|
-// ];
|
|
|
|
-
|
|
|
|
-let popupsObj=null;
|
|
|
|
-
|
|
|
|
|
|
+let popupsObj = null;
|
|
class company extends PureComponent {
|
|
class company extends PureComponent {
|
|
|
|
|
|
render() {
|
|
render() {
|
|
- const { companyData, columnsData, companyList, pagination, handleCompanyData, loading, columns, handleCompanyPopups } = this.props;
|
|
|
|
|
|
+ const { handleInputChange, columnsVisible, companyList, pagination, handleCompanyData, loading, columns, handleColumnsShow } = this.props;
|
|
|
|
|
|
return (
|
|
return (
|
|
<Fragment>
|
|
<Fragment>
|
|
@@ -134,21 +71,21 @@ value={searchValue} onChange={handleInputSearchValue}
|
|
<button className="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown">显示列</button>
|
|
<button className="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown">显示列</button>
|
|
|
|
|
|
<div className="dropdown-menu">
|
|
<div className="dropdown-menu">
|
|
- {/* <ul className="list-unstyled px-3 pt-2 mb-0">
|
|
|
|
- {
|
|
|
|
- columnsData.map((item, index) => {
|
|
|
|
- return (
|
|
|
|
- <li key={index} className="mb-2">
|
|
|
|
- <div className="custom-control custom-switch">
|
|
|
|
- <input type="checkbox" name={index} onChange={(e) => handleInputChange(e, index)} value={item.get('columnsValue')} checked={item.get('columnsValue')} className="custom-control-input" id={"lie" + index} />
|
|
|
|
- <label onClick={() => handleColumnsShow(index)} htmlFor={"lie" + index} className="custom-control-label" >{item.get('columnsName')}</label>
|
|
|
|
-
|
|
|
|
- </div>
|
|
|
|
- </li>
|
|
|
|
- )
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- </ul> */}
|
|
|
|
|
|
+ <ul className="list-unstyled px-3 pt-2 mb-0">
|
|
|
|
+ {
|
|
|
|
+ columnsVisible.map((item, index) => {
|
|
|
|
+ return (
|
|
|
|
+ <li key={index} className="mb-2">
|
|
|
|
+ <div className="custom-control custom-switch">
|
|
|
|
+ <input type="checkbox" name={index} onChange={(e) => handleInputChange(e, index)} value={item.get('columnsValue')} checked={item.get('columnsValue')} className="custom-control-input" id={"lie" + index} />
|
|
|
|
+ <label onClick={() => handleColumnsShow(index)} htmlFor={"lie" + index} className="custom-control-label" >{item.get('columnsName')}</label>
|
|
|
|
+
|
|
|
|
+ </div>
|
|
|
|
+ </li>
|
|
|
|
+ )
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ </ul>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
@@ -294,19 +231,19 @@ value={searchValue} onChange={handleInputSearchValue}
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</main>
|
|
</main>
|
|
-
|
|
|
|
-
|
|
|
|
|
|
|
|
- <Popups mainView={'company'} onRef={(ref) => popupsObj = ref} />
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <Popups mainView={'company'} onRef={(ref) => popupsObj = ref} />
|
|
|
|
+
|
|
|
|
|
|
</Fragment>
|
|
</Fragment>
|
|
)
|
|
)
|
|
}
|
|
}
|
|
|
|
|
|
componentDidMount() {
|
|
componentDidMount() {
|
|
- const { handleCompanyData, companyList, pagination, handleCompanyPopups } = this.props;
|
|
|
|
-
|
|
|
|
|
|
+ const { handleCompanyData, handleColumnsAllShow, pagination, handleCompanyPopups } = this.props;
|
|
|
|
+ handleColumnsAllShow();
|
|
handleCompanyData(pagination.toJS(), {}, {}, this.props);
|
|
handleCompanyData(pagination.toJS(), {}, {}, this.props);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -318,13 +255,14 @@ value={searchValue} onChange={handleInputSearchValue}
|
|
const mapStateToProps = (state) => {
|
|
const mapStateToProps = (state) => {
|
|
return {
|
|
return {
|
|
companyData: state.getIn(['company', 'companyData']),
|
|
companyData: state.getIn(['company', 'companyData']),
|
|
- columnsData: state.getIn(['company', 'columnsData']),
|
|
|
|
|
|
|
|
|
|
+ columnsVisible: state.getIn(['company', 'columnsVisible']),
|
|
companyList: state.getIn(['company', 'companyList']),
|
|
companyList: state.getIn(['company', 'companyList']),
|
|
pagination: state.getIn(['company', 'pagination']),
|
|
pagination: state.getIn(['company', 'pagination']),
|
|
loading: state.getIn(['company', 'loading']),
|
|
loading: state.getIn(['company', 'loading']),
|
|
columns: state.getIn(['company', 'columns']),
|
|
columns: state.getIn(['company', 'columns']),
|
|
|
|
|
|
|
|
+
|
|
companyDetail: state.getIn(['popups', 'companyDetail']),
|
|
companyDetail: state.getIn(['popups', 'companyDetail']),
|
|
|
|
|
|
}
|
|
}
|
|
@@ -332,11 +270,24 @@ const mapStateToProps = (state) => {
|
|
|
|
|
|
const mapDispathToProps = (dispatch) => {
|
|
const mapDispathToProps = (dispatch) => {
|
|
return {
|
|
return {
|
|
|
|
+ //列隐藏显示
|
|
|
|
+ handleInputChange(e, index) {//---此方法可能废弃
|
|
|
|
+
|
|
|
|
+ //dt.handleColumnVisible(index, e.target.value);
|
|
|
|
+ },
|
|
|
|
+ handleColumnsShow(index) {
|
|
|
|
+ dispatch(actionCreators.toggleColumns(index));
|
|
|
|
+ },
|
|
|
|
+ handleColumnsAllShow() {
|
|
|
|
+ dispatch(actionCreators.toggleColumnsAll());
|
|
|
|
+ },
|
|
|
|
+ //获得客户数据
|
|
handleCompanyData(pagination, filters, sorter, props) {
|
|
handleCompanyData(pagination, filters, sorter, props) {
|
|
dispatch(actionCreators.changeLoading());
|
|
dispatch(actionCreators.changeLoading());
|
|
dispatch(actionCreators.getCompanyLIst(pagination, props));
|
|
dispatch(actionCreators.getCompanyLIst(pagination, props));
|
|
//(list.size === 0) && dispatch(actionCreators.getCompanyLIst());
|
|
//(list.size === 0) && dispatch(actionCreators.getCompanyLIst());
|
|
},
|
|
},
|
|
|
|
+ //弹出详情页点击触发
|
|
handleCompanyPopups(key) {
|
|
handleCompanyPopups(key) {
|
|
popupsObj.handleCompanyPopups(key);
|
|
popupsObj.handleCompanyPopups(key);
|
|
// console.log(popupsObj);
|
|
// console.log(popupsObj);
|