import {
inject,
observer
} from 'mobx-react';
import {
WeaUpload,
WeaDialog,
WeaSelect,
WeaNewScroll,
WeaMoreButton,
WeaSearchGroup,
} from 'ecCom'
import {
WeaSwitch
} from 'comsMobx';
import {
Row,
Col,
Spin,
Button,
} from 'antd'
import {
IEVersion
} from '../../public/pulic-func'
import {
i18n
} from '../../public/i18nbk';
import ImportResult from './ImportResult'
import ImportHistory from './ImportHistory'
@inject('hrmImportCommon')
@observer
export default class Import extends React.Component {
constructor(props) {
super(props);
this.state = {
width: 870,
height: 510,
list: [],
upStatus: '',
}
}
getForm = () => {
const {
hrmImportCommon
} = this.props, {
importDialog
} = hrmImportCommon, {
condition,
form,
} = importDialog, {
isFormInit
} = form;
let _arr = [];
isFormInit && condition.map((c, i) => {
let arr = [];
if (i == 0) { //基本信息
c.items.map((field, index) => {
let key = field.domkey[0];
let url = field.value ? field.value : '';
arr.push({
com: (
{i18n.label.noFileSelected()}
: list.map(file =>{file.filename}
) }{i18n.label.downloadTemplateFirst()}:{dom}
); } else { p = ({val}
); } return p; } getTempletElement = (url, selectedValue, templetName) => { let dom; let urlArr = url.split(';'); if (urlArr.length > 1) { if (selectedValue == 'workcode') { dom = {templetName}; } else { dom = {templetName}; } } else { dom = {templetName}; } return dom } handleUploading = (status) => { this.setState({ upStatus: status }); if (status == 'uploading') { this.setState({ list: [] }); } } getButtons = () => { const { hrmImportCommon } = this.props, { submitExcel, queryRecord, importDialog, } = hrmImportCommon, { upStatus } = this.state; return [ (), (), (