11
22import  React ,  {  PropTypes ,  Component  }  from  'react' ; 
3- import  { Breadcrumb ,  Table }  from  'react-bootstrap' ; 
3+ import  { Breadcrumb ,  Table ,   Button ,   Col }  from  'react-bootstrap' ; 
44import  cx  from  'classnames' ; 
55import  _  from  'lodash' ; 
66import  withStyles  from  'isomorphic-style-loader/lib/withStyles' ; 
77import  s  from  './ProductList.css' ; 
88import  Link  from  '../Link' ; 
9+ import  PopAddApp  from  './PopAddApp' ; 
910
1011class  ProductList  extends  Component  { 
1112  static  propTypes  =  { 
1213    isFetching : PropTypes . bool , 
1314    rs : PropTypes . array , 
1415  } ; 
1516
17+   popAddApp :PopAddApp  =  null ; 
18+ 
1619  static  defaultProps  =  { 
1720    isFetching : true , 
1821    rs : [ ] , 
@@ -22,12 +25,13 @@ class ProductList extends Component {
2225    super ( ) ; 
2326    this . renderRow  =  this . renderRow . bind ( this ) ; 
2427  } 
25- 
2628  renderRow ( rowData ,  index )  { 
2729    const  appName  =  _ . get ( rowData ,  'name' ) ; 
2830    return  ( 
2931      < tr  key = { index } > 
30-         < td > { appName } </ td > 
32+         < td > 
33+           < Link  to = { `/apps/${ appName }  } > { appName } </ Link > 
34+         </ td > 
3135        < td  style = { {  textAlign : 'left'  } } > 
3236          < ul > 
3337            { 
@@ -70,12 +74,27 @@ class ProductList extends Component {
7074    const  tipText  =  '暂无数据' ; 
7175    return  ( 
7276      < div  className = { s . root } > 
77+         < PopAddApp 
78+           ref = { ( popAddApp )  =>  {  this . popAddApp  =  popAddApp ;  } } 
79+           value = { this . props . token } 
80+           close = { this . props . close } 
81+         /> 
7382        < div  className = { s . container } > 
7483        < Breadcrumb > 
7584          < Breadcrumb . Item  active = { true } > 
7685            应用列表
7786          </ Breadcrumb . Item > 
7887        </ Breadcrumb > 
88+         < Col  style = { { marginBottom :'20px' } } > 
89+           < Button 
90+             onClick = { ( ) => { 
91+               self . popAddApp . open ( ) ; 
92+             } } 
93+             bsStyle = "primary" 
94+           > 
95+           添加应用
96+           </ Button > 
97+         </ Col > 
7998        < Table  striped  bordered  condensed  hover  responsive > 
8099          < thead > 
81100            < tr > 
0 commit comments