import React from 'react';
import { connect } from 'dva';
import { Button, Row, Col, Form, Input,Select,Upload,Icon,Transfer,Spin,message,Tabs, } from 'antd';
import {
  extend,
  extendRule,
  initFilter,
  initQueryFilter,
  getOnlyPropertyData,
  extendInclude, guid, getDataFieldValue
} from "../../../utils/common";
import DropDownPagination from '../../common/DropDownPaginationEx';
import EditComponent from "../../../baseComponents/EditComponent";
import config from "../../../config";
const TabPane = Tabs.TabPane;
const FormItem = Form.Item;
const Option = Select.Option;
const { TextArea } = Input;
class MaintainStartEditPage extends EditComponent {
  constructor(props) {
    super(props);
    this.state = {
      data: {
      },
    };
  };
  JointRows=({record})=>{
    if(record.Nav_AbnormalOrder.Nav_AbnormalOrderDetails)return;
    let joinRows='';
    if(this.state.btns){
      return record.Nav_AbnormalOrder.Nav_AbnormalOrderDetails.map(item=>{
        joinRows +='  <Row style={{ \'marginTop\': \'10px\' }}> <Col span={8}' +
          ' value={item.Nav_AbnormalProject.CODE}></Col><Col span={16}   value={item.Nav_AbnormalProject.NAME}>' +
          ' </Col></Row>'
      });
    }
  };
  // onRenderHeadControl(params){
  //   const {colConfig,record}=params;
  //   console.log(colConfig.field);
  //   if(colConfig.field==='subProject'){
  //     const that=this;
  //     return (
  //       <div>
  //         <Form>
  //           <Row style={{ 'marginTop': '20px' }}>
  //             <Tabs defaultActiveKey="1" >
  //               <TabPane tab="异常项目明细" key="1">
  //                 <Row style={{ 'marginTop': '10px' }}>
  //                   <Col span={8}>异常项目编号
  //                   </Col>
  //                   <Col span={8}>异常项目名称
  //                   </Col>
  //                 </Row>
  //                 {this.JointRows(params)}
  //                 <Row style={{ 'marginTop': '10px' }}>
  //                   <Col span={8}>AS-999213
  //                   </Col>
  //                   <Col span={8}>
  //                      测试数据
  //                   </Col>
  //                 </Row>
  //               </TabPane>
  //             </Tabs>
  //           </Row>
  //         </Form>
  //       </div>
  //     )
  //   }
  //   return super.onRenderHeadControl(params);
  // }
  
  onBeforeEdit(params){
    super.onBeforeEdit(params);
    const data=this.state.data;
    data['Nav_AbnormalOrder.Nav_AbnormalOrderDetails']=
      getDataFieldValue(data,'Nav_AbnormalOrder.Nav_AbnormalOrderDetails');
    this.setState({
      data
    });
  }
  
  
  

}


export default connect(({ login, loading,custom,app }) => ({ login, loading,custom,app}))(Form.create()(MaintainStartEditPage));
