import React from 'react';
import { connect } from 'dva';
import PageConfigShowBaseComponent from "../Lib/PageConfigShowBaseComponent";
import {guid} from "../../../utils/common";


class EditColumnFillMapDetailShowPage extends PageConfigShowBaseComponent{
  constructor(props) {
    super(props);
    this.state = {
      data: {},
      paginationIndex:1,
      paginationTotalCount: 0,
      rowData:{},
      visible:false,
      selectedRowKeys: []
    };
  };

  onGetTableConfig(){
    const tableConfig={
      sort: 'CREATE_TIME',
      order: 1,
      api:'PF/EditColumnFillMapDetail/OrderPaged',
      columns: [

        {controlType:1,field:'SRC_FIELD_NAME',label:'来源字段',isRequire:true},
        {controlType:1,field:'DEST_FIELD_NAME',label:'目标字段',isRequire:true},
      ],
      deleteApi:'PF/EditColumnFillMapDetail/Delete',
      editConfig:{
        data: {
          'ORG_ID': this.props.orgId,
          'EDIT_COLUMN_FILL_MAP_ID': this.props.fillMapId,
        },
        columns:[
          {controlType:1,field:'SRC_FIELD_NAME',label:'来源字段',isRequire:true},
          {controlType:1,field:'DEST_FIELD_NAME',label:'目标字段',isRequire:true},
        ],
        getApi:'PF/EditColumnFillMapDetail/Get',
        saveApi:'PF/EditColumnFillMapDetail/Update',
      },
      rule:{
        rules:[
          {field:'EDIT_COLUMN_FILL_MAP_ID',operator:1,value:this.props.fillMapId},
        ]
      },
      rowBtns:[
        {id:guid(),btnType:7,code:'edit'},
        {id:guid(),btnType:4,code:'delete'},
      ]
    };
    return [tableConfig];
  }
}

export default  connect(({ login, app,loading,custom }) => ({ login,app, loading,custom }))(EditColumnFillMapDetailShowPage);
