import { inject, observer } from 'mobx-react'; import { WeaDialog, WeaNewScroll, } from 'ecCom' import { Row, Col, Icon, Spin, Modal, Table, Button, } from 'antd' import isEmpty from 'lodash/isEmpty'; import React from 'react' import { WeaTableNew } from 'comsMobx'; import { toJS } from 'mobx'; const WeaTable = WeaTableNew.WeaTable; import { i18n } from '../../public/i18n'; @inject('hrmImportResource') @observer class ImportResult extends React.Component { constructor(props) { super(props); } componentDidMount() { const { hrmImportResource } = this.props; hrmImportResource.errorInfo = ''; } getButtons() { const { hrmImportResource } = this.props; const { failnum, importStatus } = hrmImportResource; const buttons = []; if (importStatus == 'over') { // if (failnum > 0) { // buttons.push(); // } // buttons.push(); buttons.push(); } return buttons; } reRenderColumns(c) { c.forEach(item => { if (item.dataIndex == 'operatedetail') { item.render = function(text, record) { return {text} } } }); } cancel() { const { hrmImportResource } = this.props; this.dialogKey = new Date().getTime(); hrmImportResource.visibleResult = false; } getImportLog() { const { hrmImportResource } = this.props; hrmImportResource.visibleImportLog = true; let params = {}; params.importType = 'resource'; hrmImportResource.getImportLogSearchCondition(params); hrmImportResource.getImportLogDetail(params); } render() { const { hrmImportResource } = this.props; const { titleResult, visibleResult, importResultColumns, importProcessLogDatas, failnum, succnum, importResultTip, importResultStore, importStatus, errorInfo, setScrollRef, dialogKey } = hrmImportResource; const buttons = []; if (importStatus == 'over') { buttons.push( { key: '1', content: i18n.button.getImportLog(), icon: , onClick: () => this.getImportLog(), } ); } return (
{ visibleResult && this.cancel()} buttons={this.getButtons()} style={{ width: 720, height: 480 }} moreBtn={{datas:buttons}} >
{ importStatus == '' || importStatus == 'importing' || importStatus == 'error'?
{ importStatus == 'error'?
{importResultTip}
:
}
{ hrmImportResource.setScrollTarget(scroll) }}> :
0 ? '#54D3A2' : '#FF0000' }}> 0 ? 'check' : 'cross'} style={{ color: '#fff' }} />
{importResultTip}
{ failnum > 0 && index} getColumns={c => this.reRenderColumns(c)} /> }
} } ) } } export default ImportResult