text: import React, {Component} from 'react'
  import {connect} from 'dva'
  import { Row, Col, Icon  } from 'antd';
  import classnames from 'classnames'
  import {BtnA,LineA} from '@ui-components/UIA.js'
  import {$temp1} from "@src/components/Carpicker/filtersTemp";
  
  class CarPickerList extends Component {
      constructor(props) {
          super(props);
          this.state={
              showMore:false
          }
      }
      handleClick(item){
          this.props.dispatch({
              type:'carpicker/addtag',
              key:this.props.keyValue,
              tagname:this.props.tagname,
              id:item.id,
              value:item.value,
              template:$temp1
          })
      }
      render() {
          let calc=(id)=>{
              let filterData = this.props.filters&&this.props.filters.filter((item)=>item.key==this.props.keyValue);
              if(filterData.length>0){
                  if(filterData[0].id==id){
                      return true;
                  }else{
                      return false;
                  }
              }else{
                  return false;
              }
          };
          return (
              <div>
                  <Row className={
                      classnames({
                          headList:true,
                          topList:this.state.showMore
                      })
                  }>
                      <Col span={Object.keys(this.props.data.all).length>6?22:24}>
                          {
                              this.props.data.special.map((item,i)=>{
                                  return (
                                      <BtnA className={classnames({
                                          cur:calc(item.id)
                                      })} key={i} onClick={()=>{this.handleClick(item)}}>{item.value}</BtnA>
                                  )
                              })
                          }
                      </Col>
                      <Col span={2} style={{textAlign:'right',display:Object.keys(this.props.data.all).length>6?'block':'none'}}>
                          <LineA onClick={()=>{this.setState({showMore:!this.state.showMore})}}>
                              更多 <Icon type={this.state.showMore?'down':'up'} />
                          </LineA>
                      </Col>
                  </Row>
                  <Row className={classnames({'centerList':true,'cur':this.state.showMore})}>
                      {
                          Object.keys(this.props.data.all).map((item,i)=>{
                              return (
                                  <Col key={i} span={24}>
                                      <div className="seriesPanle">
                                          <label>
                                              {item}
                                          </label>
                                          <dl>
                                              {
                                                  this.props.data.all[item].map((jtem,j)=>{
                                                      return (
                                                          <dd
                                                              className={classnames({
                                                                  cur:calc(jtem.id)
                                                              })}
                                                              onClick={()=>{this.handleClick(jtem)}} key={j}>{jtem.value}</dd>
                                                      )
                                                  })
                                              }
                                          </dl>
                                      </div>
                                  </Col>
                              )
                          })
                      }
                  </Row>
              </div>
          )
      }
  }
  export default connect(
      ({carpicker})=>{
          return {
              filters:carpicker.filters
          }
      }
  )(CarPickerList)