import { inject, observer } from 'mobx-react'; import { WeaTab, WeaDialog, WeaFormItem, WeaSearchGroup, } from 'ecCom' import { Row, Col, Button, } from 'antd' import * as mobx from 'mobx'; const toJS = mobx.toJS; import { WeaSwitch } from 'comsMobx' import { WeaTableNew } from 'comsMobx'; import React from 'react' const WeaTable = WeaTableNew.WeaTable; import { i18n } from '../../public/i18n'; @inject('hrmImportResource') @observer class ImportLog extends React.Component { constructor(props) { super(props); } componentWillReceiveProps(nextProps) { } getSearchs() { const { hrmImportResource } = this.props; const { form, searchCondition } = hrmImportResource; const { isFormInit } = form; let group = []; const formParams = form.getFormParams(); isFormInit && toJS(searchCondition).map((c, i) => { let items = []; c.items.map((fields, index) => { let hide = false; let dom = ; items.push({ com: ( {dom} ), colSpan: 1, hide: hide }) }); group.push() }); return group; } jumpToHrmCard(id) { window.open(`/spa/hrm/index_mobx.html#/main/hrm/card/cardInfo/${id}`); } reRenderColumns(c) { let _this = this; let status = ""; c.forEach(item => { if (item.dataIndex == 'operator') { item.render = function(text, record) { return _this.jumpToHrmCard(record.operator)}>{record.operatorspan} } } else if (item.dataIndex == 'status') { item.render = function(text, record) { status = text; return {text=='1'?i18n.label.success():i18n.label.fail()} } } else if (item.dataIndex == 'operatedetail') { item.render = function(text, record) { return {status=="1"?"":text} } } }); } cancel() { const { hrmImportResource } = this.props; hrmImportResource.visibleImportLog = false; } render() { const { hrmImportResource, viewLogTitle } = this.props; const { form, titleImportLog, visibleImportLog, importLogStore, showSearchAd } = hrmImportResource; const btn = [ (), (), () ] return (
{ visibleImportLog && { this.cancel()} } //buttons={buttons} style={{width: 970, height: 510}} > { if (e.keyCode == 13 && e.target.tagName === "INPUT") { hrmImportResource.doSearch(); hrmImportResource.showSearchAd=false } } } >{this.getSearchs()}
} setShowSearchAd={bool => {hrmImportResource.showSearchAd = bool}} hideSearchAd={() => hrmImportResource.showSearchAd = false} advanceHeight={200} hasMask={false} buttonsAd={btn} /> index} getColumns={c => this.reRenderColumns(c)} /> } ) } } export default ImportLog