|
@@ -113,10 +113,16 @@ class TemplateItems extends React.Component {
|
|
|
this.$search.current.value = '';
|
|
|
this.setState({
|
|
|
val:''
|
|
|
- })
|
|
|
+ });
|
|
|
this.$search.current.focus();
|
|
|
+ this.templateSearch();
|
|
|
+ }
|
|
|
+ componentWillReceiveProps(next){
|
|
|
+ //点清空恢复初始状态
|
|
|
+ if(this.props.clearSearch!==next.clearSearch){
|
|
|
+ this.clear();
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
render() {
|
|
|
const { checkItemsAdmin,handleAllCheckboxAdmin,handleMangerTemplateAdmin,allCheckShowAdmin,admin,adminItems,allCheckShow, handleMangerTemplate,handleClickGetMore, handleDelList, handleAllCheckbox, items,checkItems,current,hasMore } = this.props;
|
|
|
const {height} = this.state
|
|
@@ -138,7 +144,7 @@ class TemplateItems extends React.Component {
|
|
|
<div className={style.wrapperTop}>
|
|
|
<div className={style.templateSearch}>
|
|
|
<input placeholder="模板搜索" maxLength="30" ref={this.$search} type="text" onInput={this.handleChange} onPropertyChange={this.handleChange} onKeyUp={this.handleEnter}/>
|
|
|
- {this.state.val?<img src={delIcon} id='clearTemplateSearch' alt="清空" onClick={this.clear}/>:''}
|
|
|
+ {this.state.val?<img src={delIcon} alt="清空" onClick={this.clear}/>:''}
|
|
|
<div className={style.search} onClick={this.templateSearch}>搜索</div>
|
|
|
</div>
|
|
|
{
|
|
@@ -150,7 +156,7 @@ class TemplateItems extends React.Component {
|
|
|
items&&!admin ?
|
|
|
<div className={style.wrapperTop}>
|
|
|
<div className={style.templateSearch}>
|
|
|
- <input placeholder="模板搜索" maxLength="30" ref={this.$search} type="text" onInput={this.handleChange} onPropertyChange={this.handleChange} onKeyUp={this.handleEnter}/>
|
|
|
+ <input placeholder="模板搜索" id='templateSearch' maxLength="30" ref={this.$search} type="text" onInput={this.handleChange} onPropertyChange={this.handleChange} onKeyUp={this.handleEnter}/>
|
|
|
{this.state.val?<img src={delIcon} alt="清空" onClick={this.clear}/>:''}
|
|
|
<div className={style.search} onClick={this.templateSearch}>搜索</div>
|
|
|
</div>
|