import { inject, observer } from 'mobx-react'; import { WeaUpload, WeaDialog, WeaFormItem, WeaSearchGroup, WeaNewScroll, WeaSelect, WeaInput } from 'ecCom' import { Row, Col, Button, Spin } from 'antd' import { WeaSwitch } from 'comsMobx' import React from 'react' import ImportResult from './ImportResult' import ImportHistory from './ImportHistory' import { WeaLocaleProvider } from 'ecCom'; import { i18n } from '../../public/i18n'; import {addContentPath} from '../../util/index.js' import '../../style/common.less' @inject('hrmImportResource') @observer export default class ImportResource extends React.Component { constructor(props) { super(props); } componentDidMount() { const { hrmImportResource } = this.props; hrmImportResource.list = []; } getCircle() { let style = { width: 20, height: 20, backgroundColor: '#D8D8D8', webkitBorderRadius: 10, mozBorderRadius: 10, msBorderRadius: 10, oBorderRadius: 10, borderRadius: 10, //paddingLeft: 6, textAlign: 'center', } return style; } getForm() { const { hrmImportResource } = this.props; const { condition } = hrmImportResource; let _arr = []; condition.map((c, i) => { let arr = []; if (i == 0) { //基本信息 c.items.map((field, index) => { arr.push({ com: (
{i18n.label.noFileSelected()}
: filelist.map(file =>{file.filename}
)}{i18n.label.downLoadTemplete()}:{dom}
); } else if (url != null) { if(hrmImportResource.importType === 'matrix'){ p = ({i18n.label.downLoadTemplete()}: { getTemplateUrl(hrmImportResource.otherParams.matrixid, hrmImportResource.operateType) }}>{i18n.label.importTemplate()}
); }else p = ({i18n.label.downLoadTemplete()}:{i18n.label.importTemplate()}
); } else { p = (); } } else { p = (); } return p; } setFileId(ids, list) { const { hrmImportResource } = this.props; hrmImportResource.excelfile = ids; hrmImportResource.filelist = list; } onUploading(s) { const { hrmImportResource } = this.props; hrmImportResource.status = s; } submit() { const { hrmImportResource } = this.props; hrmImportResource.saveImport({}, () => { this.refs.scroll && this.refs.scroll.scrollToLast() }); } cancel() { const { hrmImportResource, onClose } = this.props; hrmImportResource.visible = false hrmImportResource.init(); onClose && onClose(); } importHistoryQuery() { const { hrmImportResource } = this.props; hrmImportResource.visibleHistory = true; hrmImportResource.getImportHistory(); } render() { const { hrmImportResource, mainTitle, importLog, viewLog, viewLogTitle, } = this.props; const { title, visible, titleResult, visibleResult, importResultColumns, importProcessLogDatas, failnum, succnum, importResultTip, importResultStore, importStatus, errorInfo, setScrollRef, single, showLoadingSpin, condition } = hrmImportResource; const buttons = condition.length ? [ (), (), ] : []; let dialogHeight = window.innerHeight - 150; if (dialogHeight > 560) dialogHeight = 560; return (