import { inject, observer } from 'mobx-react'; import { WeaDialog, } from 'ecCom' import { Modal, Table, Button, } from 'antd' import React from 'react' import { WeaTableNew } from 'comsMobx'; import ImportLog from './ImportLog' import { i18n } from '../../public/i18n'; const WeaTable = WeaTableNew.WeaTable; @inject('hrmImportResource') @observer class ImportHistory extends React.Component { constructor(props) { super(props); } reRenderColumns(c) { let _this = this; c.forEach(item => { if (item.dataIndex == 'operator') { item.render = function(text, record) { return _this.jumpToHrmCard(record.operator)}>{record.operatorspan} } } if (item.dataIndex == 'allnum') { item.render = function(text, record) { return _this.jumpToImportResult(record.randomFieldId)}>{record.allnumspan} } } }); } jumpToHrmCard(id) { window.open(`/spa/hrm/index_mobx.html#/main/hrm/card/cardInfo/${id}`); } jumpToImportResult(pId) { const { hrmImportResource } = this.props; hrmImportResource.dialogKey = new Date().getTime(); hrmImportResource.visibleResult = true; hrmImportResource.getImportResult({ pId, importType: 'resource' }); } queryImportLog() { const { hrmImportResource } = this.props; let params = {}; params.importType = 'resource'; hrmImportResource.pId = ''; hrmImportResource.getImportLogDetail(params); hrmImportResource.getImportLogSearchCondition(params); hrmImportResource.visibleImportLog = true; } cancel() { const { hrmImportResource } = this.props; hrmImportResource.visibleHistory = false; } render() { const { hrmImportResource, importLog, viewLog, } = this.props; const { titleHistory, visibleHistory, onCancel, importHistoryStore } = hrmImportResource; const buttons = [ (), ]; let dialogHeight = window.innerHeight - 150; if (dialogHeight > 510) dialogHeight = 510; return (
{visibleHistory && this.cancel()} buttons={buttons} style={{ width: 870, height: dialogHeight }} moreBtn={{datas:[{ key: '1', content: viewLog || i18n.button.queryImportLog(), icon: , onClick: () => this.queryImportLog(), } ]}} > index} getColumns={c => this.reRenderColumns(c)} /> }
) } } export default ImportHistory