import * as React from 'react';
import * as T from '../types';
import './<%=subComp.fileName%>.less';
import pageModel from '../actions';
import { connect } from 'react-redux';
import {store2Props} from "../selectors";
import classNames from "classnames";
<%-subComp.imports%>

type I<%=Util.toUCamelize(subComp.fileName)%>Props = T.IAllReducerProps & T.I<%=Util.toUCamelize(subComp.fileName)%>Props;

@connect<Partial<I<%=Util.toUCamelize(subComp.fileName)%>Props>, T.I<%=Util.toUCamelize(subComp.fileName)%>State>(store2Props)
export default class <%=Util.toUCamelize(subComp.fileName)%> extends React.Component<Partial<I<%=Util.toUCamelize(subComp.fileName)%>Props>, T.I<%=Util.toUCamelize(subComp.fileName)%>State> {
  constructor(props:I<%=Util.toUCamelize(subComp.fileName)%>Props) {
    super(props);
  }

/**
    <%-(subComp.methods.filter(item=>item.name =="render")[0]||{}).comment%>
*/
  render() {
    let {<% pageInfo.models.forEach(actor=>{ %>
                    <%=Util.toLCamelize(actor.fileName)%> ,
      <% }) %>
    } =  this.props;
    let {actions} = pageModel;




    <% if (subComp.methods.filter(item=>item.name =="render")[0] && subComp.methods.filter(item=>item.name =="render")[0].content) { %>
        <%- (subComp.methods.filter(item=>item.name =="render")[0]||{}).content %>
    <% }  else {%>
       return (
                  <div className="<%=Util.toUCamelize(pageInfo.pageKey)%><%=Util.toUCamelize(subComp.fileName)%>">
                     <div/>
                  </div>
              );
    <% } %>
  }

   <% subComp.methods.filter(item=>item.name!=="render").forEach(method=>{ %>
          /**
           * <%= method.comment||"" %>
           */
          async <%=method.name%>() {
              <%-method.content%>
           },
        <% }) %>
}


// create by moon https://github.com/creasy2010/moon
