|
@@ -21,7 +21,7 @@ import '../style.css';
|
|
|
// );
|
|
|
// }
|
|
|
|
|
|
-
|
|
|
+let dt = null;
|
|
|
|
|
|
class client extends PureComponent {
|
|
|
|
|
@@ -137,7 +137,7 @@ class client extends PureComponent {
|
|
|
|
|
|
|
|
|
render() {
|
|
|
- const { columns, clientThead, handleSearch } = this.props;
|
|
|
+ const { columns, columnsData, handleSearch, handleColumnsShow } = this.props;
|
|
|
|
|
|
return (
|
|
|
<Fragment>
|
|
@@ -185,10 +185,7 @@ value={searchValue} onChange={handleInputSearchValue}
|
|
|
|
|
|
<div className="col-auto pr-0">
|
|
|
<div className="input-group input-group-sm bg-white shadow-inset-2">
|
|
|
- <input type="text" ref={(input)=>{this.searchValue=input}} onKeyUp={()=>handleSearch(this.searchValue)} className="form-control bg-transparent" placeholder="姓名/客户/手机/QQ" />
|
|
|
- <div className="input-group-append">
|
|
|
- <button className="btn btn-default waves-effect waves-themed" type="button" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="搜索"><i className="fal fa-search"></i></button>
|
|
|
- </div>
|
|
|
+ <input type="text" ref={(input) => { this.searchValue = input }} onKeyUp={() => handleSearch(this.searchValue)} className="form-control bg-transparent" placeholder="姓名/客户/手机/QQ" />
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
@@ -197,104 +194,26 @@ value={searchValue} onChange={handleInputSearchValue}
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
<div className="col-auto ml-auto">
|
|
|
- <button className="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown">已显示5列</button>
|
|
|
- {/* <div className="dropdown-menu">
|
|
|
- <ul className="list-unstyled px-3 pt-2 mb-0">
|
|
|
- <li className="mb-2">
|
|
|
- <div className="custom-control custom-switch">
|
|
|
- <input type="checkbox" className="custom-control-input" id="lie1" />
|
|
|
- <label className="custom-control-label" forHtml="lie1">手机</label>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- <li className="mb-2">
|
|
|
- <div className="custom-control custom-switch">
|
|
|
- <input type="checkbox" className="custom-control-input" id="lie2" />
|
|
|
- <label className="custom-control-label" forHtml="lie2">电话</label>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- <li className="mb-2">
|
|
|
- <div className="custom-control custom-switch">
|
|
|
- <input type="checkbox" className="custom-control-input" id="lie3" />
|
|
|
- <label className="custom-control-label" forHtml="lie3">QQ</label>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- <li className="mb-2">
|
|
|
- <div className="custom-control custom-switch">
|
|
|
- <input type="checkbox" className="custom-control-input" id="lie4" checked="" />
|
|
|
- <label className="custom-control-label" forHtml="lie4">部门</label>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- <li className="mb-2">
|
|
|
- <div className="custom-control custom-switch">
|
|
|
- <input type="checkbox" className="custom-control-input" id="lie5" />
|
|
|
- <label className="custom-control-label" forHtml="lie5">职务</label>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- <li className="mb-2">
|
|
|
- <div className="custom-control custom-switch">
|
|
|
- <input type="checkbox" className="custom-control-input" id="lie6" />
|
|
|
- <label className="custom-control-label" forHtml="lie6">办公室</label>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- <li className="mb-2">
|
|
|
- <div className="custom-control custom-switch">
|
|
|
- <input type="checkbox" className="custom-control-input" id="lie7" />
|
|
|
- <label className="custom-control-label" forHtml="lie7">地区</label>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- <li className="mb-2">
|
|
|
- <div className="custom-control custom-switch">
|
|
|
- <input type="checkbox" className="custom-control-input" id="lie8" checked="" />
|
|
|
- <label className="custom-control-label" forHtml="lie8">个人标签</label>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- <li className="mb-2">
|
|
|
- <div className="custom-control custom-switch">
|
|
|
- <input type="checkbox" className="custom-control-input" id="lie8" checked="" />
|
|
|
- <label className="custom-control-label" forHtml="lie8">地址</label>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- <li className="mb-2">
|
|
|
- <div className="custom-control custom-switch">
|
|
|
- <input type="checkbox" className="custom-control-input" id="lie8" checked="" />
|
|
|
- <label className="custom-control-label" forHtml="lie8">乘车</label>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- <li className="mb-2">
|
|
|
- <div className="custom-control custom-switch">
|
|
|
- <input type="checkbox" className="custom-control-input" id="lie8" checked="" />
|
|
|
- <label className="custom-control-label" forHtml="lie8">地标</label>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- <li className="mb-2">
|
|
|
- <div className="custom-control custom-switch">
|
|
|
- <input type="checkbox" className="custom-control-input" id="lie8" checked="" />
|
|
|
- <label className="custom-control-label" forHtml="lie8">住宿</label>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- <li className="mb-2">
|
|
|
- <div className="custom-control custom-switch">
|
|
|
- <input type="checkbox" className="custom-control-input" id="lie10" checked="" />
|
|
|
- <label className="custom-control-label" forHtml="lie10">软件锁</label>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- <li className="mb-2">
|
|
|
- <div className="custom-control custom-switch">
|
|
|
- <input type="checkbox" className="custom-control-input" id="lie11" checked="" />
|
|
|
- <label className="custom-control-label" forHtml="lie11">大司空</label>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
+ <button className="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown">显示列</button>
|
|
|
|
|
|
+ <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={() => handleInputChange()} value={item.get('columnsValue')} checked={item.get('columnsValue')} className="custom-control-input" id={"lie" + index} />
|
|
|
+ <label onClick={() => handleColumnsShow(index)} className="custom-control-label" >{item.get('columnsName')}</label>
|
|
|
+ </div>
|
|
|
+ </li>
|
|
|
+ )
|
|
|
+ })
|
|
|
+ }
|
|
|
</ul>
|
|
|
- </div> */}
|
|
|
+ </div>
|
|
|
+
|
|
|
</div>
|
|
|
|
|
|
<div className="col-auto pl-0">
|
|
@@ -345,7 +264,7 @@ value={searchValue} onChange={handleInputSearchValue}
|
|
|
<div className="panel-container show ">
|
|
|
<div className="panel-content " >
|
|
|
{/* this.constructClientColumns() this.constructClientThead() */}
|
|
|
- <DataTable onRef={(ref) => this.dt = ref} url={`/contact/client`} thead={clientThead} columns={columns.toJS()} />
|
|
|
+ <DataTable onRef={(ref) => dt = ref} url={`/contact/client`} columnsData={columnsData} columns={columns.toJS()} />
|
|
|
|
|
|
{/* <table id="dt-basic-example" className="table table-bordered table-hover table-striped w-100">
|
|
|
<thead>
|
|
@@ -446,8 +365,7 @@ value={searchValue} onChange={handleInputSearchValue}
|
|
|
}
|
|
|
|
|
|
|
|
|
-let delaySwitch=null;
|
|
|
-
|
|
|
+let delaySwitch = null;//延迟检索开关
|
|
|
|
|
|
/**
|
|
|
* store里的数据映射到这个组件里的state
|
|
@@ -455,11 +373,8 @@ let delaySwitch=null;
|
|
|
*/
|
|
|
const mapStateToProps = (state) => {
|
|
|
return {
|
|
|
- clientList: state.getIn(['contact', 'clientList']),
|
|
|
-
|
|
|
- //searchValue: state.getIn(['contact', 'searchValue']),
|
|
|
columns: state.getIn(['contact', 'columns']),
|
|
|
- clientThead: state.getIn(['contact', 'clientThead']),
|
|
|
+ columnsData: state.getIn(['contact', 'columnsData']),
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -473,19 +388,27 @@ const mapDispathToProps = (dispatch) => {
|
|
|
handleClientData(list) {
|
|
|
(list.size === 0) && dispatch(actionCreators.getClientLIst());
|
|
|
},
|
|
|
+ //检索联系人
|
|
|
handleSearch(serchValue) {
|
|
|
//e.target --可以获得dom
|
|
|
- if(delaySwitch != null){
|
|
|
+ if (delaySwitch != null) {
|
|
|
clearTimeout(delaySwitch);
|
|
|
}
|
|
|
- delaySwitch = setTimeout(()=>{
|
|
|
- this.dt.handleSearch();
|
|
|
+ delaySwitch = setTimeout(() => {
|
|
|
+ let filter = {
|
|
|
+ searchValue: serchValue.value
|
|
|
+ };
|
|
|
+ dt.handleSearch(filter);
|
|
|
}, 350);
|
|
|
-
|
|
|
-
|
|
|
- ;
|
|
|
},
|
|
|
-
|
|
|
+ handleInputChange(e){
|
|
|
+ // const target = event.target;
|
|
|
+ // const value = target.checked;
|
|
|
+ // console.log(value);
|
|
|
+ },
|
|
|
+ handleColumnsShow(index) {
|
|
|
+ dispatch(actionCreators.toggleColumns(index));
|
|
|
+ },
|
|
|
// handleInputFocus(list) {
|
|
|
|
|
|
// // const action = {
|