import { WeaNewScroll, WeaSearchGroup, WeaMoreButton, WeaDialog } from 'ecCom' import { inject, observer, } from 'mobx-react' import { Spin, Button, Pagination, Steps, Upload, Icon, Row, Col, Progress } from 'antd' import { WeaSwitch, WeaTableNew } from 'comsMobx' import { i18n } from '../public/i18n'; import { addContentPath } from '../util/index.js' const Step = Steps.Step; const Dragger = Upload.Dragger; const WeaTable = WeaTableNew.WeaTable; @inject("importDialog") @observer export default class ImportDialog extends React.Component { constructor(props) { super(props); this.state = { width: 800, height: 600, title: i18n.label.dataImport(), } } 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; } getIllustration(val, url, index, link) { let p; if (index == 0) { p = (

{i18n.label.downLoadTemplete()}: {i18n.label.importTemplate()}

); } else { p = (

); } return p; } next() { const { importDialog } = this.props; let { current, steps } = importDialog; current = current + 1; if (current === steps.length) { current = 0; importDialog.init(); } importDialog.current = current; current === steps.length - 1 && importDialog.startImport(); } getForm() { const { importDialog } = this.props; const { condition } = importDialog; let _arr = []; condition.map((c, i) => { let arr = []; c.items.map((field, index) => { arr.push({ com: (
{index + 1}
{this.getIllustration(field.value, field.link, index, field)}
), colSpan: 1 }) }) _arr.push(
) }); return _arr; } setFileId(fileInfo) { const { importDialog } = this.props; fileInfo.file.response && importDialog.setExcelfile(fileInfo.file.response.data.fileid); importDialog.filelist = fileInfo.fileList; } reRenderColumns(c) { c.forEach(item => { if (item.dataIndex == 'operatedetail') { item.render = function (text, record) { return {text} } } }); } render() { const { importDialog } = this.props, { importVisible,steps,current, pvisable, percent, failnum, succnum, importResultTip, importResultStore, importStatus, loading, date } = importDialog, { width, height, title } = this.state; const buttons = [ (), ]; const props = { name: 'file', action: '/api/doc/upload/uploadFile', accept: '.xls,.xlsx', multiple:false }; return ( importDialog.init()} buttons={buttons} style={{ width: width, height: height }} >
{steps.map((s, i) => )}
{ current == 0 && { this.setFileId(fileInfo) } } >

{i18n.label.importTip1()}

{i18n.label.importTip2()}

{this.getForm()}
} { current == 1 &&
{ importStatus == 'over' &&
0 ? '#54D3A2' : '#FF0000' }}> 0 ? 'check' : 'cross'} style={{ color: '#fff' }} />
{importResultTip}
} { failnum > 0 && this.reRenderColumns(c)} /> } importDialog.pvisable = false} visible={pvisable} style={{ width: 300, height: 50 }} >
}
) } }