import {
inject,
observer
} from 'mobx-react';
import {
WeaTab,
WeaDialog,
WeaFormItem,
WeaMoreButton,
WeaLocaleProvider,
} from 'ecCom'
import {
Row,
Col,
Spin,
Button,
} from 'antd'
import {
WeaSwitch,
WeaTableNew
} from 'comsMobx'
import {
jumpToHrmCard
} from '../util/pure-util'
const WeaTable = WeaTableNew.WeaTable;
const getLabel = WeaLocaleProvider.getLabel;
@observer
export default class ImportLog extends React.Component {
constructor(props) {
super(props);
this.state = {
width: 870,
height: 510,
isPanelShow: false,
num: 5,
}
}
getPanelComponents() {
const {
hrmImportCommon
} = this.props, {
logDialog
} = hrmImportCommon, {
form,
condition,
loading
} = logDialog, {
isFormInit
} = form;
let arr = [];
isFormInit && condition.map(c => {
c.items.map((field, index) => {
arr.push(
{}
)
})
})
return {arr}
}
reRenderColumns(c) {
c.forEach(item => {
if (item.dataIndex == 'operator') {
item.render = function(text, record) {
return jumpToHrmCard(record.operator)}>{record.operatorspan}
}
}
if (item.dataIndex == 'status') {
item.render = function(text, record) {
return {record.status == '1' ? {getLabel(15242, '成功')} : {getLabel(498, '失败')}}
}
}
});
}
getDialogButtons = () => {
const buttons = [
()
];
return buttons
}
getSearchPanelButtons = () => {
const {
hrmImportCommon
} = this.props, {
searchLogInfo,
setLogPanelStatus,
logDialog,
} = hrmImportCommon, {
form
} = logDialog;
return [
(),
(),
(),
];
}
render() {
const {
hrmImportCommon
} = this.props, {
logDialog,
setLogDialogVisible,
setLogPanelStatus,
} = hrmImportCommon, {
title,
visible,
isPanelShow,
tableStore,
} = logDialog, {
width,
height,
num
} = this.state;
return (
setLogDialogVisible(false)}
buttons={this.getDialogButtons()}
style={{width: width, height: height}}
onChangeHeight={h => this.setState({height: h})}
>
setLogPanelStatus(bool) }
hideSearchAd={ () => setLogPanelStatus(false) }
searchsAd= {this.getPanelComponents()}
advanceHeight={ Math.ceil(num / 2) * 42 + 10}
hasMask={false}
buttonsAd={this.getSearchPanelButtons()}
/>
index}
getColumns={c => this.reRenderColumns(c)}
/>
)
}
}